SparseVector.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2008-2015 Gael Guennebaud <gael.guennebaud@inria.fr>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_SPARSEVECTOR_H
11 #define EIGEN_SPARSEVECTOR_H
12 
13 namespace Eigen {
14 
28 namespace internal {
29 template<typename _Scalar, int _Options, typename _StorageIndex>
30 struct traits<SparseVector<_Scalar, _Options, _StorageIndex> >
31 {
32  typedef _Scalar Scalar;
33  typedef _StorageIndex StorageIndex;
35  typedef MatrixXpr XprKind;
36  enum {
37  IsColVector = (_Options & RowMajorBit) ? 0 : 1,
38 
39  RowsAtCompileTime = IsColVector ? Dynamic : 1,
40  ColsAtCompileTime = IsColVector ? 1 : Dynamic,
41  MaxRowsAtCompileTime = RowsAtCompileTime,
42  MaxColsAtCompileTime = ColsAtCompileTime,
43  Flags = _Options | NestByRefBit | LvalueBit | (IsColVector ? 0 : RowMajorBit) | CompressedAccessBit,
44  SupportedAccessPatterns = InnerRandomAccessPattern
45  };
46 };
47 
48 // Sparse-Vector-Assignment kinds:
49 enum {
53 };
54 
55 template< typename Dest, typename Src,
56  int AssignmentKind = !bool(Src::IsVectorAtCompileTime) ? SVA_RuntimeSwitch
57  : Src::InnerSizeAtCompileTime==1 ? SVA_Outer
58  : SVA_Inner>
60 
61 }
62 
63 template<typename _Scalar, int _Options, typename _StorageIndex>
64 class SparseVector
65  : public SparseCompressedBase<SparseVector<_Scalar, _Options, _StorageIndex> >
66 {
68  using Base::convert_index;
69  public:
73 
74  typedef internal::CompressedStorage<Scalar,StorageIndex> Storage;
76 
77  enum {
78  Options = _Options
79  };
80 
81  EIGEN_STRONG_INLINE Index rows() const { return IsColVector ? m_size : 1; }
82  EIGEN_STRONG_INLINE Index cols() const { return IsColVector ? 1 : m_size; }
84  EIGEN_STRONG_INLINE Index outerSize() const { return 1; }
85 
86  EIGEN_STRONG_INLINE const Scalar* valuePtr() const { return m_data.valuePtr(); }
88 
89  EIGEN_STRONG_INLINE const StorageIndex* innerIndexPtr() const { return m_data.indexPtr(); }
90  EIGEN_STRONG_INLINE StorageIndex* innerIndexPtr() { return m_data.indexPtr(); }
91 
92  inline const StorageIndex* outerIndexPtr() const { return 0; }
93  inline StorageIndex* outerIndexPtr() { return 0; }
94  inline const StorageIndex* innerNonZeroPtr() const { return 0; }
95  inline StorageIndex* innerNonZeroPtr() { return 0; }
96 
98  inline Storage& data() { return m_data; }
100  inline const Storage& data() const { return m_data; }
101 
102  inline Scalar coeff(Index row, Index col) const
103  {
104  eigen_assert(IsColVector ? (col==0 && row>=0 && row<m_size) : (row==0 && col>=0 && col<m_size));
105  return coeff(IsColVector ? row : col);
106  }
107  inline Scalar coeff(Index i) const
108  {
109  eigen_assert(i>=0 && i<m_size);
110  return m_data.at(StorageIndex(i));
111  }
112 
114  {
115  eigen_assert(IsColVector ? (col==0 && row>=0 && row<m_size) : (row==0 && col>=0 && col<m_size));
116  return coeffRef(IsColVector ? row : col);
117  }
118 
126  {
127  eigen_assert(i>=0 && i<m_size);
128 
129  return m_data.atWithInsertion(StorageIndex(i));
130  }
131 
132  public:
133 
136 
137  inline void setZero() { m_data.clear(); }
138 
140  inline Index nonZeros() const { return m_data.size(); }
141 
142  inline void startVec(Index outer)
143  {
144  EIGEN_UNUSED_VARIABLE(outer);
145  eigen_assert(outer==0);
146  }
147 
148  inline Scalar& insertBackByOuterInner(Index outer, Index inner)
149  {
150  EIGEN_UNUSED_VARIABLE(outer);
151  eigen_assert(outer==0);
152  return insertBack(inner);
153  }
155  {
156  m_data.append(0, i);
157  return m_data.value(m_data.size()-1);
158  }
159 
161  {
162  EIGEN_UNUSED_VARIABLE(outer);
163  eigen_assert(outer==0);
164  return insertBackUnordered(inner);
165  }
167  {
168  m_data.append(0, i);
169  return m_data.value(m_data.size()-1);
170  }
171 
173  {
174  eigen_assert(IsColVector ? (col==0 && row>=0 && row<m_size) : (row==0 && col>=0 && col<m_size));
175 
176  Index inner = IsColVector ? row : col;
177  Index outer = IsColVector ? col : row;
179  eigen_assert(outer==0);
180  return insert(inner);
181  }
183  {
184  eigen_assert(i>=0 && i<m_size);
185 
186  Index startId = 0;
187  Index p = Index(m_data.size()) - 1;
188  // TODO smart realloc
189  m_data.resize(p+2,1);
190 
191  while ( (p >= startId) && (m_data.index(p) > i) )
192  {
193  m_data.index(p+1) = m_data.index(p);
194  m_data.value(p+1) = m_data.value(p);
195  --p;
196  }
197  m_data.index(p+1) = convert_index(i);
198  m_data.value(p+1) = 0;
199  return m_data.value(p+1);
200  }
201 
204  inline void reserve(Index reserveSize) { m_data.reserve(reserveSize); }
205 
206 
207  inline void finalize() {}
208 
211  {
213  }
214 
224  {
225  eigen_assert((IsColVector ? cols : rows)==1 && "Outer dimension must equal 1");
227  }
228 
233  void resize(Index newSize)
234  {
235  m_size = newSize;
236  m_data.clear();
237  }
238 
246  void conservativeResize(Index newSize)
247  {
248  if (newSize < m_size)
249  {
250  Index i = 0;
251  while (i<m_data.size() && m_data.index(i)<newSize) ++i;
252  m_data.resize(i);
253  }
254  m_size = newSize;
255  }
256 
258 
260 
262 
264 
265  template<typename OtherDerived>
267  : m_size(0)
268  {
269  #ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
271  #endif
273  *this = other.derived();
274  }
275 
277  : Base(other), m_size(0)
278  {
280  *this = other.derived();
281  }
282 
287  inline void swap(SparseVector& other)
288  {
289  std::swap(m_size, other.m_size);
290  m_data.swap(other.m_data);
291  }
292 
293  template<int OtherOptions>
295  {
296  eigen_assert(other.outerSize()==1);
297  std::swap(m_size, other.m_innerSize);
298  m_data.swap(other.m_data);
299  }
300 
302  {
303  if (other.isRValue())
304  {
305  swap(other.const_cast_derived());
306  }
307  else
308  {
309  resize(other.size());
310  m_data = other.m_data;
311  }
312  return *this;
313  }
314 
315  template<typename OtherDerived>
317  {
318  SparseVector tmp(other.size());
320  this->swap(tmp);
321  return *this;
322  }
323 
324  #ifndef EIGEN_PARSED_BY_DOXYGEN
325  template<typename Lhs, typename Rhs>
327  {
328  return Base::operator=(product);
329  }
330  #endif
331 
332  friend std::ostream & operator << (std::ostream & s, const SparseVector& m)
333  {
334  for (Index i=0; i<m.nonZeros(); ++i)
335  s << "(" << m.m_data.value(i) << "," << m.m_data.index(i) << ") ";
336  s << std::endl;
337  return s;
338  }
339 
341  inline ~SparseVector() {}
342 
344  Scalar sum() const;
345 
346  public:
347 
350  {
351  setZero();
353  }
354 
357  {
358  eigen_assert(r==0 || c==0);
359  return fill(IsColVector ? r : c);
360  }
361 
364  {
365  m_data.append(0, i);
366  return m_data.value(m_data.size()-1);
367  }
368 
371  {
372  eigen_assert(r==0 || c==0);
373  return fillrand(IsColVector ? r : c);
374  }
375 
378  {
379  return insert(i);
380  }
381 
384 
385  // These two functions were here in the 3.1 release, so let's keep them in case some code rely on them.
389  EIGEN_DEPRECATED const Storage& _data() const { return m_data; }
390 
391 # ifdef EIGEN_SPARSEVECTOR_PLUGIN
392 # include EIGEN_SPARSEVECTOR_PLUGIN
393 # endif
394 
395 protected:
396 
398  {
399  EIGEN_STATIC_ASSERT(NumTraits<StorageIndex>::IsSigned,THE_INDEX_TYPE_MUST_BE_A_SIGNED_TYPE);
400  EIGEN_STATIC_ASSERT((_Options&(ColMajor|RowMajor))==Options,INVALID_MATRIX_TEMPLATE_PARAMETERS);
401  }
402 
405 };
406 
407 namespace internal {
408 
409 template<typename _Scalar, int _Options, typename _Index>
410 struct evaluator<SparseVector<_Scalar,_Options,_Index> >
411  : evaluator_base<SparseVector<_Scalar,_Options,_Index> >
412 {
417 
418  enum {
420  Flags = SparseVectorType::Flags
421  };
422 
423  evaluator() : Base() {}
424 
425  explicit evaluator(const SparseVectorType &mat) : m_matrix(&mat)
426  {
427  EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
428  }
429 
430  inline Index nonZerosEstimate() const {
431  return m_matrix->nonZeros();
432  }
433 
434  operator SparseVectorType&() { return m_matrix->const_cast_derived(); }
435  operator const SparseVectorType&() const { return *m_matrix; }
436 
438 };
439 
440 template< typename Dest, typename Src>
442  static void run(Dest& dst, const Src& src) {
443  eigen_internal_assert(src.innerSize()==src.size());
444  typedef internal::evaluator<Src> SrcEvaluatorType;
445  SrcEvaluatorType srcEval(src);
446  for(typename SrcEvaluatorType::InnerIterator it(srcEval, 0); it; ++it)
447  dst.insert(it.index()) = it.value();
448  }
449 };
450 
451 template< typename Dest, typename Src>
453  static void run(Dest& dst, const Src& src) {
454  eigen_internal_assert(src.outerSize()==src.size());
455  typedef internal::evaluator<Src> SrcEvaluatorType;
456  SrcEvaluatorType srcEval(src);
457  for(Index i=0; i<src.size(); ++i)
458  {
459  typename SrcEvaluatorType::InnerIterator it(srcEval, i);
460  if(it)
461  dst.insert(i) = it.value();
462  }
463  }
464 };
465 
466 template< typename Dest, typename Src>
468  static void run(Dest& dst, const Src& src) {
469  if(src.outerSize()==1) sparse_vector_assign_selector<Dest,Src,SVA_Inner>::run(dst, src);
471  }
472 };
473 
474 }
475 
476 } // end namespace Eigen
477 
478 #endif // EIGEN_SPARSEVECTOR_H
Eigen::SparseVector::finalize
void finalize()
Definition: SparseVector.h:207
Eigen::internal::CompressedStorage::reserve
void reserve(Index size)
Definition: CompressedStorage.h:76
Eigen::SparseVector::check_template_parameters
static void check_template_parameters()
Definition: SparseVector.h:397
Eigen::SparseVector::operator=
SparseVector & operator=(const SparseMatrixBase< OtherDerived > &other)
Definition: SparseVector.h:316
Eigen::internal::traits< SparseVector< _Scalar, _Options, _StorageIndex > >::StorageKind
Sparse StorageKind
Definition: SparseVector.h:34
Eigen::MatrixXpr
Definition: Constants.h:522
Eigen::internal::traits< SparseVector< _Scalar, _Options, _StorageIndex > >::StorageIndex
_StorageIndex StorageIndex
Definition: SparseVector.h:33
Eigen::SparseVector::SparseVector
SparseVector(Index size)
Definition: SparseVector.h:261
Eigen::SparseVector::insertBackByOuterInnerUnordered
Scalar & insertBackByOuterInnerUnordered(Index outer, Index inner)
Definition: SparseVector.h:160
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::SparseVector::outerIndexPtr
StorageIndex * outerIndexPtr()
Definition: SparseVector.h:93
Eigen::SparseMatrix
A versatible sparse matrix representation.
Definition: SparseMatrix.h:96
col
m col(1)
Eigen::internal::evaluator< SparseVector< _Scalar, _Options, _Index > >::ReverseInnerIterator
SparseVectorType::ReverseInnerIterator ReverseInnerIterator
Definition: SparseVector.h:416
Eigen::SparseVector::m_data
Storage m_data
Definition: SparseVector.h:403
Eigen::SparseVector::innerIndexPtr
EIGEN_STRONG_INLINE StorageIndex * innerIndexPtr()
Definition: SparseVector.h:90
Eigen::SparseVector::sum
Scalar sum() const
Definition: SparseRedux.h:41
s
RealScalar s
Definition: level1_cplx_impl.h:126
Eigen::internal::traits< SparseVector< _Scalar, _Options, _StorageIndex > >::XprKind
MatrixXpr XprKind
Definition: SparseVector.h:35
Eigen::Sparse
Definition: Constants.h:510
Eigen::internal::CompressedStorage::append
void append(const Scalar &v, Index i)
Definition: CompressedStorage.h:101
Eigen::internal::CompressedStorage::index
StorageIndex & index(Index i)
Definition: CompressedStorage.h:121
Eigen::SparseVector::reserve
void reserve(Index reserveSize)
Definition: SparseVector.h:204
Eigen::SparseVector::SparseVector
SparseVector()
Definition: SparseVector.h:259
c
Scalar Scalar * c
Definition: benchVecAdd.cpp:17
Eigen::SparseVector::endFill
EIGEN_DEPRECATED void endFill()
Definition: SparseVector.h:383
Eigen::internal::CompressedStorage::swap
void swap(CompressedStorage &other)
Definition: CompressedStorage.h:62
Eigen::SparseVector::innerIndexPtr
const EIGEN_STRONG_INLINE StorageIndex * innerIndexPtr() const
Definition: SparseVector.h:89
eigen_assert
#define eigen_assert(x)
Definition: Macros.h:1037
Eigen::SparseVector::SparseVector
SparseVector(const SparseMatrixBase< OtherDerived > &other)
Definition: SparseVector.h:266
Eigen::RowMajorBit
const unsigned int RowMajorBit
Definition: Constants.h:66
Eigen::SparseVector::valuePtr
EIGEN_STRONG_INLINE Scalar * valuePtr()
Definition: SparseVector.h:87
Eigen::CompressedAccessBit
const unsigned int CompressedAccessBit
Definition: Constants.h:191
Eigen::SparseVector::prune
void prune(const Scalar &reference, const RealScalar &epsilon=NumTraits< RealScalar >::dummy_precision())
Definition: SparseVector.h:210
Eigen::internal::sparse_vector_assign_selector< Dest, Src, SVA_RuntimeSwitch >::run
static void run(Dest &dst, const Src &src)
Definition: SparseVector.h:468
EIGEN_DEPRECATED
#define EIGEN_DEPRECATED
Definition: Macros.h:1058
Eigen::SparseVector::resize
void resize(Index rows, Index cols)
Definition: SparseVector.h:223
Eigen::SparseVector::SparseVector
SparseVector(const SparseVector &other)
Definition: SparseVector.h:276
EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR
#define EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(Derived, Op)
Definition: SparseUtil.h:21
Eigen::RowMajor
@ RowMajor
Definition: Constants.h:321
Eigen::SparseVector::startVec
void startVec(Index outer)
Definition: SparseVector.h:142
Eigen::SparseVector::fillrand
EIGEN_DEPRECATED Scalar & fillrand(Index r, Index c)
Definition: SparseVector.h:370
mat
MatrixXf mat
Definition: Tutorial_AdvancedInitialization_CommaTemporary.cpp:1
Eigen::internal::evaluator_base
Definition: CoreEvaluators.h:110
Eigen::SparseVector::outerSize
EIGEN_STRONG_INLINE Index outerSize() const
Definition: SparseVector.h:84
Eigen::internal::evaluator< SparseVector< _Scalar, _Options, _Index > >::Base
evaluator_base< SparseVectorType > Base
Definition: SparseVector.h:414
Eigen::internal::evaluator< SparseVector< _Scalar, _Options, _Index > >::SparseVectorType
SparseVector< _Scalar, _Options, _Index > SparseVectorType
Definition: SparseVector.h:413
Eigen::SparseCompressedBase::InnerIterator
Definition: SparseCompressedBase.h:158
Eigen::SparseVector::insertBackByOuterInner
Scalar & insertBackByOuterInner(Index outer, Index inner)
Definition: SparseVector.h:148
eigen_internal_assert
#define eigen_internal_assert(x)
Definition: Macros.h:1043
Eigen::SparseVector::outerIndexPtr
const StorageIndex * outerIndexPtr() const
Definition: SparseVector.h:92
Eigen::internal::sparse_vector_assign_selector
Definition: SparseVector.h:59
EIGEN_ONLY_USED_FOR_DEBUG
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Definition: Macros.h:1049
Eigen::internal::SVA_Outer
@ SVA_Outer
Definition: SparseVector.h:52
size
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
Eigen::SparseVector::swap
void swap(SparseVector &other)
Definition: SparseVector.h:287
epsilon
static double epsilon
Definition: testRot3.cpp:37
Eigen::SparseVector::innerNonZeroPtr
const StorageIndex * innerNonZeroPtr() const
Definition: SparseVector.h:94
EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
#define EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
Definition: test/sparse_product.cpp:23
Eigen::SparseCompressedBase
Common base class for sparse [compressed]-{row|column}-storage format.
Definition: SparseCompressedBase.h:15
EIGEN_SPARSE_PUBLIC_INTERFACE
#define EIGEN_SPARSE_PUBLIC_INTERFACE(Derived)
Definition: SparseUtil.h:43
Eigen::SparseVector::fill
EIGEN_DEPRECATED Scalar & fill(Index i)
Definition: SparseVector.h:363
Eigen::SparseVector::_data
EIGEN_DEPRECATED Storage & _data()
Definition: SparseVector.h:387
Eigen::SparseVector::nonZeros
Index nonZeros() const
Definition: SparseVector.h:140
Eigen::SparseVector::resize
void resize(Index newSize)
Definition: SparseVector.h:233
EIGEN_UNUSED_VARIABLE
#define EIGEN_UNUSED_VARIABLE(var)
Definition: Macros.h:1076
Eigen::internal::CompressedStorage::size
Index size() const
Definition: CompressedStorage.h:109
Eigen::SparseVector::operator=
SparseVector & operator=(const SparseSparseProduct< Lhs, Rhs > &product)
Definition: SparseVector.h:326
Eigen::LvalueBit
const unsigned int LvalueBit
Definition: Constants.h:144
Eigen::SparseVector::resizeNonZeros
void resizeNonZeros(Index size)
Definition: SparseVector.h:257
Eigen::Dynamic
const int Dynamic
Definition: Constants.h:22
Eigen::SparseVector::_data
const EIGEN_DEPRECATED Storage & _data() const
Definition: SparseVector.h:389
Eigen::SparseVector::conservativeResize
void conservativeResize(Index newSize)
Definition: SparseVector.h:246
Eigen::internal::CompressedStorage::clear
void clear()
Definition: CompressedStorage.h:111
return_value_policy::reference
@ reference
EIGEN_STRONG_INLINE
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
Eigen::internal::CompressedStorage::indexPtr
const StorageIndex * indexPtr() const
Definition: CompressedStorage.h:115
std::swap
void swap(GeographicLib::NearestNeighbor< dist_t, pos_t, distfun_t > &a, GeographicLib::NearestNeighbor< dist_t, pos_t, distfun_t > &b)
Definition: NearestNeighbor.hpp:827
Eigen::SparseVector::data
const Storage & data() const
Definition: SparseVector.h:100
Eigen::SparseVector::rows
EIGEN_STRONG_INLINE Index rows() const
Definition: SparseVector.h:81
Eigen::SparseVector::valuePtr
const EIGEN_STRONG_INLINE Scalar * valuePtr() const
Definition: SparseVector.h:86
Eigen::internal::CompressedStorage::atWithInsertion
Scalar & atWithInsertion(Index key, const Scalar &defaultValue=Scalar(0))
Definition: CompressedStorage.h:174
Eigen::SparseVector::insertBack
Scalar & insertBack(Index i)
Definition: SparseVector.h:154
Eigen::SparseSparseProduct
Definition: SparseUtil.h:61
gtsam.examples.DogLegOptimizerExample.run
def run(args)
Definition: DogLegOptimizerExample.py:21
m
Matrix3f m
Definition: AngleAxis_mimic_euler.cpp:1
Eigen::SparseVector::ReverseInnerIterator
Base::ReverseInnerIterator ReverseInnerIterator
Definition: SparseVector.h:135
Eigen::internal::CompressedStorage::at
Scalar at(Index key, const Scalar &defaultValue=Scalar(0)) const
Definition: CompressedStorage.h:146
Eigen::internal::evaluator< SparseVector< _Scalar, _Options, _Index > >::evaluator
evaluator()
Definition: SparseVector.h:423
Eigen::internal::evaluator
Definition: CoreEvaluators.h:90
Eigen::internal::convert_index
EIGEN_DEVICE_FUNC IndexDest convert_index(const IndexSrc &idx)
Definition: XprHelper.h:31
Eigen::internal::sparse_vector_assign_selector< Dest, Src, SVA_Inner >::run
static void run(Dest &dst, const Src &src)
Definition: SparseVector.h:442
Eigen::internal::CompressedStorage::value
Scalar & value(Index i)
Definition: CompressedStorage.h:118
Eigen::SparseVector::startFill
EIGEN_DEPRECATED void startFill(Index reserve)
Definition: SparseVector.h:349
Eigen::SparseVector::operator=
SparseVector & operator=(const SparseVector &other)
Definition: SparseVector.h:301
Eigen::internal::CompressedStorage::resize
void resize(Index size, double reserveSizeFactor=0)
Definition: CompressedStorage.h:89
Eigen::internal::evaluator< SparseVector< _Scalar, _Options, _Index > >::evaluator
evaluator(const SparseVectorType &mat)
Definition: SparseVector.h:425
Eigen::internal::CompressedStorage::valuePtr
const Scalar * valuePtr() const
Definition: CompressedStorage.h:113
Eigen::SparseVector::SparseVector
SparseVector(Index rows, Index cols)
Definition: SparseVector.h:263
RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:47
Eigen::SparseVector::fill
EIGEN_DEPRECATED Scalar & fill(Index r, Index c)
Definition: SparseVector.h:356
Eigen::SparseVector::Base
SparseCompressedBase< SparseVector > Base
Definition: SparseVector.h:67
Eigen::SparseCompressedBase::ReverseInnerIterator
Definition: SparseCompressedBase.h:244
Eigen::SparseVector::innerSize
EIGEN_STRONG_INLINE Index innerSize() const
Definition: SparseVector.h:83
Eigen::internal::CompressedStorage::prune
void prune(const Scalar &reference, const RealScalar &epsilon=NumTraits< RealScalar >::dummy_precision())
Definition: CompressedStorage.h:226
Eigen::internal::SVA_Inner
@ SVA_Inner
Definition: SparseVector.h:51
Eigen::SparseVector::InnerIterator
Base::InnerIterator InnerIterator
Definition: SparseVector.h:134
Eigen::internal::traits
Definition: ForwardDeclarations.h:17
Eigen::internal::evaluator< SparseVector< _Scalar, _Options, _Index > >::InnerIterator
SparseVectorType::InnerIterator InnerIterator
Definition: SparseVector.h:415
EIGEN_STATIC_ASSERT
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition: StaticAssert.h:127
Eigen::SparseVector::coeffRef
Scalar & coeffRef(Index i)
Definition: SparseVector.h:125
Eigen::internal::sparse_vector_assign_selector< Dest, Src, SVA_Outer >::run
static void run(Dest &dst, const Src &src)
Definition: SparseVector.h:453
row
m row(1)
Eigen::SparseVector
a sparse vector class
Definition: SparseUtil.h:54
p
float * p
Definition: Tutorial_Map_using.cpp:9
Eigen::internal::evaluator< SparseVector< _Scalar, _Options, _Index > >::m_matrix
const SparseVectorType * m_matrix
Definition: SparseVector.h:437
Eigen::SparseVector::insertBackUnordered
Scalar & insertBackUnordered(Index i)
Definition: SparseVector.h:166
Eigen::SparseVector::~SparseVector
~SparseVector()
Definition: SparseVector.h:341
Eigen::SparseMatrixBase
Base class of any sparse matrices or sparse expressions.
Definition: ForwardDeclarations.h:301
Eigen::SparseVector::m_size
Index m_size
Definition: SparseVector.h:404
Eigen::SparseVector::operator<<
friend std::ostream & operator<<(std::ostream &s, const SparseVector &m)
Definition: SparseVector.h:332
Eigen::internal::CompressedStorage< Scalar, StorageIndex >
product
void product(const MatrixType &m)
Definition: product.h:20
Eigen::SparseVector::innerNonZeroPtr
StorageIndex * innerNonZeroPtr()
Definition: SparseVector.h:95
Eigen::internal::evaluator< SparseVector< _Scalar, _Options, _Index > >::nonZerosEstimate
Index nonZerosEstimate() const
Definition: SparseVector.h:430
Eigen::SparseVector::cols
EIGEN_STRONG_INLINE Index cols() const
Definition: SparseVector.h:82
internal
Definition: BandTriangularSolver.h:13
Eigen::ColMajor
@ ColMajor
Definition: Constants.h:319
Eigen::InnerRandomAccessPattern
const int InnerRandomAccessPattern
Definition: SparseUtil.h:48
EIGEN_INTERNAL_CHECK_COST_VALUE
#define EIGEN_INTERNAL_CHECK_COST_VALUE(C)
Definition: StaticAssert.h:218
Eigen::internal::traits< SparseVector< _Scalar, _Options, _StorageIndex > >::Scalar
_Scalar Scalar
Definition: SparseVector.h:32
Eigen::SparseVector::setZero
void setZero()
Definition: SparseVector.h:137
Eigen::SparseVector::fillrand
EIGEN_DEPRECATED Scalar & fillrand(Index i)
Definition: SparseVector.h:377
Eigen::SparseVector::Options
@ Options
Definition: SparseVector.h:78
Eigen::NestByRefBit
const unsigned int NestByRefBit
Definition: Constants.h:169
Eigen::SparseVector::insert
Scalar & insert(Index i)
Definition: SparseVector.h:182
Eigen::SparseVector::IsColVector
@ IsColVector
Definition: SparseVector.h:75
Eigen::SparseVector::coeffRef
Scalar & coeffRef(Index row, Index col)
Definition: SparseVector.h:113
Eigen::SparseVector::swap
void swap(SparseMatrix< Scalar, OtherOptions, StorageIndex > &other)
Definition: SparseVector.h:294
Eigen::SparseVector::data
Storage & data()
Definition: SparseVector.h:98
Eigen::NumTraits
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:232
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Eigen::internal::SVA_RuntimeSwitch
@ SVA_RuntimeSwitch
Definition: SparseVector.h:50
pybind_wrapper_test_script.other
other
Definition: pybind_wrapper_test_script.py:42
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
Eigen::SparseVector::insert
Scalar & insert(Index row, Index col)
Definition: SparseVector.h:172
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Eigen::SparseVector::coeff
Scalar coeff(Index row, Index col) const
Definition: SparseVector.h:102
Eigen::SparseVector::coeff
Scalar coeff(Index i) const
Definition: SparseVector.h:107


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:04:56