-
Notifications
You must be signed in to change notification settings - Fork 0
Home
SOME INFO: before you start reading rest if don't want to read this you can study my code, but this is more recommended.
How to Initialize one
example: "StringMatrix examplematrix = new(2, 2);" The type could be StringMatrix or NumMatrix, the first parameter is an integer for the row, second one is an integer for the column.
Types:
NumMatrix, a matrix with addition, subtraction, scaling with division, addition, multiplication, and subtraction, matrix multiplication not implemented yet, also has a fixed size, because this library's types want to be closest to mathematical matrices.
StringMatrix, NumMatrix, but no arithmetic operations.
Accessors for both types:
example: "examplematrix.Items", returns amount of items in matrix.
example: "examplematrix[(double), (double)]", accessor for value of a cell, 1-indexed.
example: "examplematrix.Ssize", returns a string like "3x3".
example: "examplematrix.MClear", returns a copy of the matrix but cleared, each cell has " " for StringMatrix or 0 for NumMatrix
Functions for both types:
example: "examplematrix.Clear();", clears the matrix, each cell has " " for StringMatrix or 0 for NumMatrix.
example: "examplematrix.ToString()", returns a formatted string of matrix, good if you wanna print it.
NumMatrix arithmetic functions:
NumMatrix.Madd((NumMatrix), (NumMatrix)), adds two matrices and returns the added one, of course you can do Madd((NumMatrix), Madd((NumMatrix), NumMatrix)), or even more since they return NumMatrices.
NumMatrix.Msub((NumMatrix),(NumMatrix)), NumMatrix.Madd((NumMatrix),(NumMatrix)) but subtracts the matrices.
NumMatrix.ScaleA((NumMatrix), (double)), adds (parameter 2) to each cell of the NumMatrix.
NumMatrix.ScaleS((NumMatrix), (double)), subtracts (parameter 2) to each cell of the NumMatrix.
NumMatrix.ScaleM((NumMatrix), (double)), multiplies by (parameter 2) to each cell of the NumMatrix.
NumMatrix.ScaleD((NumMatrix), (double)), divides by (parameter 2) to each cell of the NumMatrix.
NumMatrix arithmetic operators(read previous section before this):
"NumMatrix a * double b" or vise versa: is NumMatrix.ScaleM() equivalent.
"NumMatrix a + double b" or vise versa: is NumMatrix.ScaleA() equivalent.
"NumMatrix a / double b" or vise versa: is NumMatrix.ScaleD() equivalent.
"NumMatrix a - double b" or vise versa: is NumMatrix.ScaleS() equivalent.
"NumMatrix a - NumMatrix b": is NumMatrix.MSub() equivalent.
"NumMatrix a + NumMatrix b": is NumMatrix.MAdd() equivalent.