Eigen::SkylineStorage< Scalar > Class Template Reference

Public Member Functions

Index allocatedSize () const
 
void clear ()
 
Scalar & diag (Index i)
 
const Scalar & diag (Index i) const
 
Index diagSize () const
 
Scalar & lower (Index i)
 
const Scalar & lower (Index i) const
 
IndexlowerProfile (Index i)
 
const IndexlowerProfile (Index i) const
 
Index lowerProfileSize () const
 
Index lowerSize () const
 
SkylineStorageoperator= (const SkylineStorage &other)
 
void prune (Scalar reference, RealScalar epsilon=dummy_precision< RealScalar >())
 
void reserve (Index size, Index upperProfileSize, Index lowerProfileSize, Index upperSize, Index lowerSize)
 
void reset ()
 
void resize (Index diagSize, Index upperProfileSize, Index lowerProfileSize, Index upperSize, Index lowerSize, float reserveSizeFactor=0)
 
 SkylineStorage ()
 
 SkylineStorage (const SkylineStorage &other)
 
void squeeze ()
 
void swap (SkylineStorage &other)
 
Scalar & upper (Index i)
 
const Scalar & upper (Index i) const
 
IndexupperProfile (Index i)
 
const IndexupperProfile (Index i) const
 
Index upperProfileSize () const
 
Index upperSize () const
 
 ~SkylineStorage ()
 

Static Public Member Functions

static SkylineStorage Map (Index *upperProfile, Index *lowerProfile, Scalar *diag, Scalar *upper, Scalar *lower, Index size, Index upperSize, Index lowerSize)
 

Public Attributes

Index m_allocatedSize
 
Scalar * m_diag
 
Index m_diagSize
 
Scalar * m_lower
 
Indexm_lowerProfile
 
Index m_lowerProfileSize
 
Index m_lowerSize
 
Scalar * m_upper
 
Indexm_upperProfile
 
Index m_upperProfileSize
 
Index m_upperSize
 

Protected Member Functions

void reallocate (Index diagSize, Index upperProfileSize, Index lowerProfileSize, Index upperSize, Index lowerSize)
 

Private Types

typedef SparseIndex Index
 
typedef NumTraits< Scalar >::Real RealScalar
 

Detailed Description

template<typename Scalar>
class Eigen::SkylineStorage< Scalar >

Stores a skyline set of values in three structures : The diagonal elements The upper elements The lower elements

Definition at line 24 of file SkylineStorage.h.

Member Typedef Documentation

◆ Index

template<typename Scalar >
typedef SparseIndex Eigen::SkylineStorage< Scalar >::Index
private

Definition at line 26 of file SkylineStorage.h.

◆ RealScalar

template<typename Scalar >
typedef NumTraits<Scalar>::Real Eigen::SkylineStorage< Scalar >::RealScalar
private

Definition at line 25 of file SkylineStorage.h.

Constructor & Destructor Documentation

◆ SkylineStorage() [1/2]

template<typename Scalar >
Eigen::SkylineStorage< Scalar >::SkylineStorage ( )
inline

Definition at line 29 of file SkylineStorage.h.

◆ SkylineStorage() [2/2]

template<typename Scalar >
Eigen::SkylineStorage< Scalar >::SkylineStorage ( const SkylineStorage< Scalar > &  other)
inline

Definition at line 43 of file SkylineStorage.h.

44  : m_diag(0),
45  m_lower(0),
46  m_upper(0),
47  m_lowerProfile(0),
48  m_upperProfile(0),
49  m_diagSize(0),
50  m_upperSize(0),
51  m_lowerSize(0),
54  m_allocatedSize(0) {
55  *this = other;
56  }

◆ ~SkylineStorage()

template<typename Scalar >
Eigen::SkylineStorage< Scalar >::~SkylineStorage ( )
inline

Definition at line 80 of file SkylineStorage.h.

80  {
81  delete[] m_diag;
82  delete[] m_upper;
83  if (m_upper != m_lower)
84  delete[] m_lower;
85  delete[] m_upperProfile;
86  delete[] m_lowerProfile;
87  }

Member Function Documentation

◆ allocatedSize()

template<typename Scalar >
Index Eigen::SkylineStorage< Scalar >::allocatedSize ( ) const
inline

Definition at line 130 of file SkylineStorage.h.

