Dynare++: add some comments

time-shift
Sébastien Villemot 2019-02-26 12:43:04 +01:00
parent 52ec6b4e93
commit c44545bb18
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
2 changed files with 11 additions and 1 deletions

View File

@ -34,9 +34,11 @@ public:
}
ConstGeneralMatrix(const ConstGeneralMatrix &m) = default;
ConstGeneralMatrix(ConstGeneralMatrix &&m) = default;
// Implicit conversion from ConstGeneralMatrix is ok, since it's cheap
// Implicit conversion from GeneralMatrix is ok, since it's cheap
ConstGeneralMatrix(const GeneralMatrix &m);
// Create submatrix (with data sharing)
ConstGeneralMatrix(const GeneralMatrix &m, int i, int j, int nrows, int ncols);
// Create submatrix (with data sharing)
ConstGeneralMatrix(const ConstGeneralMatrix &m, int i, int j, int nrows, int ncols);
virtual ~ConstGeneralMatrix() = default;
@ -155,7 +157,9 @@ public:
GeneralMatrix(GeneralMatrix &&m) = default;
GeneralMatrix(const GeneralMatrix &m, const std::string &dummy); // transpose
GeneralMatrix(const ConstGeneralMatrix &m, const std::string &dummy); // transpose
// Create submatrix (with data copy)
GeneralMatrix(const GeneralMatrix &m, int i, int j, int nrows, int ncols);
// Create submatrix (with data sharing)
GeneralMatrix(GeneralMatrix &m, int i, int j, int nrows, int ncols);
/* this = a*b */
GeneralMatrix(const ConstGeneralMatrix &a, const ConstGeneralMatrix &b);

View File

@ -97,26 +97,32 @@ public:
: GeneralMatrix(m, dummy)
{
}
// Select only some columns (with data copy)
TwoDMatrix(const TwoDMatrix &m, int first_col, int num)
: GeneralMatrix(m, 0, first_col, m.numRows(), num)
{
}
// Select only some columns (with data sharing)
TwoDMatrix(TwoDMatrix &m, int first_col, int num)
: GeneralMatrix(m, 0, first_col, m.numRows(), num)
{
}
// Select only some rows (with data copy)
TwoDMatrix(int first_row, int num, const TwoDMatrix &m)
: GeneralMatrix(m, first_row, 0, num, m.ncols())
{
}
// Select only some rows (with data sharing)
TwoDMatrix(int first_row, int num, TwoDMatrix &m)
: GeneralMatrix(m, first_row, 0, num, m.ncols())
{
}
// Select a submatrix (with data sharing)
TwoDMatrix(TwoDMatrix &m, int first_row, int first_col, int rows, int cols)
: GeneralMatrix(m, first_row, first_col, rows, cols)
{
}
// Select a submatrix (with data copy)
TwoDMatrix(const TwoDMatrix &m, int first_row, int first_col, int rows, int cols)
: GeneralMatrix(m, first_row, first_col, rows, cols)
{