Skip to content

Commit

Permalink
sparsity
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Sep 23, 2024
1 parent bb304ce commit 11bcedc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/unit/solver/test_linear_solver_policy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,15 @@ void testExtremeInitialValue(std::size_t number_of_blocks, double initial_value)
const size_t size = 5;

auto builder = SparseMatrixPolicy::Create(size).SetNumberOfBlocks(number_of_blocks).InitialValue(1e-30);
for (std::size_t i = 0; i < size; ++i)
for (std::size_t j = 0; j < size; ++j)
if (i == j || gen_bool())
for (std::size_t i = 0; i < size; ++i) {
for (std::size_t j = 0; j < size; ++j) {
if (i == j || gen_bool()) {
std::cout << i << ", " << j << "; ";
builder = builder.WithElement(i, j);
}
}
std::cout << std::endl;
}

SparseMatrixPolicy A(builder);
MatrixPolicy b(number_of_blocks, size, 0.0);
Expand Down

0 comments on commit 11bcedc

Please sign in to comment.