aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/MatrixBase.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-10-20 23:25:49 -0400
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-10-20 23:25:49 -0400
commitc3180b7ffbc98d69764b3c1ab17b36e289f7cf7e (patch)
treea6744a712b9a226ea8436a75b3c0b5985570f65b /Eigen/src/Core/MatrixBase.h
parent471b4d509234cbcbd4a1cd45d48fe10efcc2bcf1 (diff)
MatrixBase:
* support resize() to same size (nop). The case of FFT was another case where that make one's life far easier. hope that's ok with you Gael. but indeed, i don't use it in the ReturnByValue stuff. FFT: * Support MatrixBase (well, in the case with direct memory access such as Map) * adapt unit test
Diffstat (limited to 'Eigen/src/Core/MatrixBase.h')
-rw-r--r--Eigen/src/Core/MatrixBase.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h
index 387c11385..0e8b49f75 100644
--- a/Eigen/src/Core/MatrixBase.h
+++ b/Eigen/src/Core/MatrixBase.h
@@ -190,6 +190,25 @@ template<typename Derived> class MatrixBase
* i.e., the number of rows for a columns major matrix, and the number of cols otherwise */
int innerSize() const { return (int(Flags)&RowMajorBit) ? this->cols() : this->rows(); }
+ /** Only plain matrices, not expressions may be resized; therefore the only useful resize method is
+ * Matrix::resize(). The present method only asserts that the new size equals the old size, and does
+ * nothing else.
+ */
+ void resize(int size)
+ {
+ ei_assert(size == this->size()
+ && "MatrixBase::resize() does not actually allow to resize.");
+ }
+ /** Only plain matrices, not expressions may be resized; therefore the only useful resize method is
+ * Matrix::resize(). The present method only asserts that the new size equals the old size, and does
+ * nothing else.
+ */
+ void resize(int rows, int cols)
+ {
+ ei_assert(rows == this->rows() && cols == this->cols()
+ && "MatrixBase::resize() does not actually allow to resize.");
+ }
+
#ifndef EIGEN_PARSED_BY_DOXYGEN
/** \internal the plain matrix type corresponding to this expression. Note that is not necessarily
* exactly the return type of eval(): in the case of plain matrices, the return type of eval() is a const