NumVect< T > Class Template Reference

#include <numvect.h>

Public Types

typedef vector< T >::iterator iterator
 

Public Member Functions

 NumVect ()
 
 NumVect (const NumVect &v)
 
 NumVect (const vector< T > &v)
 
 NumVect (int size)
 
 NumVect (int size, const T &t)
 
void operator= (const NumVect &v)
 
void swap (NumVect &v)
 
const iterator begin ()
 
iterator end ()
 
int size () const
 
bool empty () const
 
void resize (int size)
 
void resize (int size, const T &t)
 
void gen_zero (int size)
 
bool operator== (NumVect< T > &other)
 
void push_back (const T &t)
 
void pop_back ()
 
T & front ()
 
const T & front () const
 
T & back ()
 
const T & back () const
 
void extend (int maxSize)
 
void clear ()
 
T & operator[] (int i)
 
const T & operator[] (int i) const
 
void add (const NumVect< T > &v, int n)
 
void add (const NumVect< T > &v)
 
void sub (const NumVect< T > &v, int n)
 
void sub (const NumVect< T > &v)
 
void mul (const NumVect< T > &v, int b, int n, T c)
 
void mul (const NumVect< T > &v, int n, T c)
 
void mul (const NumVect< T > &v, T c)
 
void div (const NumVect< T > &v, int b, int n, T c)
 
void div (const NumVect< T > &v, int n, T c)
 
void div (const NumVect< T > &v, T c)
 
void addmul (const NumVect< T > &v, T x, int beg, int n)
 
void addmul (const NumVect< T > &v, T x, int n)
 
void addmul (const NumVect< T > &v, T x)
 
void addmul_2exp (const NumVect< T > &v, const T &x, long expo, T &tmp)
 
void addmul_2exp (const NumVect< T > &v, const T &x, long expo, int n, T &tmp)
 
void addmul_si (const NumVect< T > &v, long x)
 
void addmul_si (const NumVect< T > &v, long x, int n)
 
void addmul_si_2exp (const NumVect< T > &v, long x, long expo, T &tmp)
 
void addmul_si_2exp (const NumVect< T > &v, long x, long expo, int n, T &tmp)
 
void rotate_left (int first, int last)
 
void rotate_right (int first, int last)
 
long get_max_exponent ()
 
void fill (long value)
 
bool is_zero (int fromCol=0) const
 
int size_nz () const
 

Friends

ostream & operator (ostream &os, const NumVect< T > &v)
 
istream & operator>> (istream &is, NumVect< T > &v)
 

Member Typedef Documentation

◆ iterator

template<class T >
typedef vector<T>::iterator NumVect< T >::iterator

Constructor & Destructor Documentation

◆ NumVect() [1/5]

template<class T >
NumVect< T >::NumVect ( )
inline

Creates an empty NumVect (0).

◆ NumVect() [2/5]

template<class T >
NumVect< T >::NumVect ( const NumVect< T > &  v)
inline

Initializes NumVect with the elements of the given NumVect.

◆ NumVect() [3/5]

template<class T >
NumVect< T >::NumVect ( const vector< T > &  v)
inline

Initializes NumVect with the elements of a given vector.

◆ NumVect() [4/5]

template<class T >
NumVect< T >::NumVect ( int  size)
inline

Initializes NumVect of specific size, The initial content is undefined.

◆ NumVect() [5/5]

template<class T >
NumVect< T >::NumVect ( int  size,
const T &  t 
)
inline

Member Function Documentation

◆ add() [1/2]

template<class T >
void NumVect< T >::add ( const NumVect< T > &  v)
inline

Addition of two NumVector objects.

◆ add() [2/2]

template<class T >
void NumVect< T >::add ( const NumVect< T > &  v,
int  n 
)

Addition of two NumVector objects, till index n.

◆ addmul() [1/3]

template<class T >
void NumVect< T >::addmul ( const NumVect< T > &  v,
x 
)
inline

Incremeanting each coefficient of NumVector by its product with number c.

◆ addmul() [2/3]

template<class T >
void NumVect< T >::addmul ( const NumVect< T > &  v,
x,
int  beg,
int  n 
)

Incremeanting each coefficient of NumVector by its product with number c, from beg to index n - 1.

◆ addmul() [3/3]

template<class T >
void NumVect< T >::addmul ( const NumVect< T > &  v,
x,
int  n 
)

Incremeanting each coefficient of NumVector by its product with number c, till index n.

◆ addmul_2exp() [1/2]

template<class T >
void NumVect< T >::addmul_2exp ( const NumVect< T > &  v,
const T &  x,
long  expo,
int  n,
T &  tmp 
)

◆ addmul_2exp() [2/2]

template<class T >
void NumVect< T >::addmul_2exp ( const NumVect< T > &  v,
const T &  x,
long  expo,
T &  tmp 
)
inline

◆ addmul_si() [1/2]

template<class T >
void NumVect< T >::addmul_si ( const NumVect< T > &  v,
long  x 
)
inline

◆ addmul_si() [2/2]

template<class T >
void NumVect< T >::addmul_si ( const NumVect< T > &  v,
long  x,
int  n 
)

◆ addmul_si_2exp() [1/2]

template<class T >
void NumVect< T >::addmul_si_2exp ( const NumVect< T > &  v,
long  x,
long  expo,
int  n,
T &  tmp 
)

◆ addmul_si_2exp() [2/2]

template<class T >
void NumVect< T >::addmul_si_2exp ( const NumVect< T > &  v,
long  x,
long  expo,
T &  tmp 
)
inline

