Class MTMatrix

Inherits from:
NSObject
Declared in:
../libmoltalk/MTMatrix.oh

Class Hierarchy

    NSObject
      |
      +---MTMatrix

Last modified:
16-May-2006 (../libmoltalk/MTMatrix.oh)

Instance Variables

private double *elements
private int rows,cols
private BOOL transposed

Method Index

Methods

+(MTMatrix*)matrixWithRows: (int)row cols:(int)col

create matrix

-(id)addScalar: (double)scal

add a scalar to each element of this matrix this is done in place! thus overriding all previous values

-(MTMatrix53*)alignTo:(MTMatrix*)m2

-(double)atRow:(int)row col:(int)col

get value at row/col

-(id)atRow:(int)row col:(int)col add:(double)v

add a value to a cell

-(id)atRow:(int)row col:(int)col divideBy:(double)v

divide a cell by value

-(id)atRow:(int)row col:(int)col multiplyBy:(double)v

multiply cell with value

-(id)atRow:(int)row col:(int)col subtract:(double)v

subtract a value from a cell

-(id)atRow:(int)row col:(int)col value:(double)val

set value at row/col

-(MTMatrix*)centerOfMass

return a row matrix with the center of mass coordinates in any dimension assuming that columns are dimensions and rows are repetitions

-(int)cols

returns the number of columns in the matrix

-(NSString*)description

see toString

-(id)divideByScalar: (double)scal

each element of this matrix is divided by the scalar this is done in place! thus overriding all previous values

-(id)initFromString:(NSString*)str

initialize from string

-(BOOL)isTransposed

returns TRUE if the matix is transposed

-(MTMatrix*)jacobianDiagonalizeWithMaxError: (double)p_error

diagonalize a symmetric nxn matrix returns a matrix with the eigenvectors in rows: 1-n, eigenvalues in row 0

-(void)linearizeTo:(double*)mat maxElements:(int)count

copy to C array in good order

-(id)madd: (MTMatrix*)m2

add a matrix to this and return new result matrix

-(id)matrixOfColumn:(int)thecol

return a column as a new matrix

-(id)mmultiply:(MTMatrix*)m2

pairwise multiplies elements in the matrix and returns result

-(id)msubtract: (MTMatrix*)m2

subtract a matrix from this and return new result matrix

-(id)multiplyByScalar: (double)scal

each element of this matrix is multiplied by the scalar this is done in place! thus overriding all previous values

-(int)rows

returns the number of rows in the matrix

-(id)setRows:(int)row cols:(int)col

recreate matrix
Warning: this is destructive and creates an empty matrix

-(id)square

square all elements in matrix

-(id)substractScalar: (double)scal

subtract a scalar from each element of this matrix this is done in place! thus overriding all previous values

-(double)sum

returns the computed sum of all elements

-(NSString*)toString

returns a string representing this matrix.
rows are put between '[' and ']', where each column is seperated by ','
all rows are put between '[' and ']'.
thus a 3x2 matrix becomes: [[0,1][2,9],[-1,0]]"

-(id)transpose

transpose the matrix

-(id)x:(MTMatrix*)m2

multiply two matrices and return new result matrix needs matrices: nxk and lxn


generated 07-Jun-2006 by ObjcDoc 3.0.0