7 DiagonalLinearFunction::DiagonalLinearFunction(
Variable& x,
const double diagonalElementValue,
8 const double vectorElementValue,
9 const bool useDefaultValue)
14 , _useDefaultValue(useDefaultValue), _defaultDiagonalValue(diagonalElementValue)
15 , _defaultbValue(vectorElementValue)
18 _d.setConstant(diagonalElementValue);
21 _b.setConstant(vectorElementValue);
25 DiagonalLinearFunction::DiagonalLinearFunction(
Variable&
x)
72 _d.setConstant(diagonalElementValue);
109 throw std::runtime_error(
"[ocra::DiagonalLinearFunction::doUpdateSize] No default value to increase the size of A");
118 _b.head(oldDim) = tmpb;
142 void DiagonalLinearFunction::buildA()
146 propagate<EVT_CHANGE_VALUE>();
168 std::cout << x.
getValue() << std::endl;
169 std::cout << f.
getValue() << std::endl << std::endl;
173 std::cout << x.
getValue() << std::endl;
174 std::cout << f.
getValue() << std::endl << std::endl;
175 std::cout << f.
getJacobian() << std::endl << std::endl;
const VectorXd & getValue() const
virtual void doChangeA(const MatrixXd &A)
virtual void doChangeDefaultbValue(const double v)
void doUpdateDimensionBegin(int newDimension)
void setValue(const VectorXd &value)
void changeDiagonal(const VectorXd &d)
double _defaultDiagonalValue
void testDiagonalLinearFunction()
void changeDefaultDiagonalValue(const double v)
Optimization-based Robot Controller namespace. a library of classes to write and solve optimization p...
virtual void doChangeDefaultDiagonalValue(const double v)
const MatrixXd & getJacobian() const
This class represents a variable in a mathematical sense.
int computeDimensionFromInputSize() const
const VectorXd & getValue() const
virtual void doUpdateInputSizeEnd()
Declaration file of the DiagonalLinearFunction class.
void resize(size_t newSize)
virtual void doUpdateInputSizeBegin()
virtual void doChangeA(const MatrixXd &A)
virtual void doChangeDiagonal(const VectorXd &d)
#define ocra_assert(ocra_expression)
void changeDefaultbValue(const double v)
virtual void updateValue() const
Implements a basic variable.
DiagonalLinearFunction class.