11 #ifndef EIGEN_DIAGONALMATRIX_H 12 #define EIGEN_DIAGONALMATRIX_H 16 #ifndef EIGEN_PARSED_BY_DOXYGEN 17 template<
typename Derived>
22 typedef typename DiagonalVectorType::Scalar
Scalar;
23 typedef typename DiagonalVectorType::RealScalar
RealScalar;
40 inline const Derived&
derived()
const {
return *
static_cast<const Derived*
>(
this); }
41 inline Derived&
derived() {
return *
static_cast<Derived*
>(
this); }
44 template<
typename DenseDerived>
46 template<
typename DenseDerived>
49 template<
typename DenseDerived>
53 inline const DiagonalVectorType&
diagonal()
const {
return derived().diagonal(); }
61 template<
typename MatrixDerived>
86 template<
typename OtherDerived>
91 template<
typename OtherDerived>
99 template<
typename Derived>
100 template<
typename DenseDerived>
122 template<
typename _Scalar,
int SizeAtCompileTime,
int MaxSizeAtCompileTime>
124 :
traits<Matrix<_Scalar,SizeAtCompileTime,SizeAtCompileTime,0,MaxSizeAtCompileTime,MaxSizeAtCompileTime> >
134 template<
typename _Scalar,
int SizeAtCompileTime,
int MaxSizeAtCompileTime>
136 :
public DiagonalBase<DiagonalMatrix<_Scalar,SizeAtCompileTime,MaxSizeAtCompileTime> >
139 #ifndef EIGEN_PARSED_BY_DOXYGEN 154 inline const DiagonalVectorType&
diagonal()
const {
return m_diagonal; }
156 inline DiagonalVectorType&
diagonal() {
return m_diagonal; }
168 inline DiagonalMatrix(
const Scalar& x,
const Scalar&
y,
const Scalar& z) : m_diagonal(x,y,z) {}
171 template<
typename OtherDerived>
174 #ifndef EIGEN_PARSED_BY_DOXYGEN 180 template<
typename OtherDerived>
185 template<
typename OtherDerived>
192 #ifndef EIGEN_PARSED_BY_DOXYGEN 206 inline void setZero() { m_diagonal.setZero(); }
230 template<
typename _DiagonalVectorType>
234 typedef typename DiagonalVectorType::Scalar
Scalar;
235 typedef typename DiagonalVectorType::Index
Index;
247 template<
typename _DiagonalVectorType>
252 #ifndef EIGEN_PARSED_BY_DOXYGEN 261 const DiagonalVectorType&
diagonal()
const {
return m_diagonal; }
276 template<
typename Derived>
291 template<
typename Derived>
300 if(absOnDiagonal > maxAbsOnDiagonal) maxAbsOnDiagonal = absOnDiagonal;
303 for(
Index i = 0; i < j; ++i)
313 #endif // EIGEN_DIAGONALMATRIX_H const Derived & derived() const
DiagonalMatrix< Scalar, DiagonalVectorType::SizeAtCompileTime, DiagonalVectorType::MaxSizeAtCompileTime > PlainObject
_DiagonalVectorType DiagonalVectorType
DiagonalMatrix & operator=(const DiagonalBase< OtherDerived > &other)
DenseMatrixType DenseType
DiagonalVectorType::Scalar Scalar
DiagonalMatrix(const DiagonalBase< OtherDerived > &other)
internal::traits< Derived >::Index Index
The type of indices.
DiagonalReturnType diagonal()
const unsigned int LvalueBit
const DiagonalVectorType & diagonal() const
DiagonalMatrix(const Scalar &x, const Scalar &y)
const DiagonalProduct< MatrixDerived, Derived, OnTheLeft > operator*(const MatrixBase< MatrixDerived > &matrix) const
Represents a diagonal matrix with its storage.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
DiagonalVectorType::Scalar Scalar
void subTo(MatrixBase< DenseDerived > &other) const
bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, typename NumTraits< Scalar >::Real precision=NumTraits< Scalar >::dummy_precision())
DiagonalWrapper(DiagonalVectorType &a_diagonal)
internal::traits< Derived >::Index Index
const DiagonalVectorType & diagonal() const
void addTo(MatrixBase< DenseDerived > &other) const
internal::traits< Derived >::DiagonalVectorType DiagonalVectorType
void evalTo(MatrixBase< DenseDerived > &other) const
const DiagonalWrapper< const CwiseUnaryOp< internal::scalar_inverse_op< Scalar >, const DiagonalVectorType > > inverse() const
const DiagonalWrapper< const CwiseUnaryOp< internal::scalar_multiple_op< Scalar >, const DiagonalVectorType > > operator*(const Scalar &scalar) const
DiagonalVectorType m_diagonal
DenseMatrixType toDenseMatrix() const
internal::traits< DiagonalMatrix >::Index Index
bool isApprox(const Scalar &x, const Scalar &y, typename NumTraits< Scalar >::Real precision=NumTraits< Scalar >::dummy_precision())
DiagonalMatrix(const Scalar &x, const Scalar &y, const Scalar &z)
internal::traits< DiagonalMatrix >::StorageKind StorageKind
bool isDiagonal(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
const DiagonalMatrix & Nested
DiagonalVectorType::RealScalar RealScalar
const DiagonalWrapper< const Derived > asDiagonal() const
DiagonalMatrix(Index dim)
DiagonalVectorType::StorageKind StorageKind
Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTime, 0, MaxRowsAtCompileTime, MaxColsAtCompileTime > DenseMatrixType
const DiagonalVectorType & diagonal() const
DiagonalMatrix & operator=(const DiagonalMatrix &other)
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
internal::traits< Derived >::StorageKind StorageKind
NumTraits< Scalar >::Real RealScalar
DiagonalVectorType & diagonal()
EIGEN_STRONG_INLINE const CwiseUnaryOp< internal::scalar_abs_op< Scalar >, const Derived > abs() const
_DiagonalVectorType DiagonalVectorType
DiagonalVectorType::Nested m_diagonal
Expression of a diagonal matrix.
void setIdentity(Index size)
internal::traits< DiagonalMatrix >::DiagonalVectorType DiagonalVectorType
DiagonalVectorType & diagonal()
DiagonalMatrix(const MatrixBase< OtherDerived > &other)
The matrix class, also used for vectors and row-vectors.
Base class for all dense matrices, vectors, and expressions.
DiagonalMatrix(const DiagonalMatrix &other)
friend const DiagonalWrapper< const CwiseUnaryOp< internal::scalar_multiple_op< Scalar >, const DiagonalVectorType > > operator*(const Scalar &scalar, const DiagonalBase &other)
Matrix< _Scalar, SizeAtCompileTime, 1, 0, MaxSizeAtCompileTime, 1 > DiagonalVectorType
DiagonalVectorType::Index Index