Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
Bial::Vector< D > Class Template Reference

#include <BinaryCOG.hpp>

Collaboration diagram for Bial::Vector< D >:
Collaboration graph

Public Member Functions

 Vector ()
 Basic Constructors. More...
 
 Vector (size_t n)
 
 Vector (size_t n, const D &val)
 
template<class InputIterator >
 Vector (InputIterator first, InputIterator last)
 
 Vector (const Vector< D > &x)
 
 Vector (Vector< D > &&x)
 
 Vector (const std::vector< D > &x)
 
 Vector (std::vector< D > &&x)
 
 Vector (std::initializer_list< D > il)
 
template<class D2 >
 Vector (const Vector< D2 > &src)
 
template<class D2 >
 Vector (const std::vector< D2 > &src)
 
 Vector (D *new_data, size_t new_size)
 Basic Constructor. This constructor works as a wrapper for data already allocated. It will use the same space pointed by new_data to manipulate the vector. Use this for compatibility with other data structures, in a easy convertion to Vector class. More...
 
Vector< D > & operator= (const Vector< D > &x)
 Assign operator. More...
 
Vector< D > & operator= (Vector< D > &&x)
 
Vector< D > & operator= (std::initializer_list< D > il)
 
Vector< D > & operator= (double val)
 
template<class D2 >
Vector< D > & operator+= (const Vector< D2 > &other)
 Arithmetic operators. More...
 
template<class D2 >
Vector< D > & operator-= (const Vector< D2 > &other)
 
template<class D2 >
Vector< D > & operator*= (const Vector< D2 > &other)
 
template<class D2 >
Vector< D > & operator/= (const Vector< D2 > &other)
 
template<class D2 >
Vector< D > operator+ (const Vector< D2 > &other) const
 
template<class D2 >
Vector< D > operator- (const Vector< D2 > &other) const
 
template<class D2 >
Vector< D > operator* (const Vector< D2 > &other) const
 
template<class D2 >
Vector< D > operator/ (const Vector< D2 > &other) const
 
Vector< D > & operator+= (const double scalar)
 
Vector< D > & operator-= (const double scalar)
 
Vector< D > & operator*= (const double scalar)
 
Vector< D > & operator/= (const double scalar)
 
Vector< D > operator+ (const double scalar) const
 
Vector< D > operator- (const double scalar) const
 
Vector< D > operator* (const double scalar) const
 
Vector< D > operator/ (const double scalar) const
 
void Abs ()
 Computes the absolute value of vector. More...
 
Vector< D > Abs () const
 Computes the absolute value of vector. More...
 
std::vector< D >::iterator begin ()
 Iterators. More...
 
std::vector< D >::const_iterator begin () const
 
std::vector< D >::iterator end ()
 
std::vector< D >::const_iterator end () const
 
std::vector< D >::reverse_iterator rbegin ()
 
std::vector< D >::const_reverse_iterator rbegin () const
 
std::vector< D >::reverse_iterator rend ()
 
std::vector< D >::const_reverse_iterator rend () const
 
std::vector< D >::const_iterator cbegin () const
 
std::vector< D >::const_iterator cend () const
 
std::vector< D >::const_reverse_iterator crbegin () const
 
std::vector< D >::const_reverse_iterator crend () const
 
size_t size () const noexcept
 Returns vector size. More...
 
size_t Size () const noexcept
 Returns vector size. More...
 
size_t Dims () const noexcept
 Returns 1. For compatibility with Matrix and Image. More...
 
size_t max_size () const noexcept
 Returns maximum vector size. More...
 
void resize (size_t n)
 Resizes vector. More...
 
void resize (size_t n, const D &val)
 
size_t capacity () const
 Returns vector capacity. More...
 
bool empty () const noexcept
 Tests if vector is empty. More...
 
void reserve (size_t n)
 Changes vector capacity. More...
 
void shrink_to_fit ()
 Reduces vector capacity to size. More...
 
void Write (const std::string &filename) const
 Writes vector into file. More...
 
D & operator[] (size_t n)
 Returns reference to data at position n. More...
 
