private static void UpdateData(double[] increment, double tettaMax, int index) { var result = new double[basis_indexes.Count]; for (int i = 0; i < basis_indexes.Count; i++) { result[i] = zero_point[0, basis_indexes[i]]; } result = result.Subtract(MoiuLib.MultiplyMatrixAndScalar(increment, tettaMax)); var min_ind = result.IndexOf(result.Min()); for (int i = 0; i < basis_indexes.Count; i++) { zero_point[0, basis_indexes[i]] = result[i]; } zero_point[0, index] = tettaMax; non_basis_indexes[non_basis_indexes.IndexOf(index)] = basis_indexes[min_ind]; basis_indexes[min_ind] = index; changeIndex = min_ind; changeVector = MoiuLib.TranposeMatrix(matrix.GetCol(index).Make2DArray()); }
public static double[,] FindDiv( double[,] Cn, double[,] Cb, double[,] Ab_inv, double[,] An) { var step1 = MoiuLib.MultiplyMatrix(Cb, Ab_inv); var step2 = MoiuLib.MultiplyMatrix(step1, matrix); var step3 = MoiuLib.MultiplyMatrixAndScalar(targetVector, -1); var result = MoiuLib.SumMatrix(step2, step3); // var step2 = MoiuLib.MultiplyMatrix(step1, An); // var step3 = MoiuLib.MultiplyMatrixAndScalar(step2, -1); // var result = MoiuLib.SumMatrix(Cn, step3); return(result); }