aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/MatrixBase.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-05-27 05:47:30 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-05-27 05:47:30 +0000
commit953efdbfe70efcb3f078f19c55baca0b118e683a (patch)
treedece04572c4384687accc008cfe9115cdc2ee6a0 /Eigen/src/Core/MatrixBase.h
parent8f1fc80a77551b26c05669527534aff7b621b86c (diff)
- introduce Part and Extract classes, splitting and extending the former
Triangular class - full meta-unrolling in Part - move inverseProduct() to MatrixBase - compilation fix in ProductWIP: introduce a meta-selector to only do direct access on types that support it. - phase out the old Product, remove the WIP_DIRTY stuff. - misc renaming and fixes
Diffstat (limited to 'Eigen/src/Core/MatrixBase.h')
-rw-r--r--Eigen/src/Core/MatrixBase.h51
1 files changed, 22 insertions, 29 deletions
diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h
index 50c4edfc8..18525a5d1 100644
--- a/Eigen/src/Core/MatrixBase.h
+++ b/Eigen/src/Core/MatrixBase.h
@@ -136,6 +136,12 @@ template<typename Derived> class MatrixBase
CoeffReadCost = ei_traits<Derived>::CoeffReadCost
};
+ MatrixBase()
+ {
+ assert(!( (Flags&UnitDiagBit && Flags&ZeroDiagBit)
+ || (Flags&UpperTriangularBit && Flags&LowerTriangularBit) ));
+ }
+
/** This is the "real scalar" type; if the \a Scalar type is already real numbers
* (e.g. int, float or double) then \a RealScalar is just the same as \a Scalar. If
* \a Scalar is \a std::complex<T> then RealScalar is \a T.
@@ -280,6 +286,10 @@ template<typename Derived> class MatrixBase
template<typename OtherDerived>
Derived& operator*=(const MatrixBase<OtherDerived>& other);
+
+ template<typename OtherDerived>
+ typename OtherDerived::Eval inverseProduct(const MatrixBase<OtherDerived>& other) const;
+
//@}
/** \name Dot product and related notions
@@ -296,7 +306,7 @@ template<typename Derived> class MatrixBase
const Transpose<Derived> transpose() const;
const Transpose<
Flagged<CwiseUnaryOp<ei_scalar_conjugate_op<typename ei_traits<Derived>::Scalar>, Derived>
- , TemporaryBit, 0> >
+ , NestByValueBit, 0> >
adjoint() const;
//@}
@@ -347,6 +357,9 @@ template<typename Derived> class MatrixBase
DiagonalCoeffs<Derived> diagonal();
const DiagonalCoeffs<Derived> diagonal() const;
+
+ template<unsigned int PartType> Part<Derived, PartType> part();
+ template<unsigned int ExtractType> const Extract<Derived, ExtractType> extract() const;
//@}
/// \name Generating special matrices
@@ -406,6 +419,9 @@ template<typename Derived> class MatrixBase
bool isIdentity(RealScalar prec = precision<Scalar>()) const;
bool isDiagonal(RealScalar prec = precision<Scalar>()) const;
+ bool isUpper(RealScalar prec = precision<Scalar>()) const;
+ bool isLower(RealScalar prec = precision<Scalar>()) const;
+
template<typename OtherDerived>
bool isOrtho(const MatrixBase<OtherDerived>& other,
RealScalar prec = precision<Scalar>()) const;
@@ -433,24 +449,17 @@ template<typename Derived> class MatrixBase
template<typename OtherDerived>
void swap(const MatrixBase<OtherDerived>& other);
- template<unsigned int Added, unsigned int Removed>
- const Flagged<Derived, Added, Removed> flagged() const;
-
- const Flagged<Derived, 0, EvalBeforeNestingBit | EvalBeforeAssigningBit> lazy() const
- {
- return derived();
- }
- const Flagged<Derived, TemporaryBit, 0> temporary() const
- {
- return derived();
- }
+ template<unsigned int Added>
+ const Flagged<Derived, Added, 0> marked() const;
+ const Flagged<Derived, 0, EvalBeforeNestingBit | EvalBeforeAssigningBit> lazy() const;
+ const Flagged<Derived, NestByValueBit, 0> temporary() const;
/** \returns number of elements to skip to pass from one row (resp. column) to another
* for a row-major (resp. column-major) matrix.
* Combined with coeffRef() and the compile times flags, it allows a direct access to the data
* of the underlying matrix.
*/
- int stride(void) const { return derived()._stride(); }
+ inline int stride(void) const { return derived()._stride(); }
//@}
/// \name Coefficient-wise operations
@@ -553,22 +562,6 @@ template<typename Derived> class MatrixBase
{ return *static_cast<Derived*>(const_cast<MatrixBase*>(this)); }
//@}
- /// \name Triangular matrices
- //@{
- Triangular<Upper, Derived> upper(void);
- const Triangular<Upper, Derived> upper(void) const;
- const Triangular<Upper|UnitDiagBit, Derived> upperWithUnitDiag(void) const;
- const Triangular<Upper|NullDiagBit, Derived> upperWithNullDiag(void) const;
-
- Triangular<Lower, Derived> lower(void);
- const Triangular<Lower, Derived> lower(void) const;
- const Triangular<Lower|UnitDiagBit, Derived> lowerWithUnitDiag(void) const;
- const Triangular<Lower|NullDiagBit, Derived> lowerWithNullDiag(void) const;
-
- bool isUpper(RealScalar prec = precision<Scalar>()) const;
- bool isLower(RealScalar prec = precision<Scalar>()) const;
- //@}
-
/** \name LU module
*
* \code #include <Eigen/LU> \endcode