const D & operator[] (size_t n) const
 
D & operator() (size_t n)
 Returns reference to data at position n. More...
 
const D & operator() (size_t n) const
 
D & at (size_t n)
 Returns reference to data at position n, checking if it exists. More...
 
const D & at (size_t n) const
 
D & front ()
 Returns vector's first element. More...
 
const D & front () const
 
D & back ()
 Returns vector's last element. More...
 
const D & back () const
 
D * data () noexcept
 Returns pointer to _data vector. More...
 
const D * data () const noexcept
 
template<class InputIterator >
void assign (InputIterator first, InputIterator last)
 Assigns data to all elements. More...
 
void assign (size_t n, const D &val)
 
void assign (std::initializer_list< D > il)
 
void Set (double val)
 Assigns data to all elements. More...
 
void push_back (const D &val)
 Inserts element in the end of the vector. More...
 
void push_back (D &&val)
 Inserts element in the end of the vector. More...
 
bool contains (const D &val)
 Searchs if the vector contains that value. More...
 
int first_of (const D &val)
 Searchs the fisrt instance of the given value in the vector. More...
 
void pop_back ()
 Removes last element from vector. More...
 
std::vector< D >::iterator insert (typename std::vector< D >::iterator position, const D &val)
 Inserts elements into the vector. More...
 
std::vector< D >::iterator insert (typename std::vector< D >::iterator position, size_t n, const D &val)
 
template<class InputIterator >
std::vector< D >::iterator insert (typename std::vector< D >::iterator position, InputIterator first, InputIterator last)
 
std::vector< D >::iterator insert (typename std::vector< D >::iterator position, D &&val)
 
std::vector< D >::iterator insert (typename std::vector< D >::iterator position, std::initializer_list< D > il)
 
std::vector< D >::iterator erase (typename std::vector< D >::iterator position)
 Removes elements from the vector. More...
 
std::vector< D >::iterator erase (typename std::vector< D >::iterator first, typename std::vector< D >::iterator last)
 
void swap (Vector &x)
 Exchanges content of this vector by x. More...
 
void clear ()
 Removes all elements from vector. More...
 
template<class... Args>
std::vector< D >::iterator emplace (typename std::vector< D >::const_iterator position, Args &&...args)
 Inserts new element into vector increasing its size. More...
 
template<class... Args>
void emplace_back (Args &&...args)
 Inserts element into the end of the vector. More...
 
Maximum () const
 Compute and return the maximum value among vector elements. More...
 
Minimum () const
 Compute and return the minimum value among vector elements. More...
 
template<class D2 >
bool SameDimensions (const Vector< D2 > &src) const
 Compares the dimensions of src vector to the dimensions of 'this' vector. For compatibility with Matrix and Image classes. More...
 
template<class O >
O & Print (O &os) const
 Prints vector containts to output stream os. More...
 
template<class O >
O & PrintDimensions (O &os) const
 Prints vector dimensions to output stream os. More...
 

Static Public Member Functions

static Vector< D > Read (const std::string &filename)
 Reads vector from file. More...
 

Protected Attributes

std::vector< D, std::allocator< D > > _data
 data vector More...
 
D * qk_data
 Quick access reference for data. More...
 
size_t _size
 Size of data. Required here because _data may not exist in case of pointer constructor. More...
 

Friends

template<class D2 >
class Vector
 

Detailed Description

template<class D>
class Bial::Vector< D >

Definition at line 25 of file BinaryCOG.hpp.

Constructor & Destructor Documentation

template<class D >
Bial::Vector< D >::Vector ( )
explicit

Basic Constructors.

Date
2015/Apr/01
Parameters
many.
Returns
none.
Warning
none.

Definition at line 880 of file Vector.hpp.

template<class D >
Bial::Vector< D >::Vector ( size_t  n)
explicit

Definition at line 899 of file Vector.hpp.

template<class D>
Bial::Vector< D >::Vector ( size_t  n,
const D &  val 
)

Definition at line 919 of file Vector.hpp.

template<class D >
template<class InputIterator >
Bial::Vector< D >::Vector ( InputIterator  first,
InputIterator  last 
)

Definition at line 941 of file Vector.hpp.

template<class D>
Bial::Vector< D >::Vector ( const Vector< D > &  x)

Definition at line 963 of file Vector.hpp.

template<class D>
Bial::Vector< D >::Vector ( Vector< D > &&  x)

Definition at line 986 of file Vector.hpp.

template<class D>
Bial::Vector< D >::Vector ( const std::vector< D > &  x)

Definition at line 1006 of file Vector.hpp.

template<class D>
Bial::Vector< D >::Vector ( std::vector< D > &&  x)

Definition at line 1027 of file Vector.hpp.

template<class D>
Bial::Vector< D >::Vector ( std::initializer_list< D >  il)

Definition at line 1069 of file Vector.hpp.

template<class D >
template<class D2 >
Bial::Vector< D >::Vector ( const Vector< D2 > &  src)

Definition at line 1092 of file Vector.hpp.

template<class D >
template<class D2 >
Bial::Vector< D >::Vector ( const std::vector< D2 > &  src)

Definition at line 1119 of file Vector.hpp.

template<class D>
Bial::Vector< D >::Vector ( D *  new_data,
size_t  new_size 
)

Basic Constructor. This constructor works as a wrapper for data already allocated. It will use the same space pointed by new_data to manipulate the vector. Use this for compatibility with other data structures, in a easy convertion to Vector class.

Date
2015/Set/10
Parameters
new_dataPointer to data allocated elsewhere.
new_sizeSize of data.
Returns
none.
Warning
Data is not deallocated automatcally, since it may be stored in the stack. Also, DO NOT USE this constructure in Verbose or Debug compilation mode, as it will try to access invalid memory positions. Just compile without any Verbosity or Debug flags.

Definition at line 1049 of file Vector.hpp.

Member Function Documentation

template<class D >
void Bial::Vector< D >::Abs ( )

Computes the absolute value of vector.

Date
2015/Apr/01
Parameters
none.
Returns
Nothing.
Warning
none.

Definition at line 1668 of file Vector.hpp.

template<class D >
Vector< D > Bial::Vector< D >::Abs ( ) const

Computes the absolute value of vector.

Date
2015/Apr/01
Parameters
none.
Returns
Image with absolute values of vector.
Warning
none.

Definition at line 1675 of file Vector.hpp.

template<class D >
template<class InputIterator >
void Bial::Vector< D >::assign ( InputIterator  first,
InputIterator  last 
)

Assigns data to all elements.

Date
2015/Apr/01
Parameters
none.
Returns
none.
Warning
none.

Definition at line 2288 of file Vector.hpp.

template<class D>
void Bial::Vector< D >::assign ( size_t  n,
const D &  val 
)

Definition at line 2315 of file Vector.hpp.

template<class D>
void Bial::Vector< D >::assign ( std::initializer_list< D >  il)

Definition at line 2342 of file Vector.hpp.

template<class D >
D & Bial::Vector< D >::at ( size_t  n)

Returns reference to data at position n, checking if it exists.

Date
2015/Apr/01
Parameters
na vector reference.
Returns
Reference to data at position n.
Warning
none.

Definition at line 2165 of file Vector.hpp.

template<class D >
const D & Bial::Vector< D >::at ( size_t  n) const

Definition at line 2175 of file Vector.hpp.

template<class D >
D & Bial::Vector< D >::back ( )

Returns vector's last element.

Date
2015/Apr/01
Parameters
none.
Returns
Vector's last element.
Warning
none.

Definition at line 2231 of file Vector.hpp.

template<class D >
const D & Bial::Vector< D >::back ( ) const

Definition at line 2254 of file Vector.hpp.

template<class D >
std::vector< D >::iterator Bial::Vector< D >::begin ( )

Iterators.

Date
2015/Apr/01
Parameters
many.
Returns
none.
Warning
none.

Definition at line 1693 of file Vector.hpp.

template<class D >
std::vector< D >::const_iterator Bial::Vector< D >::begin ( ) const

Definition at line 1703 of file Vector.hpp.

template<class D >
size_t Bial::Vector< D >::capacity ( ) const

Returns vector capacity.

Date
2015/Apr/01
Parameters
none.
Returns
Vector capacity.
Warning
none.

Definition at line 1844 of file Vector.hpp.

template<class D >
std::vector< D >::const_iterator Bial::Vector< D >::cbegin ( ) const

Definition at line 1766 of file Vector.hpp.

template<class D >
std::vector< D >::const_iterator Bial::Vector< D >::cend ( ) const

Definition at line 1775 of file Vector.hpp.

template<class D >
void Bial::Vector< D >::clear ( )

Removes all elements from vector.

Date
2015/Apr/01
Parameters
none.
Returns
none.
Warning
none.

Definition at line 2780 of file Vector.hpp.

template<class D>
bool Bial::Vector< D >::contains ( const D &  val)

Searchs if the vector contains that value.

Date
2015/Aug/31
Parameters
valThe element to be searched.
Returns
A boolean value.
Warning
This operation can be slow.

Definition at line 2423 of file Vector.hpp.

template<class D >
std::vector< D >::const_reverse_iterator Bial::Vector< D >::crbegin ( ) const

Definition at line 1784 of file Vector.hpp.

template<class D >
std::vector< D >::const_reverse_iterator Bial::Vector< D >::crend ( ) const

Definition at line 1793 of file Vector.hpp.

template<class D >
D * Bial::Vector< D >::data ( )
noexcept

Returns pointer to _data vector.

Date
2015/Apr/01
Parameters
none.
Returns
Pointer to _data vector.
Warning
none.

Definition at line 2277 of file Vector.hpp.

template<class D >
const D * Bial::Vector< D >::data ( ) const
noexcept

Definition at line 2282 of file Vector.hpp.

template<class D >
size_t Bial::Vector< D >::Dims ( ) const
noexcept

Returns 1. For compatibility with Matrix and Image.

Date
2015/Jun/25
Parameters
none.
Returns
Vector dimensions.
Warning
none.

Definition at line 1812 of file Vector.hpp.

template<class D>
template<class... Args>
std::vector< D >::iterator Bial::Vector< D >::emplace ( typename std::vector< D >::const_iterator  position,
Args &&...  args 
)

Inserts new element into vector increasing its size.

Date
2015/Apr/01
Parameters
many.
Returns
Pointer to inserted element.
Warning
none.

Definition at line 2793 of file Vector.hpp.

template<class D >
template<class... Args>
void Bial::Vector< D >::emplace_back ( Args &&...  args)

Inserts element into the end of the vector.

Date
2015/Apr/01
Parameters
many.
Returns
none.
Warning
none.

Definition at line 2824 of file Vector.hpp.

template<class D >
bool Bial::Vector< D >::empty ( ) const
noexcept

Tests if vector is empty.

Date
2015/Apr/01
Parameters
none.
Returns
true if vector is empty.
Warning
none.

Definition at line 1853 of file Vector.hpp.

template<class D >
std::vector< D >::iterator Bial::Vector< D >::end ( )

Definition at line 1712 of file Vector.hpp.

template<class D >
std::vector< D >::const_iterator Bial::Vector< D >::end ( ) const

Definition at line 1721 of file Vector.hpp.

template<class D>
std::vector< D >::iterator Bial::Vector< D >::erase ( typename std::vector< D >::iterator  position)

Removes elements from the vector.

Date
2015/Apr/01
Parameters
many.
Returns
Pointer to element after the lastest removed.
Warning
none.

Definition at line 2690 of file Vector.hpp.

template<class D>
std::vector< D >::iterator Bial::Vector< D >::erase ( typename std::vector< D >::iterator  first,
typename std::vector< D >::iterator  last 
)

Definition at line 2724 of file Vector.hpp.

template<class D>
int Bial::Vector< D >::first_of ( const D &  val)

Searchs the fisrt instance of the given value in the vector.

Date
2015/Aug/31
Parameters
valThe element to be searched.
Returns
The found element position, -1 for failed searchs.
Warning
This operation can be slow.

Definition at line 2450 of file Vector.hpp.

template<class D >
D & Bial::Vector< D >::front ( )

Returns vector's first element.

Date
2015/Apr/01
Parameters
none.
Returns
Vector's first element.
Warning
none.

Definition at line 2185 of file Vector.hpp.

template<class D >
const D & Bial::Vector< D >::front ( ) const

Definition at line 2208 of file Vector.hpp.

template<class D>
std::vector< D >::iterator Bial::Vector< D >::insert ( typename std::vector< D >::iterator  position,
const D &  val 
)

Inserts elements into the vector.

Date
2015/Apr/01
Parameters
many.
Returns
Pointer to the first inserted element.
Warning
none.

Definition at line 2535 of file Vector.hpp.

template<class D>
std::vector< D >::iterator Bial::Vector< D >::insert ( typename std::vector< D >::iterator  position,
size_t  n,
const D &  val 
)

Definition at line 2566 of file Vector.hpp.

template<class D>
template<class InputIterator >
std::vector< D >::iterator Bial::Vector< D >::insert ( typename std::vector< D >::iterator  position,
InputIterator  first,
InputIterator  last 
)

Definition at line 2598 of file Vector.hpp.

template<class D>
std::vector< D >::iterator Bial::Vector< D >::insert ( typename std::vector< D >::iterator  position,
D &&  val 
)

Definition at line 2629 of file Vector.hpp.

template<class D>
std::vector< D >::iterator Bial::Vector< D >::insert ( typename std::vector< D >::iterator  position,
std::initializer_list< D >  il 
)

Definition at line 2659 of file Vector.hpp.

template<class D >
size_t Bial::Vector< D >::max_size ( ) const
noexcept

Returns maximum vector size.

Date
2015/Apr/01
Parameters
none.
Returns
Vector maximum size.
Warning
none.

Definition at line 1817 of file Vector.hpp.

template<class D >
D Bial::Vector< D >::Maximum ( ) const

Compute and return the maximum value among vector elements.

Date
2012/Jun/21
Parameters
none.
Returns
The maximum value among vector elements.
Warning
none.

Definition at line 2853 of file Vector.hpp.

template<class D >
D Bial::Vector< D >::Minimum ( ) const

Compute and return the minimum value among vector elements.

Date
2012/Jun/21
Parameters
none.
Returns
The minimum value among vector elements.
Warning
none.

Definition at line 2872 of file Vector.hpp.

template<class D >
D & Bial::Vector< D >::operator() ( size_t  n)

Returns reference to data at position n.

Date
2015/Apr/01
Parameters
na vector index.
Returns
Reference to data at position n.
Warning
none.

Definition at line 2141 of file Vector.hpp.

template<class D >
const D & Bial::Vector< D >::operator() ( size_t  n) const

Definition at line 2153 of file Vector.hpp.

template<class D >
template<class D2 >
Vector< D > Bial::Vector< D >::operator* ( const Vector< D2 > &  other) const
inline

Definition at line 1418 of file Vector.hpp.

template<class D >
Vector< D > Bial::Vector< D >::operator* ( const double  scalar) const
inline

Definition at line 1620 of file Vector.hpp.

template<class D >
template<class D2 >
Vector< D > & Bial::Vector< D >::operator*= ( const Vector< D2 > &  other)
inline

Definition at line 1304 of file Vector.hpp.

template<class D >
Vector< D > & Bial::Vector< D >::operator*= ( const double  scalar)
inline

Definition at line 1517 of file Vector.hpp.

template<class D >
template<class D2 >
Vector< D > Bial::Vector< D >::operator+ ( const Vector< D2 > &  other) const
inline

Definition at line 1368 of file Vector.hpp.

template<class D >
Vector< D > Bial::Vector< D >::operator+ ( const double  scalar) const
inline

Definition at line 1572 of file Vector.hpp.

template<class D >
template<class D2 >
Vector< D > & Bial::Vector< D >::operator+= ( const Vector< D2 > &  other)
inline

Arithmetic operators.

Date
2015/Apr/01
Parameters
many.
Returns
none.
Warning
none.

Definition at line 1252 of file Vector.hpp.

template<class D >
Vector< D > & Bial::Vector< D >::operator+= ( const double  scalar)
inline

Definition at line 1467 of file Vector.hpp.

template<class D >
template<class D2 >
Vector< D > Bial::Vector< D >::operator- ( const Vector< D2 > &  other) const
inline

Definition at line 1393 of file Vector.hpp.

template<class D >
Vector< D > Bial::Vector< D >::operator- ( const double  scalar) const
inline

Definition at line 1596 of file Vector.hpp.

template<class D >
template<class D2 >
Vector< D > & Bial::Vector< D >::operator-= ( const Vector< D2 > &  other)
inline

Definition at line 1278 of file Vector.hpp.

template<class D >
Vector< D > & Bial::Vector< D >::operator-= ( const double  scalar)
inline

Definition at line 1492 of file Vector.hpp.

template<class D >
template<class D2 >
Vector< D > Bial::Vector< D >::operator/ ( const Vector< D2 > &  other) const
inline

Definition at line 1443 of file Vector.hpp.

template<class D >
Vector< D > Bial::Vector< D >::operator/ ( const double  scalar) const
inline

Definition at line 1644 of file Vector.hpp.

template<class D >
template<class D2 >
Vector< D > & Bial::Vector< D >::operator/= ( const Vector< D2 > &  other)
inline

Definition at line 1330 of file Vector.hpp.

template<class D >
Vector< D > & Bial::Vector< D >::operator/= ( const double  scalar)
inline

Definition at line 1542 of file Vector.hpp.

template<class D>
Vector< D > & Bial::Vector< D >::operator= ( const Vector< D > &  x)

Assign operator.

Date
2015/Apr/01
Parameters
many.
Returns
none.
Warning
none.

Definition at line 1145 of file Vector.hpp.

template<class D>
Vector< D > & Bial::Vector< D >::operator= ( Vector< D > &&  x)

Definition at line 1174 of file Vector.hpp.

template<class D>
Vector< D > & Bial::Vector< D >::operator= ( std::initializer_list< D >  il)

Definition at line 1200 of file Vector.hpp.

template<class D>
Vector< D > & Bial::Vector< D >::operator= ( double  val)

Definition at line 1226 of file Vector.hpp.

template<class D >
D & Bial::Vector< D >::operator[] ( size_t  n)

Returns reference to data at position n.

Date
2015/Apr/01
Parameters
na vector index.
Returns
Reference to data at position n.
Warning
none.

Definition at line 2117 of file Vector.hpp.

template<class D >
const D & Bial::Vector< D >::operator[] ( size_t  n) const

Definition at line 2129 of file Vector.hpp.

template<class D >
void Bial::Vector< D >::pop_back ( )

Removes last element from vector.

Date
2015/Apr/01
Parameters
none.
Returns
none.
Warning
none.

Definition at line 2506 of file Vector.hpp.

template<class D >
template<class O >
O & Bial::Vector< D >::Print ( O &  os) const

Prints vector containts to output stream os.

Date
2012/Jun/21
Parameters
osan output stream.
Returns
The output stream.
Warning
'this' vector must be 1D, 2D, or 3D.

Definition at line 2897 of file Vector.hpp.

template<class D >
template<class O >
O & Bial::Vector< D >::PrintDimensions ( O &  os) const

Prints vector dimensions to output stream os.

Date
2012/Jun/21
Parameters
none.
Returns
The dimensions of the vector.
Warning
none.

Definition at line 2916 of file Vector.hpp.

template<class D>
void Bial::Vector< D >::push_back ( const D &  val)

Inserts element in the end of the vector.

Date
2015/Apr/01
Parameters
valThe element to be inserted.
Returns
none.
Warning
none.

Definition at line 2394 of file Vector.hpp.

template<class D>
void Bial::Vector< D >::push_back ( D &&  val)

Inserts element in the end of the vector.

Date
2015/Apr/01
Parameters
valThe element to be inserted.
Returns
none.
Warning
none.

Definition at line 2477 of file Vector.hpp.

template<class D >
std::vector< D >::reverse_iterator Bial::Vector< D >::rbegin ( )

Definition at line 1730 of file Vector.hpp.

template<class D >
std::vector< D >::const_reverse_iterator Bial::Vector< D >::rbegin ( ) const

Definition at line 1739 of file Vector.hpp.

template<class D >
Vector< D > Bial::Vector< D >::Read ( const std::string &  filename)
static

Reads vector from file.

Date
2015/Jun/25
Parameters
filenameName of the file conatining vector.
Returns
The read vector.
Warning
none.

Definition at line 1915 of file Vector.hpp.

template<class D >
std::vector< D >::reverse_iterator Bial::Vector< D >::rend ( )

Definition at line 1748 of file Vector.hpp.

template<class D >
std::vector< D >::const_reverse_iterator Bial::Vector< D >::rend ( ) const

Definition at line 1757 of file Vector.hpp.

template<class D >
void Bial::Vector< D >::reserve ( size_t  n)

Changes vector capacity.

Date
2015/Apr/01
Parameters
nnew vector capacity.
Returns
none.
Warning
none.

Definition at line 1858 of file Vector.hpp.

template<class D >
void Bial::Vector< D >::resize ( size_t  n)

Resizes vector.

Date
2015/Apr/01
Parameters
nnew size.
valvalue assigned to new elements.
Returns
none.
Warning
none.

Definition at line 1822 of file Vector.hpp.

template<class D>
void Bial::Vector< D >::resize ( size_t  n,
const D &  val 
)

Definition at line 1833 of file Vector.hpp.

template<class D >
template<class D2 >
bool Bial::Vector< D >::SameDimensions ( const Vector< D2 > &  src) const

Compares the dimensions of src vector to the dimensions of 'this' vector. For compatibility with Matrix and Image classes.

Date
2012/Jun/27
Parameters
srcVector to compare to.
Returns
Weather src has the same dimensions as 'this' vector.
Warning
none.

Definition at line 2891 of file Vector.hpp.

template<class D >
void Bial::Vector< D >::Set ( double  val)

Assigns data to all elements.

Date
2015/Apr/01
Parameters
none.
Returns
none.
Warning
none.

Definition at line 2369 of file Vector.hpp.

template<class D >
void Bial::Vector< D >::shrink_to_fit ( )

Reduces vector capacity to size.

Date
2015/Apr/01
Parameters
none.
Returns
none.
Warning
none.

Definition at line 1886 of file Vector.hpp.

template<class D >
size_t Bial::Vector< D >::size ( ) const
noexcept

Returns vector size.

Date
2015/Apr/01
Parameters
none.
Returns
Vector size.
Warning
none.

Definition at line 1802 of file Vector.hpp.

template<class D >
size_t Bial::Vector< D >::Size ( ) const
noexcept

Returns vector size.

Date
2015/Apr/01
Parameters
none.
Returns
Vector size.
Warning
none.

Definition at line 1807 of file Vector.hpp.

template<class D >
void Bial::Vector< D >::swap ( Vector< D > &  x)

Exchanges content of this vector by x.

Date
2015/Apr/01
Parameters
xa vector.
Returns
none.
Warning
none.

Definition at line 2759 of file Vector.hpp.

template<class D >
void Bial::Vector< D >::Write ( const std::string &  filename) const

Writes vector into file.

Date
2015/Jun/25
Parameters
filenameName of the file conatining vector.
Returns
none.
Warning
none.

Definition at line 2027 of file Vector.hpp.

Friends And Related Function Documentation

template<class D>
template<class D2 >
friend class Vector
friend

Definition at line 26 of file Vector.hpp.

Member Data Documentation

template<class D>
std::vector< D, std::allocator< D > > Bial::Vector< D >::_data
protected

data vector

Definition at line 33 of file Vector.hpp.

template<class D>
size_t Bial::Vector< D >::_size
protected

Size of data. Required here because _data may not exist in case of pointer constructor.

Definition at line 43 of file Vector.hpp.

template<class D>
D* Bial::Vector< D >::qk_data
protected

Quick access reference for data.

Definition at line 38 of file Vector.hpp.


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