11 LinearFunction::LinearFunction(
Variable& x,
int dimension)
17 ,_inhibitPropagationFromb(false)
45 "The size of the new matrix A does not match with the size of previous A");
46 propagate<EVT_CHANGE_VALUE>();
53 ocra_assert(
_b.size() ==
_dim &&
"Size of b does not match with function dimension.");
54 propagate<EVT_CHANGE_VALUE>();
70 if (!_inhibitPropagationFromb)
71 propagate<EVT_CHANGE_VALUE>();
98 _inhibitPropagationFromb =
true;
103 _inhibitPropagationFromb =
false;
126 for (
int i=0; i<n; ++i)
128 b[i] = (4*rand())/RAND_MAX - 2;
129 for (
int j=0; j<y.
getSize(); ++j)
130 A(i,j) = (5*rand())/(RAND_MAX) - 2;
132 std::cout << A << std::endl;
133 std::cout << b << std::endl;
137 for (
int i=0; i<y.
getSize(); ++i)
138 v[i] = (4*rand())/RAND_MAX - 2;
141 std::cout << (VectorXd)y << std::endl;
142 std::cout << f.
getValue() << std::endl;
virtual void doUpdateInputSizeEnd()
virtual void updateJacobian() const
void desinhibitPropagationFromb() const
virtual void doChangeb(const VectorXd &b)
const VectorXd & getValue() const
virtual void doChangeA(const MatrixXd &A)
void changeA(const MatrixXd &A)
virtual void updateb() const
virtual void updateValue() const
void setValue(const VectorXd &value)
void changeb(const VectorXd &b)
Optimization-based Robot Controller namespace. a library of classes to write and solve optimization p...
Declaration file of the LinearFunction class.
const MatrixXd & getJacobian() const
const VectorXd & getb() const
void invalidateb(int timestamp)
This class represents a variable in a mathematical sense.
void inhibitPropagationFromb() const
const VectorXd & getValue() const
const MatrixXd & getA() const
CompositeVariable & add(Variable &child)
Attach/detach the child to/from this node.
void testLinearFunction()
A concatenation of base variables and other composite variables.
#define ocra_assert(ocra_expression)
Declaration file of the Variable class.
Implements a basic variable.