Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
|
dimensional matrix handeling. When acessed by (x, y), or (x, y, z) operator, index x corresponds to the index of the column, and index y corresponds to the index of the row. This standard comes from text printing order and image display and storage in most of the computer systems. More...
#include <FileImage.hpp>
Public Member Functions | |
Matrix () | |
Basic Constructor. More... | |
Matrix (const Vector< size_t > &size) | |
Basic Constructor. More... | |
Matrix (D *new_data, const Vector< size_t > &new_dim) | |
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 matrix. Use this for compatibility with other data structures, in a easy convertion to Matrix class. More... | |
Matrix (size_t size_0, size_t size_1) | |
Basic Constructor for 2D matrix. More... | |
Matrix (size_t size_0, size_t size_1, size_t size_2) | |
Basic Constructor for 3D matrix. More... | |
Matrix (const Matrix< D > &mtx) | |
Copy constructor. More... | |
Matrix (Matrix< D > &&)=default | |
Move constructor. More... | |
template<class D2 > | |
Matrix (const Matrix< D2 > &mtx) | |
Copy constructor. More... | |
Matrix< D > & | operator= (const Matrix< D > &other) |
Assigns 'other' matrix content to this matrix. More... | |
Matrix< D > & | operator= (Matrix< D > &&)=default |
Assigns 'other' matrix content to this matrix, moving the content. More... | |
template<class D2 > | |
Matrix< D > & | operator= (const Matrix< D2 > &other) |
Assigns 'other' matrix content to this matrix. More... | |
template<class D2 > | |
bool | operator== (const Matrix< D2 > &other) const |
The matrices are considered equal if they have the same dimensions and their elements have the same value. More... | |
Matrix< D > & | operator++ () |
Increments all elements of this matrix and returns it. More... | |
Matrix< D > | operator++ (int) |
Increments all elements of this matrix and returns it. More... | |
Matrix< D > & | operator-- () |
Decrements all elements of this matrix and returns it. More... | |
Matrix< D > | operator-- (int) |
Decrements all elements of this matrix and returns it. More... | |
template<class D2 > | |
Matrix< D > | operator+ (const Matrix< D2 > &other) const |
Computes the sum of the matrices 'this' and other and returns the resultant matrix. More... | |
template<class D2 > | |
Matrix< D > & | operator+= (const Matrix< D2 > &other) |
Computes the sum of the matrices 'this' and other and assigns the result to this. More... | |
Matrix< D > | operator- () const |
Computes the negative matrix of 'this' and returns the resultant matrix. More... | |
template<class D2 > | |
Matrix< D > | operator- (const Matrix< D2 > &other) const |
Computes the difference of the matrices 'this' and other and returns the resultant matrix. More... | |
template<class D2 > | |
Matrix< D > & | operator-= (const Matrix< D2 > &other) |
Computes the difference of the matrices 'this' and other and assigns the result to this. More... | |
template<class D2 > | |
Matrix< D > | operator* (const Matrix< D2 > &other) const |
Computes the product of the matrices 'this' and other and returns the resultant matrix. More... | |
template<class D2 > | |
Matrix< D > & | operator*= (const Matrix< D2 > &other) |
Computes the product of the matrices 'this' and other and assigns the result to this. More... | |
Matrix< D > | operator+ (double scalar) const |
Computes the sum of 'this' matrix by the scalar. More... | |
Matrix< D > & | operator+= (double scalar) |
Updates 'this' matrix with the sum of 'this' by the input scalar. More... | |
Matrix< D > | operator- (double scalar) const |
Computes the difference between 'this' matrix and the scalar. More... | |
Matrix< D > & | operator-= (double scalar) |
Updates 'this' matrix with the difference between 'this' and the input scalar. More... | |
Matrix< D > | operator* (double scalar) const |
Computes the product of 'this' matrix by the scalar. More... | |
Matrix< D > & | operator*= (double scalar) |
Updates 'this' matrix with the product of 'this' by the input scalar. More... | |
template<class D2 > | |
Matrix< D > | operator/ (const Matrix< D2 > &other) const |
Computes the division of the matrices 'this' and other and returns the resultant matrix. More... | |
template<class D2 > | |
Matrix< D > & | operator/= (const Matrix< D2 > &other) |
Computes the division of the matrices 'this' and other and assigns the result to this. More... | |
Matrix< D > | operator/ (double scalar) const |
Computes the division of 'this' matrix by the scalar. More... | |
Matrix< D > & | operator/= (double scalar) |
Updates 'this' matrix with the division of 'this' by the input scalar. More... | |
const D & | operator[] (size_t p) const |
Returns a constant reference of data pointed by index p. It has the same effect as operator data( p ). More... | |
D & | operator[] (size_t p) |
Returns the reference for data pointed by index p. It has the same effect as operator data( p ). More... | |
const D & | operator() (size_t p) const |
Returns constant reference of data pointed by index p. It has the same effect as operator data[ p ]. More... | |
D & | operator() (size_t p) |
Returns the reference for data pointed by index p. It has the same effect as operator data[ p ]. More... | |
const D & | operator() (size_t p_0, size_t p_1) const |
Returns constant reference of data pointed by index ( p_0, p_1 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] ]. More... | |
D & | operator() (size_t p_0, size_t p_1) |
Returns the reference for data pointed by index ( p_0, p_1 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] ]. More... | |
const D & | operator() (size_t p_0, size_t p_1, size_t p_2) const |
Returns constant reference of data pointed by index ( p_0, p_1, p_2 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] ]. More... | |
D & | operator() (size_t p_0, size_t p_1, size_t p_2) |
Returns the reference for data pointed by index ( p_0, p_1, p_2 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] ]. More... | |
const D & | operator() (size_t p_0, size_t p_1, size_t p_2, size_t p_3) const |
Returns constant reference of data pointed by index ( p_0, p_1, p_2, p_3 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] + p_3 * acc_dim_size[ 2 ] ]. More... | |
D & | operator() (size_t p_0, size_t p_1, size_t p_2, size_t p_3) |
Returns the reference for data pointed by index ( p_0, p_1, p_2, p_3 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] + p_3 * acc_dim_size[ 2 ] ]. More... | |
const D & | operator() (size_t p_0, size_t p_1, size_t p_2, size_t p_3, size_t p_4) const |
Returns constant reference of data pointed by index ( p_0, p_1, p_2, p_3, p_4 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] + p_3 * acc_dim_size[ 2 ] + p_4 * acc_dim_size[ 3 ] ]. More... | |
D & | operator() (size_t p_0, size_t p_1, size_t p_2, size_t p_3, size_t p_4) |
Returns the reference for data pointed by index ( p_0, p_1, p_2, p_3, p_4 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] + p_3 * acc_dim_size[ 2 ] + p_4 * acc_dim_size[ 3 ] ]. More... | |
const D & | operator() (const Vector< size_t > &p) const |
Returns constant reference of data pointed by index ( p[ 0 ], p[ 1 ], p[ 2 ], ... ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] ... ]. More... | |
D & | operator() (const Vector< size_t > &p) |
Returns the reference of data pointed by index ( p[ 0 ], p[ 1 ], p[ 2 ], ... ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] ... ]. More... | |
void | Abs () |
Computes the absolute value of the matrix elements. More... | |
Matrix< D > | Abs () const |
Computes the absolute value of the matrix elements. More... | |
std::vector< D >::iterator | begin () noexcept |
Returns iterator begin() of data. More... | |
std::vector< D >::const_iterator | begin () const noexcept |
Returns const_iterator begin() of data. More... | |
std::vector< D >::iterator | end () noexcept |
Returns iterator end() of data. More... | |
std::vector< D >::const_iterator | end () const noexcept |
Returns const_iterator end() of data. More... | |
std::vector< D >::reverse_iterator | rbegin () noexcept |
Returns the reverse_iterator rbegin() of data Vector. More... | |
std::vector< D >::const_reverse_iterator | rbegin () const noexcept |
Returns const_reverse_iterator rbegin() of data Vector. More... | |
std::vector< D >::reverse_iterator | rend () noexcept |
Returns reverse_iterator rend() of data Vector. More... | |
std::vector< D >::const_reverse_iterator | rend () const noexcept |
Returns const_reverse_iterator rend() of data Vector. More... | |
std::vector< D >::const_iterator | cbegin () const noexcept |
Returns the iterator cbegin() of data Vector. More... | |
std::vector< D >::const_iterator | cend () const noexcept |
Returns the iterator cend() of data Vector. More... | |
std::vector< D >::const_reverse_iterator | crbegin () const noexcept |
Returns the iterator crbegin() of data Vector. More... | |
std::vector< D >::const_reverse_iterator | crend () const noexcept |
Returns the iterator crend() of data Vector. More... | |
const D * | Data () const |
Returns a reference to data. More... | |
D * | Data () |
Returns a reference to data. More... | |
const D * | data () const |
Returns a reference to data. More... | |
D * | data () |
Returns a reference to data. More... | |
size_t | Size () const |
Returns size of data Vector. More... | |
size_t | size () const |
Returns size of data Vector. Same as Size( ), just for compatibility with std containers. More... | |
size_t | Elements () const |
Returns the number of elements of the matrix. Same as Size( ) method. More... | |
size_t | Elements (D min, D max) const |
Returns the number of elements counted inside the interval limited by min and max. More... | |
size_t | Coordinate (size_t position, size_t dimension) const |
Returns the coordinate of position in given dimension. More... | |
Vector< size_t > | Coordinates (size_t position) const |
Returns the coordinates of the input position in this matrix. More... | |
size_t | Position (size_t p_0, size_t p_1) const |
Returns the position corresponding to the input coordinates in this matrix. More... | |
size_t | Position (size_t p_0, size_t p_1, size_t p_2) const |
Returns the position corresponding to the input coordinates in this matrix. More... | |
size_t | Position (size_t p_0, size_t p_1, size_t p_2, size_t p_3) const |
Returns the position corresponding to the input coordinates in this matrix. More... | |
size_t | Position (const Vector< size_t > &coordinates) const |
Returns the position corresponding to the input coordinates in this matrix. More... | |
size_t | Position (const Vector< int > &coordinates) const |
Returns the position corresponding to the input coordinates in this matrix. More... | |
size_t | Position (const Vector< float > &coordinates) const |
Returns the position corresponding to the input coordinates in this matrix. More... | |
void | Set (D val) |
Sets val to each element of the matrix. More... | |
Vector< size_t > | Dim () const |
Returns a Vector with all matrix dimensions. More... | |
size_t | MinDim () const |
Returns the minimum size among all matrix dimensions. More... | |
size_t | MaxDim () const |
Returns the maximum size among all matrix dimensions. More... | |
size_t | Size (size_t dimension) const |
Returns matrix required dimension. More... | |
size_t | size (size_t dimension) const |
Returns matrix required dimension. Just for symmetry with size( ) and Size( ) functions. More... | |
size_t | Dims () const |
Returns the number of dimensions of 'this' matrix. More... | |
size_t | Displacement (size_t dimension) const |
Returns the position displacement of one unit in dimension i. More... | |
const D & | at (size_t p) const |
Reads the constant reverence of value contained at position p of data Vector. More... | |
D & | at (size_t p) |
Reads the value contained at position p of data Vector and returns its reference. More... | |
const D & | at (size_t p_0, size_t p_1) const |
Reads the constant reverence of value contained at position p_0, p_1 of data Vector. More... | |
D & | at (size_t p_0, size_t p_1) |
Reads the value contained at position p_0, p_1 of data Vector and returns its reference. More... | |
const D & | at (size_t p_0, size_t p_1, size_t p_2) const |
Reads the constant reverence of value contained at position p_0, p_1, p_2 of data Vector. More... | |
D & | at (size_t p_0, size_t p_1, size_t p_2) |
Reads the value contained at position p_0, p_1, p_2 of data Vector and returns its reference. More... | |
const D & | at (size_t p_0, size_t p_1, size_t p_2, size_t p_3) const |
Reads the constant reverence of value contained at position p_0, p_1, p_2, p_3 of data Vector. More... | |
D & | at (size_t p_0, size_t p_1, size_t p_2, size_t p_3) |
Reads the value contained at position p_0, p_1, p_2, p_3 of data Vector and returns its reference. More... | |
const D & | at (size_t p_0, size_t p_1, size_t p_2, size_t p_3, size_t p_4) const |
Reads the constant reverence of value contained at position p_0, p_1, p_2, p_3, p_4 of data Vector. More... | |
D & | at (size_t p_0, size_t p_1, size_t p_2, size_t p_3, size_t p_4) |
Reads the value contained at position p_0, p_1, p_2, p_3, p_4 of data Vector and returns its reference. More... | |
const D & | at (const Vector< size_t > &p) const |
Returns constant reference of data pointed by index ( p[ 0 ], p[ 1 ], p[ 2 ], ... ). It has the same effect as operator data[ p_0 + p_1 * acc_dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] ... ]. More... | |
D & | at (const Vector< size_t > &p) |
Returns constant reference of data pointed by index ( p[ 0 ], p[ 1 ], p[ 2 ], ... ). It has the same effect as operator data[ p_0 + p_1 * acc_dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] ... ]. More... | |
bool | ValidElement (const Vector< size_t > &p) const |
Verifies if element is in matrix domain. More... | |
void | SetRange (D min, D max) |
Recalculate the amplitude scale of the matrix by the following formula: mat[ pxl ] = min + ( mat[ pxl ] - mat_min ) * ( max - min ) / ( mat_max - mat_min ) More... | |
D | Maximum () const |
Compute and return the maximum value among matrix elements. More... | |
D | Minimum () const |
Compute and return the minimum value among matrix elements. More... | |
template<class O > | |
O & | Print (O &os) const |
Prints matrix containts to output stream os. More... | |
template<class O > | |
O & | PrintDimensions (O &os) const |
Prints matrix dimensions to output stream os. More... | |
template<class D2 > | |
bool | Equals (const Matrix< D2 > &src, double delta) const |
Compares src matrix to 'this' matrix. They are considere equal only if they have the same dimensions and data. More... | |
template<class D2 > | |
bool | SameDimensions (const Matrix< D2 > &src) const |
Compares the dimensions of src matrix to the dimensions of 'this' matrix. More... | |
bool | SameDimensions (const Adjacency &adj) const |
Compares the dimensions of adj adjacency relation to the dimensions of 'this' matrix. More... | |
Protected Attributes | |
Vector< D > | _data |
data vector More... | |
D * | qk_data |
Quick access reference for data. More... | |
size_t | _size |
data size More... | |
size_t | dims |
number of matrix dimensions More... | |
Vector< size_t > | dim_size |
size of matrix dimensions. More... | |
Vector< size_t > | acc_dim_size |
accumulated size of matrix dimensions. More... | |
Friends | |
class | Adjacency |
class | Kernel |
template<class D2 > | |
class | Matrix |
template<class D2 > | |
class | Image |
dimensional matrix handeling. When acessed by (x, y), or (x, y, z) operator, index x corresponds to the index of the column, and index y corresponds to the index of the row. This standard comes from text printing order and image display and storage in most of the computer systems.
Definition at line 29 of file FileImage.hpp.
Bial::Matrix< D >::Matrix | ( | ) |
Basic Constructor.
none. |
Definition at line 1145 of file Matrix.hpp.
Bial::Matrix< D >::Matrix | ( | const Vector< size_t > & | size | ) |
Basic Constructor.
size | Vector with matrix dimensions. |
Definition at line 1149 of file Matrix.hpp.
Bial::Matrix< D >::Matrix | ( | D * | new_data, |
const Vector< size_t > & | new_dim | ||
) |
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 matrix. Use this for compatibility with other data structures, in a easy convertion to Matrix class.
new_data | Pointer to data allocated elsewhere. |
new_dim | Matrix dimensions. |
Definition at line 1185 of file Matrix.hpp.
Bial::Matrix< D >::Matrix | ( | size_t | size_0, |
size_t | size_1 | ||
) |
Basic Constructor for 2D matrix.
size_0 | matrix dimension 0. |
size_1 | matrix dimension 1. |
Definition at line 1211 of file Matrix.hpp.
Bial::Matrix< D >::Matrix | ( | size_t | size_0, |
size_t | size_1, | ||
size_t | size_2 | ||
) |
Basic Constructor for 3D matrix.
size_0 | matrix dimension 0. |
size_1 | matrix dimension 1. |
size_2 | matrix dimension 2. |
Definition at line 1247 of file Matrix.hpp.
Bial::Matrix< D >::Matrix | ( | const Matrix< D > & | mtx | ) |
Copy constructor.
mtx | Source matrix to be clonned. |
Definition at line 1283 of file Matrix.hpp.
|
default |
Move constructor.
mtx | Source matrix to be clonned. |
Copy constructor.
mtx | Source matrix to be clonned. |
Definition at line 1308 of file Matrix.hpp.
void Bial::Matrix< D >::Abs | ( | ) |
Computes the absolute value of the matrix elements.
none. |
Definition at line 2106 of file Matrix.hpp.
Matrix< D > Bial::Matrix< D >::Abs | ( | ) | const |
Computes the absolute value of the matrix elements.
none. |
Definition at line 2123 of file Matrix.hpp.
const D & Bial::Matrix< D >::at | ( | size_t | p | ) | const |
Reads the constant reverence of value contained at position p of data Vector.
p | global index of the data being accessed. |
Definition at line 2391 of file Matrix.hpp.
D & Bial::Matrix< D >::at | ( | size_t | p | ) |
Reads the value contained at position p of data Vector and returns its reference.
p | global index of the data being accessed. |
Definition at line 2401 of file Matrix.hpp.
const D & Bial::Matrix< D >::at | ( | size_t | p_0, |
size_t | p_1 | ||
) | const |
Reads the constant reverence of value contained at position p_0, p_1 of data Vector.
p_0 | first index of the data being accessed. |
p_1 | second index of the data being accessed. |
Definition at line 2411 of file Matrix.hpp.
D & Bial::Matrix< D >::at | ( | size_t | p_0, |
size_t | p_1 | ||
) |
Reads the value contained at position p_0, p_1 of data Vector and returns its reference.
p_0 | first index of the data being accessed. |
p_1 | second index of the data being accessed. |
Definition at line 2424 of file Matrix.hpp.
const D & Bial::Matrix< D >::at | ( | size_t | p_0, |
size_t | p_1, | ||
size_t | p_2 | ||
) | const |
Reads the constant reverence of value contained at position p_0, p_1, p_2 of data Vector.
p_0 | first index of the data being accessed. |
p_1 | second index of the data being accessed. |
p_2 | third index of the data being accessed. |
Definition at line 2437 of file Matrix.hpp.
D & Bial::Matrix< D >::at | ( | size_t | p_0, |
size_t | p_1, | ||
size_t | p_2 | ||
) |
Reads the value contained at position p_0, p_1, p_2 of data Vector and returns its reference.
p_0 | first index of the data being accessed. |
p_1 | second index of the data being accessed. |
p_2 | third index of the data being accessed. |
Definition at line 2450 of file Matrix.hpp.
const D & Bial::Matrix< D >::at | ( | size_t | p_0, |
size_t | p_1, | ||
size_t | p_2, | ||
size_t | p_3 | ||
) | const |
Reads the constant reverence of value contained at position p_0, p_1, p_2, p_3 of data Vector.
p_0 | first index of the data being accessed. |
p_1 | second index of the data being accessed. |
p_2 | third index of the data being accessed. |
p_3 | fourth index of the data being accessed. |
Definition at line 2463 of file Matrix.hpp.
D & Bial::Matrix< D >::at | ( | size_t | p_0, |
size_t | p_1, | ||
size_t | p_2, | ||
size_t | p_3 | ||
) |
Reads the value contained at position p_0, p_1, p_2, p_3 of data Vector and returns its reference.
p_0 | first index of the data being accessed. |
p_1 | second index of the data being accessed. |
p_2 | third index of the data being accessed. |
p_3 | fourth index of the data being accessed. |
Definition at line 2477 of file Matrix.hpp.
const D & Bial::Matrix< D >::at | ( | size_t | p_0, |
size_t | p_1, | ||
size_t | p_2, | ||
size_t | p_3, | ||
size_t | p_4 | ||
) | const |
Reads the constant reverence of value contained at position p_0, p_1, p_2, p_3, p_4 of data Vector.
p_0 | first index of the data being accessed. |
p_1 | second index of the data being accessed. |
p_2 | third index of the data being accessed. |
p_3 | fourth index of the data being accessed. |
p_4 | fifth index of the data being accessed. |
Definition at line 2491 of file Matrix.hpp.
D & Bial::Matrix< D >::at | ( | size_t | p_0, |
size_t | p_1, | ||
size_t | p_2, | ||
size_t | p_3, | ||
size_t | p_4 | ||
) |
Reads the value contained at position p_0, p_1, p_2, p_3, p_4 of data Vector and returns its reference.
p_0 | first index of the data being accessed. |
p_1 | second index of the data being accessed. |
p_2 | third index of the data being accessed. |
p_3 | fourth index of the data being accessed. |
p_4 | fifth index of the data being accessed. |
Definition at line 2506 of file Matrix.hpp.
const D & Bial::Matrix< D >::at | ( | const Vector< size_t > & | p | ) | const |
Returns constant reference of data pointed by index ( p[ 0 ], p[ 1 ], p[ 2 ], ... ). It has the same effect as operator data[ p_0 + p_1 * acc_dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] ... ].
p | Vector of indexes to be acessed. |
Definition at line 2522 of file Matrix.hpp.
D & Bial::Matrix< D >::at | ( | const Vector< size_t > & | p | ) |
Returns constant reference of data pointed by index ( p[ 0 ], p[ 1 ], p[ 2 ], ... ). It has the same effect as operator data[ p_0 + p_1 * acc_dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] ... ].
p | Vector of indexes to be acessed. |
Definition at line 2537 of file Matrix.hpp.
|
noexcept |
Returns iterator begin() of data.
none. |
Definition at line 2146 of file Matrix.hpp.
|
noexcept |
Returns const_iterator begin() of data.
none. |
Definition at line 2152 of file Matrix.hpp.
|
noexcept |
|
noexcept |
size_t Bial::Matrix< D >::Coordinate | ( | size_t | position, |
size_t | dimension | ||
) | const |
Returns the coordinate of position in given dimension.
position | Dimension index. |
dimension | A matrix dimension. |
Definition at line 2257 of file Matrix.hpp.
Vector< size_t > Bial::Matrix< D >::Coordinates | ( | size_t | position | ) | const |
Returns the coordinates of the input position in this matrix.
index | element position. |
Definition at line 2268 of file Matrix.hpp.
|
noexcept |
|
noexcept |
const D * Bial::Matrix< D >::Data | ( | ) | const |
Returns a reference to data.
none. |
Definition at line 2210 of file Matrix.hpp.
D * Bial::Matrix< D >::Data | ( | ) |
Returns a reference to data.
none. |
Definition at line 2215 of file Matrix.hpp.
const D * Bial::Matrix< D >::data | ( | ) | const |
Returns a reference to data.
none. |
Definition at line 2220 of file Matrix.hpp.
D * Bial::Matrix< D >::data | ( | ) |
Returns a reference to data.
none. |
Definition at line 2225 of file Matrix.hpp.
Vector< size_t > Bial::Matrix< D >::Dim | ( | ) | const |
Returns a Vector with all matrix dimensions.
none. |
Definition at line 2344 of file Matrix.hpp.
size_t Bial::Matrix< D >::Dims | ( | ) | const |
Returns the number of dimensions of 'this' matrix.
none. |
Definition at line 2381 of file Matrix.hpp.
size_t Bial::Matrix< D >::Displacement | ( | size_t | dimension | ) | const |
Returns the position displacement of one unit in dimension i.
dimension | The required dimension. |
Definition at line 2386 of file Matrix.hpp.
size_t Bial::Matrix< D >::Elements | ( | ) | const |
Returns the number of elements of the matrix. Same as Size( ) method.
none. |
Definition at line 2240 of file Matrix.hpp.
size_t Bial::Matrix< D >::Elements | ( | D | min, |
D | max | ||
) | const |
Returns the number of elements counted inside the interval limited by min and max.
min | Minimum value in interval. |
max | Maximum value in interval. |
Definition at line 2245 of file Matrix.hpp.
|
noexcept |
Returns iterator end() of data.
none. |
Definition at line 2158 of file Matrix.hpp.
|
noexcept |
Returns const_iterator end() of data.
none. |
Definition at line 2164 of file Matrix.hpp.
bool Bial::Matrix< D >::Equals | ( | const Matrix< D2 > & | src, |
double | delta | ||
) | const |
Compares src matrix to 'this' matrix. They are considere equal only if they have the same dimensions and data.
src | Matrix to compare to. |
delta | Maximum difference between any element of |
'this' | and src. |
Definition at line 2701 of file Matrix.hpp.
size_t Bial::Matrix< D >::MaxDim | ( | ) | const |
Returns the maximum size among all matrix dimensions.
none. |
Definition at line 2360 of file Matrix.hpp.
D Bial::Matrix< D >::Maximum | ( | ) | const |
Compute and return the maximum value among matrix elements.
none. |
Definition at line 2608 of file Matrix.hpp.
size_t Bial::Matrix< D >::MinDim | ( | ) | const |
Returns the minimum size among all matrix dimensions.
none. |
Definition at line 2349 of file Matrix.hpp.
D Bial::Matrix< D >::Minimum | ( | ) | const |
Compute and return the minimum value among matrix elements.
none. |
Definition at line 2613 of file Matrix.hpp.
const D & Bial::Matrix< D >::operator() | ( | size_t | p | ) | const |
Returns constant reference of data pointed by index p. It has the same effect as operator data[ p ].
p | a global index to be acessed. |
Definition at line 2004 of file Matrix.hpp.
D & Bial::Matrix< D >::operator() | ( | size_t | p | ) |
Returns the reference for data pointed by index p. It has the same effect as operator data[ p ].
p | a global index to be acessed. |
Definition at line 2009 of file Matrix.hpp.
const D & Bial::Matrix< D >::operator() | ( | size_t | p_0, |
size_t | p_1 | ||
) | const |
Returns constant reference of data pointed by index ( p_0, p_1 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] ].
p_0 | first index to be acessed. |
p_1 | second index to be acessed. |
Definition at line 2014 of file Matrix.hpp.
D & Bial::Matrix< D >::operator() | ( | size_t | p_0, |
size_t | p_1 | ||
) |
Returns the reference for data pointed by index ( p_0, p_1 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] ].
p_0 | first index to be acessed. |
p_1 | second index to be acessed. |
Definition at line 2019 of file Matrix.hpp.
const D & Bial::Matrix< D >::operator() | ( | size_t | p_0, |
size_t | p_1, | ||
size_t | p_2 | ||
) | const |
Returns constant reference of data pointed by index ( p_0, p_1, p_2 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] ].
p_0 | first index to be acessed. |
p_1 | second index to be acessed. |
p_2 | third index to be acessed. |
Definition at line 2024 of file Matrix.hpp.
D & Bial::Matrix< D >::operator() | ( | size_t | p_0, |
size_t | p_1, | ||
size_t | p_2 | ||
) |
Returns the reference for data pointed by index ( p_0, p_1, p_2 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] ].
p_0 | first index to be acessed. |
p_1 | second index to be acessed. |
p_2 | third index to be acessed. |
Definition at line 2029 of file Matrix.hpp.
const D & Bial::Matrix< D >::operator() | ( | size_t | p_0, |
size_t | p_1, | ||
size_t | p_2, | ||
size_t | p_3 | ||
) | const |
Returns constant reference of data pointed by index ( p_0, p_1, p_2, p_3 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] + p_3 * acc_dim_size[ 2 ] ].
p_0 | first index to be acessed. |
p_1 | second index to be acessed. |
p_2 | third index to be acessed. |
p_3 | fourth index to be acessed. |
Definition at line 2034 of file Matrix.hpp.
D & Bial::Matrix< D >::operator() | ( | size_t | p_0, |
size_t | p_1, | ||
size_t | p_2, | ||
size_t | p_3 | ||
) |
Returns the reference for data pointed by index ( p_0, p_1, p_2, p_3 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] + p_3 * acc_dim_size[ 2 ] ].
p_0 | first index to be acessed. |
p_1 | second index to be acessed. |
p_2 | third index to be acessed. |
p_3 | fourth index to be acessed. |
Definition at line 2039 of file Matrix.hpp.
const D & Bial::Matrix< D >::operator() | ( | size_t | p_0, |
size_t | p_1, | ||
size_t | p_2, | ||
size_t | p_3, | ||
size_t | p_4 | ||
) | const |
Returns constant reference of data pointed by index ( p_0, p_1, p_2, p_3, p_4 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] + p_3 * acc_dim_size[ 2 ] + p_4 * acc_dim_size[ 3 ] ].
p_0 | first index to be acessed. |
p_1 | second index to be acessed. |
p_2 | third index to be acessed. |
p_3 | fourth index to be acessed. |
p_4 | fifth index to be acessed. |
Definition at line 2044 of file Matrix.hpp.
D & Bial::Matrix< D >::operator() | ( | size_t | p_0, |
size_t | p_1, | ||
size_t | p_2, | ||
size_t | p_3, | ||
size_t | p_4 | ||
) |
Returns the reference for data pointed by index ( p_0, p_1, p_2, p_3, p_4 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] + p_3 * acc_dim_size[ 2 ] + p_4 * acc_dim_size[ 3 ] ].
p_0 | first index to be acessed. |
p_1 | second index to be acessed. |
p_2 | third index to be acessed. |
p_3 | fourth index to be acessed. |
p_4 | fifth index to be acessed. |
Definition at line 2050 of file Matrix.hpp.
const D & Bial::Matrix< D >::operator() | ( | const Vector< size_t > & | p | ) | const |
Returns constant reference of data pointed by index ( p[ 0 ], p[ 1 ], p[ 2 ], ... ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] ... ].
p | Vector of indexes to be acessed. |
Definition at line 2056 of file Matrix.hpp.
D & Bial::Matrix< D >::operator() | ( | const Vector< size_t > & | p | ) |
Returns the reference of data pointed by index ( p[ 0 ], p[ 1 ], p[ 2 ], ... ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] ... ].
p | Vector of indexes to be acessed. |
Definition at line 2081 of file Matrix.hpp.
Matrix< D > Bial::Matrix< D >::operator* | ( | const Matrix< D2 > & | other | ) | const |
Computes the product of the matrices 'this' and other and returns the resultant matrix.
other | second other. |
Definition at line 1641 of file Matrix.hpp.
Matrix< D > Bial::Matrix< D >::operator* | ( | double | scalar | ) | const |
Computes the product of 'this' matrix by the scalar.
scalar | a scalar. |
Definition at line 1883 of file Matrix.hpp.
Matrix< D > & Bial::Matrix< D >::operator*= | ( | const Matrix< D2 > & | other | ) |
Computes the product of the matrices 'this' and other and assigns the result to this.
other | second other. |
Definition at line 1684 of file Matrix.hpp.
Matrix< D > & Bial::Matrix< D >::operator*= | ( | double | scalar | ) |
Updates 'this' matrix with the product of 'this' by the input scalar.
scalar | a scalar. |
Definition at line 1910 of file Matrix.hpp.
Matrix< D > Bial::Matrix< D >::operator+ | ( | const Matrix< D2 > & | other | ) | const |
Computes the sum of the matrices 'this' and other and returns the resultant matrix.
other | second other. |
Definition at line 1500 of file Matrix.hpp.
Matrix< D > Bial::Matrix< D >::operator+ | ( | double | scalar | ) | const |
Computes the sum of 'this' matrix by the scalar.
scalar | a scalar. |
Definition at line 1781 of file Matrix.hpp.
Matrix< D > & Bial::Matrix< D >::operator++ | ( | ) |
Increments all elements of this matrix and returns it.
none. |
Definition at line 1427 of file Matrix.hpp.
Matrix< D > Bial::Matrix< D >::operator++ | ( | int | ) |
Increments all elements of this matrix and returns it.
none. |
Definition at line 1435 of file Matrix.hpp.
Matrix< D > & Bial::Matrix< D >::operator+= | ( | const Matrix< D2 > & | other | ) |
Computes the sum of the matrices 'this' and other and assigns the result to this.
other | second other. |
Definition at line 1532 of file Matrix.hpp.
Matrix< D > & Bial::Matrix< D >::operator+= | ( | double | scalar | ) |
Updates 'this' matrix with the sum of 'this' by the input scalar.
scalar | a scalar. |
Definition at line 1808 of file Matrix.hpp.
Matrix< D > Bial::Matrix< D >::operator- | ( | ) | const |
Computes the negative matrix of 'this' and returns the resultant matrix.
other | second other. |
Definition at line 1556 of file Matrix.hpp.
Matrix< D > Bial::Matrix< D >::operator- | ( | const Matrix< D2 > & | other | ) | const |
Computes the difference of the matrices 'this' and other and returns the resultant matrix.
other | second other. |
Definition at line 1584 of file Matrix.hpp.
Matrix< D > Bial::Matrix< D >::operator- | ( | double | scalar | ) | const |
Computes the difference between 'this' matrix and the scalar.
scalar | a scalar. |
Definition at line 1832 of file Matrix.hpp.
Matrix< D > & Bial::Matrix< D >::operator-- | ( | ) |
Decrements all elements of this matrix and returns it.
none. |
Definition at line 1460 of file Matrix.hpp.
Matrix< D > Bial::Matrix< D >::operator-- | ( | int | ) |
Decrements all elements of this matrix and returns it.
none. |
Definition at line 1474 of file Matrix.hpp.
Matrix< D > & Bial::Matrix< D >::operator-= | ( | const Matrix< D2 > & | other | ) |
Computes the difference of the matrices 'this' and other and assigns the result to this.
other | second other. |
Definition at line 1616 of file Matrix.hpp.
Matrix< D > & Bial::Matrix< D >::operator-= | ( | double | scalar | ) |
Updates 'this' matrix with the difference between 'this' and the input scalar.
scalar | a scalar. |
Definition at line 1859 of file Matrix.hpp.
Matrix< D > Bial::Matrix< D >::operator/ | ( | const Matrix< D2 > & | other | ) | const |
Computes the division of the matrices 'this' and other and returns the resultant matrix.
other | second other. |
Definition at line 1709 of file Matrix.hpp.
Matrix< D > Bial::Matrix< D >::operator/ | ( | double | scalar | ) | const |
Computes the division of 'this' matrix by the scalar.
scalar | a scalar. |
Definition at line 1934 of file Matrix.hpp.
Matrix< D > & Bial::Matrix< D >::operator/= | ( | const Matrix< D2 > & | other | ) |
Computes the division of the matrices 'this' and other and assigns the result to this.
other | second other. |
Definition at line 1757 of file Matrix.hpp.
Matrix< D > & Bial::Matrix< D >::operator/= | ( | double | scalar | ) |
Updates 'this' matrix with the division of 'this' by the input scalar.
scalar | a scalar. |
Definition at line 1966 of file Matrix.hpp.
Matrix< D > & Bial::Matrix< D >::operator= | ( | const Matrix< D > & | other | ) |
Assigns 'other' matrix content to this matrix.
other | matrix to be assigned. |
Definition at line 1337 of file Matrix.hpp.
|
default |
Assigns 'other' matrix content to this matrix, moving the content.
other | matrix to be assigned. |
Matrix< D > & Bial::Matrix< D >::operator= | ( | const Matrix< D2 > & | other | ) |
Assigns 'other' matrix content to this matrix.
other | matrix to be assigned. |
Definition at line 1370 of file Matrix.hpp.
bool Bial::Matrix< D >::operator== | ( | const Matrix< D2 > & | other | ) | const |
The matrices are considered equal if they have the same dimensions and their elements have the same value.
other | matrix to be compared. |
Definition at line 1405 of file Matrix.hpp.
const D & Bial::Matrix< D >::operator[] | ( | size_t | p | ) | const |
Returns a constant reference of data pointed by index p. It has the same effect as operator data( p ).
p | a global index to be acessed. |
Definition at line 1993 of file Matrix.hpp.
D & Bial::Matrix< D >::operator[] | ( | size_t | p | ) |
Returns the reference for data pointed by index p. It has the same effect as operator data( p ).
p | a global index to be acessed. |
Definition at line 1999 of file Matrix.hpp.
size_t Bial::Matrix< D >::Position | ( | size_t | p_0, |
size_t | p_1 | ||
) | const |
Returns the position corresponding to the input coordinates in this matrix.
p_0 | dim 0 coordinate. |
p_1 | dim 1 coordinate. |
Definition at line 2279 of file Matrix.hpp.
size_t Bial::Matrix< D >::Position | ( | size_t | p_0, |
size_t | p_1, | ||
size_t | p_2 | ||
) | const |
Returns the position corresponding to the input coordinates in this matrix.
p_0 | dim 0 coordinate. |
p_1 | dim 1 coordinate. |
p_2 | dim 2 coordinate. |
Definition at line 2284 of file Matrix.hpp.
size_t Bial::Matrix< D >::Position | ( | size_t | p_0, |
size_t | p_1, | ||
size_t | p_2, | ||
size_t | p_3 | ||
) | const |
Returns the position corresponding to the input coordinates in this matrix.
p_0 | dim 0 coordinate. |
p_1 | dim 1 coordinate. |
p_2 | dim 2 coordinate. |
p_3 | dim 3 coordinate. |
Definition at line 2289 of file Matrix.hpp.
size_t Bial::Matrix< D >::Position | ( | const Vector< size_t > & | coordinates | ) | const |
Returns the position corresponding to the input coordinates in this matrix.
coordinates | element coordinates. |
Definition at line 2294 of file Matrix.hpp.
size_t Bial::Matrix< D >::Position | ( | const Vector< int > & | coordinates | ) | const |
Returns the position corresponding to the input coordinates in this matrix.
coordinates | element coordinates. |
Definition at line 2306 of file Matrix.hpp.
size_t Bial::Matrix< D >::Position | ( | const Vector< float > & | coordinates | ) | const |
Returns the position corresponding to the input coordinates in this matrix.
coordinates | element coordinates. |
Definition at line 2318 of file Matrix.hpp.
Prints matrix containts to output stream os.
os | an output stream. |
Definition at line 2619 of file Matrix.hpp.
Prints matrix dimensions to output stream os.
none. |
Definition at line 2679 of file Matrix.hpp.
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
bool Bial::Matrix< D >::SameDimensions | ( | const Matrix< D2 > & | src | ) | const |
Compares the dimensions of src matrix to the dimensions of 'this' matrix.
src | Matrix to compare to. |
Definition at line 2727 of file Matrix.hpp.
bool Bial::Matrix< D >::SameDimensions | ( | const Adjacency & | adj | ) | const |
Compares the dimensions of adj adjacency relation to the dimensions of 'this' matrix.
adj | Adjacency relation to compare to. |
Definition at line 2735 of file Matrix.hpp.
void Bial::Matrix< D >::Set | ( | D | val | ) |
Sets val to each element of the matrix.
val | value to be set to the entire matrix. |
Definition at line 2330 of file Matrix.hpp.
void Bial::Matrix< D >::SetRange | ( | D | min, |
D | max | ||
) |
Recalculate the amplitude scale of the matrix by the following formula: mat[ pxl ] = min + ( mat[ pxl ] - mat_min ) * ( max - min ) / ( mat_max - mat_min )
min | minimum value of the new amplitude scale |
max | maximum value of the new amplitude scale |
Definition at line 2562 of file Matrix.hpp.
size_t Bial::Matrix< D >::Size | ( | ) | const |
Returns size of data Vector.
none. |
Definition at line 2235 of file Matrix.hpp.
size_t Bial::Matrix< D >::size | ( | ) | const |
Returns size of data Vector. Same as Size( ), just for compatibility with std containers.
none. |
Definition at line 2230 of file Matrix.hpp.
size_t Bial::Matrix< D >::Size | ( | size_t | dimension | ) | const |
Returns matrix required dimension.
i | The required dimension. |
Definition at line 2371 of file Matrix.hpp.
size_t Bial::Matrix< D >::size | ( | size_t | dimension | ) | const |
Returns matrix required dimension. Just for symmetry with size( ) and Size( ) functions.
dimension | The required dimension. |
Definition at line 2376 of file Matrix.hpp.
bool Bial::Matrix< D >::ValidElement | ( | const Vector< size_t > & | p | ) | const |
Verifies if element is in matrix domain.
p | Vector of indexes to be acessed. |
Definition at line 2552 of file Matrix.hpp.
|
friend |
Definition at line 36 of file Matrix.hpp.
Definition at line 41 of file Matrix.hpp.
|
friend |
Definition at line 37 of file Matrix.hpp.
Definition at line 39 of file Matrix.hpp.
|
protected |
data vector
Definition at line 46 of file Matrix.hpp.
|
protected |
data size
Definition at line 50 of file Matrix.hpp.
|
protected |
accumulated size of matrix dimensions.
Definition at line 56 of file Matrix.hpp.
|
protected |
size of matrix dimensions.
Definition at line 54 of file Matrix.hpp.
|
protected |
number of matrix dimensions
Definition at line 52 of file Matrix.hpp.
|
protected |
Quick access reference for data.
Definition at line 48 of file Matrix.hpp.