STIR
6.2.0
|
This stores the non-zero projection matrix elements for every 'voxel'. More...
#include "stir/recon_buildblock/ProjMatrixElemsForOneDensel.h"
Public Types | |
typedef ProjMatrixElemsForOneDenselValue | value_type |
Recommended way to call the type of the elements, instead of referring to the actual classname. More... | |
typedef Element_vector::iterator | iterator |
typedefs for iterator support | |
typedef Element_vector::const_iterator | const_iterator |
typedef Element_vector::size_type | size_type |
typedef Element_vector::difference_type | difference_type |
typedef std::random_access_iterator_tag | iterator_category |
typedef value_type & | reference |
typedef const value_type & | const_reference |
Public Member Functions | |
ProjMatrixElemsForOneDensel () | |
constructor | |
ProjMatrixElemsForOneDensel (const Densel &Densel, const int default_capacity=300) | |
Succeeded | check_state () const |
check if each voxel occurs only once | |
const Densel & | get_densel () const |
get the Densel coordinates corresponding to this row | |
void | set_densel (const Densel &) |
and set the Densel coordinates | |
iterator | begin () |
functions for allowing iterator access | |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
void | erase () |
reset lor to 0 length | |
void | push_back (const value_type &) |
add a new value_type object at the end More... | |
void | reserve (size_type max_number) |
reserve enough space for max_number elements (but don't fill them in) | |
size_type | size () const |
number of non-zero elements | |
ProjMatrixElemsForOneDensel & | operator*= (const float d) |
Multiplies all values with a constant. | |
ProjMatrixElemsForOneDensel & | operator/= (const float d) |
Divides all values with a constant. | |
void | sort () |
Sort the elements on coordinates of the voxels. More... | |
void | merge (ProjMatrixElemsForOneDensel &lor) |
merge 2nd lor into current object More... | |
float | square_sum () const |
Return sum of squares of all values. More... | |
This stores the non-zero projection matrix elements for every 'voxel'.
Most of the members of this class would work just as well for a (not yet existing) class ProjMatrixElemsForOneVoxel. This means that we should derived both from a common base class, templated in the type of element (TODO).
It might be useful to template this class in terms of the element-type as well. That way, we could have 'compact' elements, efficient elements, etc. However, doing this will probably only be useful if all ProjMatrixByDensel classes are then templated as well (TODO?).
Recommended way to call the type of the elements, instead of referring to the actual classname.
Think about this name as 'the type of the value of a ProjMatrixElemsForOneDensel::iterator *'.
This typedef is also required for 'standard' iterators.
|
explicit |
Densel | effectively calls set_densel(Densel) |
default_capacity | effectively calls reserve(default_capacity) |
|
inline |
add a new value_type object at the end
Referenced by stir::ProjMatrixByDenselOnCartesianGridUsingElement::calculate_proj_matrix_elems_for_one_densel(), and merge().
void stir::ProjMatrixElemsForOneDensel::sort | ( | ) |
Sort the elements on coordinates of the voxels.
Uses value_type::coordinates_less as ordering function.
References begin(), and stir::ProjMatrixElemsForOneDenselValue::coordinates_less().
Referenced by check_state().
void stir::ProjMatrixElemsForOneDensel::merge | ( | ProjMatrixElemsForOneDensel & | lor | ) |
merge 2nd lor into current object
This makes sure that in the result, no duplicate coordinates occur.
lor
. References begin(), check_state(), stir::ProjMatrixElemsForOneDenselValue::coordinates_equal(), erase(), push_back(), and size().
float stir::ProjMatrixElemsForOneDensel::square_sum | ( | ) | const |
Return sum of squares of all values.
References begin(), and stir::square().