sparse_vector< C, T, V > Class Template Reference

#include <sparse_vector.hpp>

List of all members.

Public Member Functions

Protected Attributes

Friends


Detailed Description

template<typename C, typename T, typename V = exact_eq_sparse_vector>
class mmx::sparse_vector< C, T, V >

Definition at line 71 of file sparse_vector.hpp.


Constructor & Destructor Documentation

sparse_vector ( sparse_vector_rep< C, T, V > *  rep2  )  [inline]

Definition at line 96 of file sparse_vector.hpp.

00098 { return v.rep->n; }

sparse_vector ( const sparse_vector_rep< C, T, V > *  rep2,
bool  inc 
) [inline]

Definition at line 96 of file sparse_vector.hpp.

00098 { return v.rep->n; }

sparse_vector ( const sparse_vector< C, T, V > &  x  )  [inline]

Definition at line 96 of file sparse_vector.hpp.

00098 { return v.rep->n; }

~sparse_vector (  )  [inline]

Definition at line 96 of file sparse_vector.hpp.

00098 { return v.rep->n; }

sparse_vector (  )  [inline]

Definition at line 73 of file sparse_vector.hpp.

References sparse_vector< C, T, V >::rep, and Sparse_vector_rep.

00073                           {
00074     rep= new Sparse_vector_rep (mmx_new<Pair > (0), 0); }

sparse_vector ( const T k,
const C v 
) [inline]

Definition at line 75 of file sparse_vector.hpp.

References mmx::C, Pair, sparse_vector< C, T, V >::rep, mmx::set_zero(), and Sparse_vector_rep.

00075                                                 {
00076     typedef typename V::val_op Eq;
00077     static C zero; set_zero (zero);
00078     if (Eq::op (v, zero)) rep= new Sparse_vector_rep (mmx_new<Pair > (0), 0);
00079     else rep= new Sparse_vector_rep (mmx_new<Pair > (1, Pair (k, v)), 1); }

sparse_vector ( const pair< T, C > &  p  )  [inline]

Definition at line 80 of file sparse_vector.hpp.

References sparse_vector< C, T, V >::rep, and Sparse_vector_rep.

00080                                        {
00081     rep= new Sparse_vector_rep (mmx_new<Pair > (1, p), 1); }

sparse_vector ( pair< T, C > *  a,
nat  n 
) [inline]

Definition at line 82 of file sparse_vector.hpp.

References sparse_vector< C, T, V >::rep, and Sparse_vector_rep.

00082                                         {
00083     rep= new Sparse_vector_rep (a, n); }

sparse_vector ( pair< T, C > *  a,
nat  n,
nat  l 
) [inline]

Definition at line 84 of file sparse_vector.hpp.

References sparse_vector< C, T, V >::rep, and Sparse_vector_rep.

00084                                                {
00085     rep= new Sparse_vector_rep (a, n, l); }


Member Function Documentation

void operator delete ( void *  ptr,
size_t  sz 
) [inline]

Definition at line 72 of file sparse_vector.hpp.

00073 {

void operator delete[] ( void *  ptr,
size_t  sz 
) [inline]

Definition at line 72 of file sparse_vector.hpp.

00073 {

void* operator new ( size_t  sz,
void *  where 
) [inline]

Definition at line 72 of file sparse_vector.hpp.

00073 {

void* operator new ( size_t  sz  )  [inline]

Definition at line 72 of file sparse_vector.hpp.

00073 {

void* operator new[] ( size_t  sz,
void *  where 
) [inline]

Definition at line 72 of file sparse_vector.hpp.

00073 {

void* operator new[] ( size_t  sz  )  [inline]

Definition at line 72 of file sparse_vector.hpp.

00073 {

const sparse_vector_rep< C, T, V > * operator-> (  )  const [inline]

Definition at line 96 of file sparse_vector.hpp.

00098 { return v.rep->n; }

sparse_vector< C, T, V > & operator= ( const sparse_vector< C, T, V > &  x  )  [inline]

Definition at line 96 of file sparse_vector.hpp.

00098 { return v.rep->n; }

pair<T,C>& operator[] ( nat  i  )  [inline]

Definition at line 89 of file sparse_vector.hpp.

References n, sparse_vector< C, T, V >::rep, sparse_vector< C, T, V >::secure(), and VERIFY.

00089                                    {
00090     VERIFY (i<rep->n, "index out of range");
00091     secure ();
00092     return rep->a[i]; }

pair<T,C> operator[] ( nat  i  )  const [inline]

Definition at line 86 of file sparse_vector.hpp.

References n, sparse_vector< C, T, V >::rep, and VERIFY.

00086                                         {
00087     VERIFY (i<rep->n, "index out of range");
00088     return rep->a[i]; }

void secure (  )  [inline]

Definition at line 96 of file sparse_vector.hpp.

Referenced by sparse_vector< C, T, V >::operator[]().

00098 { return v.rep->n; }


Friends And Related Function Documentation

nat N ( const sparse_vector< C, T, V > &  v  )  [friend]

Member Data Documentation

sparse_vector_rep< C , T , V >* rep [protected]

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

Generated on 6 Dec 2012 for basix by  doxygen 1.6.1