Skip to content

Commit cf0c276

Browse files
committed
fix last comments
Signed-off-by: Tony Xiang <[email protected]>
1 parent d6acd4d commit cf0c276

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

include/power_grid_model/math_solver/iterative_current_pf_solver.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class IterativeCurrentPFSolver : public IterativePFSolver<sym, IterativeCurrentP
171171
// Solve the linear equations I_inj = YU
172172
// inplace
173173
void solve_matrix() {
174-
sparse_solver_.solve_with_prefactorization(*mat_data_, *perm_, rhs_u_, rhs_u_);
174+
sparse_solver_.solve_with_prefactorized_matrix(*mat_data_, *perm_, rhs_u_, rhs_u_);
175175
}
176176

177177
// Find maximum deviation in voltage among all buses

include/power_grid_model/math_solver/iterative_linear_se_solver.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ class IterativeLinearSESolver {
621621
prepare_rhs(y_bus, measured_values, output.u);
622622
// solve with prefactorization
623623
sub_timer = Timer(calculation_info, 2225, "Solve sparse linear equation (pre-factorized)");
624-
sparse_solver_.solve_with_prefactorization(data_gain_, perm_, x_rhs_, x_rhs_);
624+
sparse_solver_.solve_with_prefactorized_matrix(data_gain_, perm_, x_rhs_, x_rhs_);
625625
sub_timer = Timer(calculation_info, 2226, "Iterate unknown");
626626
max_dev = iterate_unknown(output.u, measured_values.has_angle_measurement());
627627
}

include/power_grid_model/math_solver/sparse_lu_solver.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,14 @@ class SparseLUSolver {
9696
std::vector<RHSVector> const& rhs, std::vector<XVector>& x) {
9797
prefactorize(data, block_perm_array);
9898
// call solve with const method
99-
solve_with_prefactorization((std::vector<Tensor> const&)data, block_perm_array, rhs, x);
99+
solve_with_prefactorized_matrix((std::vector<Tensor> const&)data, block_perm_array, rhs, x);
100100
}
101101

102102
// solve with existing pre-factorization
103-
void solve_with_prefactorization(std::vector<Tensor> const& data, // pre-factoirzed data, const ref
104-
BlockPermArray const& block_perm_array, // pre-calculated permutation, const ref
105-
std::vector<RHSVector> const& rhs, std::vector<XVector>& x) {
103+
void solve_with_prefactorized_matrix(
104+
std::vector<Tensor> const& data, // pre-factoirzed data, const ref
105+
BlockPermArray const& block_perm_array, // pre-calculated permutation, const ref
106+
std::vector<RHSVector> const& rhs, std::vector<XVector>& x) {
106107
// local reference
107108
auto const& row_indptr = *row_indptr_;
108109
auto const& col_indices = *col_indices_;

tests/cpp_unit_tests/test_sparse_lu_solver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ TEST_CASE("Test Sparse LU solver") {
7373

7474
SECTION("Test prefactorize") {
7575
solver.prefactorize(data, block_perm);
76-
solver.solve_with_prefactorization((std::vector<double> const&)data, block_perm, rhs, x);
76+
solver.solve_with_prefactorized_matrix((std::vector<double> const&)data, block_perm, rhs, x);
7777
check_result(x, x_ref);
7878
}
7979

@@ -123,7 +123,7 @@ TEST_CASE("Test Sparse LU solver") {
123123

124124
SECTION("Test prefactorize") {
125125
solver.prefactorize(data, block_perm);
126-
solver.solve_with_prefactorization((std::vector<Tensor> const&)data, block_perm, rhs, x);
126+
solver.solve_with_prefactorized_matrix((std::vector<Tensor> const&)data, block_perm, rhs, x);
127127
check_result(x, x_ref);
128128
}
129129
}

0 commit comments

Comments
 (0)