NSObject
|
+---MTMatrix
+(MTMatrix*)matrixWithRows: (int)row cols:(int)col
create matrix
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
return a row matrix with the center of mass coordinates in any dimension assuming that columns are dimensions and rows are repetitions
returns the number of columns in the matrix
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
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
add a matrix to this and return new result matrix
-(id)matrixOfColumn:(int)thecol
return a column as a new matrix
pairwise multiplies elements in the matrix and returns result
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
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
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
returns the computed sum of all elements
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]]"
transpose the matrix
multiply two matrices and return new result matrix needs matrices: nxk and lxn