130  {
131  return m_allocatedSize;
132  }

◆ clear()

template<typename Scalar >
void Eigen::SkylineStorage< Scalar >::clear ( )
inline

Definition at line 134 of file SkylineStorage.h.

134  {
135  m_diagSize = 0;
136  }

◆ diag() [1/2]

template<typename Scalar >
Scalar& Eigen::SkylineStorage< Scalar >::diag ( Index  i)
inline

Definition at line 138 of file SkylineStorage.h.

138  {
139  return m_diag[i];
140  }
int i

◆ diag() [2/2]

template<typename Scalar >
const Scalar& Eigen::SkylineStorage< Scalar >::diag ( Index  i) const
inline

Definition at line 142 of file SkylineStorage.h.

142  {
143  return m_diag[i];
144  }

◆ diagSize()

template<typename Scalar >
Index Eigen::SkylineStorage< Scalar >::diagSize ( ) const
inline

Definition at line 110 of file SkylineStorage.h.

110  {
111  return m_diagSize;
112  }

◆ lower() [1/2]

template<typename Scalar >
Scalar& Eigen::SkylineStorage< Scalar >::lower ( Index  i)
inline

Definition at line 154 of file SkylineStorage.h.

154  {
155  return m_lower[i];
156  }

◆ lower() [2/2]

template<typename Scalar >
const Scalar& Eigen::SkylineStorage< Scalar >::lower ( Index  i) const
inline

Definition at line 158 of file SkylineStorage.h.

158  {
159  return m_lower[i];
160  }

◆ lowerProfile() [1/2]

template<typename Scalar >
Index& Eigen::SkylineStorage< Scalar >::lowerProfile ( Index  i)
inline

Definition at line 170 of file SkylineStorage.h.

170  {
171  return m_lowerProfile[i];
172  }

◆ lowerProfile() [2/2]

template<typename Scalar >
const Index& Eigen::SkylineStorage< Scalar >::lowerProfile ( Index  i) const
inline

Definition at line 174 of file SkylineStorage.h.

174  {
175  return m_lowerProfile[i];
176  }

◆ lowerProfileSize()

template<typename Scalar >
Index Eigen::SkylineStorage< Scalar >::lowerProfileSize ( ) const
inline

Definition at line 126 of file SkylineStorage.h.

126  {
127  return m_lowerProfileSize;
128  }

◆ lowerSize()

template<typename Scalar >
Index Eigen::SkylineStorage< Scalar >::lowerSize ( ) const
inline

Definition at line 118 of file SkylineStorage.h.

118  {
119  return m_lowerSize;
120  }

◆ Map()

template<typename Scalar >
static SkylineStorage Eigen::SkylineStorage< Scalar >::Map ( Index upperProfile,
Index lowerProfile,
Scalar *  diag,
Scalar *  upper,
Scalar *  lower,
Index  size,
Index  upperSize,
Index  lowerSize 
)
inlinestatic

Definition at line 178 of file SkylineStorage.h.

178  {
180  res.m_upperProfile = upperProfile;
181  res.m_lowerProfile = lowerProfile;
182  res.m_diag = diag;
183  res.m_upper = upper;
184  res.m_lower = lower;
185  res.m_allocatedSize = res.m_diagSize = size;
186  res.m_upperSize = upperSize;
187  res.m_lowerSize = lowerSize;
188  return res;
189  }
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Index & upperProfile(Index i)
Index & lowerProfile(Index i)
Index upperSize() const
Scalar & lower(Index i)
Index lowerSize() const
Scalar & upper(Index i)
Scalar & diag(Index i)
SparseMat::Index size

◆ operator=()

template<typename Scalar >
SkylineStorage& Eigen::SkylineStorage< Scalar >::operator= ( const SkylineStorage< Scalar > &  other)
inline

Definition at line 58 of file SkylineStorage.h.

58  {
59  resize(other.diagSize(), other.m_upperProfileSize, other.m_lowerProfileSize, other.upperSize(), other.lowerSize());
60  memcpy(m_diag, other.m_diag, m_diagSize * sizeof (Scalar));
61  memcpy(m_upper, other.m_upper, other.upperSize() * sizeof (Scalar));
62  memcpy(m_lower, other.m_lower, other.lowerSize() * sizeof (Scalar));
63  memcpy(m_upperProfile, other.m_upperProfile, m_upperProfileSize * sizeof (Index));
64  memcpy(m_lowerProfile, other.m_lowerProfile, m_lowerProfileSize * sizeof (Index));
65  return *this;
66  }
void resize(Index diagSize, Index upperProfileSize, Index lowerProfileSize, Index upperSize, Index lowerSize, float reserveSizeFactor=0)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index

