mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
restrict operator[] to vectors, not matrices.
This commit is contained in:
@@ -22,6 +22,8 @@
|
||||
// License and a copy of the GNU General Public License along with
|
||||
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#define EIGEN_NO_STATIC_ASSERT
|
||||
|
||||
#include "main.h"
|
||||
|
||||
template<typename MatrixType> void basicStuff(const MatrixType& m)
|
||||
@@ -96,6 +98,12 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
|
||||
VERIFY_RAISES_ASSERT(m1 = (m2.block(0,0, rows-1, cols-1)));
|
||||
}
|
||||
|
||||
if(cols!=1 && rows!=1)
|
||||
{
|
||||
VERIFY_RAISES_ASSERT(m1[0]);
|
||||
VERIFY_RAISES_ASSERT((m1+m1)[0]);
|
||||
}
|
||||
|
||||
VERIFY_IS_APPROX(m3 = m1,m1);
|
||||
MatrixType m4;
|
||||
VERIFY_IS_APPROX(m4 = m1,m1);
|
||||
|
||||
Reference in New Issue
Block a user