Skip to content

Commit

Permalink
print subnormals/ inertia
Browse files Browse the repository at this point in the history
  • Loading branch information
pghysels committed Jul 14, 2023
1 parent 3c7d124 commit a081f5f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
20 changes: 10 additions & 10 deletions examples/sparse/testMMdouble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ test(int argc, char* argv[], CSRMatrix<scalar_t,integer_t>& A) {
}
spss.solve(b.data(), x.data());

// std::size_t subs = 0, zeros = 0;
// auto err0 = spss.subnormals(subs, zeros);
// std::cout << "# SUBNORMALS = " << subs
// << " ZEROS = " << zeros
// << " (" << err0 << ")" << std::endl;
std::size_t subs = 0, zeros = 0;
auto err0 = spss.subnormals(subs, zeros);
std::cout << "# SUBNORMALS = " << subs
<< " ZEROS = " << zeros
<< " (" << err0 << ")" << std::endl;

// integer_t neg, zero, pos;
// auto err = spss.inertia(neg, zero, pos);
// std::cout << "# INERTIA neg,zero,pos = "
// << neg << ", " << zero << ", " << pos
// << " (" << err << ")" << std::endl;
integer_t neg, zero, pos;
auto err = spss.inertia(neg, zero, pos);
std::cout << "# INERTIA neg,zero,pos = "
<< neg << ", " << zero << ", " << pos
<< " (" << err << ")" << std::endl;

std::cout << "# COMPONENTWISE SCALED RESIDUAL = "
<< A.max_scaled_residual(x.data(), b.data()) << std::endl;
Expand Down
26 changes: 13 additions & 13 deletions examples/sparse/testMMdoubleMPIDist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ test(int argc, char* argv[], CSRMatrix<scalar,integer>& A) {
}
spss.solve(b.data(), x.data());

// std::size_t subs = 0, zeros = 0;
// auto err0 = spss.subnormals(subs, zeros);
// if (!rank)
// std::cout << "# SUBNORMALS = " << subs
// << " ZEROS = " << zeros
// << " (" << err0 << ")" << std::endl;

// integer neg, zero, pos;
// auto err = spss.inertia(neg, zero, pos);
// if (!rank)
// std::cout << "# INERTIA neg,zero,pos = "
// << neg << ", " << zero << ", " << pos
// << " (" << err << ")" << std::endl;
std::size_t subs = 0, zeros = 0;
auto err0 = spss.subnormals(subs, zeros);
if (!rank)
std::cout << "# SUBNORMALS = " << subs
<< " ZEROS = " << zeros
<< " (" << err0 << ")" << std::endl;

integer neg, zero, pos;
auto err = spss.inertia(neg, zero, pos);
if (!rank)
std::cout << "# INERTIA neg,zero,pos = "
<< neg << ", " << zero << ", " << pos
<< " (" << err << ")" << std::endl;

auto scaled_res = Adist.max_scaled_residual(x.data(), b.data());
if (!rank)
Expand Down

0 comments on commit a081f5f

Please sign in to comment.