20 Index supers = _m.supers();
21 Index subs = _m.subs();
25 DenseMatrixType dm1(rows,cols);
28 m.diagonal().setConstant(123);
29 dm1.diagonal().setConstant(123);
30 for (
int i=1;
i<=m.supers();++
i)
32 m.diagonal(
i).setConstant(static_cast<RealScalar>(
i));
33 dm1.diagonal(
i).setConstant(static_cast<RealScalar>(
i));
35 for (
int i=1;
i<=m.subs();++
i)
37 m.diagonal(-
i).setConstant(-static_cast<RealScalar>(
i));
38 dm1.diagonal(-
i).setConstant(-static_cast<RealScalar>(
i));
45 m.col(
i).setConstant(static_cast<RealScalar>(
i+1));
46 dm1.col(
i).setConstant(static_cast<RealScalar>(
i+1));
49 Index a = std::max<Index>(0,cols-d-supers);
50 Index b = std::max<Index>(0,rows-d-subs);
51 if(a>0) dm1.block(0,d+supers,rows,a).setZero();
52 dm1.block(0,supers+1,cols-supers-1-a,cols-supers-1-a).template triangularView<Upper>().
setZero();
54 if(b>0) dm1.block(d+subs,0,b,cols).setZero();
65 Index rows = internal::random<Index>(1,10);
66 Index cols = internal::random<Index>(1,10);
67 Index sups = internal::random<Index>(0,cols-1);
68 Index subs = internal::random<Index>(0,rows-1);
EIGEN_DECLARE_TEST(bandmatrix)
Represents a rectangular matrix with a banded storage.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
void bandmatrix(const MatrixType &_m)
#define VERIFY_IS_APPROX(a, b)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
NumTraits< Scalar >::Real RealScalar
#define CALL_SUBTEST(FUNC)
A triangularView< Lower >().adjoint().solveInPlace(B)