mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-22 21:04:28 +08:00
Renamed PlainMatrixType to PlainObject (Array != Matrix).
Renamed ReturnByValue::ReturnMatrixType ReturnByValue::ReturnType (again, Array != Matrix).
This commit is contained in:
parent
f0c8dcf1e2
commit
abc8c01080
@ -41,7 +41,7 @@ class Array
|
|||||||
EIGEN_DENSE_PUBLIC_INTERFACE(Array)
|
EIGEN_DENSE_PUBLIC_INTERFACE(Array)
|
||||||
|
|
||||||
enum { Options = _Options };
|
enum { Options = _Options };
|
||||||
typedef typename Base::PlainMatrixType PlainMatrixType;
|
typedef typename Base::PlainObject PlainObject;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
using Base::m_storage;
|
using Base::m_storage;
|
||||||
|
@ -97,7 +97,7 @@ template<typename Derived> class ArrayBase
|
|||||||
/** \internal the plain matrix type corresponding to this expression. Note that is not necessarily
|
/** \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
|
* exactly the return type of eval(): in the case of plain matrices, the return type of eval() is a const
|
||||||
* reference to a matrix, not a matrix! It is however guaranteed that the return type of eval() is either
|
* reference to a matrix, not a matrix! It is however guaranteed that the return type of eval() is either
|
||||||
* PlainMatrixType or const PlainMatrixType&.
|
* PlainObject or const PlainObject&.
|
||||||
*/
|
*/
|
||||||
typedef Array<typename ei_traits<Derived>::Scalar,
|
typedef Array<typename ei_traits<Derived>::Scalar,
|
||||||
ei_traits<Derived>::RowsAtCompileTime,
|
ei_traits<Derived>::RowsAtCompileTime,
|
||||||
@ -105,7 +105,7 @@ template<typename Derived> class ArrayBase
|
|||||||
AutoAlign | (ei_traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor),
|
AutoAlign | (ei_traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor),
|
||||||
ei_traits<Derived>::MaxRowsAtCompileTime,
|
ei_traits<Derived>::MaxRowsAtCompileTime,
|
||||||
ei_traits<Derived>::MaxColsAtCompileTime
|
ei_traits<Derived>::MaxColsAtCompileTime
|
||||||
> PlainMatrixType;
|
> PlainObject;
|
||||||
|
|
||||||
|
|
||||||
/** \internal Represents a matrix with all coefficients equal to one another*/
|
/** \internal Represents a matrix with all coefficients equal to one another*/
|
||||||
|
@ -462,7 +462,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
|
|||||||
|
|
||||||
const Homogeneous<ExpressionType,Direction> homogeneous() const;
|
const Homogeneous<ExpressionType,Direction> homogeneous() const;
|
||||||
|
|
||||||
typedef typename ExpressionType::PlainMatrixType CrossReturnType;
|
typedef typename ExpressionType::PlainObject CrossReturnType;
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
const CrossReturnType cross(const MatrixBase<OtherDerived>& other) const;
|
const CrossReturnType cross(const MatrixBase<OtherDerived>& other) const;
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ bool LDLT<MatrixType>::solveInPlace(MatrixBase<Derived> &bAndX) const
|
|||||||
* \returns the Cholesky decomposition with full pivoting without square root of \c *this
|
* \returns the Cholesky decomposition with full pivoting without square root of \c *this
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
inline const LDLT<typename MatrixBase<Derived>::PlainMatrixType>
|
inline const LDLT<typename MatrixBase<Derived>::PlainObject>
|
||||||
MatrixBase<Derived>::ldlt() const
|
MatrixBase<Derived>::ldlt() const
|
||||||
{
|
{
|
||||||
return derived();
|
return derived();
|
||||||
|
@ -299,20 +299,20 @@ bool LLT<MatrixType,_UpLo>::solveInPlace(MatrixBase<Derived> &bAndX) const
|
|||||||
* \returns the LLT decomposition of \c *this
|
* \returns the LLT decomposition of \c *this
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
inline const LLT<typename MatrixBase<Derived>::PlainMatrixType>
|
inline const LLT<typename MatrixBase<Derived>::PlainObject>
|
||||||
MatrixBase<Derived>::llt() const
|
MatrixBase<Derived>::llt() const
|
||||||
{
|
{
|
||||||
return LLT<PlainMatrixType>(derived());
|
return LLT<PlainObject>(derived());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \cholesky_module
|
/** \cholesky_module
|
||||||
* \returns the LLT decomposition of \c *this
|
* \returns the LLT decomposition of \c *this
|
||||||
*/
|
*/
|
||||||
template<typename MatrixType, unsigned int UpLo>
|
template<typename MatrixType, unsigned int UpLo>
|
||||||
inline const LLT<typename SelfAdjointView<MatrixType, UpLo>::PlainMatrixType, UpLo>
|
inline const LLT<typename SelfAdjointView<MatrixType, UpLo>::PlainObject, UpLo>
|
||||||
SelfAdjointView<MatrixType, UpLo>::llt() const
|
SelfAdjointView<MatrixType, UpLo>::llt() const
|
||||||
{
|
{
|
||||||
return LLT<PlainMatrixType,UpLo>(m_matrix);
|
return LLT<PlainObject,UpLo>(m_matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // EIGEN_LLT_H
|
#endif // EIGEN_LLT_H
|
||||||
|
@ -44,7 +44,7 @@ class DenseStorageBase : public _Base<Derived>
|
|||||||
public:
|
public:
|
||||||
enum { Options = _Options };
|
enum { Options = _Options };
|
||||||
typedef _Base<Derived> Base;
|
typedef _Base<Derived> Base;
|
||||||
typedef typename Base::PlainMatrixType PlainMatrixType;
|
typedef typename Base::PlainObject PlainObject;
|
||||||
typedef typename Base::Scalar Scalar;
|
typedef typename Base::Scalar Scalar;
|
||||||
typedef typename Base::PacketScalar PacketScalar;
|
typedef typename Base::PacketScalar PacketScalar;
|
||||||
using Base::RowsAtCompileTime;
|
using Base::RowsAtCompileTime;
|
||||||
@ -544,7 +544,7 @@ struct ei_conservative_resize_like_impl
|
|||||||
{
|
{
|
||||||
if (_this.rows() == rows && _this.cols() == cols) return;
|
if (_this.rows() == rows && _this.cols() == cols) return;
|
||||||
EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(Derived)
|
EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(Derived)
|
||||||
typename Derived::PlainMatrixType tmp(rows,cols);
|
typename Derived::PlainObject tmp(rows,cols);
|
||||||
const int common_rows = std::min(rows, _this.rows());
|
const int common_rows = std::min(rows, _this.rows());
|
||||||
const int common_cols = std::min(cols, _this.cols());
|
const int common_cols = std::min(cols, _this.cols());
|
||||||
tmp.block(0,0,common_rows,common_cols) = _this.block(0,0,common_rows,common_cols);
|
tmp.block(0,0,common_rows,common_cols) = _this.block(0,0,common_rows,common_cols);
|
||||||
@ -563,7 +563,7 @@ struct ei_conservative_resize_like_impl
|
|||||||
EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(Derived)
|
EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(Derived)
|
||||||
EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(OtherDerived)
|
EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(OtherDerived)
|
||||||
|
|
||||||
typename Derived::PlainMatrixType tmp(other);
|
typename Derived::PlainObject tmp(other);
|
||||||
const int common_rows = std::min(tmp.rows(), _this.rows());
|
const int common_rows = std::min(tmp.rows(), _this.rows());
|
||||||
const int common_cols = std::min(tmp.cols(), _this.cols());
|
const int common_cols = std::min(tmp.cols(), _this.cols());
|
||||||
tmp.block(0,0,common_rows,common_cols) = _this.block(0,0,common_rows,common_cols);
|
tmp.block(0,0,common_rows,common_cols) = _this.block(0,0,common_rows,common_cols);
|
||||||
@ -577,7 +577,7 @@ struct ei_conservative_resize_like_impl<Derived,OtherDerived,true>
|
|||||||
static void run(DenseBase<Derived>& _this, int size)
|
static void run(DenseBase<Derived>& _this, int size)
|
||||||
{
|
{
|
||||||
if (_this.size() == size) return;
|
if (_this.size() == size) return;
|
||||||
typename Derived::PlainMatrixType tmp(size);
|
typename Derived::PlainObject tmp(size);
|
||||||
const int common_size = std::min<int>(_this.size(),size);
|
const int common_size = std::min<int>(_this.size(),size);
|
||||||
tmp.segment(0,common_size) = _this.segment(0,common_size);
|
tmp.segment(0,common_size) = _this.segment(0,common_size);
|
||||||
_this.derived().swap(tmp);
|
_this.derived().swap(tmp);
|
||||||
@ -588,7 +588,7 @@ struct ei_conservative_resize_like_impl<Derived,OtherDerived,true>
|
|||||||
if (_this.rows() == other.rows() && _this.cols() == other.cols()) return;
|
if (_this.rows() == other.rows() && _this.cols() == other.cols()) return;
|
||||||
|
|
||||||
// segment(...) will check whether Derived/OtherDerived are vectors!
|
// segment(...) will check whether Derived/OtherDerived are vectors!
|
||||||
typename Derived::PlainMatrixType tmp(other);
|
typename Derived::PlainObject tmp(other);
|
||||||
const int common_size = std::min<int>(_this.size(),tmp.size());
|
const int common_size = std::min<int>(_this.size(),tmp.size());
|
||||||
tmp.segment(0,common_size) = _this.segment(0,common_size);
|
tmp.segment(0,common_size) = _this.segment(0,common_size);
|
||||||
_this.derived().swap(tmp);
|
_this.derived().swap(tmp);
|
||||||
|
@ -299,7 +299,7 @@ inline typename NumTraits<typename ei_traits<Derived>::Scalar>::Real MatrixBase<
|
|||||||
* \sa norm(), normalize()
|
* \sa norm(), normalize()
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
inline const typename MatrixBase<Derived>::PlainMatrixType
|
inline const typename MatrixBase<Derived>::PlainObject
|
||||||
MatrixBase<Derived>::normalized() const
|
MatrixBase<Derived>::normalized() const
|
||||||
{
|
{
|
||||||
typedef typename ei_nested<Derived>::type Nested;
|
typedef typename ei_nested<Derived>::type Nested;
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
*/
|
*/
|
||||||
template<typename Derived> struct EigenBase
|
template<typename Derived> struct EigenBase
|
||||||
{
|
{
|
||||||
// typedef typename ei_plain_matrix_type<Derived>::type PlainMatrixType;
|
// typedef typename ei_plain_matrix_type<Derived>::type PlainObject;
|
||||||
|
|
||||||
/** \returns a reference to the derived object */
|
/** \returns a reference to the derived object */
|
||||||
Derived& derived() { return *static_cast<Derived*>(this); }
|
Derived& derived() { return *static_cast<Derived*>(this); }
|
||||||
@ -61,7 +61,7 @@ template<typename Derived> struct EigenBase
|
|||||||
{
|
{
|
||||||
// This is the default implementation,
|
// This is the default implementation,
|
||||||
// derived class can reimplement it in a more optimized way.
|
// derived class can reimplement it in a more optimized way.
|
||||||
typename Dest::PlainMatrixType res(rows(),cols());
|
typename Dest::PlainObject res(rows(),cols());
|
||||||
evalTo(res);
|
evalTo(res);
|
||||||
dst += res;
|
dst += res;
|
||||||
}
|
}
|
||||||
@ -71,7 +71,7 @@ template<typename Derived> struct EigenBase
|
|||||||
{
|
{
|
||||||
// This is the default implementation,
|
// This is the default implementation,
|
||||||
// derived class can reimplement it in a more optimized way.
|
// derived class can reimplement it in a more optimized way.
|
||||||
typename Dest::PlainMatrixType res(rows(),cols());
|
typename Dest::PlainObject res(rows(),cols());
|
||||||
evalTo(res);
|
evalTo(res);
|
||||||
dst -= res;
|
dst -= res;
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ template<typename ExpressionType, unsigned int Added, unsigned int Removed> clas
|
|||||||
const ExpressionType& _expression() const { return m_matrix; }
|
const ExpressionType& _expression() const { return m_matrix; }
|
||||||
|
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
typename ExpressionType::PlainMatrixType solveTriangular(const MatrixBase<OtherDerived>& other) const;
|
typename ExpressionType::PlainObject solveTriangular(const MatrixBase<OtherDerived>& other) const;
|
||||||
|
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
void solveTriangularInPlace(const MatrixBase<OtherDerived>& other) const;
|
void solveTriangularInPlace(const MatrixBase<OtherDerived>& other) const;
|
||||||
|
@ -139,7 +139,7 @@ class Matrix
|
|||||||
|
|
||||||
EIGEN_DENSE_PUBLIC_INTERFACE(Matrix)
|
EIGEN_DENSE_PUBLIC_INTERFACE(Matrix)
|
||||||
|
|
||||||
typedef typename Base::PlainMatrixType PlainMatrixType;
|
typedef typename Base::PlainObject PlainObject;
|
||||||
|
|
||||||
enum { NeedsToAlign = (!(Options&DontAlign))
|
enum { NeedsToAlign = (!(Options&DontAlign))
|
||||||
&& SizeAtCompileTime!=Dynamic && ((sizeof(Scalar)*SizeAtCompileTime)%16)==0 };
|
&& SizeAtCompileTime!=Dynamic && ((sizeof(Scalar)*SizeAtCompileTime)%16)==0 };
|
||||||
|
@ -121,7 +121,7 @@ template<typename Derived> class MatrixBase
|
|||||||
*
|
*
|
||||||
* This is not necessarily exactly the return type of eval(). In the case of plain matrices,
|
* This is not necessarily exactly the return type of eval(). In the case of plain matrices,
|
||||||
* the return type of eval() is a const reference to a matrix, not a matrix! It is however guaranteed
|
* the return type of eval() is a const reference to a matrix, not a matrix! It is however guaranteed
|
||||||
* that the return type of eval() is either PlainMatrixType or const PlainMatrixType&.
|
* that the return type of eval() is either PlainObject or const PlainObject&.
|
||||||
*/
|
*/
|
||||||
typedef Matrix<typename ei_traits<Derived>::Scalar,
|
typedef Matrix<typename ei_traits<Derived>::Scalar,
|
||||||
ei_traits<Derived>::RowsAtCompileTime,
|
ei_traits<Derived>::RowsAtCompileTime,
|
||||||
@ -129,8 +129,7 @@ template<typename Derived> class MatrixBase
|
|||||||
AutoAlign | (ei_traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor),
|
AutoAlign | (ei_traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor),
|
||||||
ei_traits<Derived>::MaxRowsAtCompileTime,
|
ei_traits<Derived>::MaxRowsAtCompileTime,
|
||||||
ei_traits<Derived>::MaxColsAtCompileTime
|
ei_traits<Derived>::MaxColsAtCompileTime
|
||||||
> PlainMatrixType;
|
> PlainObject;
|
||||||
// typedef typename ei_plain_matrix_type<Derived>::type PlainMatrixType;
|
|
||||||
|
|
||||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||||
/** \internal Represents a matrix with all coefficients equal to one another*/
|
/** \internal Represents a matrix with all coefficients equal to one another*/
|
||||||
@ -212,7 +211,7 @@ template<typename Derived> class MatrixBase
|
|||||||
RealScalar stableNorm() const;
|
RealScalar stableNorm() const;
|
||||||
RealScalar blueNorm() const;
|
RealScalar blueNorm() const;
|
||||||
RealScalar hypotNorm() const;
|
RealScalar hypotNorm() const;
|
||||||
const PlainMatrixType normalized() const;
|
const PlainObject normalized() const;
|
||||||
void normalize();
|
void normalize();
|
||||||
|
|
||||||
const AdjointReturnType adjoint() const;
|
const AdjointReturnType adjoint() const;
|
||||||
@ -301,9 +300,9 @@ template<typename Derived> class MatrixBase
|
|||||||
|
|
||||||
/////////// LU module ///////////
|
/////////// LU module ///////////
|
||||||
|
|
||||||
const FullPivLU<PlainMatrixType> fullPivLu() const;
|
const FullPivLU<PlainObject> fullPivLu() const;
|
||||||
const PartialPivLU<PlainMatrixType> partialPivLu() const;
|
const PartialPivLU<PlainObject> partialPivLu() const;
|
||||||
const PartialPivLU<PlainMatrixType> lu() const;
|
const PartialPivLU<PlainObject> lu() const;
|
||||||
const ei_inverse_impl<Derived> inverse() const;
|
const ei_inverse_impl<Derived> inverse() const;
|
||||||
template<typename ResultType>
|
template<typename ResultType>
|
||||||
void computeInverseAndDetWithCheck(
|
void computeInverseAndDetWithCheck(
|
||||||
@ -322,29 +321,29 @@ template<typename Derived> class MatrixBase
|
|||||||
|
|
||||||
/////////// Cholesky module ///////////
|
/////////// Cholesky module ///////////
|
||||||
|
|
||||||
const LLT<PlainMatrixType> llt() const;
|
const LLT<PlainObject> llt() const;
|
||||||
const LDLT<PlainMatrixType> ldlt() const;
|
const LDLT<PlainObject> ldlt() const;
|
||||||
|
|
||||||
/////////// QR module ///////////
|
/////////// QR module ///////////
|
||||||
|
|
||||||
const HouseholderQR<PlainMatrixType> householderQr() const;
|
const HouseholderQR<PlainObject> householderQr() const;
|
||||||
const ColPivHouseholderQR<PlainMatrixType> colPivHouseholderQr() const;
|
const ColPivHouseholderQR<PlainObject> colPivHouseholderQr() const;
|
||||||
const FullPivHouseholderQR<PlainMatrixType> fullPivHouseholderQr() const;
|
const FullPivHouseholderQR<PlainObject> fullPivHouseholderQr() const;
|
||||||
|
|
||||||
EigenvaluesReturnType eigenvalues() const;
|
EigenvaluesReturnType eigenvalues() const;
|
||||||
RealScalar operatorNorm() const;
|
RealScalar operatorNorm() const;
|
||||||
|
|
||||||
/////////// SVD module ///////////
|
/////////// SVD module ///////////
|
||||||
|
|
||||||
SVD<PlainMatrixType> svd() const;
|
SVD<PlainObject> svd() const;
|
||||||
|
|
||||||
/////////// Geometry module ///////////
|
/////////// Geometry module ///////////
|
||||||
|
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
PlainMatrixType cross(const MatrixBase<OtherDerived>& other) const;
|
PlainObject cross(const MatrixBase<OtherDerived>& other) const;
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
PlainMatrixType cross3(const MatrixBase<OtherDerived>& other) const;
|
PlainObject cross3(const MatrixBase<OtherDerived>& other) const;
|
||||||
PlainMatrixType unitOrthogonal(void) const;
|
PlainObject unitOrthogonal(void) const;
|
||||||
Matrix<Scalar,3,1> eulerAngles(int a0, int a1, int a2) const;
|
Matrix<Scalar,3,1> eulerAngles(int a0, int a1, int a2) const;
|
||||||
const ScalarMultipleReturnType operator*(const UniformScaling<Scalar>& s) const;
|
const ScalarMultipleReturnType operator*(const UniformScaling<Scalar>& s) const;
|
||||||
enum {
|
enum {
|
||||||
|
@ -280,7 +280,7 @@ operator*(const PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime> &perm
|
|||||||
template<typename PermutationType, typename MatrixType, int Side>
|
template<typename PermutationType, typename MatrixType, int Side>
|
||||||
struct ei_traits<ei_permut_matrix_product_retval<PermutationType, MatrixType, Side> >
|
struct ei_traits<ei_permut_matrix_product_retval<PermutationType, MatrixType, Side> >
|
||||||
{
|
{
|
||||||
typedef typename MatrixType::PlainMatrixType ReturnMatrixType;
|
typedef typename MatrixType::PlainObject ReturnType;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename PermutationType, typename MatrixType, int Side>
|
template<typename PermutationType, typename MatrixType, int Side>
|
||||||
|
@ -88,7 +88,7 @@ class ProductBase : public MatrixBase<Derived>
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef typename Base::PlainMatrixType PlainMatrixType;
|
typedef typename Base::PlainObject PlainObject;
|
||||||
|
|
||||||
ProductBase(const Lhs& lhs, const Rhs& rhs)
|
ProductBase(const Lhs& lhs, const Rhs& rhs)
|
||||||
: m_lhs(lhs), m_rhs(rhs)
|
: m_lhs(lhs), m_rhs(rhs)
|
||||||
@ -116,8 +116,8 @@ class ProductBase : public MatrixBase<Derived>
|
|||||||
const _LhsNested& lhs() const { return m_lhs; }
|
const _LhsNested& lhs() const { return m_lhs; }
|
||||||
const _RhsNested& rhs() const { return m_rhs; }
|
const _RhsNested& rhs() const { return m_rhs; }
|
||||||
|
|
||||||
// Implicit convertion to the nested type (trigger the evaluation of the product)
|
// Implicit conversion to the nested type (trigger the evaluation of the product)
|
||||||
operator const PlainMatrixType& () const
|
operator const PlainObject& () const
|
||||||
{
|
{
|
||||||
m_result.resize(m_lhs.rows(), m_rhs.cols());
|
m_result.resize(m_lhs.rows(), m_rhs.cols());
|
||||||
this->evalTo(m_result);
|
this->evalTo(m_result);
|
||||||
@ -139,7 +139,7 @@ class ProductBase : public MatrixBase<Derived>
|
|||||||
const LhsNested m_lhs;
|
const LhsNested m_lhs;
|
||||||
const RhsNested m_rhs;
|
const RhsNested m_rhs;
|
||||||
|
|
||||||
mutable PlainMatrixType m_result;
|
mutable PlainObject m_result;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -152,10 +152,10 @@ class ProductBase : public MatrixBase<Derived>
|
|||||||
|
|
||||||
// here we need to overload the nested rule for products
|
// here we need to overload the nested rule for products
|
||||||
// such that the nested type is a const reference to a plain matrix
|
// such that the nested type is a const reference to a plain matrix
|
||||||
template<typename Lhs, typename Rhs, int Mode, int N, typename PlainMatrixType>
|
template<typename Lhs, typename Rhs, int Mode, int N, typename PlainObject>
|
||||||
struct ei_nested<GeneralProduct<Lhs,Rhs,Mode>, N, PlainMatrixType>
|
struct ei_nested<GeneralProduct<Lhs,Rhs,Mode>, N, PlainObject>
|
||||||
{
|
{
|
||||||
typedef PlainMatrixType const& type;
|
typedef PlainObject const& type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename NestedProduct>
|
template<typename NestedProduct>
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
struct ei_traits<ReturnByValue<Derived> >
|
struct ei_traits<ReturnByValue<Derived> >
|
||||||
: public ei_traits<typename ei_traits<Derived>::ReturnMatrixType>
|
: public ei_traits<typename ei_traits<Derived>::ReturnType>
|
||||||
{
|
{
|
||||||
enum {
|
enum {
|
||||||
// FIXME had to remove the DirectAccessBit for usage like
|
// FIXME had to remove the DirectAccessBit for usage like
|
||||||
@ -42,7 +42,7 @@ struct ei_traits<ReturnByValue<Derived> >
|
|||||||
// The fact that I had to do that shows that when doing xpr.block() with a non-direct-access xpr,
|
// The fact that I had to do that shows that when doing xpr.block() with a non-direct-access xpr,
|
||||||
// even if xpr has the EvalBeforeNestingBit, the block() doesn't use direct access on the evaluated
|
// even if xpr has the EvalBeforeNestingBit, the block() doesn't use direct access on the evaluated
|
||||||
// xpr.
|
// xpr.
|
||||||
Flags = (ei_traits<typename ei_traits<Derived>::ReturnMatrixType>::Flags
|
Flags = (ei_traits<typename ei_traits<Derived>::ReturnType>::Flags
|
||||||
| EvalBeforeNestingBit) & ~DirectAccessBit
|
| EvalBeforeNestingBit) & ~DirectAccessBit
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -51,18 +51,18 @@ struct ei_traits<ReturnByValue<Derived> >
|
|||||||
* So the only way that nesting it in an expression can work, is by evaluating it into a plain matrix.
|
* So the only way that nesting it in an expression can work, is by evaluating it into a plain matrix.
|
||||||
* So ei_nested always gives the plain return matrix type.
|
* So ei_nested always gives the plain return matrix type.
|
||||||
*/
|
*/
|
||||||
template<typename Derived,int n,typename PlainMatrixType>
|
template<typename Derived,int n,typename PlainObject>
|
||||||
struct ei_nested<ReturnByValue<Derived>, n, PlainMatrixType>
|
struct ei_nested<ReturnByValue<Derived>, n, PlainObject>
|
||||||
{
|
{
|
||||||
typedef typename ei_traits<Derived>::ReturnMatrixType type;
|
typedef typename ei_traits<Derived>::ReturnType type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Derived> class ReturnByValue
|
template<typename Derived> class ReturnByValue
|
||||||
: public ei_traits<Derived>::ReturnMatrixType::template MakeBase<ReturnByValue<Derived> >::Type
|
: public ei_traits<Derived>::ReturnType::template MakeBase<ReturnByValue<Derived> >::Type
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef typename ei_traits<Derived>::ReturnMatrixType ReturnMatrixType;
|
typedef typename ei_traits<Derived>::ReturnType ReturnType;
|
||||||
typedef typename ReturnMatrixType::template MakeBase<ReturnByValue<Derived> >::Type Base;
|
typedef typename ReturnType::template MakeBase<ReturnByValue<Derived> >::Type Base;
|
||||||
EIGEN_DENSE_PUBLIC_INTERFACE(ReturnByValue)
|
EIGEN_DENSE_PUBLIC_INTERFACE(ReturnByValue)
|
||||||
|
|
||||||
template<typename Dest>
|
template<typename Dest>
|
||||||
|
@ -68,7 +68,7 @@ template<typename MatrixType, unsigned int UpLo> class SelfAdjointView
|
|||||||
enum {
|
enum {
|
||||||
Mode = ei_traits<SelfAdjointView>::Mode
|
Mode = ei_traits<SelfAdjointView>::Mode
|
||||||
};
|
};
|
||||||
typedef typename MatrixType::PlainMatrixType PlainMatrixType;
|
typedef typename MatrixType::PlainObject PlainObject;
|
||||||
|
|
||||||
inline SelfAdjointView(const MatrixType& matrix) : m_matrix(matrix)
|
inline SelfAdjointView(const MatrixType& matrix) : m_matrix(matrix)
|
||||||
{ ei_assert(ei_are_flags_consistent<Mode>::ret); }
|
{ ei_assert(ei_are_flags_consistent<Mode>::ret); }
|
||||||
@ -146,8 +146,8 @@ template<typename MatrixType, unsigned int UpLo> class SelfAdjointView
|
|||||||
|
|
||||||
/////////// Cholesky module ///////////
|
/////////// Cholesky module ///////////
|
||||||
|
|
||||||
const LLT<PlainMatrixType, UpLo> llt() const;
|
const LLT<PlainObject, UpLo> llt() const;
|
||||||
const LDLT<PlainMatrixType> ldlt() const;
|
const LDLT<PlainObject> ldlt() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const typename MatrixType::Nested m_matrix;
|
const typename MatrixType::Nested m_matrix;
|
||||||
|
@ -124,8 +124,8 @@ template<typename Derived>
|
|||||||
inline Derived& DenseBase<Derived>::operator*=(const Scalar& other)
|
inline Derived& DenseBase<Derived>::operator*=(const Scalar& other)
|
||||||
{
|
{
|
||||||
SelfCwiseBinaryOp<ei_scalar_product_op<Scalar>, Derived> tmp(derived());
|
SelfCwiseBinaryOp<ei_scalar_product_op<Scalar>, Derived> tmp(derived());
|
||||||
typedef typename Derived::PlainMatrixType PlainMatrixType;
|
typedef typename Derived::PlainObject PlainObject;
|
||||||
tmp = PlainMatrixType::Constant(rows(),cols(),other);
|
tmp = PlainObject::Constant(rows(),cols(),other);
|
||||||
return derived();
|
return derived();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,8 +133,8 @@ template<typename Derived>
|
|||||||
inline Derived& DenseBase<Derived>::operator/=(const Scalar& other)
|
inline Derived& DenseBase<Derived>::operator/=(const Scalar& other)
|
||||||
{
|
{
|
||||||
SelfCwiseBinaryOp<typename ei_meta_if<NumTraits<Scalar>::HasFloatingPoint,ei_scalar_product_op<Scalar>,ei_scalar_quotient_op<Scalar> >::ret, Derived> tmp(derived());
|
SelfCwiseBinaryOp<typename ei_meta_if<NumTraits<Scalar>::HasFloatingPoint,ei_scalar_product_op<Scalar>,ei_scalar_quotient_op<Scalar> >::ret, Derived> tmp(derived());
|
||||||
typedef typename Derived::PlainMatrixType PlainMatrixType;
|
typedef typename Derived::PlainObject PlainObject;
|
||||||
tmp = PlainMatrixType::Constant(rows(),cols(), NumTraits<Scalar>::HasFloatingPoint ? Scalar(1)/other : other);
|
tmp = PlainObject::Constant(rows(),cols(), NumTraits<Scalar>::HasFloatingPoint ? Scalar(1)/other : other);
|
||||||
return derived();
|
return derived();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView
|
|||||||
typedef TriangularBase<TriangularView> Base;
|
typedef TriangularBase<TriangularView> Base;
|
||||||
typedef typename ei_traits<TriangularView>::Scalar Scalar;
|
typedef typename ei_traits<TriangularView>::Scalar Scalar;
|
||||||
typedef _MatrixType MatrixType;
|
typedef _MatrixType MatrixType;
|
||||||
typedef typename MatrixType::PlainMatrixType DenseMatrixType;
|
typedef typename MatrixType::PlainObject DenseMatrixType;
|
||||||
typedef typename MatrixType::Nested MatrixTypeNested;
|
typedef typename MatrixType::Nested MatrixTypeNested;
|
||||||
typedef typename ei_cleantype<MatrixTypeNested>::type _MatrixTypeNested;
|
typedef typename ei_cleantype<MatrixTypeNested>::type _MatrixTypeNested;
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ class CoeffBasedProduct
|
|||||||
|
|
||||||
typedef MatrixBase<CoeffBasedProduct> Base;
|
typedef MatrixBase<CoeffBasedProduct> Base;
|
||||||
EIGEN_DENSE_PUBLIC_INTERFACE(CoeffBasedProduct)
|
EIGEN_DENSE_PUBLIC_INTERFACE(CoeffBasedProduct)
|
||||||
typedef typename Base::PlainMatrixType PlainMatrixType;
|
typedef typename Base::PlainObject PlainObject;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -181,8 +181,8 @@ class CoeffBasedProduct
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implicit convertion to the nested type (trigger the evaluation of the product)
|
// Implicit conversion to the nested type (trigger the evaluation of the product)
|
||||||
operator const PlainMatrixType& () const
|
operator const PlainObject& () const
|
||||||
{
|
{
|
||||||
m_result.lazyAssign(*this);
|
m_result.lazyAssign(*this);
|
||||||
return m_result;
|
return m_result;
|
||||||
@ -205,15 +205,15 @@ class CoeffBasedProduct
|
|||||||
const LhsNested m_lhs;
|
const LhsNested m_lhs;
|
||||||
const RhsNested m_rhs;
|
const RhsNested m_rhs;
|
||||||
|
|
||||||
mutable PlainMatrixType m_result;
|
mutable PlainObject m_result;
|
||||||
};
|
};
|
||||||
|
|
||||||
// here we need to overload the nested rule for products
|
// here we need to overload the nested rule for products
|
||||||
// such that the nested type is a const reference to a plain matrix
|
// such that the nested type is a const reference to a plain matrix
|
||||||
template<typename Lhs, typename Rhs, int N, typename PlainMatrixType>
|
template<typename Lhs, typename Rhs, int N, typename PlainObject>
|
||||||
struct ei_nested<CoeffBasedProduct<Lhs,Rhs,EvalBeforeNestingBit|EvalBeforeAssigningBit>, N, PlainMatrixType>
|
struct ei_nested<CoeffBasedProduct<Lhs,Rhs,EvalBeforeNestingBit|EvalBeforeAssigningBit>, N, PlainObject>
|
||||||
{
|
{
|
||||||
typedef PlainMatrixType const& type;
|
typedef PlainObject const& type;
|
||||||
};
|
};
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
|
@ -166,7 +166,7 @@ template<typename XprType> struct ei_blas_traits
|
|||||||
};
|
};
|
||||||
typedef typename ei_meta_if<int(ActualAccess)==HasDirectAccess,
|
typedef typename ei_meta_if<int(ActualAccess)==HasDirectAccess,
|
||||||
ExtractType,
|
ExtractType,
|
||||||
typename _ExtractType::PlainMatrixType
|
typename _ExtractType::PlainObject
|
||||||
>::ret DirectLinearAccessType;
|
>::ret DirectLinearAccessType;
|
||||||
static inline ExtractType extract(const XprType& x) { return x; }
|
static inline ExtractType extract(const XprType& x) { return x; }
|
||||||
static inline Scalar extractScalarFactor(const XprType&) { return Scalar(1); }
|
static inline Scalar extractScalarFactor(const XprType&) { return Scalar(1); }
|
||||||
@ -227,7 +227,7 @@ struct ei_blas_traits<Transpose<NestedXpr> >
|
|||||||
typedef Transpose<typename Base::_ExtractType> _ExtractType;
|
typedef Transpose<typename Base::_ExtractType> _ExtractType;
|
||||||
typedef typename ei_meta_if<int(Base::ActualAccess)==HasDirectAccess,
|
typedef typename ei_meta_if<int(Base::ActualAccess)==HasDirectAccess,
|
||||||
ExtractType,
|
ExtractType,
|
||||||
typename ExtractType::PlainMatrixType
|
typename ExtractType::PlainObject
|
||||||
>::ret DirectLinearAccessType;
|
>::ret DirectLinearAccessType;
|
||||||
enum {
|
enum {
|
||||||
IsTransposed = Base::IsTransposed ? 0 : 1
|
IsTransposed = Base::IsTransposed ? 0 : 1
|
||||||
|
@ -147,7 +147,7 @@ template<typename T, typename StorageType = typename ei_traits<T>::StorageType>
|
|||||||
template<typename T> struct ei_eval<T,Dense>
|
template<typename T> struct ei_eval<T,Dense>
|
||||||
{
|
{
|
||||||
typedef typename ei_plain_matrix_type<T>::type type;
|
typedef typename ei_plain_matrix_type<T>::type type;
|
||||||
// typedef typename T::PlainMatrixType type;
|
// typedef typename T::PlainObject type;
|
||||||
// typedef T::Matrix<typename ei_traits<T>::Scalar,
|
// typedef T::Matrix<typename ei_traits<T>::Scalar,
|
||||||
// ei_traits<T>::RowsAtCompileTime,
|
// ei_traits<T>::RowsAtCompileTime,
|
||||||
// ei_traits<T>::ColsAtCompileTime,
|
// ei_traits<T>::ColsAtCompileTime,
|
||||||
@ -256,7 +256,7 @@ struct ei_ref_selector
|
|||||||
* const Matrix3d&, because the internal logic of ei_nested determined that since a was already a matrix, there was no point
|
* const Matrix3d&, because the internal logic of ei_nested determined that since a was already a matrix, there was no point
|
||||||
* in copying it into another matrix.
|
* in copying it into another matrix.
|
||||||
*/
|
*/
|
||||||
template<typename T, int n=1, typename PlainMatrixType = typename ei_eval<T>::type> struct ei_nested
|
template<typename T, int n=1, typename PlainObject = typename ei_eval<T>::type> struct ei_nested
|
||||||
{
|
{
|
||||||
enum {
|
enum {
|
||||||
CostEval = (n+1) * int(NumTraits<typename ei_traits<T>::Scalar>::ReadCost),
|
CostEval = (n+1) * int(NumTraits<typename ei_traits<T>::Scalar>::ReadCost),
|
||||||
@ -266,7 +266,7 @@ template<typename T, int n=1, typename PlainMatrixType = typename ei_eval<T>::ty
|
|||||||
typedef typename ei_meta_if<
|
typedef typename ei_meta_if<
|
||||||
( int(ei_traits<T>::Flags) & EvalBeforeNestingBit ) ||
|
( int(ei_traits<T>::Flags) & EvalBeforeNestingBit ) ||
|
||||||
( int(CostEval) <= int(CostNoEval) ),
|
( int(CostEval) <= int(CostNoEval) ),
|
||||||
PlainMatrixType,
|
PlainObject,
|
||||||
typename ei_ref_selector<T>::type
|
typename ei_ref_selector<T>::type
|
||||||
>::ret type;
|
>::ret type;
|
||||||
};
|
};
|
||||||
|
@ -37,7 +37,7 @@ const unsigned int UnitLowerTriangular = UnitLower;
|
|||||||
|
|
||||||
template<typename ExpressionType, unsigned int Added, unsigned int Removed>
|
template<typename ExpressionType, unsigned int Added, unsigned int Removed>
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
typename ExpressionType::PlainMatrixType
|
typename ExpressionType::PlainObject
|
||||||
Flagged<ExpressionType,Added,Removed>::solveTriangular(const MatrixBase<OtherDerived>& other) const
|
Flagged<ExpressionType,Added,Removed>::solveTriangular(const MatrixBase<OtherDerived>& other) const
|
||||||
{
|
{
|
||||||
return m_matrix.template triangularView<Added>.solve(other.derived());
|
return m_matrix.template triangularView<Added>.solve(other.derived());
|
||||||
|
@ -276,7 +276,7 @@ inline Matrix<typename NumTraits<typename ei_traits<Derived>::Scalar>::Real, ei_
|
|||||||
MatrixBase<Derived>::eigenvalues() const
|
MatrixBase<Derived>::eigenvalues() const
|
||||||
{
|
{
|
||||||
ei_assert(Flags&SelfAdjoint);
|
ei_assert(Flags&SelfAdjoint);
|
||||||
return SelfAdjointEigenSolver<typename Derived::PlainMatrixType>(eval(),false).eigenvalues();
|
return SelfAdjointEigenSolver<typename Derived::PlainObject>(eval(),false).eigenvalues();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Derived, bool IsSelfAdjoint>
|
template<typename Derived, bool IsSelfAdjoint>
|
||||||
@ -296,7 +296,7 @@ template<typename Derived> struct ei_operatorNorm_selector<Derived, false>
|
|||||||
static inline typename NumTraits<typename ei_traits<Derived>::Scalar>::Real
|
static inline typename NumTraits<typename ei_traits<Derived>::Scalar>::Real
|
||||||
operatorNorm(const MatrixBase<Derived>& m)
|
operatorNorm(const MatrixBase<Derived>& m)
|
||||||
{
|
{
|
||||||
typename Derived::PlainMatrixType m_eval(m);
|
typename Derived::PlainObject m_eval(m);
|
||||||
// FIXME if it is really guaranteed that the eigenvalues are already sorted,
|
// FIXME if it is really guaranteed that the eigenvalues are already sorted,
|
||||||
// then we don't need to compute a maxCoeff() here, comparing the 1st and last ones is enough.
|
// then we don't need to compute a maxCoeff() here, comparing the 1st and last ones is enough.
|
||||||
return ei_sqrt(
|
return ei_sqrt(
|
||||||
|
@ -213,9 +213,9 @@ struct ei_traits<ei_homogeneous_left_product_impl<Homogeneous<MatrixType,Vertica
|
|||||||
typedef Matrix<typename ei_traits<MatrixType>::Scalar,
|
typedef Matrix<typename ei_traits<MatrixType>::Scalar,
|
||||||
Lhs::RowsAtCompileTime,
|
Lhs::RowsAtCompileTime,
|
||||||
MatrixType::ColsAtCompileTime,
|
MatrixType::ColsAtCompileTime,
|
||||||
MatrixType::PlainMatrixType::Options,
|
MatrixType::PlainObject::Options,
|
||||||
Lhs::MaxRowsAtCompileTime,
|
Lhs::MaxRowsAtCompileTime,
|
||||||
MatrixType::MaxColsAtCompileTime> ReturnMatrixType;
|
MatrixType::MaxColsAtCompileTime> ReturnType;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename MatrixType,typename Lhs>
|
template<typename MatrixType,typename Lhs>
|
||||||
@ -251,9 +251,9 @@ struct ei_traits<ei_homogeneous_right_product_impl<Homogeneous<MatrixType,Horizo
|
|||||||
typedef Matrix<typename ei_traits<MatrixType>::Scalar,
|
typedef Matrix<typename ei_traits<MatrixType>::Scalar,
|
||||||
MatrixType::RowsAtCompileTime,
|
MatrixType::RowsAtCompileTime,
|
||||||
Rhs::ColsAtCompileTime,
|
Rhs::ColsAtCompileTime,
|
||||||
MatrixType::PlainMatrixType::Options,
|
MatrixType::PlainObject::Options,
|
||||||
MatrixType::MaxRowsAtCompileTime,
|
MatrixType::MaxRowsAtCompileTime,
|
||||||
Rhs::MaxColsAtCompileTime> ReturnMatrixType;
|
Rhs::MaxColsAtCompileTime> ReturnType;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename MatrixType,typename Rhs>
|
template<typename MatrixType,typename Rhs>
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
inline typename MatrixBase<Derived>::PlainMatrixType
|
inline typename MatrixBase<Derived>::PlainObject
|
||||||
MatrixBase<Derived>::cross(const MatrixBase<OtherDerived>& other) const
|
MatrixBase<Derived>::cross(const MatrixBase<OtherDerived>& other) const
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Derived,3)
|
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Derived,3)
|
||||||
@ -79,7 +79,7 @@ struct ei_cross3_impl {
|
|||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
inline typename MatrixBase<Derived>::PlainMatrixType
|
inline typename MatrixBase<Derived>::PlainObject
|
||||||
MatrixBase<Derived>::cross3(const MatrixBase<OtherDerived>& other) const
|
MatrixBase<Derived>::cross3(const MatrixBase<OtherDerived>& other) const
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Derived,4)
|
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Derived,4)
|
||||||
@ -210,7 +210,7 @@ struct ei_unitOrthogonal_selector<Derived,2>
|
|||||||
* \sa cross()
|
* \sa cross()
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
typename MatrixBase<Derived>::PlainMatrixType
|
typename MatrixBase<Derived>::PlainObject
|
||||||
MatrixBase<Derived>::unitOrthogonal() const
|
MatrixBase<Derived>::unitOrthogonal() const
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
|
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
|
||||||
|
@ -99,7 +99,7 @@ void MatrixBase<Derived>::applyHouseholderOnTheLeft(
|
|||||||
const Scalar& tau,
|
const Scalar& tau,
|
||||||
Scalar* workspace)
|
Scalar* workspace)
|
||||||
{
|
{
|
||||||
Map<Matrix<Scalar, 1, Base::ColsAtCompileTime, PlainMatrixType::Options, 1, Base::MaxColsAtCompileTime> > tmp(workspace,cols());
|
Map<Matrix<Scalar, 1, Base::ColsAtCompileTime, PlainObject::Options, 1, Base::MaxColsAtCompileTime> > tmp(workspace,cols());
|
||||||
Block<Derived, EssentialPart::SizeAtCompileTime, Derived::ColsAtCompileTime> bottom(derived(), 1, 0, rows()-1, cols());
|
Block<Derived, EssentialPart::SizeAtCompileTime, Derived::ColsAtCompileTime> bottom(derived(), 1, 0, rows()-1, cols());
|
||||||
tmp.noalias() = essential.adjoint() * bottom;
|
tmp.noalias() = essential.adjoint() * bottom;
|
||||||
tmp += this->row(0);
|
tmp += this->row(0);
|
||||||
@ -114,7 +114,7 @@ void MatrixBase<Derived>::applyHouseholderOnTheRight(
|
|||||||
const Scalar& tau,
|
const Scalar& tau,
|
||||||
Scalar* workspace)
|
Scalar* workspace)
|
||||||
{
|
{
|
||||||
Map<Matrix<Scalar, Base::RowsAtCompileTime, 1, PlainMatrixType::Options, Base::MaxRowsAtCompileTime, 1> > tmp(workspace,rows());
|
Map<Matrix<Scalar, Base::RowsAtCompileTime, 1, PlainObject::Options, Base::MaxRowsAtCompileTime, 1> > tmp(workspace,rows());
|
||||||
Block<Derived, Derived::RowsAtCompileTime, EssentialPart::SizeAtCompileTime> right(derived(), 0, 1, rows(), cols()-1);
|
Block<Derived, Derived::RowsAtCompileTime, EssentialPart::SizeAtCompileTime> right(derived(), 0, 1, rows(), cols()-1);
|
||||||
tmp.noalias() = right * essential.conjugate();
|
tmp.noalias() = right * essential.conjugate();
|
||||||
tmp += this->col(0);
|
tmp += this->col(0);
|
||||||
|
@ -630,7 +630,7 @@ struct ei_solve_retval<FullPivLU<_MatrixType>, Rhs>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
typename Rhs::PlainMatrixType c(rhs().rows(), rhs().cols());
|
typename Rhs::PlainObject c(rhs().rows(), rhs().cols());
|
||||||
|
|
||||||
// Step 1
|
// Step 1
|
||||||
c = dec().permutationP() * rhs();
|
c = dec().permutationP() * rhs();
|
||||||
@ -670,10 +670,10 @@ struct ei_solve_retval<FullPivLU<_MatrixType>, Rhs>
|
|||||||
* \sa class FullPivLU
|
* \sa class FullPivLU
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
inline const FullPivLU<typename MatrixBase<Derived>::PlainMatrixType>
|
inline const FullPivLU<typename MatrixBase<Derived>::PlainObject>
|
||||||
MatrixBase<Derived>::fullPivLu() const
|
MatrixBase<Derived>::fullPivLu() const
|
||||||
{
|
{
|
||||||
return FullPivLU<PlainMatrixType>(eval());
|
return FullPivLU<PlainObject>(eval());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // EIGEN_LU_H
|
#endif // EIGEN_LU_H
|
||||||
|
@ -238,7 +238,7 @@ struct ei_compute_inverse_and_det_with_check<MatrixType, ResultType, 4>
|
|||||||
template<typename MatrixType>
|
template<typename MatrixType>
|
||||||
struct ei_traits<ei_inverse_impl<MatrixType> >
|
struct ei_traits<ei_inverse_impl<MatrixType> >
|
||||||
{
|
{
|
||||||
typedef typename MatrixType::PlainMatrixType ReturnMatrixType;
|
typedef typename MatrixType::PlainObject ReturnType;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename MatrixType>
|
template<typename MatrixType>
|
||||||
@ -327,7 +327,7 @@ inline void MatrixBase<Derived>::computeInverseAndDetWithCheck(
|
|||||||
typedef typename ei_meta_if<
|
typedef typename ei_meta_if<
|
||||||
RowsAtCompileTime == 2,
|
RowsAtCompileTime == 2,
|
||||||
typename ei_cleantype<typename ei_nested<Derived, 2>::type>::type,
|
typename ei_cleantype<typename ei_nested<Derived, 2>::type>::type,
|
||||||
PlainMatrixType
|
PlainObject
|
||||||
>::ret MatrixType;
|
>::ret MatrixType;
|
||||||
ei_compute_inverse_and_det_with_check<MatrixType, ResultType>::run
|
ei_compute_inverse_and_det_with_check<MatrixType, ResultType>::run
|
||||||
(derived(), absDeterminantThreshold, inverse, determinant, invertible);
|
(derived(), absDeterminantThreshold, inverse, determinant, invertible);
|
||||||
|
@ -442,10 +442,10 @@ struct ei_solve_retval<PartialPivLU<_MatrixType>, Rhs>
|
|||||||
* \sa class PartialPivLU
|
* \sa class PartialPivLU
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
inline const PartialPivLU<typename MatrixBase<Derived>::PlainMatrixType>
|
inline const PartialPivLU<typename MatrixBase<Derived>::PlainObject>
|
||||||
MatrixBase<Derived>::partialPivLu() const
|
MatrixBase<Derived>::partialPivLu() const
|
||||||
{
|
{
|
||||||
return PartialPivLU<PlainMatrixType>(eval());
|
return PartialPivLU<PlainObject>(eval());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \lu_module
|
/** \lu_module
|
||||||
@ -457,10 +457,10 @@ MatrixBase<Derived>::partialPivLu() const
|
|||||||
* \sa class PartialPivLU
|
* \sa class PartialPivLU
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
inline const PartialPivLU<typename MatrixBase<Derived>::PlainMatrixType>
|
inline const PartialPivLU<typename MatrixBase<Derived>::PlainObject>
|
||||||
MatrixBase<Derived>::lu() const
|
MatrixBase<Derived>::lu() const
|
||||||
{
|
{
|
||||||
return PartialPivLU<PlainMatrixType>(eval());
|
return PartialPivLU<PlainObject>(eval());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // EIGEN_PARTIALLU_H
|
#endif // EIGEN_PARTIALLU_H
|
||||||
|
@ -441,7 +441,7 @@ struct ei_solve_retval<ColPivHouseholderQR<_MatrixType>, Rhs>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
typename Rhs::PlainMatrixType c(rhs());
|
typename Rhs::PlainObject c(rhs());
|
||||||
|
|
||||||
// Note that the matrix Q = H_0^* H_1^*... so its inverse is Q^* = (H_0 H_1 ...)^T
|
// Note that the matrix Q = H_0^* H_1^*... so its inverse is Q^* = (H_0 H_1 ...)^T
|
||||||
c.applyOnTheLeft(householderSequence(
|
c.applyOnTheLeft(householderSequence(
|
||||||
@ -458,7 +458,7 @@ struct ei_solve_retval<ColPivHouseholderQR<_MatrixType>, Rhs>
|
|||||||
.solveInPlace(c.corner(TopLeft, nonzero_pivots, c.cols()));
|
.solveInPlace(c.corner(TopLeft, nonzero_pivots, c.cols()));
|
||||||
|
|
||||||
|
|
||||||
typename Rhs::PlainMatrixType d(c);
|
typename Rhs::PlainObject d(c);
|
||||||
d.corner(TopLeft, nonzero_pivots, c.cols())
|
d.corner(TopLeft, nonzero_pivots, c.cols())
|
||||||
= dec().matrixQR()
|
= dec().matrixQR()
|
||||||
.corner(TopLeft, nonzero_pivots, nonzero_pivots)
|
.corner(TopLeft, nonzero_pivots, nonzero_pivots)
|
||||||
@ -486,10 +486,10 @@ typename ColPivHouseholderQR<MatrixType>::HouseholderSequenceType ColPivHousehol
|
|||||||
* \sa class ColPivHouseholderQR
|
* \sa class ColPivHouseholderQR
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
const ColPivHouseholderQR<typename MatrixBase<Derived>::PlainMatrixType>
|
const ColPivHouseholderQR<typename MatrixBase<Derived>::PlainObject>
|
||||||
MatrixBase<Derived>::colPivHouseholderQr() const
|
MatrixBase<Derived>::colPivHouseholderQr() const
|
||||||
{
|
{
|
||||||
return ColPivHouseholderQR<PlainMatrixType>(eval());
|
return ColPivHouseholderQR<PlainObject>(eval());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -352,7 +352,7 @@ struct ei_solve_retval<FullPivHouseholderQR<_MatrixType>, Rhs>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
typename Rhs::PlainMatrixType c(rhs());
|
typename Rhs::PlainObject c(rhs());
|
||||||
|
|
||||||
Matrix<Scalar,1,Rhs::ColsAtCompileTime> temp(rhs().cols());
|
Matrix<Scalar,1,Rhs::ColsAtCompileTime> temp(rhs().cols());
|
||||||
for (int k = 0; k < dec().rank(); ++k)
|
for (int k = 0; k < dec().rank(); ++k)
|
||||||
@ -413,10 +413,10 @@ typename FullPivHouseholderQR<MatrixType>::MatrixQType FullPivHouseholderQR<Matr
|
|||||||
* \sa class FullPivHouseholderQR
|
* \sa class FullPivHouseholderQR
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
const FullPivHouseholderQR<typename MatrixBase<Derived>::PlainMatrixType>
|
const FullPivHouseholderQR<typename MatrixBase<Derived>::PlainObject>
|
||||||
MatrixBase<Derived>::fullPivHouseholderQr() const
|
MatrixBase<Derived>::fullPivHouseholderQr() const
|
||||||
{
|
{
|
||||||
return FullPivHouseholderQR<PlainMatrixType>(eval());
|
return FullPivHouseholderQR<PlainObject>(eval());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // EIGEN_FULLPIVOTINGHOUSEHOLDERQR_H
|
#endif // EIGEN_FULLPIVOTINGHOUSEHOLDERQR_H
|
||||||
|
@ -221,7 +221,7 @@ struct ei_solve_retval<HouseholderQR<_MatrixType>, Rhs>
|
|||||||
const int rank = std::min(rows, cols);
|
const int rank = std::min(rows, cols);
|
||||||
ei_assert(rhs().rows() == rows);
|
ei_assert(rhs().rows() == rows);
|
||||||
|
|
||||||
typename Rhs::PlainMatrixType c(rhs());
|
typename Rhs::PlainObject c(rhs());
|
||||||
|
|
||||||
// Note that the matrix Q = H_0^* H_1^*... so its inverse is Q^* = (H_0 H_1 ...)^T
|
// Note that the matrix Q = H_0^* H_1^*... so its inverse is Q^* = (H_0 H_1 ...)^T
|
||||||
c.applyOnTheLeft(householderSequence(
|
c.applyOnTheLeft(householderSequence(
|
||||||
@ -246,10 +246,10 @@ struct ei_solve_retval<HouseholderQR<_MatrixType>, Rhs>
|
|||||||
* \sa class HouseholderQR
|
* \sa class HouseholderQR
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
const HouseholderQR<typename MatrixBase<Derived>::PlainMatrixType>
|
const HouseholderQR<typename MatrixBase<Derived>::PlainObject>
|
||||||
MatrixBase<Derived>::householderQr() const
|
MatrixBase<Derived>::householderQr() const
|
||||||
{
|
{
|
||||||
return HouseholderQR<PlainMatrixType>(eval());
|
return HouseholderQR<PlainObject>(eval());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -555,10 +555,10 @@ void SVD<MatrixType>::computeScalingRotation(ScalingType *scaling, RotationType
|
|||||||
* \returns the SVD decomposition of \c *this
|
* \returns the SVD decomposition of \c *this
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
inline SVD<typename MatrixBase<Derived>::PlainMatrixType>
|
inline SVD<typename MatrixBase<Derived>::PlainObject>
|
||||||
MatrixBase<Derived>::svd() const
|
MatrixBase<Derived>::svd() const
|
||||||
{
|
{
|
||||||
return SVD<PlainMatrixType>(derived());
|
return SVD<PlainObject>(derived());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // EIGEN_SVD_H
|
#endif // EIGEN_SVD_H
|
||||||
|
@ -141,10 +141,10 @@ UpperBidiagonalization<_MatrixType>& UpperBidiagonalization<_MatrixType>::comput
|
|||||||
* \sa class Bidiagonalization
|
* \sa class Bidiagonalization
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
const UpperBidiagonalization<typename MatrixBase<Derived>::PlainMatrixType>
|
const UpperBidiagonalization<typename MatrixBase<Derived>::PlainObject>
|
||||||
MatrixBase<Derived>::bidiagonalization() const
|
MatrixBase<Derived>::bidiagonalization() const
|
||||||
{
|
{
|
||||||
return UpperBidiagonalization<PlainMatrixType>(eval());
|
return UpperBidiagonalization<PlainObject>(eval());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ template<typename Derived> class SparseMatrixBase : public EigenBase<Derived>
|
|||||||
Transpose<Derived>
|
Transpose<Derived>
|
||||||
>::ret AdjointReturnType;
|
>::ret AdjointReturnType;
|
||||||
|
|
||||||
typedef SparseMatrix<Scalar, Flags&RowMajorBit ? RowMajor : ColMajor> PlainMatrixType;
|
typedef SparseMatrix<Scalar, Flags&RowMajorBit ? RowMajor : ColMajor> PlainObject;
|
||||||
|
|
||||||
#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::SparseMatrixBase
|
#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::SparseMatrixBase
|
||||||
#include "../plugins/CommonCwiseUnaryOps.h"
|
#include "../plugins/CommonCwiseUnaryOps.h"
|
||||||
@ -396,7 +396,7 @@ template<typename Derived> class SparseMatrixBase : public EigenBase<Derived>
|
|||||||
template<typename OtherDerived> Scalar dot(const SparseMatrixBase<OtherDerived>& other) const;
|
template<typename OtherDerived> Scalar dot(const SparseMatrixBase<OtherDerived>& other) const;
|
||||||
RealScalar squaredNorm() const;
|
RealScalar squaredNorm() const;
|
||||||
RealScalar norm() const;
|
RealScalar norm() const;
|
||||||
// const PlainMatrixType normalized() const;
|
// const PlainObject normalized() const;
|
||||||
// void normalize();
|
// void normalize();
|
||||||
|
|
||||||
Transpose<Derived> transpose() { return derived(); }
|
Transpose<Derived> transpose() { return derived(); }
|
||||||
|
@ -93,8 +93,8 @@ template<typename MatrixType, unsigned int UpLo> class SparseSelfAdjointView
|
|||||||
template<typename DerivedU>
|
template<typename DerivedU>
|
||||||
SparseSelfAdjointView& rankUpdate(const MatrixBase<DerivedU>& u, Scalar alpha = Scalar(1));
|
SparseSelfAdjointView& rankUpdate(const MatrixBase<DerivedU>& u, Scalar alpha = Scalar(1));
|
||||||
|
|
||||||
// const SparseLLT<PlainMatrixType, UpLo> llt() const;
|
// const SparseLLT<PlainObject, UpLo> llt() const;
|
||||||
// const SparseLDLT<PlainMatrixType, UpLo> ldlt() const;
|
// const SparseLDLT<PlainObject, UpLo> ldlt() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ struct ei_traits<ei_image_retval_base<DecompositionType> >
|
|||||||
MatrixType::Options,
|
MatrixType::Options,
|
||||||
MatrixType::MaxRowsAtCompileTime, // the image matrix will consist of columns from the original matrix,
|
MatrixType::MaxRowsAtCompileTime, // the image matrix will consist of columns from the original matrix,
|
||||||
MatrixType::MaxColsAtCompileTime // so it has the same number of rows and at most as many columns.
|
MatrixType::MaxColsAtCompileTime // so it has the same number of rows and at most as many columns.
|
||||||
> ReturnMatrixType;
|
> ReturnType;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename _DecompositionType> struct ei_image_retval_base
|
template<typename _DecompositionType> struct ei_image_retval_base
|
||||||
|
@ -42,7 +42,7 @@ struct ei_traits<ei_kernel_retval_base<DecompositionType> >
|
|||||||
MatrixType::MaxColsAtCompileTime, // see explanation for 2nd template parameter
|
MatrixType::MaxColsAtCompileTime, // see explanation for 2nd template parameter
|
||||||
MatrixType::MaxColsAtCompileTime // the kernel is a subspace of the domain space,
|
MatrixType::MaxColsAtCompileTime // the kernel is a subspace of the domain space,
|
||||||
// whose dimension is the number of columns of the original matrix
|
// whose dimension is the number of columns of the original matrix
|
||||||
> ReturnMatrixType;
|
> ReturnType;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename _DecompositionType> struct ei_kernel_retval_base
|
template<typename _DecompositionType> struct ei_kernel_retval_base
|
||||||
|
@ -35,9 +35,9 @@ struct ei_traits<ei_solve_retval_base<DecompositionType, Rhs> >
|
|||||||
typedef Matrix<typename Rhs::Scalar,
|
typedef Matrix<typename Rhs::Scalar,
|
||||||
MatrixType::ColsAtCompileTime,
|
MatrixType::ColsAtCompileTime,
|
||||||
Rhs::ColsAtCompileTime,
|
Rhs::ColsAtCompileTime,
|
||||||
Rhs::PlainMatrixType::Options,
|
Rhs::PlainObject::Options,
|
||||||
MatrixType::MaxColsAtCompileTime,
|
MatrixType::MaxColsAtCompileTime,
|
||||||
Rhs::MaxColsAtCompileTime> ReturnMatrixType;
|
Rhs::MaxColsAtCompileTime> ReturnType;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename _DecompositionType, typename Rhs> struct ei_solve_retval_base
|
template<typename _DecompositionType, typename Rhs> struct ei_solve_retval_base
|
||||||
|
@ -62,7 +62,7 @@ class BandMatrix : public MultiplierBase<BandMatrix<_Scalar,Supers,Subs,Options>
|
|||||||
MaxColsAtCompileTime = ei_traits<BandMatrix>::MaxColsAtCompileTime
|
MaxColsAtCompileTime = ei_traits<BandMatrix>::MaxColsAtCompileTime
|
||||||
};
|
};
|
||||||
typedef typename ei_traits<BandMatrix>::Scalar Scalar;
|
typedef typename ei_traits<BandMatrix>::Scalar Scalar;
|
||||||
typedef Matrix<Scalar,RowsAtCompileTime,ColsAtCompileTime> PlainMatrixType;
|
typedef Matrix<Scalar,RowsAtCompileTime,ColsAtCompileTime> PlainObject;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enum {
|
enum {
|
||||||
@ -125,9 +125,9 @@ class BandMatrix : public MultiplierBase<BandMatrix<_Scalar,Supers,Subs,Options>
|
|||||||
// inline VectorBlock<DataType,Size> subDiagonal()
|
// inline VectorBlock<DataType,Size> subDiagonal()
|
||||||
// { return VectorBlock<DataType,Size>(m_data,0,m_size.value()); }
|
// { return VectorBlock<DataType,Size>(m_data,0,m_size.value()); }
|
||||||
|
|
||||||
PlainMatrixType toDense() const
|
PlainObject toDense() const
|
||||||
{
|
{
|
||||||
PlainMatrixType res(rows(),cols());
|
PlainObject res(rows(),cols());
|
||||||
res.setZero();
|
res.setZero();
|
||||||
res.diagonal() = diagonal();
|
res.diagonal() = diagonal();
|
||||||
for (int i=1; i<=supers();++i)
|
for (int i=1; i<=supers();++i)
|
||||||
|
@ -51,8 +51,8 @@ template<typename MatrixType> void lu_non_invertible()
|
|||||||
cols2 = cols = MatrixType::ColsAtCompileTime;
|
cols2 = cols = MatrixType::ColsAtCompileTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef typename ei_kernel_retval_base<FullPivLU<MatrixType> >::ReturnMatrixType KernelMatrixType;
|
typedef typename ei_kernel_retval_base<FullPivLU<MatrixType> >::ReturnType KernelMatrixType;
|
||||||
typedef typename ei_image_retval_base<FullPivLU<MatrixType> >::ReturnMatrixType ImageMatrixType;
|
typedef typename ei_image_retval_base<FullPivLU<MatrixType> >::ReturnType ImageMatrixType;
|
||||||
typedef Matrix<typename MatrixType::Scalar, Dynamic, Dynamic> DynamicMatrixType;
|
typedef Matrix<typename MatrixType::Scalar, Dynamic, Dynamic> DynamicMatrixType;
|
||||||
typedef Matrix<typename MatrixType::Scalar, MatrixType::ColsAtCompileTime, MatrixType::ColsAtCompileTime>
|
typedef Matrix<typename MatrixType::Scalar, MatrixType::ColsAtCompileTime, MatrixType::ColsAtCompileTime>
|
||||||
CMatrixType;
|
CMatrixType;
|
||||||
|
@ -313,7 +313,7 @@ template<typename Derived> struct MatrixExponentialReturnValue
|
|||||||
inline void evalTo(ResultType& result) const
|
inline void evalTo(ResultType& result) const
|
||||||
{
|
{
|
||||||
const typename ei_eval<Derived>::type srcEvaluated = m_src.eval();
|
const typename ei_eval<Derived>::type srcEvaluated = m_src.eval();
|
||||||
MatrixExponential<typename Derived::PlainMatrixType> me(srcEvaluated);
|
MatrixExponential<typename Derived::PlainObject> me(srcEvaluated);
|
||||||
me.compute(result);
|
me.compute(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ template<typename Derived> struct MatrixExponentialReturnValue
|
|||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
struct ei_traits<MatrixExponentialReturnValue<Derived> >
|
struct ei_traits<MatrixExponentialReturnValue<Derived> >
|
||||||
{
|
{
|
||||||
typedef typename Derived::PlainMatrixType ReturnMatrixType;
|
typedef typename Derived::PlainObject ReturnType;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** \ingroup MatrixFunctions_Module
|
/** \ingroup MatrixFunctions_Module
|
||||||
|
@ -516,7 +516,7 @@ template<typename Derived> class MatrixFunctionReturnValue
|
|||||||
inline void evalTo(ResultType& result) const
|
inline void evalTo(ResultType& result) const
|
||||||
{
|
{
|
||||||
const typename ei_eval<Derived>::type Aevaluated = m_A.eval();
|
const typename ei_eval<Derived>::type Aevaluated = m_A.eval();
|
||||||
MatrixFunction<typename Derived::PlainMatrixType> mf(Aevaluated, m_f);
|
MatrixFunction<typename Derived::PlainObject> mf(Aevaluated, m_f);
|
||||||
mf.compute(result);
|
mf.compute(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -531,7 +531,7 @@ template<typename Derived> class MatrixFunctionReturnValue
|
|||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
struct ei_traits<MatrixFunctionReturnValue<Derived> >
|
struct ei_traits<MatrixFunctionReturnValue<Derived> >
|
||||||
{
|
{
|
||||||
typedef typename Derived::PlainMatrixType ReturnMatrixType;
|
typedef typename Derived::PlainObject ReturnType;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user