Skip to content

Commit

Permalink
core: Fix build with cl compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisv committed Dec 20, 2024
1 parent cbbd1c1 commit 5e83807
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
14 changes: 14 additions & 0 deletions include/ndcurves/linear_variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,20 @@ struct linear_variable : public serialization::Serializable {
return (*this - other).norm() < prec;
}

/// \brief Check if actual linear variable and other are equal.
/// \param other : the other linear_variable to check.
/// \return true if the two linear_variable are equals.
virtual bool operator==(const linear_variable& other) const {
return this->B_ == other.B_ && this->c_ == other.c_;
}

/// \brief Check if actual linear variable and other are different.
/// \param other : the other linear_variable to check.
/// \return true if the two linear_variable are different.
virtual bool operator!=(const linear_variable& other) const {
return !(*this == other);
}

const matrix_x_t& B() const { return B_; }
const vector_x_t& c() const { return c_; }
bool isZero() const { return zero; }
Expand Down
6 changes: 3 additions & 3 deletions tests/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,7 @@ void piecewiseCurveTest(bool& error) {
}
// C0
isC0 = pc_C0.is_continuous(0);
if (not isC0) {
if (!isC0) {
std::cout << errmsg2 << " pc_C0 " << std::endl;
error = true;
}
Expand All @@ -1444,7 +1444,7 @@ void piecewiseCurveTest(bool& error) {
}
// C1
isC1 = pc_C1.is_continuous(1);
if (not isC1) {
if (!isC1) {
std::cout << errmsg3 << " pc_C1 " << std::endl;
error = true;
}
Expand All @@ -1456,7 +1456,7 @@ void piecewiseCurveTest(bool& error) {
}
// C2
isC2 = pc_C2.is_continuous(2);
if (not isC2) {
if (!isC2) {
std::cout << errmsg4 << " pc_C2 " << std::endl;
error = true;
}
Expand Down

0 comments on commit 5e83807

Please sign in to comment.