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.
ExportVariable getRow(const ExportIndex &idx) const
virtual uint getDim() const
bool isOne(const ExportIndex &rowIdx, const ExportIndex &colIdx) const
ExportVariable makeRowVector() 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)
std::string getFullName() const
Allows to pass back messages to the calling function.
Represents a diagonal matrix with its storage.
std::shared_ptr< GenericMatrix< double > > DMatrixPtr
GenericMatrix & makeVector()
const std::string get(const ExportIndex &rowIdx, const ExportIndex &colIdx) const
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
ExportVariable getRows(const ExportIndex &idx1, const ExportIndex &idx2) const
Returned value is a error.
returnValue print() const
virtual ~ExportVariableInternal()
Defines a matrix-valued variable to be used for exporting code.
#define CLOSE_NAMESPACE_ACADO
virtual ExportIndex getTotalIdx(const ExportIndex &rowIdx, const ExportIndex &colIdx) const
Defines a scalar-valued index variable to be used for exporting code.
virtual bool isGiven() const
const ExportIndex emptyConstExportIndex(int(0))
virtual uint getNumCols() const
bool isZero(const ExportIndex &rowIdx, const ExportIndex &colIdx) const
Defines a matrix-valued variable that can be passed as argument to exported functions.
virtual uint getColDim() const
virtual uint getNumRows() const
ExportVariable getTranspose() const
ExportType getType() const
static const double undefinedEntry
const DMatrix & getGivenMatrix() const
const std::string get() const
bool hasValue(const ExportIndex &_rowIdx, const ExportIndex &_colIdx, double _value) const
int getGivenValue() const
ExportVariable getSubMatrix(const ExportIndex &_rowIdx1, const ExportIndex &_rowIdx2, const ExportIndex &_colIdx1, const ExportIndex &_colIdx2) const
#define BEGIN_NAMESPACE_ACADO
virtual bool isGiven() const
virtual ExportVariableInternal * clone() const
ExportVariable makeColVector() const
ExportVariable getCols(const ExportIndex &idx1, const ExportIndex &idx2) const
ExportVariable getCol(const ExportIndex &idx) const
#define ACADOERROR(retval)
Defines a matrix-valued variable to be used for exporting code.
bool isCalledByValue() const