STIR  6.2.0
SumOfGeneralisedObjectiveFunctions.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2005- 2008, Hammersmith Imanet
5  This file is part of STIR.
6 
7  SPDX-License-Identifier: Apache-2.0
8 
9  See STIR/LICENSE.txt for details
10 */
20 #ifndef __stir_recon_buildblock_SumOfGeneralisedObjectiveFunctions_H__
21 #define __stir_recon_buildblock_SumOfGeneralisedObjectiveFunctions_H__
22 
23 #include "stir/shared_ptr.h"
25 #include <vector>
26 
27 START_NAMESPACE_STIR
28 
37 template <typename ObjFuncT, typename TargetT, typename ParentT = GeneralisedObjectiveFunction<TargetT>>
38 class SumOfGeneralisedObjectiveFunctions : public ParentT
39 {
40  typedef ParentT base_type;
42 
43 public:
45 
46  template <typename IterT>
47  inline SumOfGeneralisedObjectiveFunctions(IterT begin, IterT end);
48 
49  inline virtual ~SumOfGeneralisedObjectiveFunctions();
50 
51  template <typename IterT>
52  inline void set_functions(IterT begin, IterT end);
53 
54 #if 0
55 
59  inline virtual
60  TargetT *
61  construct_target_ptr() const;
62 #endif
63 
65 
68  inline virtual Succeeded set_up(shared_ptr<TargetT> const& target_sptr);
69 
71 
73  inline virtual void
74  compute_sub_gradient_without_penalty(TargetT& gradient, const TargetT& current_estimate, const int subset_num);
75 
76  inline virtual double actual_compute_objective_function_without_penalty(const TargetT& current_estimate, const int subset_num);
77 
79 
81  inline virtual int set_num_subsets(const int num_subsets);
82 
83 protected:
84  typedef std::vector<ObjFuncT> _functions_type;
85  typedef typename _functions_type::iterator _functions_iterator_type;
86  typedef typename _functions_type::const_iterator _functions_const_iterator_type;
87  _functions_type _functions;
89 
92  inline virtual bool actual_subsets_are_approximately_balanced(std::string& warning_message) const;
93 };
94 
95 END_NAMESPACE_STIR
96 
98 
99 #endif
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast (or corresponding b...
Declaration of class stir::GeneralisedObjectiveFunction.
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
Implementation of class stir::SumOfGeneralisedObjectiveFunctions.
A base class for sums of &#39;generalised&#39; objective functions, i.e. objective functions for which at lea...
Definition: SumOfGeneralisedObjectiveFunctions.h:38