7 int continuity,
bool explicitlyTimeDependant,
bool separableTimeDependancy)
12 ,
IFunctionProperties(linearity, convexity, continuity, explicitlyTimeDependant, separableTimeDependancy)
16 , _dimension(dimension)
18 , _hasDisconnected(false)
33 if(! _hasDisconnected)
35 _hasDisconnected =
true;
58 changeFunctionDimensionImpl(newDimension);
62 void Function::changeFunctionDimensionImpl(
int newDimension)
65 int oldDimension = _dimension;
66 _dimension = newDimension;
76 stopPropagation<EVT_RESIZE>();
88 const int m = _dimension;
95 throw std::runtime_error(
"[Function::doUpdateInputSizeBegin]: by default, the function variable is not resizable. doUpdateInputSizeBegin must be overloaded if the function accept variable resizing.");
105 ocra_assert(
false &&
"This should never happen, this function has to be overloaded in contexts where it might be called");
111 throw std::runtime_error(
"[Function::doUpdateDimensionBegin]: by default, a function is not resizable. doUpdateDimensionBegin must be overloaded if the function dimension can be changed.");
127 IFunction<FUN_DOT>::_val += get<PARTIAL_T>();
140 + get<PARTIAL_X_DOT>()*
static_cast<VectorXd
>(x_dot);
169 std::cout <<
"Welcome in updateValue" << std::endl;
174 std::cout <<
"Welcome in updateJacobian" << std::endl;
179 std::cout <<
"Welcome in updateFdot" << std::endl;
const Variable & getVariable() const
Computation ability of a ocra function.
virtual Variable & getTimeDerivative()
Get the time derivative/primitive of the variable.
virtual int computeDimensionFromInputSize() const
const VectorXd & getValue() const
virtual void updateFdot() const
virtual void doUpdateDimensionBegin(int newDimension)
#define OCRA_FUNCTION_INTERFACE_LIST(begin, pre, end)
NamedInstance(const std::string &name)
void disconnectVariable()
Optimization-based Robot Controller namespace. a library of classes to write and solve optimization p...
virtual void updateFddot() const
virtual void doUpdateDimensionEnd(int oldDimension)
bool hasTimeDerivative() const
const IFunction< Ability >::return_type & get() const
MyFunction(ocra::Variable &x, int dimension)
virtual void doUpdateInputSizeEnd()
const MatrixXd & getJacobian() const
bool isExplicitlyTimeDependant(void) const
void updateJacobian() const
Function(Variable &x, int dimension, eFunctionLinearity linearity=LINEARITY_UNDEFINED, eFunctionConvexity convexity=CONVEXITY_UNDEFINED, int continuity=CONTINUITY_UNKNOWN, bool explicitlyTimeDependant=false, bool separableTimeDependancy=true)
Function Constructor.
virtual void updateValue() const
This class represents a variable in a mathematical sense.
#define OCRA_APPLY_FUNCTION_ON_ALL_INTERFACE(methodAndArgs)
void changeFunctionDimension(int newDimension)
Declaration file of the Function class.
virtual void doUpdateInputSizeBegin()
#define ocra_assert(ocra_expression)
virtual void updateJdotXdot() const
Declaration file of the Variable class.
#define OCRA_FUNCTION_INTERFACE_INITIALIZE(usageSet)
void disconnect(Derived &object, void(Base::*callbackToErase)(int)) const
Disconnect non-static method.
void connect(Derived &object, void(Base::*newCallback)(int)) const
Call this method to register a non-static method as a callback.
Implements a basic variable.
AbilitySet(const std::vector< bool > &usageSet)
void updateInputSize(int timestamp)