ocra-recipes
Doxygen documentation for the ocra-recipes repository
SumOfLinearFunctions.h
Go to the documentation of this file.
1 #ifndef _OCRA_SUM_OF_LINEAR_FUNCTIONS_H_
2 #define _OCRA_SUM_OF_LINEAR_FUNCTIONS_H_
3 
6 
7 #include <vector>
8 
9 namespace ocra
10 {
12  : public LinearFunction
13  {
14  public:
15  typedef LinearFunction functionType_t; //< alias on the type of the mother class. Needed to duplicate the function tree.
16 
17  private:
18  SumOfLinearFunctions(const SumOfLinearFunctions&); // forbid copy
19  SumOfLinearFunctions& operator=(const SumOfLinearFunctions&); // forbid assignment
20 
21  public:
22  SumOfLinearFunctions(int dimension);
24 
25  SumOfLinearFunctions& addFunction(LinearFunction& f, double scale=1.);
28 
29  protected:
30  void updateJacobian() const;
31  void updateb() const;
32  void doUpdateInputSizeBegin(); // does nothing : this overload allows to resize
33 
34  void doChangeA(const MatrixXd& A);
35  void doChangeb(const VectorXd& b);
36 
37  private:
38  void checkThatFunctionsDimensionDoNotChange(int timestamp);
39 
40  private:
41  typedef std::pair<LinearFunction*, double> weightedFunction_t;
42  MergedVariable _variable;
43  std::vector<weightedFunction_t> _functions;
44  VectorXd _offset;
45  };
46 }
47 
48 #endif
49 
50 // cmake:sourcegroup=Function
SumOfLinearFunctions & removeFunction(LinearFunction &f, double scale)
LinearFunction class.
Optimization-based Robot Controller namespace. a library of classes to write and solve optimization p...
Declaration file of the LinearFunction class.
void doChangeA(const MatrixXd &A)
void doChangeb(const VectorXd &b)
SumOfLinearFunctions & addFunction(LinearFunction &f, double scale=1.)