◆ prune()

template<typename Scalar >
void Eigen::SkylineStorage< Scalar >::prune ( Scalar  reference,
RealScalar  epsilon = dummy_precision<RealScalar>() 
)
inline

Definition at line 199 of file SkylineStorage.h.

199  {
200  //TODO
201  }

◆ reallocate()

template<typename Scalar >
void Eigen::SkylineStorage< Scalar >::reallocate ( Index  diagSize,
Index  upperProfileSize,
Index  lowerProfileSize,
Index  upperSize,
Index  lowerSize 
)
inlineprotected

Definition at line 205 of file SkylineStorage.h.

205  {
206 
207  Scalar* diag = new Scalar[diagSize];
208  Scalar* upper = new Scalar[upperSize];
209  Scalar* lower = new Scalar[lowerSize];
212 
213  Index copyDiagSize = (std::min)(diagSize, m_diagSize);
214  Index copyUpperSize = (std::min)(upperSize, m_upperSize);
215  Index copyLowerSize = (std::min)(lowerSize, m_lowerSize);
216  Index copyUpperProfileSize = (std::min)(upperProfileSize, m_upperProfileSize);
217  Index copyLowerProfileSize = (std::min)(lowerProfileSize, m_lowerProfileSize);
218 
219  // copy
220  memcpy(diag, m_diag, copyDiagSize * sizeof (Scalar));
221  memcpy(upper, m_upper, copyUpperSize * sizeof (Scalar));
222  memcpy(lower, m_lower, copyLowerSize * sizeof (Scalar));
223  memcpy(upperProfile, m_upperProfile, copyUpperProfileSize * sizeof (Index));
224  memcpy(lowerProfile, m_lowerProfile, copyLowerProfileSize * sizeof (Index));
225 
226 
227 
228  // delete old stuff
229  delete[] m_diag;
230  delete[] m_upper;
231  delete[] m_lower;
232  delete[] m_upperProfile;
233  delete[] m_lowerProfile;
234  m_diag = diag;
235  m_upper = upper;
236  m_lower = lower;
242  }
Index lowerProfileSize() const
Index diagSize() const
Index upperProfileSize() const
CleanedUpDerType< DerType >::type() min(const AutoDiffScalar< DerType > &x, const T &y)

◆ reserve()

template<typename Scalar >
void Eigen::SkylineStorage< Scalar >::reserve ( Index  size,
Index  upperProfileSize,
Index  lowerProfileSize,
Index  upperSize,
Index  lowerSize 
)
inline

Definition at line 89 of file SkylineStorage.h.

89  {
90  Index newAllocatedSize = size + upperSize + lowerSize;
91  if (newAllocatedSize > m_allocatedSize)
93  }
void reallocate(Index diagSize, Index upperProfileSize, Index lowerProfileSize, Index upperSize, Index lowerSize)

◆ reset()

template<typename Scalar >
void Eigen::SkylineStorage< Scalar >::reset ( )
inline

Definition at line 191 of file SkylineStorage.h.

191  {
192  std::fill_n(m_diag, m_diagSize, Scalar(0));
193  std::fill_n(m_upper, m_upperSize, Scalar(0));
194  std::fill_n(m_lower, m_lowerSize, Scalar(0));
195  std::fill_n(m_upperProfile, m_diagSize, Index(0));
196  std::fill_n(m_lowerProfile, m_diagSize, Index(0));
197  }

◆ resize()

template<typename Scalar >
void Eigen::SkylineStorage< Scalar >::resize ( Index  diagSize,
Index  upperProfileSize,
Index  lowerProfileSize,
Index  upperSize,
Index  lowerSize,
float  reserveSizeFactor = 0 
)
inline

Definition at line 100 of file SkylineStorage.h.

◆ squeeze()

template<typename Scalar >
void Eigen::SkylineStorage< Scalar >::squeeze ( )
inline

◆ swap()

