Skip to content

Commit

Permalink
MSSL compilation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael McLeod committed Jul 25, 2024
1 parent a2ec0b5 commit d78edb4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions cpp/sopt/config.in.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <string>
#include <tuple>
#include <cstdint>

namespace sopt {

Expand Down
10 changes: 5 additions & 5 deletions cpp/sopt/relative_variation.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class RelativeVariation {
}
//! Name that gets interpolated into the log's output
std::string const &name() const { return name_; }
RelativeVariation const &name(std::string const &name) const {
RelativeVariation const &name(std::string const &name) {
name_ = name;
return *this;
}
Expand Down Expand Up @@ -78,21 +78,21 @@ class ScalarRelativeVariation {
//! Allowed variation
Real relative_tolerance() const { return relative_tolerance_; }
//! Allowed variation
RelativeVariation<Scalar> &relative_tolerance(Real &e) const {
RelativeVariation<Scalar> &relative_tolerance(Real &e) {
relative_tolerance_ = e;
return *this;
}
//! Allowed variation
Real absolute_tolerance() const { return relative_tolerance_; }
//! Allowed variation
RelativeVariation<Scalar> &absolute_tolerance(Real &e) const {
RelativeVariation<Scalar> &absolute_tolerance(Real &e) {
absolute_tolerance_ = e;
return *this;
}

//! Name that gets interpolated into the log's output
std::string const &name() const { return name_; }
ScalarRelativeVariation const &name(std::string const &name) const {
ScalarRelativeVariation const &name(std::string const &name) {
name_ = name;
return *this;
}
Expand All @@ -116,7 +116,7 @@ bool RelativeVariation<SCALAR>::operator()(Eigen::ArrayBase<T> const &input) {
}
auto const norm = (input - previous_).matrix().squaredNorm();
previous_ = input;
SOPT_LOW_LOG(" - {} relative variation: {} <? {}", name(), std::sqrt(norm), tolerance());
SOPT_HIGH_LOG(" - {} relative variation: {} <? {}", name(), std::sqrt(norm), tolerance());
return norm < tolerance() * tolerance();
}

Expand Down

0 comments on commit d78edb4

Please sign in to comment.