Commit 39322553 authored by Florent Lamiraux's avatar Florent Lamiraux
Browse files

[DifferentiableFunction] define operator== in cc file.

parent d08a1f07
......@@ -175,18 +175,8 @@ namespace hpp {
DevicePtr_t robot = DevicePtr_t (),
value_type eps = std::sqrt(Eigen::NumTraits<value_type>::epsilon())) const;
inline bool operator== (DifferentiableFunction const & other) const
{
try {
return isEqual(other) && other.isEqual(*this);
} catch (const std::bad_cast& exc) {
return false;
}
}
inline bool operator!= (DifferentiableFunction const & b) const
{
return !(*this == b);
}
bool operator== (DifferentiableFunction const & other) const;
bool operator!= (DifferentiableFunction const & b) const;
//virtual bool isEqual(DifferentiableFunctionPtr_t const &, bool) const {return true;}
protected:
/// \brief Concrete class constructor should call this constructor.
......
......@@ -204,6 +204,21 @@ namespace hpp {
finiteDiffCentral(jacobian, x, FiniteDiffVectorSpaceOp(eps), *this);
}
bool DifferentiableFunction::operator==
(DifferentiableFunction const & other) const
{
try {
return isEqual(other) && other.isEqual(*this);
} catch (const std::bad_cast& exc) {
return false;
}
}
bool DifferentiableFunction::operator!=
(DifferentiableFunction const & b) const
{
return !(*this == b);
}
DifferentiableFunction::DifferentiableFunction
(size_type sizeInput, size_type sizeInputDerivative,
size_type sizeOutput, std::string name) :
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment