openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
Public Member Functions | List of all members
SF::vector< T > Class Template Reference

A vector storing arbitrary data. More...

#include <SF_vector.h>

Inheritance diagram for SF::vector< T >:
Collaboration diagram for SF::vector< T >:

Public Member Functions

 vector ()
 Initialize an empty vector. More...
 
 vector (size_t n)
 Initialize a vector of size n. More...
 
 vector (size_t n, const T val)
 Initialize a vector of size n and of constant value val. More...
 
 vector (const vector< T > &vec)
 Initialize a vector from another vector. More...
 
virtual ~vector ()
 
const T & operator[] (size_t i) const
 Vector access. More...
 
T & operator[] (size_t i)
 Vector access. More...
 
void operator= (const vector< T > &vec)
 Deep copy of a vector. More...
 
T * data ()
 Pointer to the vector's start. More...
 
const T * data () const
 Pointer to the vector's start. More...
 
size_t size () const
 The current size of the vector. More...
 
size_t capacity () const
 The maximum amount of entries the vector can hold without reallocating. More...
 
const T * begin () const
 Pointer to the vector's start. More...
 
T * begin ()
 Pointer to the vector's start. More...
 
const T * end () const
 Pointer to the vector's end. More...
 
T * end ()
 Pointer to the vector's end. More...
 
T & front ()
 
T & back ()
 
const T & front () const
 
const T & back () const
 
template<class InputIterator >
void assign (InputIterator s, InputIterator e)
 Assign a memory range. More...
 
void assign (size_t n, T val=T())
 Assign n many elements of value val. More...
 
void assign (size_t n, T *array, bool del=true)
 Make a vector point to an existing array. More...
 
void resize (size_t n)
 Resize a vector. More...
 
void resize (size_t n, const T val)
 Resize a vector setting the newly allocated elements to val. More...
 
void reserve (size_t n)
 
void zero ()
 
void reallocate ()
 
template<class InputIterator >
void append (InputIterator s, InputIterator e)
 Append data to the current data chunk. More...
 
T & push_back (T val)
 

Detailed Description

template<class T>
class SF::vector< T >

A vector storing arbitrary data.

The design and API are similar to std::vector.

Definition at line 42 of file SF_vector.h.

Constructor & Destructor Documentation

◆ vector() [1/4]

template<class T>
SF::vector< T >::vector ( )
inline

Initialize an empty vector.

Definition at line 46 of file SF_vector.h.

◆ vector() [2/4]

template<class T>
SF::vector< T >::vector ( size_t  n)
inline

Initialize a vector of size n.

Definition at line 50 of file SF_vector.h.

◆ vector() [3/4]

template<class T>
SF::vector< T >::vector ( size_t  n,
const T  val 
)
inline

Initialize a vector of size n and of constant value val.

Definition at line 56 of file SF_vector.h.

◆ vector() [4/4]

template<class T>
SF::vector< T >::vector ( const vector< T > &  vec)
inline

Initialize a vector from another vector.

Definition at line 62 of file SF_vector.h.

◆ ~vector()

template<class T>
virtual SF::vector< T >::~vector ( )
inlinevirtual

Definition at line 67 of file SF_vector.h.

Member Function Documentation

◆ append()

template<class T>
template<class InputIterator >
void SF::vector< T >::append ( InputIterator  s,
InputIterator  e 
)
inline

Append data to the current data chunk.

Definition at line 268 of file SF_vector.h.

Here is the caller graph for this function:

◆ assign() [1/3]

template<class T>
template<class InputIterator >
void SF::vector< T >::assign ( InputIterator  s,
InputIterator  e 
)
inline

Assign a memory range.

Definition at line 161 of file SF_vector.h.

Here is the caller graph for this function:

◆ assign() [2/3]

template<class T>
void SF::vector< T >::assign ( size_t  n,
val = T() 
)
inline

Assign n many elements of value val.

Definition at line 184 of file SF_vector.h.

◆ assign() [3/3]

template<class T>
void SF::vector< T >::assign ( size_t  n,
T *  array,
bool  del = true 
)
inline

Make a vector point to an existing array.

Only recommended for experts.

Definition at line 201 of file SF_vector.h.

◆ back() [1/2]

template<class T>
T& SF::vector< T >::back ( )
inline

Definition at line 144 of file SF_vector.h.

Here is the caller graph for this function:

◆ back() [2/2]

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

Definition at line 154 of file SF_vector.h.

◆ begin() [1/2]

template<class T>
const T* SF::vector< T >::begin ( ) const
inline

Pointer to the vector's start.

Definition at line 116 of file SF_vector.h.

Here is the caller graph for this function:

◆ begin() [2/2]

template<class T>
T* SF::vector< T >::begin ( )
inline

Pointer to the vector's start.

Definition at line 122 of file SF_vector.h.

◆ capacity()

template<class T>
size_t SF::vector< T >::capacity ( ) const
inline

The maximum amount of entries the vector can hold without reallocating.

Definition at line 110 of file SF_vector.h.

◆ data() [1/2]

template<class T>
T* SF::vector< T >::data ( )
inline

Pointer to the vector's start.

Definition at line 91 of file SF_vector.h.

Here is the caller graph for this function:

◆ data() [2/2]

template<class T>
const T* SF::vector< T >::data ( ) const
inline

Pointer to the vector's start.

Definition at line 97 of file SF_vector.h.

◆ end() [1/2]

template<class T>
const T* SF::vector< T >::end ( ) const
inline

Pointer to the vector's end.

Definition at line 128 of file SF_vector.h.

Here is the caller graph for this function:

◆ end() [2/2]

template<class T>
T* SF::vector< T >::end ( )
inline

Pointer to the vector's end.

Definition at line 134 of file SF_vector.h.

◆ front() [1/2]

template<class T>
T& SF::vector< T >::front ( )
inline

Definition at line 139 of file SF_vector.h.

◆ front() [2/2]

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

Definition at line 149 of file SF_vector.h.

◆ operator=()

template<class T>
void SF::vector< T >::operator= ( const vector< T > &  vec)
inline

Deep copy of a vector.

Definition at line 85 of file SF_vector.h.

◆ operator[]() [1/2]

template<class T>
const T& SF::vector< T >::operator[] ( size_t  i) const
inline

Vector access.

Definition at line 73 of file SF_vector.h.

◆ operator[]() [2/2]

template<class T>
T& SF::vector< T >::operator[] ( size_t  i)
inline

Vector access.

Definition at line 79 of file SF_vector.h.

◆ push_back()

template<class T>
T& SF::vector< T >::push_back ( val)
inline

Definition at line 283 of file SF_vector.h.

Here is the caller graph for this function:

◆ reallocate()

template<class T>
void SF::vector< T >::reallocate ( )
inline

Allocate new data chunk for the current size. This is useful if the vector has been resized to a considerably smaller size.

Definition at line 257 of file SF_vector.h.

Here is the caller graph for this function:

◆ reserve()

template<class T>
void SF::vector< T >::reserve ( size_t  n)
inline

Definition at line 241 of file SF_vector.h.

Here is the caller graph for this function:

◆ resize() [1/2]

template<class T>
void SF::vector< T >::resize ( size_t  n)
inline

Resize a vector.

Definition at line 209 of file SF_vector.h.

◆ resize() [2/2]

template<class T>
void SF::vector< T >::resize ( size_t  n,
const T  val 
)
inline

Resize a vector setting the newly allocated elements to val.

Definition at line 228 of file SF_vector.h.

◆ size()

template<class T>
size_t SF::vector< T >::size ( ) const
inline

The current size of the vector.

Definition at line 104 of file SF_vector.h.

◆ zero()

template<class T>
void SF::vector< T >::zero ( )
inline

Definition at line 248 of file SF_vector.h.

Here is the caller graph for this function:

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