UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
psc_ts_dispersion_residual.hpp
1 /* psc_ts_dispersion_residual.hpp */
2 /* $Id$ */
3 #ifndef __psc_ts_dispersion_residual_hpp
4 #define __psc_ts_dispersion_residual_hpp
5 
6 #include <stdio.h>
7 #include <stdint.h>
8 #include <utility>
9 
10 #ifdef GE_BUILD
11 #include <residual.hpp>
12 #include <psc_service.hpp>
13 #include <psc_ts_container.hpp>
14 #else
15 #include <mth/residual.hpp>
16 #include <s2proc/psc_service.hpp>
17 #include <s2proc/psc_ts_container.hpp>
18 #endif
19 
21 namespace psc
22 {
25  {
26  public:
27 
29  struct Params
30  {
31  Params():
33  id(0),
34  max_trs_in_base(10),
36  {/* nothing to do */}
37 
39  int id;
44  };
45 
47  TsDispersionResidual(TsContainer &ts_container,
48  const Params &params = Params());
49 
51  virtual ~TsDispersionResidual();
52 
53 
55  Params& params() {return m_params;}
56 
58  const Params& params() const {return m_params;}
59 
60 
62  TsContainer& tsContainer() {return *mp_ts_container;}
63 
65  const TsContainer& tsContainer() const {return *mp_ts_container;}
66 
67  protected:
68 
70  {
71  int row_id;
72  std::pair<int,int> ids_range;
73  Trace::TimeT time_shift;
74  unsigned int corr_dir;
75  int stride;
76  };
77 
79  {
80  TsCurveResult(const size_t size) :
81  dt_vec(std::vector<double>(size, 0)),
82  w_vec(std::vector<double>(size, 0)),
83  points_num_vec(std::vector<int>(size, 0))
84  {/* nothing to do */}
85 
86  size_t size() const {return dt_vec.size();}
87 
88  std::vector<double> dt_vec;
89  std::vector<double> w_vec;
90  std::vector<int> points_num_vec;
91  };
92 
95 
97  TsContainer *mp_ts_container;
98 
100  virtual double calc(const std::vector<double> &dt_vec) const;
101 
103  bool get_ts_curve(const TsCurveParams &cp, TsCurveResult &cr) const;
104 
105  bool get_ids_range(const int id,
106  const int base_size,
107  const std::pair<int,int> &full_ids_range,
108  std::pair<int,int> &ids_range) const;
109 
111  virtual void progress(const int cur, const int max) const;
112 
113  }; // class TsDispersionResidual
114 
115 }; // namespace psc
116 
117 #endif /* psc_ts_dispersion_residual.hpp */
Trace::Header::AttrId hdr_attr
Definition: psc_ts_dispersion_residual.hpp:38
Definition: residual.hpp:9
TsDispersionResidual(TsContainer &ts_container, const Params &params=Params())
Definition: psc_ts_container.hpp:20
float TimeT
Definition: trace.hpp:22
Definition: psc_ts_dispersion_residual.hpp:29
const Params & params() const
Definition: psc_ts_dispersion_residual.hpp:58
Definition: psc_ts_dispersion_residual.hpp:24
Definition: psc_ts_dispersion_residual.hpp:69
int id
Definition: psc_ts_dispersion_residual.hpp:39
Params m_params
Definition: psc_ts_dispersion_residual.hpp:94
Definition: psc_ts_dispersion_residual.hpp:78
Definition: trace.hpp:39
bool get_ts_curve(const TsCurveParams &cp, TsCurveResult &cr) const
const TsContainer & tsContainer() const
Definition: psc_ts_dispersion_residual.hpp:65
float min_available_weight
Definition: psc_ts_dispersion_residual.hpp:42
virtual double calc(const std::vector< double > &dt_vec) const
virtual void progress(const int cur, const int max) const
int max_trs_in_base
Definition: psc_ts_dispersion_residual.hpp:40
TsContainer & tsContainer()
Definition: psc_ts_dispersion_residual.hpp:62
Params & params()
Definition: psc_ts_dispersion_residual.hpp:55
AttrId
Definition: trace.hpp:34