/// <summary> /// Add simmetric and square matrix /// </summary> /// <typeparam name="T">type elements in matrix</typeparam> /// <param name="first">first simmetric matrix</param> /// <param name="second">second square matrix</param> /// <returns>result square matrix</returns> private static SquareMatrix <T> Add <T>(this SimmetricSquareMatrix <T> first, SquareMatrix <T> second) { var resutMatrix = new SquareMatrix <T>(first.Size); for (int i = 0; i < first.Size; i++) { for (int j = 0; j < first.Size; j++) { resutMatrix[i, j] = (dynamic)first[i, j] + second[i, j]; } } return(resutMatrix); }
/// <summary> /// Creates square matrix from another square matrix. /// </summary> /// <param name="matrix">Square matrix.</param> /// <exception cref="ArgumentNullException"> /// Thrown when matrix is null. /// </exception> public SquareMatrix(SquareMatrix <T> matrix) : base(matrix) { }