Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
|
|
@ -0,0 +1,19 @@
|
|||
uses NumLibABC;
|
||||
|
||||
function operator **(m: Matrix; exp: integer): Matrix;
|
||||
extensionmethod;
|
||||
begin
|
||||
Assert(m.ColCount = m.RowCount, 'Matrix must be square.');
|
||||
Assert(exp >= 0, 'Negative exponents not supported');
|
||||
result := Matrix.Diag(m.RowCount, 1);
|
||||
loop exp do result := result * m;
|
||||
end;
|
||||
|
||||
begin
|
||||
var A := new Matrix(2, 2, 1, 1, 1, 0);
|
||||
'Original: '.Println;
|
||||
A.Println;
|
||||
A := A ** 10;
|
||||
'Raised to the power of 10: '.Println;
|
||||
A.Println;
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue