25 #ifndef EIGEN_SKYLINEMATRIXBASE_H
26 #define EIGEN_SKYLINEMATRIXBASE_H
28 #include "SkylineUtil.h"
44 typedef typename internal::traits<Derived>::Scalar Scalar;
45 typedef typename internal::traits<Derived>::StorageKind StorageKind;
46 typedef typename internal::index<StorageKind>::type Index;
62 SizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::RowsAtCompileTime,
63 internal::traits<Derived>::ColsAtCompileTime>::ret),
71 MaxSizeAtCompileTime = (internal::size_at_compile_time<MaxRowsAtCompileTime,
72 MaxColsAtCompileTime>::ret),
80 Flags = internal::traits<Derived>::Flags,
93 #ifndef EIGEN_PARSED_BY_DOXYGEN
100 typedef typename NumTraits<Scalar>::Real RealScalar;
106 inline const Derived& derived()
const {
107 return *
static_cast<const Derived*
> (
this);
110 inline Derived& derived() {
111 return *
static_cast<Derived*
> (
this);
114 inline Derived& const_cast_derived()
const {
115 return *
static_cast<Derived*
> (
const_cast<SkylineMatrixBase*
> (
this));
117 #endif // not EIGEN_PARSED_BY_DOXYGEN
121 return derived().rows();
126 return derived().cols();
138 return derived().nonZeros();
153 bool isRValue()
const {
157 Derived& markAsRValue() {
162 SkylineMatrixBase() : m_isRValue(false) {
166 inline Derived & operator=(
const Derived& other) {
167 this->
operator=<Derived > (other);
171 template<
typename OtherDerived>
172 inline void assignGeneric(
const OtherDerived& other) {
173 derived().resize(other.rows(), other.cols());
176 if (other.coeff(row, col) != Scalar(0))
177 derived().insert(row, col) = other.coeff(row, col);
179 derived().finalize();
182 template<
typename OtherDerived>
183 inline Derived & operator=(
const SkylineMatrixBase<OtherDerived>& other) {
187 template<
typename Lhs,
typename Rhs>
188 inline Derived & operator=(
const SkylineProduct<Lhs, Rhs, SkylineTimeSkylineProduct>& product);
190 friend std::ostream & operator <<(std::ostream & s,
const SkylineMatrixBase& m) {
195 template<
typename OtherDerived>
196 const typename SkylineProductReturnType<Derived, OtherDerived>::Type
197 operator*(
const MatrixBase<OtherDerived> &other)
const;
200 template<
typename DenseDerived>
201 void evalTo(MatrixBase<DenseDerived>& dst)
const {
203 for (Index i = 0; i <
rows(); i++)
204 for (Index j = 0; j <
rows(); j++)
205 dst(i, j) = derived().coeff(i, j);
208 Matrix<Scalar, RowsAtCompileTime, ColsAtCompileTime> toDense()
const {
217 EIGEN_STRONG_INLINE
const typename internal::eval<Derived, IsSkyline>::type
eval()
const {
218 return typename internal::eval<Derived>::type(derived());
227 #endif // EIGEN_SkylineMatrixBase_H