template<typename Scalar >
void Eigen::SkylineStorage< Scalar >::swap ( SkylineStorage< Scalar > &  other)
inline

Definition at line 68 of file SkylineStorage.h.

68  {
69  std::swap(m_diag, other.m_diag);
70  std::swap(m_upper, other.m_upper);
71  std::swap(m_lower, other.m_lower);
72  std::swap(m_upperProfile, other.m_upperProfile);
73  std::swap(m_lowerProfile, other.m_lowerProfile);
74  std::swap(m_diagSize, other.m_diagSize);
75  std::swap(m_upperSize, other.m_upperSize);
76  std::swap(m_lowerSize, other.m_lowerSize);
77  std::swap(m_allocatedSize, other.m_allocatedSize);
78  }

◆ upper() [1/2]

template<typename Scalar >
Scalar& Eigen::SkylineStorage< Scalar >::upper ( Index  i)
inline

Definition at line 146 of file SkylineStorage.h.

146  {
147  return m_upper[i];
148  }

◆ upper() [2/2]

template<typename Scalar >
const Scalar& Eigen::SkylineStorage< Scalar >::upper ( Index  i) const
inline

Definition at line 150 of file SkylineStorage.h.

150  {
151  return m_upper[i];
152  }

◆ upperProfile() [1/2]

template<typename Scalar >
Index& Eigen::SkylineStorage< Scalar >::upperProfile ( Index  i)
inline

Definition at line 162 of file SkylineStorage.h.

162  {
163  return m_upperProfile[i];
164  }

◆ upperProfile() [2/2]

template<typename Scalar >
const Index& Eigen::SkylineStorage< Scalar >::upperProfile ( Index  i) const
inline

Definition at line 166 of file SkylineStorage.h.

166  {
167  return m_upperProfile[i];
168  }

◆ upperProfileSize()

template<typename Scalar >
Index Eigen::SkylineStorage< Scalar >::upperProfileSize ( ) const
inline

Definition at line 122 of file SkylineStorage.h.

122  {
123  return m_upperProfileSize;
124  }

◆ upperSize()

template<typename Scalar >
Index Eigen::SkylineStorage< Scalar >::upperSize ( ) const
inline

Definition at line 114 of file SkylineStorage.h.

114  {
115  return m_upperSize;
116  }

Member Data Documentation

◆ m_allocatedSize

template<typename Scalar >
Index Eigen::SkylineStorage< Scalar >::m_allocatedSize

Definition at line 255 of file SkylineStorage.h.

◆ m_diag

template<typename Scalar >
Scalar* Eigen::SkylineStorage< Scalar >::m_diag

Definition at line 245 of file SkylineStorage.h.

◆ m_diagSize

template<typename Scalar >
Index Eigen::SkylineStorage< Scalar >::m_diagSize

Definition at line 250 of file SkylineStorage.h.

◆ m_lower

template<typename Scalar >
Scalar* Eigen::SkylineStorage< Scalar >::m_lower

Definition at line 247 of file SkylineStorage.h.

◆ m_lowerProfile

template<typename Scalar >
Index* Eigen::SkylineStorage< Scalar >::m_lowerProfile

Definition at line 249 of file SkylineStorage.h.

◆ m_lowerProfileSize

template<typename Scalar >
Index Eigen::SkylineStorage< Scalar >::m_lowerProfileSize

Definition at line 254 of file SkylineStorage.h.

◆ m_lowerSize

template<typename Scalar >
Index Eigen::SkylineStorage< Scalar >::m_lowerSize

Definition at line 252 of file SkylineStorage.h.

◆ m_upper

template<typename Scalar >
Scalar* Eigen::SkylineStorage< Scalar >::m_upper

Definition at line 246 of file SkylineStorage.h.

◆ m_upperProfile

template<typename Scalar >
Index* Eigen::SkylineStorage< Scalar >::m_upperProfile

Definition at line 248 of file SkylineStorage.h.

◆ m_upperProfileSize

template<typename Scalar >
Index Eigen::SkylineStorage< Scalar >::m_upperProfileSize

Definition at line 253 of file SkylineStorage.h.

◆ m_upperSize

template<typename Scalar >
Index Eigen::SkylineStorage< Scalar >::m_upperSize

Definition at line 251 of file SkylineStorage.h.


The documentation for this class was generated from the following file: