11 #ifndef EIGEN_DIAGONALMATRIX_H 12 #define EIGEN_DIAGONALMATRIX_H 16 #ifndef EIGEN_PARSED_BY_DOXYGEN 17 template<
typename Derived>
41 inline const Derived&
derived()
const {
return *
static_cast<const Derived*
>(
this); }
43 inline Derived&
derived() {
return *
static_cast<Derived*
>(
this); }
49 inline const DiagonalVectorType&
diagonal()
const {
return derived().diagonal(); }
58 template<
typename MatrixDerived>
68 inline const InverseReturnType
87 template<
typename OtherDerived>
89 #ifdef EIGEN_PARSED_BY_DOXYGEN 90 inline unspecified_expression_type
99 template<
typename OtherDerived>
101 #ifdef EIGEN_PARSED_BY_DOXYGEN 102 inline unspecified_expression_type
128 template<
typename _Scalar,
int SizeAtCompileTime,
int MaxSizeAtCompileTime>
130 :
traits<Matrix<_Scalar,SizeAtCompileTime,SizeAtCompileTime,0,MaxSizeAtCompileTime,MaxSizeAtCompileTime> >
139 template<
typename _Scalar,
int SizeAtCompileTime,
int MaxSizeAtCompileTime>
141 :
public DiagonalBase<DiagonalMatrix<_Scalar,SizeAtCompileTime,MaxSizeAtCompileTime> >
144 #ifndef EIGEN_PARSED_BY_DOXYGEN 160 inline const DiagonalVectorType&
diagonal()
const {
return m_diagonal; }
163 inline DiagonalVectorType&
diagonal() {
return m_diagonal; }
192 template <
typename... ArgTypes>
195 : m_diagonal(a0, a1, a2, args...) {}
202 : m_diagonal(
list) {}
203 #endif // EIGEN_HAS_CXX11 206 template<
typename OtherDerived>
210 #ifndef EIGEN_PARSED_BY_DOXYGEN 216 template<
typename OtherDerived>
222 template<
typename OtherDerived>
230 #ifndef EIGEN_PARSED_BY_DOXYGEN 247 inline void setZero() { m_diagonal.setZero(); }
274 template<
typename _DiagonalVectorType>
292 template<
typename _DiagonalVectorType>
297 #ifndef EIGEN_PARSED_BY_DOXYGEN 304 explicit inline DiagonalWrapper(DiagonalVectorType& a_diagonal) : m_diagonal(a_diagonal) {}
308 const DiagonalVectorType&
diagonal()
const {
return m_diagonal; }
323 template<
typename Derived>
338 template<
typename Derived>
346 if(absOnDiagonal > maxAbsOnDiagonal) maxAbsOnDiagonal = absOnDiagonal;
366 template<
typename DstXprType,
typename SrcXprType,
typename Functor>
371 Index dstRows = src.rows();
372 Index dstCols = src.cols();
373 if((dst.rows()!=dstRows) || (dst.cols()!=dstCols))
374 dst.resize(dstRows, dstCols);
377 dst.diagonal() = src.diagonal();
381 { dst.diagonal() += src.diagonal(); }
384 { dst.diagonal() -= src.diagonal(); }
391 #endif // EIGEN_DIAGONALMATRIX_H
EIGEN_DEVICE_FUNC Index cols() const
DiagonalMatrix< Scalar, DiagonalVectorType::SizeAtCompileTime, DiagonalVectorType::MaxSizeAtCompileTime > PlainObject
EIGEN_DEVICE_FUNC const Product< Derived, MatrixDerived, LazyProduct > operator*(const MatrixBase< MatrixDerived > &matrix) const
EIGEN_DEVICE_FUNC const DiagonalVectorType & diagonal() const
#define EIGEN_STRONG_INLINE
DiagonalVectorType::StorageIndex StorageIndex
EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
DiagonalShape StorageKind
_DiagonalVectorType DiagonalVectorType
Expression of the product of two arbitrary matrices or vectors.
DenseMatrixType DenseType
DiagonalVectorType::Scalar Scalar
EIGEN_DEVICE_FUNC const DiagonalVectorType & diagonal() const
EIGEN_DEVICE_FUNC friend const DiagonalWrapper< const EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(Scalar, DiagonalVectorType, product) > operator*(const Scalar &scalar, const DiagonalBase &other)
EIGEN_DEVICE_FUNC Derived & derived()
static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op< typename DstXprType::Scalar, typename SrcXprType::Scalar > &)
const unsigned int LvalueBit
Represents a diagonal matrix with its storage.
Namespace containing all symbols from the Eigen library.
EIGEN_DEVICE_FUNC const InverseReturnType inverse() const
EIGEN_DEVICE_FUNC DiagonalMatrix()
DiagonalVectorType::Scalar Scalar
EIGEN_DEVICE_FUNC const DiagonalVectorType & diagonal() const
EIGEN_DEVICE_FUNC DiagonalMatrix(const Scalar &x, const Scalar &y)
Eigen::Index Index
The interface type of indices.
EIGEN_DEVICE_FUNC Index rows() const
internal::traits< Derived >::DiagonalVectorType DiagonalVectorType
static void run(DstXprType &dst, const SrcXprType &src, const internal::sub_assign_op< typename DstXprType::Scalar, typename SrcXprType::Scalar > &)
EIGEN_DEVICE_FUNC const DiagonalWrapper< const EIGEN_CWISE_BINARY_RETURN_TYPE(DiagonalVectorType, typename OtherDerived::DiagonalVectorType, difference) > operator-(const DiagonalBase< OtherDerived > &other) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE internal::enable_if< NumTraits< T >::IsSigned||NumTraits< T >::IsComplex, typename NumTraits< T >::Real >::type abs(const T &x)
EIGEN_DEVICE_FUNC DiagonalMatrix(Index dim)
internal::traits< DiagonalMatrix >::StorageIndex StorageIndex
EIGEN_DEVICE_FUNC void setIdentity(Index size)
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT
DiagonalWrapper< const CwiseUnaryOp< internal::scalar_inverse_op< Scalar >, const DiagonalVectorType > > InverseReturnType
DiagonalVectorType m_diagonal
EIGEN_DEVICE_FUNC DiagonalMatrix & operator=(const DiagonalMatrix &other)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
internal::traits< DiagonalMatrix >::StorageKind StorageKind
bool isDiagonal(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
const DiagonalMatrix & Nested
EIGEN_DEVICE_FUNC DiagonalMatrix & operator=(const DiagonalBase< OtherDerived > &other)
DiagonalVectorType::RealScalar RealScalar
EIGEN_DEVICE_FUNC void resize(Index size)
EIGEN_DEVICE_FUNC const CwiseInverseReturnType cwiseInverse() const
NumTraits< Scalar >::Real RealScalar
EIGEN_DEVICE_FUNC const DiagonalWrapper< const Derived > asDiagonal() const
Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTime, 0, MaxRowsAtCompileTime, MaxColsAtCompileTime > DenseMatrixType
#define EIGEN_DEVICE_FUNC
internal::traits< Derived >::StorageKind StorageKind
EIGEN_DEVICE_FUNC DiagonalVectorType & diagonal()
NumTraits< Scalar >::Real RealScalar
DiagonalShape StorageKind
EIGEN_DEVICE_FUNC DiagonalVectorType & diagonal()
static void run(DstXprType &dst, const SrcXprType &src, const internal::add_assign_op< typename DstXprType::Scalar, typename SrcXprType::Scalar > &)
EIGEN_DEVICE_FUNC const DiagonalWrapper< const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DiagonalVectorType, Scalar, product) > operator*(const Scalar &scalar) const
_DiagonalVectorType DiagonalVectorType
DiagonalVectorType::Nested m_diagonal
Expression of a diagonal matrix.
traits< DiagonalVectorType >::XprKind XprKind
internal::traits< DiagonalMatrix >::DiagonalVectorType DiagonalVectorType
EIGEN_DEVICE_FUNC DiagonalMatrix(const Scalar &x, const Scalar &y, const Scalar &z)
EIGEN_DEVICE_FUNC DenseMatrixType toDenseMatrix() const
EIGEN_DEVICE_FUNC void setIdentity()
EIGEN_DEVICE_FUNC DiagonalMatrix(const MatrixBase< OtherDerived > &other)
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
The matrix class, also used for vectors and row-vectors.
EIGEN_DEVICE_FUNC const DiagonalWrapper< const EIGEN_CWISE_BINARY_RETURN_TYPE(DiagonalVectorType, typename OtherDerived::DiagonalVectorType, sum) > operator+(const DiagonalBase< OtherDerived > &other) const
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
EIGEN_DEVICE_FUNC DiagonalMatrix(const DiagonalBase< OtherDerived > &other)
mxArray * scalar(mxClassID classid)
internal::traits< Derived >::StorageIndex StorageIndex
Base class for all dense matrices, vectors, and expressions.
EIGEN_DEVICE_FUNC void setZero(Index size)
EIGEN_DEVICE_FUNC DiagonalWrapper(DiagonalVectorType &a_diagonal)
DiagonalMatrix(const DiagonalMatrix &other)
EIGEN_DEVICE_FUNC const Derived & derived() const
Matrix< _Scalar, SizeAtCompileTime, 1, 0, MaxSizeAtCompileTime, 1 > DiagonalVectorType
const unsigned int NoPreferredStorageOrderBit
EIGEN_DEVICE_FUNC void setZero()