Skip to content

Commit

Permalink
Eigen 3.3.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
EmbersArc committed Sep 24, 2020
1 parent c76293f commit 5c599ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Epigraph is a modern C++ interface to formulate and solve linear, quadratic and

## Dependencies

* [Eigen](http://eigen.tuxfamily.org) 3.3.7
* [Eigen](http://eigen.tuxfamily.org)

## Supported Solvers

Expand Down
3 changes: 3 additions & 0 deletions include/parameter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ namespace cvx

bool operator==(const Parameter &other) const;

// required for eigen < 3.3.7
bool operator==(const int const_value) const;

Parameter operator+(const Parameter &other) const;
Parameter operator-(const Parameter &other) const;
Parameter operator-() const;
Expand Down
5 changes: 5 additions & 0 deletions src/parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ namespace cvx::internal
return compare_sources(this->source, other.source);
}

bool Parameter::operator==(const int const_value) const
{
return compare_sources(this->source, Parameter(const_value).source);
}

Parameter::operator double() const
{
return getValue();
Expand Down

0 comments on commit 5c599ad

Please sign in to comment.