public static Vector Start_Solver(Matrix A, Vector F, int mod = MODE.QR_GRAMM) { Vector X = new Vector(F.N); Vector Y; Matrix Q = new Matrix(F.N, F.N); Matrix R = new Matrix(F.N, F.N); switch (mod) { case MODE.QR_GRAMM: QR_GramDecompose(A, Q, R); break; case MODE.QR_GRAMM_MOD: QR_GramDecomposeMOD(A, Q, R); break; case MODE.QR_GIVENS: QR_RotationGivens(A, Q, R); break; case MODE.QR_HOUSEHOLDER: QR_ReflectionHouseholder(A, Q, R); break; } //1. y=Q'F Y = F * Q; //2. Rx=y Substitution_Methods.Back_Row_Substitution(R, X, Y); return(X); }
public static Vector Start_Solver(Matrix A, Vector F) { Vector X = new Vector(F.N); Vector Y = new Vector(F.N); Matrix L = new Matrix(F.N, F.N); Matrix U = new Matrix(F.N, F.N); //0. A=LU LU_Decompose(A, L, U); //1. Ly=f Substitution_Methods.Direct_Row_Substitution(L, Y, F); //2. Ux=y Substitution_Methods.Back_Row_Substitution(U, X, Y); return(X); }
public static Vector Start_Solver(Matrix A_, Vector F_) { Matrix A = new Matrix(A_.M, A_.N); Vector F = new Vector(F_.N); Vector X = new Vector(F_.N); A_.Copy(A); F_.Copy(F); Direct_Way(A, F); Substitution_Methods.Back_Row_Substitution(A, X, F); return(X); }