banded_cp.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 
35 
37 
38 
39 //
40 // PUBLIC MEMBER FUNCTIONS:
41 //
42 
44 
45  nS = 0;
46 
47  B = 0;
48  lbB = 0;
49  ubB = 0;
50 
51  ylbB = 0;
52  yubB = 0;
53 }
54 
55 
57 
58  copy(rhs);
59 }
60 
61 
63 
64  clean();
65 }
66 
67 
69 
70  if ( this != &rhs ){
71 
72  clean() ;
73  copy(rhs);
74  }
75  return *this;
76 }
77 
78 
79 
80 void BandedCP::copy( const BandedCP& rhs ){
81 
82 
83  hessian = rhs.hessian ;
85 
88 
89  dynGradient = rhs.dynGradient ;
90  dynResiduum = rhs.dynResiduum ;
91 
95 
96  deltaX = rhs.deltaX ;
97  lambdaBound = rhs.lambdaBound ;
100 
101 
102 // int run1, run2;
103 
104 // nS = rhs.nS;
105 //
106 //
107 // if( rhs.B != 0 ){
108 // B = (BlockMatrix**)calloc(nS,sizeof(BlockMatrix*));
109 // for( run1 = 0; run1 < nS; run1++ ){
110 // B[run1] = new BlockMatrix[nV];
111 // for( run2 = 0; run2 < nV; run2++ )
112 // B[run1][run2] = rhs.B[run1][run2];
113 // }
114 // }
115 // else B = 0;
116 //
117 //
118 // if( rhs.lbB != 0 ){
119 // lbB = (BlockMatrix*)calloc(nS,sizeof(BlockMatrix));
120 // for( run1 = 0; run1 < nS; run1++ )
121 // lbB[run1] = rhs.lbB[run1];
122 // }
123 // else lbB = 0;
124 //
125 // if( rhs.ubB != 0 ){
126 // ubB = (BlockMatrix*)calloc(nS,sizeof(BlockMatrix));
127 // for( run1 = 0; run1 < nS; run1++ )
128 // ubB[run1] = rhs.ubB[run1];
129 // }
130 // else ubB = 0;
131 //
132 //
133 // if( nS > 0 ){
134 //
135 // ylbB = (BlockMatrix**)calloc(nS,sizeof(BlockMatrix*));
136 // yubB = (BlockMatrix**)calloc(nS,sizeof(BlockMatrix*));
137 //
138 // for( run1 = 0; run1 < nS; run1++ ){
139 // if( rhs.ylbB[run1] != 0 ) ylbB[run1] = new BlockMatrix(*rhs.ylbB[run1]);
140 // else ylbB[run1] = 0 ;
141 //
142 // if( rhs.yubB[run1] != 0 ) yubB[run1] = new BlockMatrix(*rhs.yubB[run1]);
143 // else yubB[run1] = 0 ;
144 // }
145 // }
146 // else{
147 // ylbB = 0;
148 // yubB = 0;
149 // }
150 }
151 
152 
153 
155 
156 // int run1;
157 //
158 // for( run1 = 0; run1 < nS; run1++ ){
159 //
160 // if( B[run1] != 0 ) delete[] B[run1];
161 // if( ylbB[run1] != 0 ) delete ylbB[run1];
162 // if( yubB[run1] != 0 ) delete yubB[run1];
163 // }
164 //
165 // if( B != 0 ) free(B) ;
166 // if( ylbB != 0 ) free(ylbB);
167 // if( yubB != 0 ) free(yubB);
168 //
169 // if( lbB != 0 ) free(lbB);
170 // if( ubB != 0 ) free(ubB);
171 }
172 
173 
174 
175 
177 
178 // end of file.
void clean()
Definition: banded_cp.cpp:154
BlockMatrix upperConstraintResiduum
Definition: banded_cp.hpp:114
BlockMatrix deltaX
Definition: banded_cp.hpp:123
BlockMatrix * lbB
Definition: banded_cp.hpp:117
BlockMatrix objectiveGradient
Definition: banded_cp.hpp:104
virtual ~BandedCP()
Definition: banded_cp.cpp:62
BlockMatrix ** B
Definition: banded_cp.hpp:116
BlockMatrix lambdaConstraint
Definition: banded_cp.hpp:126
#define CLOSE_NAMESPACE_ACADO
BlockMatrix hessian
Definition: banded_cp.hpp:103
BlockMatrix lambdaDynamic
Definition: banded_cp.hpp:125
BlockMatrix lowerBoundResiduum
Definition: banded_cp.hpp:106
BlockMatrix ** ylbB
Definition: banded_cp.hpp:128
BlockMatrix * ubB
Definition: banded_cp.hpp:118
BlockMatrix lowerConstraintResiduum
Definition: banded_cp.hpp:113
BlockMatrix lambdaBound
Definition: banded_cp.hpp:124
BlockMatrix upperBoundResiduum
Definition: banded_cp.hpp:107
void rhs(const real_t *x, real_t *f)
BlockMatrix dynResiduum
Definition: banded_cp.hpp:110
BlockMatrix dynGradient
Definition: banded_cp.hpp:109
#define BEGIN_NAMESPACE_ACADO
BandedCP & operator=(const BandedCP &rhs)
Definition: banded_cp.cpp:68
BlockMatrix constraintGradient
Definition: banded_cp.hpp:112
BlockMatrix ** yubB
Definition: banded_cp.hpp:129
void copy(const BandedCP &rhs)
Definition: banded_cp.cpp:80
Data class for storing conic programs arising from optimal control.
Definition: banded_cp.hpp:56


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