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 DiagonalMatrix< Scalar, DiagonalVectorType::SizeAtCompileTime, DiagonalVectorType::MaxSizeAtCompileTime > PlainObject
_DiagonalVectorType DiagonalVectorType
DiagonalMatrix & operator=(const DiagonalBase< OtherDerived > &other)
void evalTo(MatrixBase< DenseDerived > &other) const
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
DiagonalMatrix(const Scalar &x, const Scalar &y)
const DiagonalVectorType & diagonal() const
Represents a diagonal matrix with its storage.
iterative scaling algorithm to equilibrate rows and column norms in matrices
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
DiagonalVectorType::Scalar Scalar
bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, typename NumTraits< Scalar >::Real precision=NumTraits< Scalar >::dummy_precision())
const DiagonalWrapper< const CwiseUnaryOp< internal::scalar_multiple_op< Scalar >, const DiagonalVectorType > > operator*(const Scalar &scalar) const
void addTo(MatrixBase< DenseDerived > &other) const
DiagonalWrapper(DiagonalVectorType &a_diagonal)
internal::traits< Derived >::Index Index
internal::traits< Derived >::DiagonalVectorType DiagonalVectorType
const DiagonalVectorType & diagonal() const
EIGEN_STRONG_INLINE const CwiseUnaryOp< internal::scalar_abs_op< Scalar >, const Derived > abs() const
DenseMatrixType toDenseMatrix() const
DiagonalVectorType m_diagonal
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
const DiagonalMatrix & Nested
const DiagonalVectorType & diagonal() const
DiagonalVectorType::RealScalar RealScalar
DiagonalMatrix(Index dim)
DiagonalVectorType::StorageKind StorageKind
Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTime, 0, MaxRowsAtCompileTime, MaxColsAtCompileTime > DenseMatrixType
DiagonalMatrix & operator=(const DiagonalMatrix &other)
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
internal::traits< Derived >::StorageKind StorageKind
NumTraits< Scalar >::Real RealScalar
void subTo(MatrixBase< DenseDerived > &other) const
DiagonalVectorType & diagonal()
_DiagonalVectorType DiagonalVectorType
DiagonalVectorType::Nested m_diagonal
const DiagonalWrapper< const CwiseUnaryOp< internal::scalar_inverse_op< Scalar >, const DiagonalVectorType > > inverse() const
Expression of a diagonal matrix.
void setIdentity(Index size)
internal::traits< DiagonalMatrix >::DiagonalVectorType DiagonalVectorType
const Derived & derived() const
DiagonalVectorType & diagonal()
DiagonalMatrix(const MatrixBase< OtherDerived > &other)
bool isDiagonal(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
const DiagonalWrapper< const Derived > asDiagonal() const
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
const DiagonalProduct< MatrixDerived, Derived, OnTheLeft > operator*(const MatrixBase< MatrixDerived > &matrix) const