export_argument_internal.hpp
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 
27 
34 #ifndef ACADO_TOOLKIT_EXPORT_ARGUMENT_INTERNAL_HPP
35 #define ACADO_TOOLKIT_EXPORT_ARGUMENT_INTERNAL_HPP
36 
41 
42 
44 
45 
47 class ExportIndex;
48 
49 
64 {
65  //
66  // PUBLIC MEMBER FUNCTIONS:
67  //
68  public:
69 
73 
86  ExportArgumentInternal( const std::string& _name,
87  const DMatrixPtr& _data,
88  ExportType _type,
89  ExportStruct _dataStruct,
90  bool _callByValue,
91  const ExportIndex& _addressIdx,
92  const std::string& _prefix
93  );
94 
96  virtual ~ExportArgumentInternal( );
97 
98  virtual ExportArgumentInternal* clone() const;
99 
101  virtual void deepCopyMembers( std::map<CasADi::SharedObjectNode*, CasADi::SharedObject>& already_copied
102  );
103 
111  ExportArgument getAddress( const ExportIndex& rowIdx,
112  const ExportIndex& colIdx = emptyConstExportIndex
113  ) const;
114 
122  const std::string getAddressString( bool withDataStruct = true
123  ) const;
124 
125 
130  virtual uint getNumRows( ) const;
131 
136  virtual uint getNumCols( ) const;
137 
142  virtual uint getDim( ) const;
143 
144 
150  virtual bool isGiven( ) const;
151 
157  bool isCalledByValue( ) const;
158 
164 
175  virtual returnValue exportDataDeclaration( std::ostream& stream,
176  const std::string& _realString = "real_t",
177  const std::string& _intString = "int",
178  int _precision = 16
179  ) const;
180 
181 
182  //
183  // PROTECTED MEMBER FUNCTIONS:
184  //
185  protected:
186 
191  virtual uint getColDim( ) const;
192 
200  virtual ExportIndex getTotalIdx( const ExportIndex& rowIdx,
201  const ExportIndex& colIdx
202  ) const;
203 
204 
205  protected:
206 
212 };
213 
214 
216 
217 
218 #endif // ACADO_TOOLKIT_EXPORT_ARGUMENT_INTERNAL_HPP
219 
220 // end of file.
virtual returnValue exportDataDeclaration(std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
ExportArgument getAddress(const ExportIndex &rowIdx, const ExportIndex &colIdx=emptyConstExportIndex) const
virtual ExportIndex getTotalIdx(const ExportIndex &rowIdx, const ExportIndex &colIdx) const
virtual ExportArgumentInternal * clone() const
Make a deep copy of the instance.
virtual void deepCopyMembers(std::map< CasADi::SharedObjectNode *, CasADi::SharedObject > &already_copied)
Allows to pass back messages to the calling function.
std::shared_ptr< GenericMatrix< double > > DMatrixPtr
Definition: matrix.hpp:463
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
#define CLOSE_NAMESPACE_ACADO
Defines a scalar-valued index variable to be used for exporting code.
const ExportIndex emptyConstExportIndex(int(0))
Defines a matrix-valued variable that can be passed as argument to exported functions.
Allows to export code of different arithmetic statements.
ExportStruct
virtual uint getNumRows() const
const std::string getAddressString(bool withDataStruct=true) const
Defines a matrix-valued variable that can be passed as argument to exported functions.
ExportType
#define BEGIN_NAMESPACE_ACADO
virtual uint getNumCols() const


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