Example #1
0
 public static double Determinant(this double[,] matrix)
 {
     if (matrix.ColumnCount() != matrix.RowCount())
     {
         return(double.NaN); //Not a square matrix
     }
     return(LUD.ComputeLUD(matrix).Determinant());
 }
Example #2
0
 public static double[,] Solve(this double[,] matrix, double[,] b)
 {
     return(matrix.IsSquare() ? (LUD.ComputeLUD(matrix)).Solve(b) : (QRD.ComputeQRD(matrix)).Solve(b));
 }