Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
|
#include <BinaryCOG.hpp>
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... | |
D | Maximum () const |
Compute and return the maximum value among vector elements. More... | |
D | 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 |
Definition at line 25 of file BinaryCOG.hpp.
|
explicit |
Basic Constructors.
many. |
Definition at line 880 of file Vector.hpp.
|
explicit |
Definition at line 899 of file Vector.hpp.
Bial::Vector< D >::Vector | ( | size_t | n, |
const D & | val | ||
) |
Definition at line 919 of file Vector.hpp.
Bial::Vector< D >::Vector | ( | InputIterator | first, |
InputIterator | last | ||
) |
Definition at line 941 of file Vector.hpp.
Bial::Vector< D >::Vector | ( | const Vector< D > & | x | ) |
Definition at line 963 of file Vector.hpp.
Bial::Vector< D >::Vector | ( | Vector< D > && | x | ) |
Definition at line 986 of file Vector.hpp.
Bial::Vector< D >::Vector | ( | const std::vector< D > & | x | ) |
Definition at line 1006 of file Vector.hpp.
Bial::Vector< D >::Vector | ( | std::vector< D > && | x | ) |
Definition at line 1027 of file Vector.hpp.
Bial::Vector< D >::Vector | ( | std::initializer_list< D > | il | ) |
Definition at line 1069 of file Vector.hpp.
Definition at line 1092 of file Vector.hpp.
Definition at line 1119 of file Vector.hpp.
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.
new_data | Pointer to data allocated elsewhere. |
new_size | Size of data. |
Definition at line 1049 of file Vector.hpp.
void Bial::Vector< D >::Abs | ( | ) |
Computes the absolute value of vector.
none. |
Definition at line 1668 of file Vector.hpp.
Vector< D > Bial::Vector< D >::Abs | ( | ) | const |
Computes the absolute value of vector.
none. |
Definition at line 1675 of file Vector.hpp.
void Bial::Vector< D >::assign | ( | InputIterator | first, |
InputIterator | last | ||
) |
Assigns data to all elements.
none. |
Definition at line 2288 of file Vector.hpp.
void Bial::Vector< D >::assign | ( | size_t | n, |
const D & | val | ||
) |
Definition at line 2315 of file Vector.hpp.
void Bial::Vector< D >::assign | ( | std::initializer_list< D > | il | ) |
Definition at line 2342 of file Vector.hpp.
D & Bial::Vector< D >::at | ( | size_t | n | ) |
Returns reference to data at position n, checking if it exists.
n | a vector reference. |
Definition at line 2165 of file Vector.hpp.
const D & Bial::Vector< D >::at | ( | size_t | n | ) | const |
Definition at line 2175 of file Vector.hpp.
D & Bial::Vector< D >::back | ( | ) |
Returns vector's last element.
none. |
Definition at line 2231 of file Vector.hpp.
const D & Bial::Vector< D >::back | ( | ) | const |
Definition at line 2254 of file Vector.hpp.
std::vector< D >::iterator Bial::Vector< D >::begin | ( | ) |
Iterators.
many. |
Definition at line 1693 of file Vector.hpp.
std::vector< D >::const_iterator Bial::Vector< D >::begin | ( | ) | const |
Definition at line 1703 of file Vector.hpp.
size_t Bial::Vector< D >::capacity | ( | ) | const |
Returns vector capacity.
none. |
Definition at line 1844 of file Vector.hpp.
std::vector< D >::const_iterator Bial::Vector< D >::cbegin | ( | ) | const |
Definition at line 1766 of file Vector.hpp.
std::vector< D >::const_iterator Bial::Vector< D >::cend | ( | ) | const |
Definition at line 1775 of file Vector.hpp.
void Bial::Vector< D >::clear | ( | ) |
Removes all elements from vector.
none. |
Definition at line 2780 of file Vector.hpp.
bool Bial::Vector< D >::contains | ( | const D & | val | ) |
Searchs if the vector contains that value.
val | The element to be searched. |
Definition at line 2423 of file Vector.hpp.
std::vector< D >::const_reverse_iterator Bial::Vector< D >::crbegin | ( | ) | const |
Definition at line 1784 of file Vector.hpp.
std::vector< D >::const_reverse_iterator Bial::Vector< D >::crend | ( | ) | const |
Definition at line 1793 of file Vector.hpp.
|
noexcept |
Returns pointer to _data vector.
none. |
Definition at line 2277 of file Vector.hpp.
|
noexcept |
Definition at line 2282 of file Vector.hpp.
|
noexcept |
Returns 1. For compatibility with Matrix and Image.
none. |
Definition at line 1812 of file Vector.hpp.
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.
many. |
Definition at line 2793 of file Vector.hpp.
Inserts element into the end of the vector.
many. |
Definition at line 2824 of file Vector.hpp.
|
noexcept |
Tests if vector is empty.
none. |
Definition at line 1853 of file Vector.hpp.
std::vector< D >::iterator Bial::Vector< D >::end | ( | ) |
Definition at line 1712 of file Vector.hpp.
std::vector< D >::const_iterator Bial::Vector< D >::end | ( | ) | const |
Definition at line 1721 of file Vector.hpp.
std::vector< D >::iterator Bial::Vector< D >::erase | ( | typename std::vector< D >::iterator | position | ) |
Removes elements from the vector.
many. |
Definition at line 2690 of file Vector.hpp.
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.
int Bial::Vector< D >::first_of | ( | const D & | val | ) |
Searchs the fisrt instance of the given value in the vector.
val | The element to be searched. |
Definition at line 2450 of file Vector.hpp.
D & Bial::Vector< D >::front | ( | ) |
Returns vector's first element.
none. |
Definition at line 2185 of file Vector.hpp.
const D & Bial::Vector< D >::front | ( | ) | const |
Definition at line 2208 of file Vector.hpp.
std::vector< D >::iterator Bial::Vector< D >::insert | ( | typename std::vector< D >::iterator | position, |
const D & | val | ||
) |
Inserts elements into the vector.
many. |
Definition at line 2535 of file Vector.hpp.
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.
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.
std::vector< D >::iterator Bial::Vector< D >::insert | ( | typename std::vector< D >::iterator | position, |
D && | val | ||
) |
Definition at line 2629 of file Vector.hpp.
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.
|
noexcept |
Returns maximum vector size.
none. |
Definition at line 1817 of file Vector.hpp.
D Bial::Vector< D >::Maximum | ( | ) | const |
Compute and return the maximum value among vector elements.
none. |
Definition at line 2853 of file Vector.hpp.
D Bial::Vector< D >::Minimum | ( | ) | const |
Compute and return the minimum value among vector elements.
none. |
Definition at line 2872 of file Vector.hpp.
D & Bial::Vector< D >::operator() | ( | size_t | n | ) |
Returns reference to data at position n.
n | a vector index. |
Definition at line 2141 of file Vector.hpp.
const D & Bial::Vector< D >::operator() | ( | size_t | n | ) | const |
Definition at line 2153 of file Vector.hpp.
|
inline |
Definition at line 1418 of file Vector.hpp.
|
inline |
Definition at line 1620 of file Vector.hpp.
|
inline |
Definition at line 1304 of file Vector.hpp.
|
inline |
Definition at line 1517 of file Vector.hpp.
|
inline |
Definition at line 1368 of file Vector.hpp.
|
inline |
Definition at line 1572 of file Vector.hpp.
|
inline |
Arithmetic operators.
many. |
Definition at line 1252 of file Vector.hpp.
|
inline |
Definition at line 1467 of file Vector.hpp.
|
inline |
Definition at line 1393 of file Vector.hpp.
|
inline |
Definition at line 1596 of file Vector.hpp.
|
inline |
Definition at line 1278 of file Vector.hpp.
|
inline |
Definition at line 1492 of file Vector.hpp.
|
inline |
Definition at line 1443 of file Vector.hpp.
|
inline |
Definition at line 1644 of file Vector.hpp.
|
inline |
Definition at line 1330 of file Vector.hpp.
|
inline |
Definition at line 1542 of file Vector.hpp.
Vector< D > & Bial::Vector< D >::operator= | ( | const Vector< D > & | x | ) |
Assign operator.
many. |
Definition at line 1145 of file Vector.hpp.
Vector< D > & Bial::Vector< D >::operator= | ( | Vector< D > && | x | ) |
Definition at line 1174 of file Vector.hpp.
Vector< D > & Bial::Vector< D >::operator= | ( | std::initializer_list< D > | il | ) |
Definition at line 1200 of file Vector.hpp.
Vector< D > & Bial::Vector< D >::operator= | ( | double | val | ) |
Definition at line 1226 of file Vector.hpp.
D & Bial::Vector< D >::operator[] | ( | size_t | n | ) |
Returns reference to data at position n.
n | a vector index. |
Definition at line 2117 of file Vector.hpp.
const D & Bial::Vector< D >::operator[] | ( | size_t | n | ) | const |
Definition at line 2129 of file Vector.hpp.
void Bial::Vector< D >::pop_back | ( | ) |
Removes last element from vector.
none. |
Definition at line 2506 of file Vector.hpp.
Prints vector containts to output stream os.
os | an output stream. |
Definition at line 2897 of file Vector.hpp.
Prints vector dimensions to output stream os.
none. |
Definition at line 2916 of file Vector.hpp.
void Bial::Vector< D >::push_back | ( | const D & | val | ) |
Inserts element in the end of the vector.
val | The element to be inserted. |
Definition at line 2394 of file Vector.hpp.
void Bial::Vector< D >::push_back | ( | D && | val | ) |
Inserts element in the end of the vector.
val | The element to be inserted. |
Definition at line 2477 of file Vector.hpp.
std::vector< D >::reverse_iterator Bial::Vector< D >::rbegin | ( | ) |
Definition at line 1730 of file Vector.hpp.
std::vector< D >::const_reverse_iterator Bial::Vector< D >::rbegin | ( | ) | const |
Definition at line 1739 of file Vector.hpp.
|
static |
Reads vector from file.
filename | Name of the file conatining vector. |
Definition at line 1915 of file Vector.hpp.
std::vector< D >::reverse_iterator Bial::Vector< D >::rend | ( | ) |
Definition at line 1748 of file Vector.hpp.
std::vector< D >::const_reverse_iterator Bial::Vector< D >::rend | ( | ) | const |
Definition at line 1757 of file Vector.hpp.
void Bial::Vector< D >::reserve | ( | size_t | n | ) |
Changes vector capacity.
n | new vector capacity. |
Definition at line 1858 of file Vector.hpp.
void Bial::Vector< D >::resize | ( | size_t | n | ) |
Resizes vector.
n | new size. |
val | value assigned to new elements. |
Definition at line 1822 of file Vector.hpp.
void Bial::Vector< D >::resize | ( | size_t | n, |
const D & | val | ||
) |
Definition at line 1833 of file Vector.hpp.
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.
src | Vector to compare to. |
Definition at line 2891 of file Vector.hpp.
void Bial::Vector< D >::Set | ( | double | val | ) |
Assigns data to all elements.
none. |
Definition at line 2369 of file Vector.hpp.
void Bial::Vector< D >::shrink_to_fit | ( | ) |
Reduces vector capacity to size.
none. |
Definition at line 1886 of file Vector.hpp.
|
noexcept |
Returns vector size.
none. |
Definition at line 1802 of file Vector.hpp.
|
noexcept |
Returns vector size.
none. |
Definition at line 1807 of file Vector.hpp.
void Bial::Vector< D >::swap | ( | Vector< D > & | x | ) |
Exchanges content of this vector by x.
x | a vector. |
Definition at line 2759 of file Vector.hpp.
void Bial::Vector< D >::Write | ( | const std::string & | filename | ) | const |
Writes vector into file.
filename | Name of the file conatining vector. |
Definition at line 2027 of file Vector.hpp.
Definition at line 26 of file Vector.hpp.
|
protected |
data vector
Definition at line 33 of file Vector.hpp.
|
protected |
Size of data. Required here because _data may not exist in case of pointer constructor.
Definition at line 43 of file Vector.hpp.
|
protected |
Quick access reference for data.
Definition at line 38 of file Vector.hpp.