Example #1
0
        //TODO: classify multiplications to have the products be as explicit as possible.
        //im sure theres a better way to do this lol
        public SquareDoubleMatrix Multiply(SquareDoubleMatrix other)
        {
            DoubleMatrix       product = Multiply(other as DoubleMatrix);
            SquareDoubleMatrix ret     = new SquareDoubleMatrix(other.RowSize);

            for (int i = 0; i < RowSize; i++)
            {
                for (int j = 0; j < RowSize; j++)
                {
                    ret.Replace(i, j, product.Get(i, j));
                }
            }
            return(ret);
        }
Example #2
0
 public SquareDoubleMatrix TrySquareConversion()
 {
     if (IsSquare)
     {
         SquareDoubleMatrix ret = new SquareDoubleMatrix(RowSize);
         for (int i = 0; i < RowSize; i++)
         {
             for (int j = 0; j < RowSize; j++)
             {
                 ret.Replace(i, j, this.Get(i, j));
             }
         }
         return(ret);
     }
     else
     {
         throw new MatrixTypeMismatchException();
     }
 }