10 #ifndef EIGEN_SKYLINEMATRIXBASE_H
11 #define EIGEN_SKYLINEMATRIXBASE_H
13 #include "SkylineUtil.h"
15 #include "./InternalHeaderCheck.h"
31 typedef typename internal::traits<Derived>::Scalar Scalar;
32 typedef typename internal::traits<Derived>::StorageKind StorageKind;
33 typedef typename internal::index<StorageKind>::type Index;
57 MaxSizeAtCompileTime = (internal::size_at_compile_time(MaxRowsAtCompileTime,
58 MaxColsAtCompileTime)),
66 Flags = internal::traits<Derived>::Flags,
79 #ifndef EIGEN_PARSED_BY_DOXYGEN
92 inline const Derived&
derived()
const {
93 return *
static_cast<const Derived*
> (
this);
97 return *
static_cast<Derived*
> (
this);
100 inline Derived& const_cast_derived()
const {
106 inline EIGEN_CONSTEXPR Index
rows() const EIGEN_NOEXCEPT {
111 inline EIGEN_CONSTEXPR Index
cols() const EIGEN_NOEXCEPT {
117 inline EIGEN_CONSTEXPR Index
size() const EIGEN_NOEXCEPT {
139 bool isRValue()
const {
143 Derived& markAsRValue() {
148 SkylineMatrixBase() : m_isRValue(false) {
152 inline Derived & operator=(
const Derived& other) {
153 this->
operator=<Derived > (other);
157 template<
typename OtherDerived>
158 inline void assignGeneric(
const OtherDerived& other) {
159 derived().resize(other.rows(), other.cols());
160 for (Index row = 0; row <
rows(); row++)
161 for (Index col = 0; col <
cols(); col++) {
162 if (other.coeff(row, col) != Scalar(0))
163 derived().insert(row, col) = other.coeff(row, col);
168 template<
typename OtherDerived>
169 inline Derived & operator=(
const SkylineMatrixBase<OtherDerived>& other) {
173 template<
typename Lhs,
typename Rhs>
174 inline Derived & operator=(
const SkylineProduct<Lhs, Rhs, SkylineTimeSkylineProduct>& product);
176 friend std::ostream & operator <<(std::ostream & s,
const SkylineMatrixBase& m) {
181 template<
typename OtherDerived>
182 const typename SkylineProductReturnType<Derived, OtherDerived>::Type
183 operator*(
const MatrixBase<OtherDerived> &other)
const;
186 template<
typename DenseDerived>
187 void evalTo(MatrixBase<DenseDerived>& dst)
const {
189 for (Index i = 0; i <
rows(); i++)
190 for (Index j = 0; j <
rows(); j++)
191 dst(i, j) =
derived().coeff(i, j);
194 Matrix<Scalar, RowsAtCompileTime, ColsAtCompileTime> toDense()
const {
203 EIGEN_STRONG_INLINE
const typename internal::eval<Derived, IsSkyline>::type
eval()
const {
204 return typename internal::eval<Derived>::type(
derived());
Base class of any skyline matrices or skyline expressions.
Definition: SkylineMatrixBase.h:28
EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT
Definition: SkylineMatrixBase.h:117
@ SizeAtCompileTime
Definition: SkylineMatrixBase.h:49
@ ColsAtCompileTime
Definition: SkylineMatrixBase.h:42
@ CoeffReadCost
Definition: SkylineMatrixBase.h:71
@ RowsAtCompileTime
Definition: SkylineMatrixBase.h:36
@ Flags
Definition: SkylineMatrixBase.h:66
@ IsVectorAtCompileTime
Definition: SkylineMatrixBase.h:60
Index outerSize() const
Definition: SkylineMatrixBase.h:129
const internal::eval< Derived, IsSkyline >::type eval() const
Definition: SkylineMatrixBase.h:203
Index innerSize() const
Definition: SkylineMatrixBase.h:135
Index nonZeros() const
Definition: SkylineMatrixBase.h:123
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: SkylineMatrixBase.h:106
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: SkylineMatrixBase.h:111
const unsigned int RowMajorBit
Namespace containing all symbols from the Eigen library.