Created
November 19, 2020 01:25
-
-
Save Rex-Ferrer/2e6855d1a0e0cb67c0d390cf26169d7b to your computer and use it in GitHub Desktop.
Matrix Class in Dart [WIP]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Strassen { | |
m1_of(List[][] a, List[][] b) {} | |
m2_of() {} | |
m3_of() {} | |
m4_of() {} | |
m5_of() {} | |
m6_of() {} | |
m7_of() {} | |
} | |
class Matrix { | |
List matrix; | |
Dimensions dimensions; | |
Matrix(int rows, int columns){ | |
matrix = List.generate(rows, (i) => List(columns), growable: true); | |
dimensions = Dimensions(rows, columns); | |
} | |
void set(Object value, int row, int column){ | |
if (row >= dimensions.rows || column >= dimensions.columns) | |
matrix[row][column] = value; | |
} | |
bool isSquare(){ | |
return dimensions.isSquare(); | |
} | |
bool isDiagonal(){} | |
bool isLowerTriangular(){} | |
bool isUpperTriangular(){} | |
bool isTriangular(){ | |
return isLowerTriangular() || isUpperTriangular(); | |
} | |
bool isIdentity(){} | |
bool isSymmetric(){} | |
bool isSkewSymmetric(){} | |
bool isInverseOf(Matrix b){} | |
bool isColumnVector(){ | |
return dimensions.columns == 1; | |
} | |
bool isRowVector(){ | |
return dimensions.rows == 1; | |
} | |
// transpose == inverse | |
bool isOrthogonal(){} | |
bool isSparse(){} | |
Matrix getTranspose(){} | |
Matrix getInverse(){} | |
Matrix getSubmatrixByRemoving(int row, int col){} | |
int getRank(){} | |
int getDeterminant(){} | |
void pad(){} | |
Matrix subtract(){} | |
Matrix add(){} | |
Matrix multiply{} | |
} | |
class Dimensions implements ForMatrices { | |
int rows; | |
int columns; | |
Dimensions(this.rows, this.columns); | |
bool isSquare(){ | |
return rows == columns; | |
} | |
} | |
class LinearEquations{} | |
class LinearTransformations{ | |
Matrix rotate(){} | |
Matrix scale(){} | |
Matrix reflect(){} | |
Matrix shear(){} | |
Matrix squeeze(){} | |
Matrix project(){} | |
} | |
// Tagging interface | |
class ForMatrices{} | |
void main() { | |
for (int i = 0; i < 5; i++) { | |
print('hello ${i + 1}'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment