Skip to content

Commit

Permalink
mnir fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
teseoch committed Sep 29, 2023
1 parent 7ec7323 commit 40b2093
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/polysolve/nonlinear/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,13 @@ namespace polysolve::nonlinear

void Solver::log_times()
{
// TODO
m_logger.debug(
"[{}] grad {:.3g}s, assembly {:.3g}s, inverting {:.3g}s, "
"line_search {:.3g}s, constraint_set_update {:.3g}s, "
"obj_fun {:.3g}s, checking_for_nan_inf {:.3g}s, "
"broad_phase_ccd {:.3g}s, ccd {:.3g}s, "
"classical_line_search {:.3g}s",
// fmt::format(fmt::fg(fmt::terminal_color::magenta), "timing"),
fmt::format(fmt::fg(fmt::terminal_color::magenta), "timing"),
grad_time, assembly_time, inverting_time, line_search_time,
constraint_set_update_time + (m_line_search ? m_line_search->constraint_set_update_time : 0),
obj_fun_time, m_line_search ? m_line_search->checking_for_nan_inf_time : 0,
Expand Down
2 changes: 1 addition & 1 deletion src/polysolve/nonlinear/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace polysolve::nonlinear
throw std::runtime_error(msg);
}

inline Eigen::SparseMatrix<double> sparse_identity(int rows, int cols)
Eigen::SparseMatrix<double> sparse_identity(int rows, int cols)
{
Eigen::SparseMatrix<double> I(rows, cols);
I.setIdentity();
Expand Down
14 changes: 7 additions & 7 deletions src/polysolve/nonlinear/line_search/LineSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ namespace polysolve::nonlinear::line_search
return std::nan("");
}

{ // clang-format off
//#pragma STDC FENV_ACCESS ON
const int current_round = std::fegetround();
std::fesetround(FE_DOWNWARD);
step_size *= max_step_size; // TODO: check me if correct
std::fesetround(current_round);
} // clang-format on
{
// #pragma STDC FENV_ACCESS ON
const int current_round = std::fegetround();
std::fesetround(FE_DOWNWARD);
step_size *= max_step_size; // TODO: check me if correct
std::fesetround(current_round);
}

// m_logger->trace("\t\tpre TOI={}, ss={}", max_step_size, step_size);

Expand Down

0 comments on commit 40b2093

Please sign in to comment.