48 elemT max_value = v[index_at_max];
51 const elemT value = v[index];
52 if (value > max_value)
69BasicCoordinate<3, int>
72 const elemT current_maximum = input_array.
find_max();
78 for (
int k = min_index[1]; k <= max_index[1] && !found; ++k)
82 for (
int j = min_index[2]; j <= max_index[2] && !found; ++j)
86 for (
int i = min_index[3]; i <= max_index[3] && !found; ++i)
88 if (input_array[k][j][i] == current_maximum)
defines the stir::Array class for multi-dimensional (numeric) arrays
This file declares class stir::BasicCoordinate and some functions acting on stir::BasicCoordinate obj...
defines the stir::VectorWithOffset class
This class defines multi-dimensional (numeric) arrays.
Definition Array.h:78
elemT find_max() const
return maximum of all the elements
Definition Array.inl:387
class BasicCoordinate<int num_dimensions, typename coordT> defines num_dimensions -dimensional coordi...
Definition BasicCoordinate.h:57
A templated class for vectors, but with indices starting not from 0.
Definition VectorWithOffset.h:65
int get_max_index() const
get value of last valid index
Definition VectorWithOffset.inl:131
int get_min_index() const
get value of first valid index
Definition VectorWithOffset.inl:124
size_t size() const
return number of elements in this vector
Definition VectorWithOffset.inl:546
BasicCoordinate< 3, int > indices_at_maximum(const Array< 3, elemT > &input_array)
Finds the first (3-dimensional) index where the maximum occurs in a (3-dimensional) array.
Definition index_at_maximum.h:70
int index_at_maximum(const VectorWithOffset< elemT > &v)
Finds the index where the maximum occurs in a (1-dimensional) vector.
Definition index_at_maximum.h:42