◆ back() [1/2]

template<class T >
T & NumVect< T >::back ( )
inline

Returns a reference to the back element of NumVect.

◆ back() [2/2]

template<class T >
const T & NumVect< T >::back ( ) const
inline

Returns a const reference to the back element of NumVect, on constant object.

◆ begin()

template<class T >
const iterator NumVect< T >::begin ( )
inline

Returns an iterator to the beginning of NumVect.

◆ clear()

template<class T >
void NumVect< T >::clear ( )
inline

◆ div() [1/3]

template<class T >
void NumVect< T >::div ( const NumVect< T > &  v,
int  b,
int  n,
c 
)

Division of NumVector and a number c, from index b till index n.

◆ div() [2/3]

template<class T >
void NumVect< T >::div ( const NumVect< T > &  v,
int  n,
c 
)

Division of NumVector and a number c, till index n.

◆ div() [3/3]

template<class T >
void NumVect< T >::div ( const NumVect< T > &  v,
c 
)
inline

Division of NumVector and a number c.

◆ empty()

template<class T >
bool NumVect< T >::empty ( ) const
inline

Checks whether NumVect is empty.

◆ end()

template<class T >
iterator NumVect< T >::end ( )
inline

Returns an iterator to the end of NumVect.

◆ extend()

template<class T >
void NumVect< T >::extend ( int  maxSize)
inline

Extends the size of NumVect, only if it is needed.

◆ fill()

template<class T >
void NumVect< T >::fill ( long  value)

Fills NumVect with the value given.

◆ front() [1/2]

template<class T >
T & NumVect< T >::front ( )
inline

Returns a reference to the front element of NumVect.

◆ front() [2/2]

template<class T >
const T & NumVect< T >::front ( ) const
inline

Returns a const reference to the front element of NumVect, on constant object.

◆ gen_zero()

template<class T >
void NumVect< T >::gen_zero ( int  size)
inline

Sets the size of NumVect and all its elements to zero.

◆ get_max_exponent()

template<class T >
long NumVect< T >::get_max_exponent

Returns expo >= 0 such that all elements are < 2^expo.

◆ is_zero()

template<class T >
bool NumVect< T >::is_zero ( int  fromCol = 0) const

Checks if NumVect has zero elements from fromCol.

◆ mul() [1/3]

template<class T >
void NumVect< T >::mul ( const NumVect< T > &  v,
int  b,
int  n,
c 
)

Multiplication of NumVector and a number c, from index b till index n.

◆ mul() [2/3]

template<class T >
void NumVect< T >::mul ( const NumVect< T > &  v,
int  n,
c 
)

Multiplication of NumVector and a number c, till index n.

◆ mul() [3/3]

template<class T >
void NumVect< T >::mul ( const NumVect< T > &  v,
c 
)
inline

Multiplication of NumVector and a number c.

◆ operator=()

template<class T >
void NumVect< T >::operator= ( const NumVect< T > &  v)
inline

Sets the NumVect to the elements of the given NumVect.

◆ operator==()

template<class T >
bool NumVect< T >::operator== ( NumVect< T > &  other)
inline

Compares two NumVects by comparing the underlying vectors. Returns true if equivalent & false otherwise. Note that this only works if the two NumVects have the same template type parameter.

◆ operator[]() [1/2]

template<class T >
T & NumVect< T >::operator[] ( int  i)
inline

Returns a reference to the i-th element of NumVect.

◆ operator[]() [2/2]

template<class T >
const T & NumVect< T >::operator[] ( int  i) const
inline

Returns a const reference to the i-th element of NumVect on constant object.

◆ pop_back()

template<class T >
void NumVect< T >::pop_back ( )
inline

Removes the back element of NumVect.

◆ push_back()

template<class T >
void NumVect< T >::push_back ( const T &  t)
inline

Inserts an element in the back of NumVect.

◆ resize() [1/2]

template<class T >
void NumVect< T >::resize ( int  size)
inline

Sets the size of NumVect.

◆ resize() [2/2]

template<class T >
void NumVect< T >::resize ( int  size,
const T &  t 
)
inline

Sets the size of NumVect and all its elemnts to t.

◆ rotate_left()

template<class T >
void NumVect< T >::rotate_left ( int  first,
int  last 
)
inline

(v[first],...,v[last]) becomes (v[first+1],...,v[last],v[first])

◆ rotate_right()

template<class T >
void NumVect< T >::rotate_right ( int  first,
int  last 
)
inline

(v[first],...,v[last]) becomes (v[last],v[first],...,v[last-1])

◆ size()

template<class T >
int NumVect< T >::size ( ) const
inline

Returns the number of elements in NumVect.

◆ size_nz()

template<class T >
int NumVect< T >::size_nz

Returns last non-zero index of NumVector.

◆ sub() [1/2]

template<class T >
void NumVect< T >::sub ( const NumVect< T > &  v)
inline

Subtraction of two NumVector objects.

◆ sub() [2/2]

template<class T >
void NumVect< T >::sub ( const NumVect< T > &  v,
int  n 
)

Subtraction of two NumVector objects, till index n.

◆ swap()

template<class T >
void NumVect< T >::swap ( NumVect< T > &  v)
inline

Swaps the data between the NumVect and the given NumVect.

Friends And Related Function Documentation

◆ operator

template<class T >
ostream & operator ( ostream &  os,
const NumVect< T > &  v 
)
friend

◆ operator>>

template<class T >
istream & operator>> ( istream &  is,
NumVect< T > &  v 
)
friend

Reads a NumVect from stream is.


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