66 const std::string& _prefix
75 rowDim = _data->getNumRows();
76 colDim = _data->getNumCols();
95 return hasValue(rowIdx, colIdx, 0.0);
102 return hasValue(rowIdx, colIdx, 1.0);
137 if ( ( totalIdx.
isGiven() == true ) && ( rowIdx.
isGiven() == true ) && ( colIdx.
isGiven() == true ) )
139 if (
isGiven(rowIdx, colIdx) ==
false)
163 return data->getNumRows( );
172 return data->getNumCols( );
205 <<
"getRow: invalid row arguments, row index " 207 <<
" does not lie in the admissible range " <<
"0 - " <<
getNumRows( ) - 1 << endl;
227 <<
"getCol: invalid column arguments, column index " 229 <<
" does not lie in the admissible range " <<
"0 - " <<
getNumCols( ) - 1 << endl;
251 if (idx1.isGiven() ==
true && idx2.
isGiven() ==
true 252 && ( idx1.getGivenValue() < 0 ||
258 else if (size.
isGiven() ==
false)
282 if (idx1.isGiven() ==
true && idx2.
isGiven() ==
true 283 && ( idx1.getGivenValue() < 0 ||
289 else if (size.
isGiven() ==
false)
319 if (_rowIdx1.isGiven() ==
true && _rowIdx2.
isGiven() ==
true 320 && ( _rowIdx1.getGivenValue() < 0 ||
327 else if (sizeRow.
isGiven() ==
false)
333 if (_colIdx1.isGiven() ==
true && _colIdx2.
isGiven() ==
true 334 && ( _colIdx1.getGivenValue() < 0 ||
341 else if (sizeCol.
isGiven() ==
false)
400 return data->print( );
491 LOG(
LVL_DEBUG ) <<
"Digonal check works for non-sub-matrices only ATM" << endl;
void assignNode(SharedObjectNode *node)
Assign the node to a node class pointer (or null)
#define LOG(level)
Just define a handy macro for getting the logger.
Lowest level, the debug level.
const std::string get(const ExportIndex &rowIdx, const ExportIndex &colIdx) const
ExportVariable getSubMatrix(const ExportIndex &_rowIdx1, const ExportIndex &_rowIdx2, const ExportIndex &_colIdx1, const ExportIndex &_colIdx2) const
returnValue print() const
const DMatrix & getGivenMatrix() const
virtual uint getNumCols() const
virtual ExportIndex getTotalIdx(const ExportIndex &rowIdx, const ExportIndex &colIdx) const
bool isZero(const ExportIndex &rowIdx, const ExportIndex &colIdx) const
ExportVariable getTranspose() const
BooleanType acadoIsEqual(double x, double y, double TOL)
static const DMatrix emptyConstMatrix
returnValue setSubmatrixOffsets(const ExportIndex &_rowOffset, const ExportIndex &_colOffset, unsigned _rowDim=0, unsigned _colDim=0, unsigned _nRows=0, unsigned _nCols=0)
Allows to pass back messages to the calling function.
Represents a diagonal matrix with its storage.
std::shared_ptr< GenericMatrix< double > > DMatrixPtr
GenericMatrix & makeVector()
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Returned value is a error.
virtual ~ExportVariableInternal()
Defines a matrix-valued variable to be used for exporting code.
#define CLOSE_NAMESPACE_ACADO
ExportVariable makeRowVector() const
Defines a scalar-valued index variable to be used for exporting code.
virtual uint getDim() const
ExportType getType() const
const ExportIndex emptyConstExportIndex(int(0))
virtual bool isGiven() const
ExportVariable getRow(const ExportIndex &idx) const
int getGivenValue() const
Defines a matrix-valued variable that can be passed as argument to exported functions.
const std::string get() const
bool isCalledByValue() const
virtual ExportVariableInternal * clone() const
virtual bool isGiven() const
static const double undefinedEntry
std::string getFullName() const
bool isOne(const ExportIndex &rowIdx, const ExportIndex &colIdx) const
virtual uint getNumRows() const
ExportVariable makeColVector() const
ExportVariable getCols(const ExportIndex &idx1, const ExportIndex &idx2) const
#define BEGIN_NAMESPACE_ACADO
ExportVariable getRows(const ExportIndex &idx1, const ExportIndex &idx2) const
ExportVariable getCol(const ExportIndex &idx) const
virtual uint getColDim() const
#define ACADOERROR(retval)
bool hasValue(const ExportIndex &_rowIdx, const ExportIndex &_colIdx, double _value) const
Defines a matrix-valued variable to be used for exporting code.