STIR 6.4.0
more_algorithms.h
Go to the documentation of this file.
1//
2//
3/*
4 Copyright (C) 2005- 2005, Hammersmith Imanet Ltd
5 This file is part of STIR.
6
7 SPDX-License-Identifier: Apache-2.0
8
9 See STIR/LICENSE.txt for details
10*/
11#ifndef __stir_more_algorithms_H__
12#define __stir_more_algorithms_H__
22#include "stir/common.h"
23#include <iterator>
24
25START_NAMESPACE_STIR
26
32template <class iterT>
33inline iterT abs_max_element(iterT start, iterT end);
34
44template <class IterT, class elemT>
45inline elemT sum(IterT start, IterT end, elemT init);
46
62template <class IterT>
63inline typename std::iterator_traits<IterT>::value_type sum(IterT start, IterT end);
64
71template <class IterT>
72inline typename std::iterator_traits<IterT>::value_type average(IterT start, IterT end);
73
74END_NAMESPACE_STIR
75
77#endif
basic configuration include file
iterT abs_max_element(iterT start, iterT end)
Like std::max_element, but comparing after taking absolute value.
Definition more_algorithms.inl:28
elemT sum(IterT start, IterT end, elemT init)
Compute the sum of a sequence using operator+=(), using an initial value.
Definition more_algorithms.inl:52
std::iterator_traits< IterT >::value_type average(IterT start, IterT end)
Compute the average of a sequence using sum(start,end).
Definition more_algorithms.inl:75
Implementation of some functions missing from std::algorithm.