bug fixes

This commit is contained in:
Spectre
2024-09-22 22:18:36 +07:00
parent 38982b501a
commit ed2163ee9d
2 changed files with 3 additions and 4 deletions
+2 -2
View File
@@ -45,14 +45,14 @@ Result Simplex(ColumnVector C, Matrix A, ColumnVector b, double eps = 0.01, bool
while (b[0] < eps) {
//3
int pivot_column_index = 0;
pivot_column_index = Math::max_index(C);
pivot_column_index = max_index(C);
//4
ColumnVector ratio_vector(m);
for (int i = 0; i < m; i++) {
ratio_vector[i] = b[i] / A[i][pivot_column_index];
}
int pivot_row_index = Math::min_index(ratio_vector);
int pivot_row_index = min_index(ratio_vector);
//5
struct FracturedMatrix fractured_matrix();
+1 -2
View File
@@ -102,5 +102,4 @@ FracturedMatrix elimination(Matrix A, ColumnVector C, ColumnVector b, int pivot_
int pivot_row_index = min_index(ratio_vector);
return {A, C, b, pivot_column_index, pivot_row_index};
}