acado/objective/lsq_term.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ACADO Toolkit.
3  *
4  * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
5  * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
6  * Milan Vukov, Rien Quirynen, KU Leuven.
7  * Developed within the Optimization in Engineering Center (OPTEC)
8  * under supervision of Moritz Diehl. All rights reserved.
9  *
10  * ACADO Toolkit is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 3 of the License, or (at your option) any later version.
14  *
15  * ACADO Toolkit is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with ACADO Toolkit; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 
34 #include <acado/curve/curve.hpp>
35 
36 // #define SIM_DEBUG
37 
38 
40 
41 //
42 // PUBLIC MEMBER FUNCTIONS:
43 //
44 
45 
48 
49  S = 0;
50  r = 0;
51 
52  S_temp = 0;
53  r_temp = 0;
54 
55  S_h_res = 0;
56 }
57 
58 
60  const Function& h ,
61  const VariablesGrid *r_ )
63 
64  S = 0;
65  r = 0;
66  S_h_res = 0;
67  fcn = h;
68 
69  if( S_ != 0 ) S_temp = new MatrixVariablesGrid(*S_);
70  else S_temp = 0 ;
71 
72  if( r_ != 0 ) r_temp = new VariablesGrid(*r_);
73  else r_temp = 0 ;
74 }
75 
76 
78  :ObjectiveElement( rhs ){
79 
80  uint run1, run2;
81 
82  if( rhs.S_temp != 0 ) S_temp = new MatrixVariablesGrid(*rhs.S_temp);
83  else S_temp = 0;
84 
85  if( rhs.r_temp != 0 ) r_temp = new VariablesGrid(*rhs.r_temp);
86  else r_temp = 0;
87 
88 
89  if( rhs.S != NULL ){
90  S = new DMatrix[grid.getNumPoints()];
91  for( run1 = 0; run1 < grid.getNumPoints(); run1++ )
92  S[run1] = rhs.S[run1];
93  }
94  else S = NULL;
95 
96  if( rhs.r != NULL ){
97  r = new DVector[grid.getNumPoints()];
98  for( run1 = 0; run1 < grid.getNumPoints(); run1++ )
99  r[run1] = rhs.r[run1];
100  }
101  else r = NULL;
102 
103  if( rhs.S_h_res != 0 ){
104  S_h_res = new double*[grid.getNumPoints()];
105  for( run1 = 0; run1 < grid.getNumPoints(); run1++ ){
106  S_h_res[run1] = new double[fcn.getDim()];
107  for( run2 = 0; (int) run2 < fcn.getDim(); run2++ ){
108  S_h_res[run1][run2] = rhs.S_h_res[run1][run2];
109  }
110  }
111  }
112 }
113 
114 
116 
117  uint run1;
118 
119  if( S_temp != 0 )
120  delete S_temp;
121 
122  if( r_temp != 0 )
123  delete r_temp;
124 
125  if( S != 0 )
126  delete[] S;
127 
128  if( r != 0 )
129  delete[] r;
130 
131  if( S_h_res != 0 ){
132  for( run1 = 0; run1 < grid.getNumPoints(); run1++ )
133  delete[] S_h_res[run1];
134  delete[] S_h_res;
135  }
136 }
137 
138 
140 
141  uint run1, run2;
142 
143  if ( this != &rhs ){
144 
145 
146  if( S_temp != 0 )
147  delete S_temp;
148 
149  if( r_temp != 0 )
150  delete[] r_temp;
151 
152  if( S!= NULL )
153  delete[] S;
154 
155  if( r!= NULL )
156  delete[] r;
157 
158  if( S_h_res != 0 ){
159  for( run1 = 0; run1 < grid.getNumPoints(); run1++ )
160  delete[] S_h_res[run1];
161  delete[] S_h_res;
162  }
163 
165 
166  if( rhs.S_temp != 0 ) S_temp = new MatrixVariablesGrid(*rhs.S_temp);
167  else S_temp = 0;
168 
169  if( rhs.r_temp != 0 ) r_temp = new VariablesGrid(*rhs.r_temp);
170  else r_temp = 0;
171 
172  if( rhs.S != NULL ){
173  S = new DMatrix[grid.getNumPoints()];
174  for( run1 = 0; run1 < grid.getNumPoints(); run1++ )
175  S[run1] = rhs.S[run1];
176  }
177  else S = NULL;
178 
179  if( rhs.r != NULL ){
180  r = new DVector[grid.getNumPoints()];
181  for( run1 = 0; run1 < grid.getNumPoints(); run1++ )
182  r[run1] = rhs.r[run1];
183  }
184  else r = NULL;
185 
186  if( rhs.S_h_res != 0 ){
187  S_h_res = new double*[grid.getNumPoints()];
188  for( run1 = 0; run1 < grid.getNumPoints(); run1++ ){
189  S_h_res[run1] = new double[fcn.getDim()];
190  for( run2 = 0; (int) run2 < fcn.getDim(); run2++ ){
191  S_h_res[run1][run2] = rhs.S_h_res[run1][run2];
192  }
193  }
194  }
195  }
196  return *this;
197 }
198 
199 
200 
202 
203  uint run1, run2, run3;
204 
205  DVector h_res;
206 
207  const uint nh = fcn.getDim();
208  const uint N = grid.getNumPoints();
209 
211 
212  obj = 0.0;
213 
214  double currentValue;
215  VariablesGrid allValues( 1,grid );
216 
217  for( run1 = 0; run1 < N; run1++ ){
218 
219  currentValue = 0.0;
220 
221  // EVALUATE THE LSQ-FUCNTION:
222  // --------------------------
223  z.setZ( run1, x );
224  h_res = fcn.evaluate( z, (int) run1 );
225 
226 
227  #ifdef SIM_DEBUG
228  if( run1 == 0 || run1 == 1 ){
229 
230  h_res.print("hres");
231  r[run1].print("reference");
232 
233  }
234  #endif
235 
236 
237 
238  // EVALUATE THE OBJECTIVE:
239  // -----------------------
240 
241  if( r != NULL )
242  h_res -= r[run1];
243 
244  if( S != NULL ){
245 
246  if ( !(S[run1].getNumCols() == nh && S[run1].getNumRows() == nh) )
248  The weighting matrix in the LSQ objective has a wrong dimension.);
249 
250  for( run2 = 0; run2 < nh; run2++ ){
251  S_h_res[run1][run2] = 0.0;
252  for( run3 = 0; run3 < nh; run3++ )
253  S_h_res[run1][run2] += S[run1].operator()(run2,run3)*h_res(run3);
254  }
255 
256  for( run2 = 0; run2 < nh; run2++ ){
257  currentValue += 0.5*h_res(run2)*S_h_res[run1][run2];
258  }
259  }
260  else{
261  for( run2 = 0; run2 < nh; run2++ ){
262  S_h_res[run1][run2] = h_res(run2);
263  currentValue += 0.5*h_res(run2)*h_res(run2);
264  }
265  }
266 
267  allValues( run1,0 ) = currentValue;
268  }
269 
270  if (N > 1) {
271  DVector tmp(1);
272  allValues.getIntegral(IM_CONSTANT, tmp);
273  obj = tmp(0);
274  } else {
275  obj = allValues(0, 0);
276  }
277 
278  return SUCCESSFUL_RETURN;
279 }
280 
281 
282 
284 
285  if( hessian == 0 ) return evaluateSensitivitiesGN(0);
286 
287  int run1, run2, run3, run4;
288  const int N = grid.getNumPoints();
289  const int nh = fcn.getDim();
290 
291  if( bSeed != 0 ){
292 
293  if( xSeed != 0 || pSeed != 0 || uSeed != 0 || wSeed != 0 ||
294  xSeed2 != 0 || pSeed2 != 0 || uSeed2 != 0 || wSeed2 != 0 )
296 
297  double *bseed = new double [nh];
298  double **J = new double*[nh];
299 
300  for( run2 = 0; run2 < nh; run2++ )
301  J[run2] = new double[fcn.getNumberOfVariables() +1];
302 
303  if( bSeed->getNumRows( 0, 0 ) != 1 ) return ACADOWARNING( RET_WRONG_DEFINITION_OF_SEEDS );
304 
305  DMatrix bseed_;
306  bSeed->getSubBlock( 0, 0, bseed_);
307 
308  dBackward.init( 1, 5*N );
309 
310  DMatrix Dx ( 1, nx );
311  DMatrix Dxa( 1, na );
312  DMatrix Dp ( 1, np );
313  DMatrix Du ( 1, nu );
314  DMatrix Dw ( 1, nw );
315 
316  for( run1 = 0; run1 < N; run1++ ){
317 
318  Dx .setZero();
319  Dxa.setZero();
320  Dp .setZero();
321  Du .setZero();
322  Dw .setZero();
323 
324  for( run2 = 0; run2 < nh; run2++ ) bseed[run2] = 0;
325 
326  for( run2 = 0; run2 < nh; run2++ ){
327  for(run3 = 0; (int) run3 < fcn.getNumberOfVariables() +1; run3++ )
328  J[run2][run3] = 0.0;
329 
330  bseed[run2] = 1.0;
331  fcn.AD_backward( run1, bseed, J[run2] );
332  bseed[run2] = 0.0;
333 
334  for( run3 = 0; run3 < nx; run3++ ){
335  Dx( 0, run3 ) += bseed_(0,0)*J[run2][y_index[run3]]*S_h_res[run1][run2];
336  }
337  for( run3 = nx; run3 < nx+na; run3++ ){
338  Dxa( 0, run3-nx ) += bseed_(0,0)*J[run2][y_index[run3]]*S_h_res[run1][run2];
339  }
340  for( run3 = nx+na; run3 < nx+na+np; run3++ ){
341  Dp( 0, run3-nx-na ) += bseed_(0,0)*J[run2][y_index[run3]]*S_h_res[run1][run2];
342  }
343  for( run3 = nx+na+np; run3 < nx+na+np+nu; run3++ ){
344  Du( 0, run3-nx-na-np ) += bseed_(0,0)*J[run2][y_index[run3]]*S_h_res[run1][run2];
345  }
346  for( run3 = nx+na+np+nu; run3 < nx+na+np+nu+nw; run3++ ){
347  Dw( 0, run3-nx-na-np-nu ) += bseed_(0,0)*J[run2][y_index[run3]]*S_h_res[run1][run2];
348  }
349  }
350  if( nx > 0 ) dBackward.setDense( 0, run1, Dx );
351  if( na > 0 ) dBackward.setDense( 0, N+run1, Dxa );
352  if( np > 0 ) dBackward.setDense( 0, 2*N+run1, Dp );
353  if( nu > 0 ) dBackward.setDense( 0, 3*N+run1, Du );
354  if( nw > 0 ) dBackward.setDense( 0, 4*N+run1, Dw );
355 
356 
357  // COMPUTATION OF THE EXACT HESSIAN:
358  // ---------------------------------
359 
360  const int nnn = nx+na+np+nu+nw;
361  DMatrix tmp( nh, nnn );
362 
363  for( run3 = 0; run3 < nnn; run3++ ){
364  for( run2 = 0; run2 < nh; run2++ ){
365  if( S != 0 ){
366  tmp( run2, run3 ) = 0.0;
367  for( run4 = 0; run4 < nh; run4++ ){
368  tmp( run2, run3 ) += S[run1].operator()(run2,run4)*J[run4][y_index[run3]];
369  }
370  }
371  else{
372  tmp( run2, run3 ) = J[run2][y_index[run3]];
373  }
374  }
375  }
376  DMatrix tmp2;
377  int i,j;
378  int *Sidx = new int[6];
379  int *Hidx = new int[5];
380 
381  Sidx[0] = 0;
382  Sidx[1] = nx;
383  Sidx[2] = nx+na;
384  Sidx[3] = nx+na+np;
385  Sidx[4] = nx+na+np+nu;
386  Sidx[5] = nx+na+np+nu+nw;
387 
388  Hidx[0] = run1;
389  Hidx[1] = N+run1;
390  Hidx[2] = 2*N+run1;
391  Hidx[3] = 3*N+run1;
392  Hidx[4] = 4*N+run1;
393 
394  for( i = 0; i < 5; i++ ){
395  for( j = 0; j < 5; j++ ){
396 
397  tmp2.init(Sidx[i+1]-Sidx[i],Sidx[j+1]-Sidx[j]);
398  tmp2.setZero();
399 
400  for( run3 = Sidx[i]; run3 < Sidx[i+1]; run3++ )
401  for( run4 = Sidx[j]; run4 < Sidx[j+1]; run4++ )
402  for( run2 = 0; run2 < nh; run2++ )
403  tmp2(run3-Sidx[i],run4-Sidx[j]) += J[run2][y_index[run3]]*tmp(run2,run4);
404 
405  if( tmp2.getDim() != 0 ) hessian->addDense(Hidx[i],Hidx[j],tmp2);
406  }
407  }
408  delete[] Sidx;
409  delete[] Hidx;
410  }
411 
412  for( run2 = 0; run2 < nh; run2++ )
413  delete[] J[run2];
414  delete[] J;
415  delete[] bseed;
416  return SUCCESSFUL_RETURN;
417  }
419 }
420 
421 
423 
424  int run1, run2, run3, run4;
425  const int N = grid.getNumPoints();
426  const int nh = fcn.getDim();
427 
428  if( bSeed != 0 ){
429 
430  if( xSeed != 0 || pSeed != 0 || uSeed != 0 || wSeed != 0 ||
431  xSeed2 != 0 || pSeed2 != 0 || uSeed2 != 0 || wSeed2 != 0 )
433 
434  double *bseed = new double [nh];
435  double **J = new double*[nh];
436 
437  for( run2 = 0; run2 < nh; run2++ )
438  J[run2] = new double[fcn.getNumberOfVariables() +1];
439 
440  if( bSeed->getNumRows( 0, 0 ) != 1 ) return ACADOWARNING( RET_WRONG_DEFINITION_OF_SEEDS );
441 
442  DMatrix bseed_;
443  bSeed->getSubBlock( 0, 0, bseed_);
444 
445  dBackward.init( 1, 5*N );
446 
447  DMatrix Dx ( 1, nx );
448  DMatrix Dxa( 1, na );
449  DMatrix Dp ( 1, np );
450  DMatrix Du ( 1, nu );
451  DMatrix Dw ( 1, nw );
452 
453  for( run1 = 0; run1 < N; run1++ ){
454 
455  Dx .setZero();
456  Dxa.setZero();
457  Dp .setZero();
458  Du .setZero();
459  Dw .setZero();
460 
461  for( run2 = 0; run2 < nh; run2++ ) bseed[run2] = 0;
462 
463  if( fcn.ADisSupported() == BT_FALSE ){
464 
465  double *fseed = new double[fcn.getNumberOfVariables()+1];
466  for( run3 = 0; (int) run3 < fcn.getNumberOfVariables()+1; run3++ )
467  fseed[run3] = 0.0;
468 
469  for( run3 = 0; (int) run3 < fcn.getNumberOfVariables()+1; run3++ ){
470  fseed[run3] = 1.0;
471  fcn.AD_forward( run1, fseed, bseed );
472  fseed[run3] = 0.0;
473  for( run2 = 0; run2 < nh; run2++ )
474  J[run2][run3] = bseed[run2];
475  }
476  delete[] fseed;
477  }
478 
479  for( run2 = 0; run2 < nh; run2++ ){
480 
481  if( fcn.ADisSupported() == BT_TRUE ){
482  for(run3 = 0; (int) run3 < fcn.getNumberOfVariables() +1; run3++ )
483  J[run2][run3] = 0.0;
484  bseed[run2] = 1.0;
485  fcn.AD_backward( run1, bseed, J[run2] );
486  bseed[run2] = 0.0;
487  }
488 
489  for( run3 = 0; run3 < nx; run3++ ){
490  Dx( 0, run3 ) += bseed_(0,0)*J[run2][y_index[run3]]*S_h_res[run1][run2];
491  }
492  for( run3 = nx; run3 < nx+na; run3++ ){
493  Dxa( 0, run3-nx ) += bseed_(0,0)*J[run2][y_index[run3]]*S_h_res[run1][run2];
494  }
495  for( run3 = nx+na; run3 < nx+na+np; run3++ ){
496  Dp( 0, run3-nx-na ) += bseed_(0,0)*J[run2][y_index[run3]]*S_h_res[run1][run2];
497  }
498  for( run3 = nx+na+np; run3 < nx+na+np+nu; run3++ ){
499  Du( 0, run3-nx-na-np ) += bseed_(0,0)*J[run2][y_index[run3]]*S_h_res[run1][run2];
500  }
501  for( run3 = nx+na+np+nu; run3 < nx+na+np+nu+nw; run3++ ){
502  Dw( 0, run3-nx-na-np-nu ) += bseed_(0,0)*J[run2][y_index[run3]]*S_h_res[run1][run2];
503  }
504  }
505  if( nx > 0 ) dBackward.setDense( 0, run1, Dx );
506  if( na > 0 ) dBackward.setDense( 0, N+run1, Dxa );
507  if( np > 0 ) dBackward.setDense( 0, 2*N+run1, Dp );
508  if( nu > 0 ) dBackward.setDense( 0, 3*N+run1, Du );
509  if( nw > 0 ) dBackward.setDense( 0, 4*N+run1, Dw );
510 
511  // COMPUTE GAUSS-NEWTON HESSIAN APPROXIMATION IF REQUESTED:
512  // --------------------------------------------------------
513 
514  if( GNhessian != 0 ){
515 
516  const int nnn = nx+na+np+nu+nw;
517  DMatrix tmp( nh, nnn );
518 
519  for( run3 = 0; run3 < nnn; run3++ ){
520  for( run2 = 0; run2 < nh; run2++ ){
521  if( S != 0 ){
522  tmp( run2, run3 ) = 0.0;
523  for( run4 = 0; run4 < nh; run4++ ){
524  tmp( run2, run3 ) += S[run1].operator()(run2,run4)*J[run4][y_index[run3]];
525  }
526  }
527  else{
528  tmp( run2, run3 ) = J[run2][y_index[run3]];
529  }
530  }
531  }
532  DMatrix tmp2;
533  int i,j;
534  int *Sidx = new int[6];
535  int *Hidx = new int[5];
536 
537  Sidx[0] = 0;
538  Sidx[1] = nx;
539  Sidx[2] = nx+na;
540  Sidx[3] = nx+na+np;
541  Sidx[4] = nx+na+np+nu;
542  Sidx[5] = nx+na+np+nu+nw;
543 
544  Hidx[0] = run1;
545  Hidx[1] = N+run1;
546  Hidx[2] = 2*N+run1;
547  Hidx[3] = 3*N+run1;
548  Hidx[4] = 4*N+run1;
549 
550  for( i = 0; i < 5; i++ ){
551  for( j = 0; j < 5; j++ ){
552 
553  tmp2.init(Sidx[i+1]-Sidx[i],Sidx[j+1]-Sidx[j]);
554  tmp2.setZero();
555 
556  for( run3 = Sidx[i]; run3 < Sidx[i+1]; run3++ )
557  for( run4 = Sidx[j]; run4 < Sidx[j+1]; run4++ )
558  for( run2 = 0; run2 < nh; run2++ )
559  tmp2(run3-Sidx[i],run4-Sidx[j]) += J[run2][y_index[run3]]*tmp(run2,run4);
560 
561  if( tmp2.getDim() != 0 ) GNhessian->addDense(Hidx[i],Hidx[j],tmp2);
562  }
563  }
564  delete[] Sidx;
565  delete[] Hidx;
566  }
567  }
568 
569  for( run2 = 0; run2 < nh; run2++ )
570  delete[] J[run2];
571  delete[] J;
572  delete[] bseed;
573  return SUCCESSFUL_RETURN;
574  }
575 
577 }
578 
579 returnValue LSQTerm::getWeigthingtMatrix(const unsigned _index, DMatrix& _matrix) const
580 {
581  if ( S_temp )
582  {
583  _matrix= S_temp->getMatrix( _index );
584 
585  return SUCCESSFUL_RETURN;
586  }
587 
588  return RET_INITIALIZE_FIRST;
589 }
590 
592  uint run1;
593  const uint N = grid.getNumPoints();
594  //ASSERT( N == ref.getNumPoints() );
595 // printf("setReference!!!!\n");
596  if( r == 0 ) r = new DVector[N];
597  if ( N == ref.getNumPoints() ) {
598  for( run1 = 0; run1 < N; run1++ )
599  r[run1] = ref.getVector(run1);
600 // r[run1].print( "ref[run1]" );
601  } else {
602  Curve tmp;tmp.add(ref);
603  for( run1 = 0; run1 < N; run1++ ) {
604  tmp.evaluate(grid.getTime(run1)+ref.getFirstTime(), r[run1]);
605 // printf( "time = %e\n", grid.getTime(run1)+ref.getFirstTime() );
606 // r[run1].print( "ref[run1]" );
607  }
608  }
609  return SUCCESSFUL_RETURN;
610 }
611 
612 
614 
615 // end of file.
#define N
Data class for storing generic optimization variables.
Definition: ocp_iterate.hpp:57
returnValue init(const OCPiterate &x)
Implements a very rudimentary block sparse matrix class.
Base class for all kind of objective function terms within optimal control problems.
Allows to setup and evaluate a general function based on SymbolicExpressions.
Definition: function_.hpp:59
void init(unsigned _nRows=0, unsigned _nCols=0)
Definition: matrix.hpp:135
double getTime(uint pointIdx) const
double getFirstTime() const
returnValue evaluate(double t, double *result) const
Definition: curve.cpp:314
returnValue setDense(uint rowIdx, uint colIdx, const DMatrix &value)
returnValue setReference(const VariablesGrid &ref)
returnValue add(double tStart, double tEnd, const DVector constant)
Definition: curve.cpp:143
Provides a time grid consisting of vector-valued optimization variables at each grid point...
returnValue getWeigthingtMatrix(const unsigned _index, DMatrix &_matrix) const
Allows to pass back messages to the calling function.
DVector evaluate(const EvaluationPoint &x, const int &number=0)
Definition: function.cpp:520
returnValue evaluateSensitivitiesGN(BlockMatrix *GNhessian)
returnValue setZ(const uint &idx, const OCPiterate &iter)
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
#define CLOSE_NAMESPACE_ACADO
returnValue getSubBlock(uint rowIdx, uint colIdx, DMatrix &value) const
returnValue evaluateSensitivities(BlockMatrix *hessian)
MatrixVariablesGrid * S_temp
Definition: lsq_term.hpp:166
Provides a time grid consisting of matrix-valued optimization variables at each grid point...
unsigned getDim() const
Definition: matrix.hpp:181
returnValue init(uint _nRows, uint _nCols)
int getDim() const
virtual returnValue print(std::ostream &stream=std::cout, const std::string &name=DEFAULT_LABEL, const std::string &startString=DEFAULT_START_STRING, const std::string &endString=DEFAULT_END_STRING, uint width=DEFAULT_WIDTH, uint precision=DEFAULT_PRECISION, const std::string &colSeparator=DEFAULT_COL_SEPARATOR, const std::string &rowSeparator=DEFAULT_ROW_SEPARATOR) const
Definition: vector.cpp:97
Derived & setZero(Index size)
DVector * r
Definition: lsq_term.hpp:170
DMatrix * S
Definition: lsq_term.hpp:169
Allows to work with piecewise-continous function defined over a scalar time interval.
Definition: curve.hpp:52
BooleanType ADisSupported() const
returnValue evaluate(const OCPiterate &x)
void rhs(const real_t *x, real_t *f)
DMatrix getMatrix(uint pointIdx) const
returnValue AD_backward(const DVector &seed, EvaluationPoint &df, const int &number=0)
Definition: function.cpp:546
double ** S_h_res
Definition: lsq_term.hpp:172
#define BT_TRUE
Definition: acado_types.hpp:47
DVector AD_forward(const EvaluationPoint &x, const int &number=0)
Definition: function.cpp:533
uint getNumPoints() const
DVector getVector(uint pointIdx) const
#define ACADOWARNING(retval)
#define BEGIN_NAMESPACE_ACADO
#define BT_FALSE
Definition: acado_types.hpp:49
Stores and evaluates LSQ terms within optimal control problems.
Definition: lsq_term.hpp:61
VariablesGrid * r_temp
Definition: lsq_term.hpp:167
returnValue getIntegral(InterpolationMode mode, DVector &value) const
returnValue addDense(uint rowIdx, uint colIdx, const DMatrix &value)
int getNumberOfVariables() const
Definition: function.cpp:264
LSQTerm & operator=(const LSQTerm &rhs)
ObjectiveElement & operator=(const ObjectiveElement &rhs)
#define ACADOERROR(retval)
#define ACADOERRORTEXT(retval, text)
uint getNumRows() const


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:48