1 #ifndef _OCRA_SOLVER_UTILITIES_H_ 2 #define _OCRA_SOLVER_UTILITIES_H_ 13 #include <Eigen/Eigen> 83 template<
class Derived,
class VectorBase>
84 inline void printLinearEquation(
const MatrixBase<Derived>& A,
const VectorBase& b,
int space = 9,
int precision=3);
138 #define DECLARE_UNCOMPRESSED_FUNCTION(functionName) \ 139 template<class Derived1, class Derived2> \ 140 void functionName(const MatrixBase<Derived1>& in, MatrixBase<Derived2> const& _out, \ 141 const std::vector<int>& mapping, double scale=1., bool reverseMapping=false); \ 142 template<class Derived1, class Derived2> \ 143 void functionName(const Variable& base, const Variable& rel, \ 144 const MatrixBase<Derived1>& in, MatrixBase<Derived2> const& _out, \ 145 std::vector<int>& mapping, double scale=1.); \ 146 template<typename Scalar, class Derived1, class Derived2> \ 148 inline void functionName(const CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, Derived1>& in, MatrixBase<Derived2> const& _out, \ 149 const std::vector<int>& mapping, double scale=1., bool reverseMapping=false) \ 150 { functionName(in.nestedExpression(), _out, mapping, scale*in.functor().m_other, reverseMapping); } \ 151 template<typename Scalar, class Derived1, class Derived2> \ 152 void functionName(const Variable& base, const Variable& rel, \ 153 const CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, Derived1>& in, MatrixBase<Derived2> const& _out, \ 154 std::vector<int>& mapping, double scale=1.) \ 156 MatrixBase<Derived2>& out = const_cast<MatrixBase<Derived2> & >(_out);\ 157 functionName(base, rel, in.nestedExpression(), out, mapping, scale*in.functor().m_other); \ 176 template<class Derived, class VectorBase1, class VectorBase2>
178 MatrixBase<Derived>& A, VectorBase1& b, VectorBase2& l,
double infinity = 0.);
184 template<class VectorBase1, class VectorBase2>
192 #include "SolverUtilities.hxx" 194 #endif // _OCRA_SOLVER_UTILITIES_H_ void minCompressedByCol(const MatrixBase< Derived1 > &in, MatrixBase< Derived2 > const &_out, const std::vector< int > &mapping, double scale, bool reverseMapping)
void addCompressedByCol(const MatrixBase< Derived1 > &in, MatrixBase< Derived2 > const &_out, const std::vector< int > &mapping, double scale, bool reverseMapping)
const details::eConvertCase conversion_cases[7][7]
void addCompressed2d(const MatrixBase< Derived1 > &in, MatrixBase< Derived2 > const &_out, const std::vector< int > &mapping, double scale, bool reverseMapping)
void minCompressedByRow(const MatrixBase< Derived1 > &in, MatrixBase< Derived2 > const &_out, const std::vector< int > &mapping, double scale, bool reverseMapping)
Constraint< LinearFunction > LinearConstraint
void uncompressByCol(const MatrixBase< Derived1 > &in, MatrixBase< Derived2 > const &_out, const std::vector< int > &mapping, double scale, bool reverseMapping)
Optimization-based Robot Controller namespace. a library of classes to write and solve optimization p...
void uncompressByRow(const MatrixBase< Derived1 > &in, MatrixBase< Derived2 > const &_out, const std::vector< int > &mapping, double scale, bool reverseMapping)
void convert(const LinearConstraint &cstr, const std::vector< int > &mapping, eConstraintOutput type, MatrixBase< Derived > &A, VectorBase1 &b, VectorBase2 &l, double infinity=0.)
void uncompress2d(const MatrixBase< Derived1 > &in, MatrixBase< Derived2 > const &_out, const std::vector< int > &mapping, double scale, bool reverseMapping)
This class represents a variable in a mathematical sense.
void addCompressedByRow(const MatrixBase< Derived1 > &in, MatrixBase< Derived2 > const &_out, const std::vector< int > &mapping, double scale, bool reverseMapping)
#define DECLARE_UNCOMPRESSED_FUNCTION(functionName)
void maxCompressed2d(const MatrixBase< Derived1 > &in, MatrixBase< Derived2 > const &_out, const std::vector< int > &mapping, double scale, bool reverseMapping)
Declaration file of the Constraint class.
void intersectBounds(const DiagonalLinearConstraint &bounds, const std::vector< int > &mapping, VectorBase1 &bl, VectorBase2 &bu)
void maxCompressedByRow(const MatrixBase< Derived1 > &in, MatrixBase< Derived2 > const &_out, const std::vector< int > &mapping, double scale, bool reverseMapping)
Constraint< DiagonalLinearFunction > DiagonalLinearConstraint
void maxCompressedByCol(const MatrixBase< Derived1 > &in, MatrixBase< Derived2 > const &_out, const std::vector< int > &mapping, double scale, bool reverseMapping)
Declaration file of the Variable class.
Declaration file of the OptimizationVariable class.
void printLinearEquation(const MatrixBase< Derived > &A, const VectorBase &b, int space=9, int precision=3)
void printSolution(const VectorXd &result, const Variable &var, int space=9, int precision=3)
void minCompressed2d(const MatrixBase< Derived1 > &in, MatrixBase< Derived2 > const &_out, const std::vector< int > &mapping, double scale, bool reverseMapping)