|
STIR 6.4.0
|
This class defines multi-dimensional (numeric) arrays. More...
#include "stir/Array.h"

Public Member Functions | |
| template<int num_dimensions, typename elemT> | |
| Array (Array< num_dimensions, elemT > &&other) noexcept | |
| template<typename elemT2> | |
| void | axpby (const elemT2 a, const Array &x, const elemT2 b, const Array &y) |
| template<class elemT> | |
| Array (const IndexRange< 1 > &range) | |
| template<class elemT> | |
| Array (const int min_index, const int max_index) | |
| template<class elemT> | |
| Array (const IndexRange< 1 > &range, shared_ptr< elemT[]> data_sptr) | |
| template<class elemT> | |
| Array (const IndexRange< 1 > &range, const elemT *const data_ptr) | |
| template<typename elemT> | |
| Array (const Array< 1, elemT > &other) | |
| template<typename elemT> | |
| Array (Array< 1, elemT > &&other) noexcept | |
functions returning full_iterators | |
| full_iterator | begin_all () |
| start value for iterating through all elements in the array, see full_iterator | |
| const_full_iterator | begin_all () const |
| start value for iterating through all elements in the (const) array, see full_iterator | |
| const_full_iterator | begin_all_const () const |
| start value for iterating through all elements in the array, see full_iterator | |
| full_iterator | end_all () |
| end value for iterating through all elements in the array, see full_iterator | |
| const_full_iterator | end_all () const |
| end value for iterating through all elements in the (const) array, see full_iterator | |
| const_full_iterator | end_all_const () const |
| end value for iterating through all elements in the array, see full_iterator | |
| IndexRange< num_dimensions > | get_index_range () const |
| size_t | size_all () const |
| return the total number of elements in this array | |
| virtual void | resize (const IndexRange< num_dimensions > &range) |
| change the array to a new range of indices, new elements are set to 0 | |
| virtual void | grow (const IndexRange< num_dimensions > &range) |
| alias for resize() | |
| elemT | sum () const |
| return sum of all elements | |
| elemT | sum_positive () const |
| return sum of all positive elements | |
| elemT | find_max () const |
| return maximum of all the elements | |
| elemT | find_min () const |
| return minimum of all the elements | |
| void | fill (const elemT &n) |
Fill elements with value n. | |
| void | apply_lower_threshold (const elemT &l) |
| Sets elements below value to the value. | |
| void | apply_upper_threshold (const elemT &u) |
| Sets elements above value to the value. | |
| bool | is_regular () const |
| checks if the index range is 'regular' | |
| bool | get_regular_range (BasicCoordinate< num_dimensions, int > &min, BasicCoordinate< num_dimensions, int > &max) const |
find regular range, returns false if the range is not regular | |
| Array< num_dimensions - 1, elemT > & | operator[] (int i) |
| allow array-style access, read/write | |
| const Array< num_dimensions - 1, elemT > & | operator[] (int i) const |
| array access, read-only | |
| elemT & | operator[] (const BasicCoordinate< num_dimensions, int > &c) |
| allow array-style access given a BasicCoordinate to specify the indices, read/write | |
| const elemT & | operator[] (const BasicCoordinate< num_dimensions, int > &c) const |
| array access given a BasicCoordinate to specify the indices, read-only | |
indexed access with range checking (throw std:out_of_range) | |
| Array< num_dimensions - 1, elemT > & | at (int i) |
| const Array< num_dimensions - 1, elemT > & | at (int i) const |
| elemT & | at (const BasicCoordinate< num_dimensions, int > &c) |
| const elemT & | at (const BasicCoordinate< num_dimensions, int > &c) const |
Numerical operations | |
| self & | operator+= (const self &x) |
| self & | operator-= (const self &x) |
| self & | operator*= (const self &x) |
| self & | operator/= (const self &x) |
| self & | operator+= (const elemT x) |
| self & | operator-= (const elemT x) |
| self & | operator*= (const elemT x) |
| self & | operator/= (const elemT x) |
| self | operator+ (const self &x) const |
| self | operator+ (const elemT x) const |
| self | operator- (const self &x) const |
| self | operator- (const elemT x) const |
| self | operator* (const self &x) const |
| self | operator* (const elemT x) const |
| self | operator/ (const self &x) const |
| self | operator/ (const elemT x) const |
| template<typename elemT2> | |
| STIR_DEPRECATED void | axpby (const elemT2 a, const Array &x, const elemT2 b, const Array &y) |
| void | xapyb (const Array &x, const elemT a, const Array &y, const elemT b) |
| set values of the array to x*a+y*b, where a and b are scalar | |
| void | xapyb (const Array &x, const Array &a, const Array &y, const Array &b) |
| set values of the array to x*a+y*b, where a and b are arrays | |
| template<class T> | |
| void | sapyb (const T &a, const Array &y, const T &b) |
| set values of the array to self*a+y*b where a and b are scalar or arrays | |
Public Member Functions inherited from stir::NumericVectorWithOffset< Array< num_dimensions - 1, elemT >, elemT > | |
| NumericVectorWithOffset (const VectorWithOffset< Array< num_dimensions - 1, elemT > > &t) | |
| Constructor from an object of this class' base_type. | |
| NumericVectorWithOffset (const NumericVectorWithOffset &t) | |
| Constructor from an object of this class' base_type. | |
| NumericVectorWithOffset (NumericVectorWithOffset &&other) noexcept | |
| move constructor | |
| NumericVectorWithOffset & | operator= (const NumericVectorWithOffset &other) |
| assignment | |
| NumericVectorWithOffset | operator+ (const NumericVectorWithOffset &v) const |
| adding vectors, element by element | |
| NumericVectorWithOffset | operator- (const NumericVectorWithOffset &v) const |
| subtracting vectors, element by element | |
| NumericVectorWithOffset | operator* (const NumericVectorWithOffset &v) const |
| multiplying vectors, element by element | |
| NumericVectorWithOffset | operator/ (const NumericVectorWithOffset &v) const |
| dividing vectors, element by element | |
| NumericVectorWithOffset | operator+ (const elemT &v) const |
return a new vector with elements equal to the sum of the elements in the original and the elemT | |
| NumericVectorWithOffset | operator- (const elemT &v) const |
return a new vector with elements equal to the difference of the elements in the original and the elemT | |
| NumericVectorWithOffset | operator* (const elemT &v) const |
return a new vector with elements equal to the multiplication of the elements in the original and the elemT | |
| NumericVectorWithOffset | operator/ (const elemT &v) const |
return a new vector with elements equal to the division of the elements in the original and the elemT | |
| NumericVectorWithOffset & | operator+= (const NumericVectorWithOffset &v) |
adding elements of v to the current vector | |
| NumericVectorWithOffset & | operator-= (const NumericVectorWithOffset &v) |
subtracting elements of v from the current vector | |
| NumericVectorWithOffset & | operator*= (const NumericVectorWithOffset &v) |
multiplying elements of the current vector with elements of v | |
| NumericVectorWithOffset & | operator/= (const NumericVectorWithOffset &v) |
dividing all elements of the current vector by elements of v | |
| NumericVectorWithOffset & | operator+= (const elemT &v) |
adding an elemT to the elements of the current vector | |
| NumericVectorWithOffset & | operator-= (const elemT &v) |
subtracting an elemT from the elements of the current vector | |
| NumericVectorWithOffset & | operator*= (const elemT &v) |
multiplying the elements of the current vector with an elemT | |
| NumericVectorWithOffset & | operator/= (const elemT &v) |
dividing the elements of the current vector by an elemT | |
| STIR_DEPRECATED void | axpby (const elemT2 a, const NumericVectorWithOffset &x, const elemT2 b, const NumericVectorWithOffset &y) |
| void | xapyb (const NumericVectorWithOffset &x, const elemT a, const NumericVectorWithOffset &y, const elemT b) |
| set values of the array to x*a+y*b, where a and b are scalar | |
| void | xapyb (const NumericVectorWithOffset &x, const NumericVectorWithOffset &a, const NumericVectorWithOffset &y, const NumericVectorWithOffset &b) |
| set the values of the array to x*a+y*b, where a and b are vectors | |
| void | sapyb (const T2 &a, const NumericVectorWithOffset &y, const T2 &b) |
| set the values of the array to self*a+y*b, where a and b are scalar or vectors | |
| void | axpby (const NUMBER2 a, const NumericVectorWithOffset &x, const NUMBER2 b, const NumericVectorWithOffset &y) |
| NumericVectorWithOffset (const VectorWithOffset< Array< num_dimensions - 1, elemT > > &t) | |
| Constructor from an object of this class' base_type. | |
| NumericVectorWithOffset (const NumericVectorWithOffset &t) | |
| Constructor from an object of this class' base_type. | |
| NumericVectorWithOffset (NumericVectorWithOffset &&other) noexcept | |
| move constructor | |
| NumericVectorWithOffset & | operator= (const NumericVectorWithOffset &other) |
| assignment | |
| NumericVectorWithOffset | operator+ (const NumericVectorWithOffset &v) const |
| adding vectors, element by element | |
| NumericVectorWithOffset | operator+ (const elemT &v) const |
return a new vector with elements equal to the sum of the elements in the original and the elemT | |
| NumericVectorWithOffset | operator- (const NumericVectorWithOffset &v) const |
| subtracting vectors, element by element | |
| NumericVectorWithOffset | operator- (const elemT &v) const |
return a new vector with elements equal to the difference of the elements in the original and the elemT | |
| NumericVectorWithOffset | operator* (const NumericVectorWithOffset &v) const |
| multiplying vectors, element by element | |
| NumericVectorWithOffset | operator* (const elemT &v) const |
return a new vector with elements equal to the multiplication of the elements in the original and the elemT | |
| NumericVectorWithOffset | operator/ (const NumericVectorWithOffset &v) const |
| dividing vectors, element by element | |
| NumericVectorWithOffset | operator/ (const elemT &v) const |
return a new vector with elements equal to the division of the elements in the original and the elemT | |
| NumericVectorWithOffset & | operator+= (const NumericVectorWithOffset &v) |
adding elements of v to the current vector | |
| NumericVectorWithOffset & | operator+= (const elemT &v) |
adding an elemT to the elements of the current vector | |
| NumericVectorWithOffset & | operator-= (const NumericVectorWithOffset &v) |
subtracting elements of v from the current vector | |
| NumericVectorWithOffset & | operator-= (const elemT &v) |
subtracting an elemT from the elements of the current vector | |
| NumericVectorWithOffset & | operator*= (const NumericVectorWithOffset &v) |
multiplying elements of the current vector with elements of v | |
| NumericVectorWithOffset & | operator*= (const elemT &v) |
multiplying the elements of the current vector with an elemT | |
| NumericVectorWithOffset & | operator/= (const NumericVectorWithOffset &v) |
dividing all elements of the current vector by elements of v | |
| NumericVectorWithOffset & | operator/= (const elemT &v) |
dividing the elements of the current vector by an elemT | |
| STIR_DEPRECATED void | axpby (const elemT2 a, const NumericVectorWithOffset &x, const elemT2 b, const NumericVectorWithOffset &y) |
| void | axpby (const NUMBER2 a, const NumericVectorWithOffset &x, const NUMBER2 b, const NumericVectorWithOffset &y) |
| void | xapyb (const NumericVectorWithOffset &x, const elemT a, const NumericVectorWithOffset &y, const elemT b) |
| set values of the array to x*a+y*b, where a and b are scalar | |
| void | xapyb (const NumericVectorWithOffset &x, const NumericVectorWithOffset &a, const NumericVectorWithOffset &y, const NumericVectorWithOffset &b) |
| set the values of the array to x*a+y*b, where a and b are vectors | |
| void | sapyb (const T2 &a, const NumericVectorWithOffset &y, const T2 &b) |
| set the values of the array to self*a+y*b, where a and b are scalar or vectors | |
Public Member Functions inherited from stir::VectorWithOffset< T > | |
| int | get_length () const |
| return number of elements in this vector | |
| size_t | size () const |
| return number of elements in this vector | |
| int | get_min_index () const |
| get value of first valid index | |
| int | get_max_index () const |
| get value of last valid index | |
| void | set_offset (const int min_index) |
| change value of starting index | |
| void | set_min_index (const int min_index) |
| identical to set_offset() | |
| virtual void | grow (const int min_index, const int max_index) |
grow the range of the vector, new elements are set to T() | |
| void | grow (const unsigned int new_size) |
grow the range of the vector from 0 to new_size-1, new elements are set to T() | |
| virtual void | resize (const int min_index, const int max_index) |
change the range of the vector, new elements are set to T() | |
| void | resize (const unsigned int new_size) |
change the range of the vector from 0 to new_size-1, new elements are set to T() | |
| void | reserve (const int min_index, const int max_index) |
| make the allocated range at least from min_index to max_index | |
| void | reserve (const unsigned int new_size) |
| make the allocated range at least from 0 to new_size-1 | |
| size_t | capacity () const |
| get allocated size | |
| bool | owns_memory_for_data () const |
| check if this object owns the memory for the data | |
| int | get_capacity_min_index () const |
| get min_index within allocated range | |
| int | get_capacity_max_index () const |
| get max_index within allocated range | |
| T & | operator[] (int i) |
| allow array-style access, read/write | |
| const T & | operator[] (int i) const |
| array access, read-only | |
| T & | at (int i) |
| allow array-style access, read/write, but with range checking (throws std::out_of_range) | |
| const T & | at (int i) const |
| array access, read-only, but with range checking (throws std::out_of_range) | |
| bool | empty () const |
| checks if the vector is empty | |
| bool | operator== (const VectorWithOffset &iv) const |
| bool | operator!= (const VectorWithOffset &iv) const |
| void | fill (const T &n) |
| fill elements with value n | |
| void | apply_lower_threshold (const T &lower) |
| Sets elements below value to the value. | |
| void | apply_upper_threshold (const T &upper) |
| Sets elements above value to the value. | |
| T * | get_data_ptr () |
| member function for access to the data via a T* | |
| const T * | get_const_data_ptr () const |
| member function for access to the data via a const T* | |
| void | release_data_ptr () |
| signal end of access to T* | |
| void | release_const_data_ptr () const |
| signal end of access to const T* | |
| iterator | begin () |
| use to initialise an iterator to the first element of the vector | |
| const_iterator | begin () const |
| use to initialise an iterator to the first element of the (const) vector | |
| iterator | end () |
| iterator 'past' the last element of the vector | |
| const_iterator | end () const |
| iterator 'past' the last element of the (const) vector | |
| reverse_iterator | rbegin () |
| reverse_iterator | rend () |
| const_reverse_iterator | rbegin () const |
| const_reverse_iterator | rend () const |
| VectorWithOffset & | operator+= (const VectorWithOffset &v) |
adding elements of v to the current vector | |
| VectorWithOffset & | operator-= (const VectorWithOffset &v) |
subtracting elements of v from the current vector | |
| VectorWithOffset & | operator*= (const VectorWithOffset &v) |
multiplying elements of the current vector with elements of v | |
| VectorWithOffset & | operator/= (const VectorWithOffset &v) |
dividing all elements of the current vector by elements of v | |
| VectorWithOffset () | |
| Default constructor: creates a vector of length 0. | |
| VectorWithOffset (const int hsz) | |
Construct a VectorWithOffset of given length (initialised with T()) | |
| VectorWithOffset (const int min_index, const int max_index) | |
Construct a VectorWithOffset with offset min_index (initialised with T()) | |
| STIR_DEPRECATED | VectorWithOffset (const int hsz, T *const data_ptr, T *const end_of_data_ptr) |
| Construct a VectorWithOffset of given length pointing to existing data. | |
| STIR_DEPRECATED | VectorWithOffset (const int min_index, const int max_index, T *const data_ptr, T *const end_of_data_ptr) |
Construct a VectorWithOffset with offset min_index pointing to existing data. | |
| VectorWithOffset (const int hsz, const T *const data_ptr) | |
| Construct a VectorWithOffset of given length from a bare pointer (copying data) | |
| VectorWithOffset (const int min_index, const int max_index, const T *const data_ptr) | |
Construct a VectorWithOffset with offset min_index from a bare pointer (copying data) | |
| VectorWithOffset (const int min_index, const int max_index, shared_ptr< T[]> data_sptr) | |
| Construct a VectorWithOffset sharing existing data. | |
| VectorWithOffset (const int sz, shared_ptr< T[]> data_sptr) | |
| Construct a VectorWithOffset sharing existing data. | |
| VectorWithOffset (const VectorWithOffset &il) | |
| copy constructor | |
| virtual | ~VectorWithOffset () |
| Destructor. | |
| VectorWithOffset (VectorWithOffset &&other) noexcept | |
| move constructor | |
| void | recycle () |
| Free all memory and make object as if default-constructed. | |
| VectorWithOffset & | operator= (const VectorWithOffset &il) |
| assignment operator with another vector | |
| VectorWithOffset | operator+ (const VectorWithOffset &v) const |
| adding vectors, element by element | |
| VectorWithOffset | operator- (const VectorWithOffset &v) const |
| subtracting vectors, element by element | |
| VectorWithOffset | operator* (const VectorWithOffset &v) const |
| multiplying vectors, element by element | |
| VectorWithOffset | operator/ (const VectorWithOffset &v) const |
| dividing vectors, element by element | |
typedefs for full_iterator support | |
Full iterators provide a 1-dimensional view on a multi-dimensional Array. | |
| typedef elemT | full_value_type |
| typedef full_value_type * | full_pointer |
| typedef const full_value_type * | const_full_pointer |
| typedef full_value_type & | full_reference |
| typedef const full_value_type & | const_full_reference |
| typedef FullArrayIterator< typename base_type::iterator, typename Array< num_dimensions - 1, elemT >::full_iterator, elemT, full_reference, full_pointer > | full_iterator |
| This defines an iterator type that iterates through all elements. | |
| typedef FullArrayIterator< typename base_type::const_iterator, typename Array< num_dimensions - 1, elemT >::const_full_iterator, elemT, const_full_reference, const_full_pointer > | const_full_iterator |
| As full_iterator, but for const objects. | |
| void | swap (Array &first, Array &second) |
| Swap content/members of 2 objects. | |
| Array () | |
| Construct an empty Array. | |
| Array (const IndexRange< num_dimensions > &) | |
| Construct an Array of given range of indices, elements are initialised to 0. | |
| Array (const IndexRange< num_dimensions > &range, shared_ptr< elemT[]> data_sptr) | |
| Construct an Array pointing to existing contiguous data. | |
| Array (const base_type &t) | |
| Construct an Array from an object of its base_type. | |
| Array (const self &t) | |
| Copy constructor. | |
| ~Array () override | |
| virtual destructor, frees up any allocated memory | |
| Array (Array &&other) noexcept | |
| move constructor | |
| Array & | operator= (Array other) |
| assignment operator | |
access to the data via a pointer | |
| bool | is_contiguous () const |
| return if the array is contiguous in memory | |
| elemT * | get_full_data_ptr () |
| member function for access to the data via a elemT* | |
| const elemT * | get_const_full_data_ptr () const |
| member function for access to the data via a const elemT* | |
| void | release_full_data_ptr () |
| signal end of access to elemT* | |
| void | release_const_full_data_ptr () const |
| signal end of access to const elemT* | |
Additional Inherited Members | |
| void | check_state () const |
| Called internally to see if all variables are consistent. | |
| void | init_with_copy (const int min_index, const int max_index, T const *const data_ptr) |
change vector to the new index range and copy data from data_ptr | |
| void | init (const int min_index, const int max_index, T *const data_ptr, bool copy_data) |
initialise vector to the given index range and either copy from or point to data_ptr | |
| T * | num |
| pointer to (*this)[0] (taking get_min_index() into account that is). | |
This class defines multi-dimensional (numeric) arrays.
This class implements multi-dimensional arrays which can have 'irregular' ranges. See IndexRange for a description of the ranges. Normal numeric operations are defined. In addition, two types of iterators are defined, one which iterators through the outer index, and one which iterates through all elements of the array.
The implementation is "recursive", e.g. a 3D array is a (1D) NumericVectorWithOffset of 2D arrays. Since STIR 6.3, Arrays are allocated using a single block of memory, such that is_contiguous() is true. However, calling Array::resize likely breaks this.
Array inherits its numeric operators from NumericVectorWithOffset. In particular this means that operator+= etc. potentially grow the object. However, as grow() is a virtual function, Array::grow is called, which initialises new elements first to 0.
|
inline |
Construct an Array pointing to existing contiguous data.
data_sptr.get() block. Therefore, any modifications to the array will modify the data at data_sptr.get(). This will be true until the Array is resized.The C-array data_ptr will be accessed with the last dimension running fastest ("row-major" order).
|
noexcept |
move constructor
implementation uses the copy-and-swap idiom, see e.g. https://stackoverflow.com/a/3279550
| Array< 1, elemT > & stir::Array< elemT >::operator= | ( | Array< num_dimensions, elemT > | other | ) |
assignment operator
implementation uses the copy-and-swap idiom, see e.g. https://stackoverflow.com/a/3279550
References size_all(), and swap.
Referenced by stir::VoxelsOnCartesianGrid< KineticParameters< 2, float > >::grow_z_range(), stir::PixelsOnCartesianGrid< elemT >::PixelsOnCartesianGrid(), stir::VoxelsOnCartesianGrid< KineticParameters< 2, float > >::set_plane(), stir::VoxelsOnCartesianGrid< elemT >::VoxelsOnCartesianGrid(), and stir::VoxelsOnCartesianGrid< KineticParameters< 2, float > >::VoxelsOnCartesianGrid().
|
inlinevirtual |
change the array to a new range of indices, new elements are set to 0
Current behaviour is that when resizing to a smaller array, the same memory will be used. However, when growing any of the dimensions, a new Array will be allocated and the data copied.
If the array points to a shared block of data, growing might be non-intuitive: the resized array will no longer point to the original block of data.
References stir::VectorWithOffset< T >::begin(), stir::VectorWithOffset< T >::end(), stir::VectorWithOffset< T >::get_max_index(), stir::VectorWithOffset< T >::get_min_index(), resize(), and stir::VectorWithOffset< T >::resize().
Referenced by grow(), stir::GE::RDF_HDF5::GEHDF5Wrapper::read_singles(), resize(), stir::SegmentBySinogram< elemT >::resize(), stir::SegmentByView< elemT >::resize(), stir::Sinogram< elemT >::resize(), stir::Viewgram< elemT >::resize(), stir::ArrayFilterTests::run_tests(), stir::ArrayTests::run_tests(), stir::ScatterSimulation::sample_scatter_points(), and stir::ColsherFilter::set_up().
|
inline |
Fill elements with value n.
hides VectorWithOffset::fill
References stir::VectorWithOffset< T >::check_state(), fill(), stir::VectorWithOffset< T >::get_max_index(), stir::VectorWithOffset< T >::get_min_index(), and stir::VectorWithOffset< T >::num.
Referenced by stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin< TargetT >::actual_subsets_are_approximately_balanced(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< TargetT >::actual_subsets_are_approximately_balanced(), stir::GibbsPenalty< elemT, potentialT >::compute_gradient(), stir::LogcoshPrior< elemT >::compute_gradient(), stir::PLSPrior< elemT >::compute_gradient(), stir::QuadraticPrior< elemT >::compute_gradient(), stir::RelativeDifferencePrior< elemT >::compute_gradient(), stir::GibbsPenalty< elemT, potentialT >::compute_Hessian(), stir::RelativeDifferencePrior< elemT >::compute_Hessian(), stir::GibbsPenalty< elemT, potentialT >::compute_Hessian_diagonal(), stir::distributable_computation(), stir::distributable_computation_cache_enabled(), fill(), stir::ProjData::fill(), stir::BackProjectorByBin::get_output(), stir::ML_estimate_component_based_normalisation(), stir::ArrayTests::run_tests(), stir::convert_array_Tests::run_tests(), stir::find_fwhm_in_imageTests::run_tests(), stir::stir_mathTests::run_tests(), stir::VoxelsOnCartesianGridTests::run_tests(), stir::warp_imageTests::run_tests(), stir::zoom_imageTests::run_tests(), stir::ColsherFilter::set_up(), stir::truncate_end_planes(), and stir::ScatterEstimation::upsample_and_fit_scatter_estimate().
|
inline |
checks if the index range is 'regular'
Implementation note: this works by calling get_index_range().is_regular(). We cannot rely on remembering if it was a regular range at construction (or even resizing) time as resize() could have been called on an element of the array. Checking for this would involve a performance penalty on operator[], which is definitely not a good idea.
Referenced by stir::absolute_max_eigenvector_using_power_method(), stir::apply_array_function_on_1st_index(), stir::apply_array_functions_on_each_index(), stir::apply_array_functions_on_each_index(), stir::determinant(), stir::matrix_multiply(), stir::matrix_transpose(), stir::ArrayTests::run_tests(), and stir::truncate_rim().
| bool stir::Array< elemT >::get_regular_range | ( | BasicCoordinate< num_dimensions, int > & | min, |
| BasicCoordinate< num_dimensions, int > & | max ) const |
find regular range, returns false if the range is not regular
References stir::IndexRange< num_dimensions >::get_regular_range().
Referenced by stir::ITKOutputFileFormat::actual_write_to_file(), stir::apply_array_functions_on_each_index(), stir::apply_array_functions_on_each_index(), stir::find_fwhm_in_image(), stir::VoxelsOnCartesianGrid< elemT >::grow_z_range(), stir::interpolate_line(), stir::maximum_location_per_slice(), stir::ArrayTests::run_tests(), stir::ProjMatrixByBinSinglePhoton::set_up(), stir::ProjMatrixByBinUsingSolidAngle::set_up(), stir::ProjMatrixByBinWithPositronRange::set_up(), and stir::ProjMatrixByDenselUsingRayTracing::set_up().
|
inline |
Referenced by stir::ArrayTests::run_tests().
|
inline |
member function for access to the data via a elemT*
If is_contiguous() is false, calls error(). Otherwise, return a elemT* to the first element of the array.
Use only in emergency cases...
To prevent invalidating the safety checks (and making reimplementation more difficult), NO manipulation with the array is allowed between the pairs get_full_data_ptr() and release_full_data_ptr() and get_const_full_data_ptr() and release_const_full_data_ptr(). (This is checked with assert() in DEBUG mode.)
References begin_all(), stir::error(), and is_contiguous().
Referenced by stir::BackProjectorByBinParallelproj::get_output(), stir::detail::read_data_1d(), and stir::ArrayTests::run_tests().
|
inline |
member function for access to the data via a const elemT*
If is_contiguous() is false, calls error(). Otherwise, return a const elemT* to the first element of the array.
Use get_const_full_data_ptr() when you are not going to modify the data.
References begin_all_const(), stir::error(), and is_contiguous().
Referenced by stir::ArrayTests::run_tests(), and stir::detail::write_data_1d().
|
inline |
signal end of access to elemT*
This has to be used when access to the elemT* returned by get_full_data_ptr() is finished. It updates the Array with any changes you made, and allows access to the other member functions again.
Referenced by stir::BackProjectorByBinParallelproj::get_output(), stir::detail::read_data_1d(), and stir::ArrayTests::run_tests().
|
inline |
signal end of access to const elemT*
This has to be used when access to the const elemT* returned by get_const_full_data_ptr() is finished. It allows access to the other member functions again.
Referenced by stir::ArrayTests::run_tests(), and stir::detail::write_data_1d().