コード例 #1
0
        private static DiagonaleMatrix <T> Add <T>(DiagonaleMatrix <T> lhs, DiagonaleMatrix <T> rhs)
        {
            var result = new T[lhs.Order, lhs.Order];

            for (int i = 0; i < lhs.Order; i++)
            {
                for (int j = 0; j < lhs.Order; j++)
                {
                    result[i, j] = (dynamic)lhs[i, j] + (dynamic)rhs[i, j];
                }
            }

            return(new DiagonaleMatrix <T>(result));
        }
コード例 #2
0
 private static SquareMatrix <T> Add <T>(DiagonaleMatrix <T> lhs, SquareMatrix <T> rhs) => Add(rhs, lhs);
コード例 #3
0
 private static DiagonaleMatrix <T> Add <T>(SymmetricMatrix <T> lhs, DiagonaleMatrix <T> rhs) => Add(rhs, lhs);