using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Science.Mathematics.LinearAlgebra { public class AugmentedMatrix : Matrix { public AugmentedMatrix(Matrix A, Vector b) : base(A.SizeOfRow,A.SizeOfColumn+1) { for (int k = 0; k < sr; k++) { for (int kk = 0; kk < sc - 1; kk++) el[k, kk] = A[k, kk]; el[k, sc-1] = b[k]; } } public AugmentedMatrix(Matrix A, Matrix B) : base(A.SizeOfRow, A.SizeOfColumn + B.SizeOfColumn) { for (int k = 0; k < sr; k++) { for (int kk = 0; kk < sc - B.SizeOfColumn; kk++) el[k, kk] = A[k, kk]; for (int kk = 0; kk < B.SizeOfColumn; kk++) el[k, A.SizeOfColumn + kk] = B[k,A.SizeOfColumn + kk]; } } } }