31 lines
399 B
Plaintext
31 lines
399 B
Plaintext
Class SquareMatrix
|
|
'=================
|
|
|
|
double *Cell
|
|
sys size
|
|
|
|
method SetIdentity()
|
|
indexbase 0
|
|
sys e,i,j
|
|
e=size*size
|
|
for i=0 to <size
|
|
cell(i*size+j)=1 : j++
|
|
next
|
|
end method
|
|
|
|
method constructor(sys n)
|
|
@cell=getmemory n*n*sizeof double
|
|
size=n
|
|
end method
|
|
|
|
method destructor()
|
|
freememory @cell
|
|
end method
|
|
|
|
end class
|
|
|
|
new SquareMatrix M(8)
|
|
M.SetIdentity
|
|
'...
|
|
del M
|