45 const std::string& _commonHeaderName
211 for( i = 0; i < 4; i++ ) {
215 if( transpose ) ss1 << b_mem1.
get(index,j) <<
" -= (";
216 else ss1 << b_mem1.
get(index,j) <<
" += (";
217 for( i = 0; i < 4; i++ ) {
218 if( i > 0 ) ss1 <<
" + ";
219 ss1 << transf1_var.
get(1,i) <<
"*" << b_full_.
get(index+i*
dim,j);
222 ss1 << b_mem1.
get(index,j) <<
" *= " << stepSizeV.
get(0,0) <<
";\n";
227 for( i = 0; i < 4; i++ ) {
231 if( transpose ) ss2 << b_mem2.
get(index,j) <<
" -= (";
232 else ss2 << b_mem2.
get(index,j) <<
" += (";
233 for( i = 0; i < 4; i++ ) {
234 if( i > 0 ) ss2 <<
" + ";
235 ss2 << transf1_var.
get(3,i) <<
"*" << b_full_.
get(index+i*
dim,j);
238 ss2 << b_mem2.
get(index,j) <<
" *= " << stepSizeV.
get(0,0) <<
";\n";
255 ss << b_full_.
get(index,j) <<
" = ";
256 if( transpose ) ss << transf2_var.
get(0,0) <<
"*creal(" << b_mem1.
get(index,j) <<
") - ";
257 else ss << transf2_var.
get(0,0) <<
"*creal(" << b_mem1.
get(index,j) <<
") + ";
258 ss << transf2_var.
get(0,1) <<
"*cimag(" << b_mem1.
get(index,j) <<
") + ";
259 if( transpose ) ss << transf2_var.
get(0,2) <<
"*creal(" << b_mem2.
get(index,j) <<
") - ";
260 else ss << transf2_var.
get(0,2) <<
"*creal(" << b_mem2.
get(index,j) <<
") + ";
261 ss << transf2_var.
get(0,3) <<
"*cimag(" << b_mem2.
get(index,j) <<
");\n";
263 ss << b_full_.
get(index+
dim,j) <<
" = ";
264 if( transpose ) ss << transf2_var.
get(1,0) <<
"*creal(" << b_mem1.
get(index,j) <<
") - ";
265 else ss << transf2_var.
get(1,0) <<
"*creal(" << b_mem1.
get(index,j) <<
") + ";
266 ss << transf2_var.
get(1,1) <<
"*cimag(" << b_mem1.
get(index,j) <<
") + ";
267 if( transpose ) ss << transf2_var.
get(1,2) <<
"*creal(" << b_mem2.
get(index,j) <<
") - ";
268 else ss << transf2_var.
get(1,2) <<
"*creal(" << b_mem2.
get(index,j) <<
") + ";
269 ss << transf2_var.
get(1,3) <<
"*cimag(" << b_mem2.
get(index,j) <<
");\n";
271 ss << b_full_.
get(index+2*
dim,j) <<
" = ";
272 if( transpose ) ss << transf2_var.
get(2,0) <<
"*creal(" << b_mem1.
get(index,j) <<
") - ";
273 else ss << transf2_var.
get(2,0) <<
"*creal(" << b_mem1.
get(index,j) <<
") + ";
274 ss << transf2_var.
get(2,1) <<
"*cimag(" << b_mem1.
get(index,j) <<
") + ";
275 if( transpose ) ss << transf2_var.
get(2,2) <<
"*creal(" << b_mem2.
get(index,j) <<
") - ";
276 else ss << transf2_var.
get(2,2) <<
"*creal(" << b_mem2.
get(index,j) <<
") + ";
277 ss << transf2_var.
get(2,3) <<
"*cimag(" << b_mem2.
get(index,j) <<
");\n";
279 ss << b_full_.
get(index+3*
dim,j) <<
" = ";
280 if( transpose ) ss << transf2_var.
get(3,0) <<
"*creal(" << b_mem1.
get(index,j) <<
") - ";
281 else ss << transf2_var.
get(3,0) <<
"*creal(" << b_mem1.
get(index,j) <<
") + ";
282 ss << transf2_var.
get(3,1) <<
"*cimag(" << b_mem1.
get(index,j) <<
") + ";
283 if( transpose ) ss << transf2_var.
get(3,2) <<
"*creal(" << b_mem2.
get(index,j) <<
") - ";
284 else ss << transf2_var.
get(3,2) <<
"*creal(" << b_mem2.
get(index,j) <<
") + ";
285 ss << transf2_var.
get(3,3) <<
"*cimag(" << b_mem2.
get(index,j) <<
");\n";
419 return string(
"solve_complex_" ) +
identifier +
"system";
425 return string(
"solve_complex_" ) +
identifier +
"system_reuse";
431 return string(
"solve_complex_trans_" ) +
identifier +
"system_reuse";
ExportVariable rk_bPerm_complex_trans
ExportVariable b_mem_complex1_trans
const std::string getNameSolveComplexTransposeReuseFunction()
const std::string getNameSolveTransposeReuseFunction()
virtual returnValue getCode(ExportStatementBlock &code)
returnValue setTransformations(const DMatrix &_transf1, const DMatrix &_transf2, const DMatrix &_transf1_T, const DMatrix &_transf2_T)
ExportFunction solveReuse_complex
virtual ~ExportIRK4StageSimplifiedNewton()
virtual returnValue setup()
Allows to pass back messages to the calling function.
ExportVariable rk_bPerm_complex
ExportFunction solveReuse_complexTranspose
ExportVariable rk_perm_full
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
ExportVariable A_mem_complex2
virtual returnValue setupSolveReuseTranspose(ExportFunction &_solveReuse, ExportVariable &_bPerm)
ExportVariable rk_swap_complex
Allows to export code of a for-loop.
string toString(T const &value)
virtual returnValue getDataDeclarations(ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const
ExportFunction solveReuse_full
virtual returnValue setupSolveReuseComplete(ExportFunction &_solveReuse, ExportVariable &_bPerm)
ExportVariable getElement(const ExportIndex &rowIdx, const ExportIndex &colIdx) const
#define CLOSE_NAMESPACE_ACADO
Defines a scalar-valued index variable to be used for exporting code.
ExportVariable determinant
const std::string getNameSolveComplexReuseFunction()
virtual returnValue transformSolution(ExportStatementBlock &code, const ExportVariable &b_mem1, const ExportVariable &b_mem2, const ExportVariable &b_full_, const ExportVariable &transf_, const ExportIndex &index, const bool transpose)
returnValue setImplicit(BooleanType _implicit)
returnValue appendVariableNames(std::stringstream &string)
virtual returnValue setup()
ExportVariable A_mem_complex1
ExportVariable b_mem_complex2
ExportVariable b_full_trans
ExportFunction solveReuseTranspose_full
Allows to export Gaussian elimination for solving linear systems of specific dimensions.
const std::string getNameSolveReuseFunction()
returnValue appendVariableNames(std::stringstream &string)
ExportIRK4StageSimplifiedNewton(UserInteraction *_userInteraction=0, const std::string &_commonHeaderName="")
const std::string get(const ExportIndex &rowIdx, const ExportIndex &colIdx) const
Encapsulates all user interaction for setting options, logging data and plotting results.
Allows to export code of an arbitrary function.
ExportVariable rk_perm_complex
returnValue addStatement(const ExportStatement &_statement)
virtual returnValue transformRightHandSide(ExportStatementBlock &code, const ExportVariable &b_mem1, const ExportVariable &b_mem2, const ExportVariable &b_full_, const ExportVariable &transf_, const ExportIndex &index, const bool transpose)
ExportFunction solve_complex
std::string getFullName() const
unsigned getNumRows() const
returnValue addLinebreak(uint num=1)
ExportFunction & setReturnValue(const ExportVariable &_functionReturnValue, bool _returnAsPointer=false)
virtual returnValue getDataDeclarations(ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const
unsigned getNumCols() const
returnValue addDeclaration(const ExportVariable &_data, ExportStruct _dataStruct=ACADO_ANY)
const std::string getNameSolveFunction()
#define BEGIN_NAMESPACE_ACADO
returnValue setEigenvalues(const DMatrix &_eig)
ExportFunction solve_full
returnValue addFunction(const ExportFunction &_function)
virtual returnValue getFunctionDeclarations(ExportStatementBlock &declarations) const
const std::string getNameSolveComplexFunction()
ExportVariable b_mem_complex1
Allows to export code for a block of statements.
ExportVariable determinant_complex
returnValue setStepSize(double _stepsize)
ExportArgument getAddress(const ExportIndex &_rowIdx, const ExportIndex &_colIdx=emptyConstExportIndex) const
ExportVariable b_complex_trans
ExportVariable b_mem_complex2_trans
ExportFunction & addIndex(const ExportIndex &_index)
#define ACADOERROR(retval)
virtual returnValue getFunctionDeclarations(ExportStatementBlock &declarations) const
Defines a matrix-valued variable to be used for exporting code.
returnValue addFunctionCall(const std::string &_fName, const ExportArgument &_argument1=emptyConstExportArgument, const ExportArgument &_argument2=emptyConstExportArgument, const ExportArgument &_argument3=emptyConstExportArgument, const ExportArgument &_argument4=emptyConstExportArgument, const ExportArgument &_argument5=emptyConstExportArgument, const ExportArgument &_argument6=emptyConstExportArgument, const ExportArgument &_argument7=emptyConstExportArgument, const ExportArgument &_argument8=emptyConstExportArgument, const ExportArgument &_argument9=emptyConstExportArgument)
virtual returnValue setupFactorization(ExportFunction &_solve, ExportVariable &_swap, ExportVariable &_determinant, const std::string &absF)