Jpp  17.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JAcoustics/JModel.hh
Go to the documentation of this file.
1 #ifndef __JACOUSTICS__JMODEL__
2 #define __JACOUSTICS__JMODEL__
3 
4 #include <istream>
5 #include <ostream>
6 #include <iomanip>
7 #include <limits>
8 #include <cmath>
9 
10 #include "JMath/JMath.hh"
11 #include "JMath/JZero.hh"
12 #include "JLang/JEquals.hh"
13 #include "JLang/JException.hh"
14 #include "JLang/JManip.hh"
15 #include "JTools/JHashMap.hh"
17 
18 #include "JAcoustics/JEKey.hh"
19 
20 
21 /**
22  * \file
23  *
24  * Model for fit to acoutsics data.
25  * \author mdejong
26  */
27 namespace JACOUSTICS {}
28 namespace JPP { using namespace JACOUSTICS; }
29 
30 namespace JACOUSTICS {
31 
32  using JMATH::JMath;
33  using JLANG::JEquals;
36  using JTOOLS::JHashMap;
37 
38 
39  /**
40  * Auxiliary namespace to encapsulate different model parameters.\n
41  */
42  namespace JMODEL {
43 
44  /**
45  * Fit options.
46  */
47  enum JOption_t {
48  fit_emitters_only_t = 0, //!< fit only times of emission of emitters
49  fit_emitters_and_strings_1st_order_t = 1, //!< fit times of emission of emitters and tilt angles of strings
50  fit_emitters_and_strings_2nd_order_t = 2, //!< fit times of emission of emitters and tilt angles of strings with second order correction
51  fit_emitters_and_strings_2nd_order_and_stretching_t = 3 //!< fit times of emission of emitters and tilt angles of strings with second order correction and stretching of string
52  };
53 
54  inline JOption_t getOption();
55  inline void setOption(const int);
56 
57  /**
58  * Auxiliary class to hide access function to fit option.
59  */
60  struct JModel_t {
61 
63  friend void JMODEL::setOption(const int);
64 
65  private:
66  /**
67  * Get reference to fit option.
68  *
69  * \return option
70  */
72  {
74 
75  return option;
76  }
77  };
78 
79 
80  /**
81  * Get fit option.
82  *
83  * \return option
84  */
86  {
87  return JModel_t::get_option();
88  }
89 
90 
91  /**
92  * Set fit option.
93  *
94  * \param option option
95  */
96  inline void setOption(const int option)
97  {
98  switch (option) {
99 
100  case fit_emitters_only_t:
104  JModel_t::get_option() = static_cast<JOption_t>(option);
105  break;
106 
107  default:
108  THROW(JValueOutOfRange, "Invalid option " << option);
109  }
110  }
111 
112 
113  /**
114  * String parameters.
115  */
116  struct JString :
117  public JMath <JString>,
118  public JEquals<JString>
119  {
120  /**
121  * Default constructor.
122  */
124  tx (0.0),
125  ty (0.0),
126  tx2(0.0),
127  ty2(0.0),
128  vs (0.0)
129  {}
130 
131 
132  /**
133  * Constructor.
134  *
135  * \param tx slope dx/dz
136  * \param ty slope dy/dz
137  * \param tx2 2nd order correction of slope dx/dz
138  * \param ty2 2nd order correction of slope dy/dz
139  * \param vs stretching factor
140  */
141  JString(const double tx,
142  const double ty,
143  const double tx2 = 0.0,
144  const double ty2 = 0.0,
145  const double vs = 0.0) :
146  tx (tx),
147  ty (ty),
148  tx2(tx2),
149  ty2(ty2),
150  vs (vs)
151  {}
152 
153 
154  /**
155  * Get number of fit parameters.
156  *
157  * \return number of parameters
158  */
159  static inline size_t getN()
160  {
161  switch (JMODEL::getOption()) {
162 
163  case fit_emitters_only_t:
164  return 0;
165 
167  return 2;
168 
170  return 4;
171 
173  return 5;
174 
175  default:
176  THROW(JValueOutOfRange, "Invalid option " << JMODEL::getOption());
177  }
178  }
179 
180 
181  /**
182  * Negate string.
183  *
184  * \return this string
185  */
187  {
188  tx = -tx;
189  ty = -ty;
190  tx2 = -tx2;
191  ty2 = -ty2;
192  vs = -vs;
193 
194  return *this;
195  }
196 
197 
198  /**
199  * Add string.
200  *
201  * \param string string
202  * \return this string
203  */
204  JString& add(const JString& string)
205  {
206  tx += string.tx;
207  ty += string.ty;
208  tx2 += string.tx2;
209  ty2 += string.ty2;
210  vs += string.vs;
211 
212  return *this;
213  }
214 
215 
216  /**
217  * Subtract string.
218  *
219  * \param string string
220  * \return this string
221  */
222  JString& sub(const JString& string)
223  {
224  tx -= string.tx;
225  ty -= string.ty;
226  tx2 -= string.tx2;
227  ty2 -= string.ty2;
228  vs -= string.vs;
229 
230  return *this;
231  }
232 
233 
234  /**
235  * Scale string.
236  *
237  * \param factor multiplication factor
238  * \return this string
239  */
240  JString& mul(const double factor)
241  {
242  tx *= factor;
243  ty *= factor;
244  tx2 *= factor;
245  ty2 *= factor;
246  vs *= factor;
247 
248  return *this;
249  }
250 
251 
252  /**
253  * Scale string.
254  *
255  * \param factor division factor
256  * \return this string
257  */
258  JString& div(const double factor)
259  {
260  tx /= factor;
261  ty /= factor;
262  tx2 /= factor;
263  ty2 /= factor;
264  vs /= factor;
265 
266  return *this;
267  }
268 
269 
270  /**
271  * Check equality.
272  *
273  * \param string string
274  * \param precision precision
275  * \return true if strings are equal; else false
276  */
277  bool equals(const JString& string,
278  const double precision = std::numeric_limits<double>::min()) const
279  {
280  return (fabs(tx - string.tx) <= precision &&
281  fabs(ty - string.ty) <= precision &&
282  fabs(tx2 - string.tx2) <= precision &&
283  fabs(ty2 - string.ty2) <= precision &&
284  fabs(vs - string.vs) <= precision);
285  }
286 
287 
288  /**
289  * Get length squared.
290  *
291  * \return square of length
292  */
293  double getLengthSquared() const
294  {
295  return tx*tx + ty*ty;
296  }
297 
298 
299  /**
300  * Get length.
301  *
302  * \return length
303  */
304  double getLength() const
305  {
306  return sqrt(getLengthSquared());
307  }
308 
309 
310  /**
311  * Get angle.
312  *
313  * \return angle [rad]
314  */
315  double getAngle() const
316  {
317  return atan2(ty, tx);
318  }
319 
320 
321  /**
322  * Get dot product.
323  *
324  * \param string string
325  * \return dot product
326  */
327  double getDot(const JString& string) const
328  {
329  return (tx * string.tx +
330  ty * string.ty +
331  tx2 * string.tx2 +
332  ty2 * string.ty2 +
333  vs * string.vs);
334  }
335 
336 
337  /**
338  * Read string parameters from input stream.
339  *
340  * \param in input stream
341  * \param string string
342  * \return input stream
343  */
344  friend inline std::istream& operator>>(std::istream& in, JString& string)
345  {
346  return in >> string.tx >> string.ty >> string.tx2 >> string.ty2 >> string.vs;
347  }
348 
349 
350  /**
351  * Write string parameters to output stream.
352  *
353  * \param out output stream
354  * \param string string
355  * \return output stream
356  */
357  friend inline std::ostream& operator<<(std::ostream& out, const JString& string)
358  {
359  using namespace std;
360  using namespace JPP;
361 
362  return out << FIXED(10,7) << string.tx << ' '
363  << FIXED(10,7) << string.ty << ' '
364  << SCIENTIFIC(12,3) << string.tx2 << ' '
365  << SCIENTIFIC(12,3) << string.ty2 << ' '
366  << FIXED(8,5) << string.vs;
367  }
368 
369 
370  double tx;
371  double ty;
372  double tx2;
373  double ty2;
374  double vs;
375  };
376 
377 
378  /**
379  * Emitter parameters.
380  */
381  struct JEmitter :
382  public JMath <JEmitter>,
383  public JEquals<JEmitter>
384  {
385  /**
386  * Default constructor.
387  */
389  t1(0.0)
390  {}
391 
392 
393  /**
394  * Constructor.
395  *
396  * \param t1 time-of-emission [s]
397  */
398  JEmitter(const double t1) :
399  t1(t1)
400  {}
401 
402 
403  /**
404  * Get number of fit parameters.
405  *
406  * \return number of parameters
407  */
408  static inline size_t getN()
409  {
410  return 1;
411  }
412 
413 
414  /**
415  * Negate emitter.
416  *
417  * \return this emitter
418  */
420  {
421  t1 = -t1;
422 
423  return *this;
424  }
425 
426 
427  /**
428  * Add emitter.
429  *
430  * \param emitter emitter
431  * \return this emitter
432  */
433  JEmitter& add(const JEmitter& emitter)
434  {
435  t1 += emitter.t1;
436 
437  return *this;
438  }
439 
440 
441  /**
442  * Subtract emitter.
443  *
444  * \param emitter emitter
445  * \return this emitter
446  */
447  JEmitter& sub(const JEmitter& emitter)
448  {
449  t1 -= emitter.t1;
450 
451  return *this;
452  }
453 
454 
455  /**
456  * Scale emitter.
457  *
458  * \param factor multiplication factor
459  * \return this emitter
460  */
461  JEmitter& mul(const double factor)
462  {
463  t1 *= factor;
464 
465  return *this;
466  }
467 
468 
469  /**
470  * Scale emitter.
471  *
472  * \param factor division factor
473  * \return this emitter
474  */
475  JEmitter& div(const double factor)
476  {
477  t1 /= factor;
478 
479  return *this;
480  }
481 
482 
483  /**
484  * Check equality.
485  *
486  * \param emitter emitter
487  * \param precision precision
488  * \return true if emitters are equal; else false
489  */
490  bool equals(const JEmitter& emitter,
491  const double precision = std::numeric_limits<double>::min()) const
492  {
493  return (fabs(t1 - emitter.t1) <= precision);
494  }
495 
496 
497  /**
498  * Write emitter parameters to output stream.
499  *
500  * \param out output stream
501  * \param emitter emitter
502  * \return output stream
503  */
504  friend inline std::ostream& operator<<(std::ostream& out, const JEmitter& emitter)
505  {
506  using namespace std;
507  using namespace JPP;
508 
509  return out << FIXED(20,6) << emitter.t1;
510  }
511 
512 
513  double t1;
514  };
515  }
516 
517 
518  /**
519  * Model for fit to acoustics data.
520  *
521  * The model consists of string parameters and emitter parameters.\n
522  * These parameters relate to the string identifer and emitter key, respectively.
523  */
524  struct JModel :
525  public JMath <JModel>,
526  public JEquals<JModel>,
528  {
532 
535 
536 
537  /**
538  * Type definition of fit parameter.
539  */
540  typedef size_t parameter_type;
541 
542 
543  /**
544  * Default constructor.
545  */
547  {}
548 
549 
550  /**
551  * Constructor.
552  *
553  * This constructor can be used to set up a default model (i.e. all values at zero) for the given set of hits.\n
554  * The data type corresponding to the hits should provide for the following policy methods.
555  * <pre>
556  * int getString(); // get string identifier
557  * JEkey getEKey(); // get emitter key
558  * </pre>
559  *
560  * \param __begin begin of hits
561  * \param __end end of hits
562  */
563  template<class T>
564  JModel(T __begin, T __end)
565  {
566  for (T hit = __begin; hit != __end; ++hit) {
567 
568  if (!this->string.has(hit->getString())) {
569  this->string[hit->getString()] = JString();
570  }
571 
572  if (!this->emitter.has(hit->getEKey())) {
573  this->emitter[hit->getEKey()] = JEmitter();
574  }
575  }
576  }
577 
578 
579  /**
580  * Reset parameters.
581  *
582  * \param zero zero
583  * \return this model
584  */
586  {
587  this->reset();
588 
589  return *this;
590  }
591 
592 
593  /**
594  * Clear parameters.
595  */
596  void clear()
597  {
598  string .clear();
599  emitter.clear();
600  }
601 
602 
603  /**
604  * Reset parameters.
605  */
606  void reset()
607  {
608  reset(string);
609  reset(emitter);
610  }
611 
612 
613  /**
614  * Negate model.
615  *
616  * \return this model
617  */
619  {
620  evaluate(this->string, &JString ::negate);
621  evaluate(this->emitter, &JEmitter::negate);
622 
623  return *this;
624  }
625 
626 
627  /**
628  * Add model.
629  *
630  * \param model model
631  * \return this model
632  */
633  JModel& add(const JModel& model)
634  {
635  evaluate(this->string, model.string, &JString ::add);
636  evaluate(this->emitter, model.emitter, &JEmitter::add);
637 
638  return *this;
639  }
640 
641 
642  /**
643  * Subtract model.
644  *
645  * \param model model
646  * \return this model
647  */
648  JModel& sub(const JModel& model)
649  {
650  evaluate(this->string, model.string, &JString ::sub);
651  evaluate(this->emitter, model.emitter, &JEmitter::sub);
652 
653  return *this;
654  }
655 
656 
657  /**
658  * Scale model.
659  *
660  * \param factor multiplication factor
661  * \return this model
662  */
663  JModel& mul(const double factor)
664  {
665  evaluate(this->string, &JString ::mul, factor);
666  evaluate(this->emitter, &JEmitter::mul, factor);
667 
668  return *this;
669  }
670 
671 
672  /**
673  * Scale model.
674  *
675  * \param factor division factor
676  * \return this model
677  */
678  JModel& div(const double factor)
679  {
680  evaluate(this->string, &JString ::div, factor);
681  evaluate(this->emitter, &JEmitter::div, factor);
682 
683  return *this;
684  }
685 
686 
687  /**
688  * Check equality.
689  *
690  * \param model model
691  * \param precision precision
692  * \return true if models are equal; else false
693  */
694  bool equals(const JModel& model,
695  const double precision = std::numeric_limits<double>::min()) const
696  {
697  return (equals(this->string, model.string, precision) &&
698  equals(this->emitter, model.emitter, precision));
699  }
700 
701 
702  /**
703  * Write model parameters to output stream.
704  *
705  * \param out output stream
706  * \param model model
707  * \return output stream
708  */
709  friend inline std::ostream& operator<<(std::ostream& out, const JModel& model)
710  {
711  using namespace std;
712  using namespace JPP;
713 
714  for (JHashMap<int, JString>::const_iterator i = model.string.begin(); i != model.string.end(); ++i) {
715  out << "string: " << setw(4) << i->first << ' ' << i->second << endl;
716  }
717 
718  for (JHashMap<JEKey, JEmitter>::const_iterator i = model.emitter.begin(); i != model.emitter.end(); ++i) {
719  out << "emitter: " << setw(3) << i->first << ' ' << i->second << endl;
720  }
721 
722  return out;
723  }
724 
725 
726  /**
727  * Get number of fit parameters.
728  *
729  * \return number of parameters
730  */
731  size_t getN() const
732  {
733  return emitter.getN() + string.getN();
734  }
735 
736 
737  /**
738  * Get index of fit parameter for given string.
739  *
740  * \param id string identifier
741  * \param p pointer to data member
742  * \return parameter
743  */
744  size_t getIndex(int id, double JString::*p) const
745  {
746  if (string.has(id))
747  return emitter.getN() + string.getIndex(id) * JString::getN() + getIndex(p);
748  else
749  THROW(JValueOutOfRange, "Invalid identifier " << id);
750  }
751 
752 
753  /**
754  * Get index of fit parameter for given emitter.
755  *
756  * \param id emitter key
757  * \param p pointer to data member
758  * \return parameter
759  */
760  size_t getIndex(const JEKey& id, double JEmitter::*p) const
761  {
762  if (emitter.has(id))
763  return emitter.getIndex(id) * JEmitter::getN() + getIndex(p);
764  else
765  THROW(JValueOutOfRange, "Invalid identifier " << id);
766  }
767 
768 
769  /**
770  * Read access to fit parameter value by index.
771  *
772  * \param index index
773  * \return value
774  */
775  inline double operator[](const size_t index) const
776  {
777  size_t i = index;
778 
779  if (i < emitter.getN()) { return getParameter(emitter, i); }
780 
781  i -= emitter.getN();
782 
783  if (i < string .getN()) { return getParameter(string, i); }
784 
785  THROW(JIndexOutOfRange, "Invalid index " << index << " >= " << getN());
786  }
787 
788 
789  /**
790  * Read/write access to fit parameter value by index.
791  *
792  * \param index index
793  * \return value
794  */
795  inline double& operator[](const size_t index)
796  {
797  size_t i = index;
798 
799  if (i < emitter.getN()) { return getParameter(emitter, i); }
800 
801  i -= emitter.getN();
802 
803  if (i < string .getN()) { return getParameter(string, i); }
804 
805  THROW(JIndexOutOfRange, "Invalid index " << index << " >= " << getN());
806  }
807 
808 
809  /**
810  * Map emitter key to model parameters of emitter.
811  */
812  struct emitter_type :
813  public JHashMap<JEKey, JEmitter>
814  {
815  private:
816  /**
817  * Auxiliary class for multiple associative map operators.
818  */
819  struct JHashMapHelper {
820  /**
821  * Constructor.
822  *
823  * \param map map
824  * \param id emitter identifier
825  */
827  map(map),
828  id (id)
829  {}
830 
831 
832  /**
833  * Get value corresponding to event counter (i.e.\ second part of JEKey).
834  *
835  * \param counter event counter
836  * \return emitter
837  */
838  JEmitter& operator[](const int counter)
839  {
840  return map[JEKey(id, counter)];
841  }
842 
843  private:
845  const int id;
846  };
847 
848  public:
849 
851 
852  /**
853  * Get number of fit parameters.
854  *
855  * \return number of parameters
856  */
857  size_t getN() const
858  {
859  return this->size() * JEmitter::getN();
860  }
861 
862 
863  /**
864  * Get helper corresponding to emitter identifier (i.e.\ first part of JEKey).
865  *
866  * \param id emitter identifier
867  * \return helper
868  */
870  {
871  return JHashMapHelper(*this, id);
872  }
873 
874  } emitter;
875 
876 
877  /**
878  * Map string identifier to model parameters of string.
879  */
880  struct string_type :
881  public JHashMap<int, JString>
882  {
883  /**
884  * Get number of fit parameters.
885  *
886  * \return number of parameters
887  */
888  size_t getN() const
889  {
890  return this->size() * JString::getN();
891  }
892  } string;
893 
894  private:
895  /**
896  * Get index of fit parameter in given data structure.
897  *
898  * \param p pointer to data member
899  * \return index
900  */
901  template<class T>
902  static inline size_t getIndex(double T::*p)
903  {
904  T* __p__ = NULL;
905 
906  return ((double*) &(__p__->*p) - (double*) __p__);
907  }
908 
909 
910  /**
911  * Get read access to fit parameter value at given index in buffer.
912  *
913  * \param buffer buffer
914  * \param index index
915  * \return value
916  */
917  template<class JKey_t, class JValue_t, class JEvaluator_t>
918  static double getParameter(const JHashMap<JKey_t, JValue_t, JEvaluator_t>& buffer, const size_t index)
919  {
920  const size_t pos = index / JValue_t::getN(); // position of element in buffer
921  const size_t offset = index % JValue_t::getN(); // offset of parameter in element
922 
923  const JValue_t& value = buffer.data()[pos].second; // value of element at given position
924 
925  return ((const double*) &value)[offset]; // parameter at given offset
926  }
927 
928 
929  /**
930  * Get read/write access to fit parameter value at given index in buffer.
931  *
932  * \param buffer buffer
933  * \param index index
934  * \return value
935  */
936  template<class JKey_t, class JValue_t, class JEvaluator_t>
937  static double& getParameter(JHashMap<JKey_t, JValue_t, JEvaluator_t>& buffer, const size_t index)
938  {
939  const size_t pos = index / JValue_t::getN(); // position of element in buffer
940  const size_t offset = index % JValue_t::getN(); // offset of parameter in element
941 
942  JValue_t& value = buffer.data()[pos].second; // value of element at given position
943 
944  return ((double*) &value)[offset]; // parameter at given offset
945  }
946  };
947 }
948 
949 #endif
fit times of emission of emitters and tilt angles of strings with second order correction and stretch...
size_t getN() const
Get number of fit parameters.
JModel & negate()
Negate model.
Exceptions.
void setOption(const int)
Set fit option.
double getN(const JRange< T > &range, const double R)
Get expected number of occurrences due to given rate within specified interval.
Definition: JRange.hh:713
int getParameter(const std::string &text)
Get parameter number from text string.
JString & mul(const double factor)
Scale string.
JEmitter & sub(const JEmitter &emitter)
Subtract emitter.
Auxiliary base class for aritmetic operations of derived class types.
Definition: JMath.hh:110
void clear()
Clear parameters.
double getAngle() const
Get angle.
Auxiliary class to hide access function to fit option.
General purpose class for hash map of unique keys.
Definition: JHashMap.hh:72
JModel & mul(const double factor)
Scale model.
JEmitter(const double t1)
Constructor.
bool equals(const JEmitter &emitter, const double precision=std::numeric_limits< double >::min()) const
Check equality.
General purpose class for hash map of unique elements.
bool equals(const JModel &model, const double precision=std::numeric_limits< double >::min()) const
Check equality.
JModel(T __begin, T __end)
Constructor.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
JEmitter & mul(const double factor)
Scale emitter.
JEmitter & div(const double factor)
Scale emitter.
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:105
JMODEL::JEmitter JEmitter
friend std::istream & operator>>(std::istream &in, JString &string)
Read string parameters from input stream.
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:446
friend std::ostream & operator<<(std::ostream &out, const JString &string)
Write string parameters to output stream.
Definition of zero value for any class.
static JOption_t & get_option()
Get reference to fit option.
JHashMapHelper operator[](int id)
Get helper corresponding to emitter identifier (i.e. first part of JEKey).
double operator[](const size_t index) const
Read access to fit parameter value by index.
fit times of emission of emitters and tilt angles of strings
Auxiliary class for multiple associative map operators.
static void reset(JHashMap< JKey_t, JValue_t, JEvaluator_t > &buffer)
Reset buffer.
static size_t getIndex(double T::*p)
Get index of fit parameter in given data structure.
friend std::ostream & operator<<(std::ostream &out, const JEmitter &emitter)
Write emitter parameters to output stream.
static size_t getN()
Get number of fit parameters.
friend std::ostream & operator<<(std::ostream &out, const JModel &model)
Write model parameters to output stream.
Model for fit to acoustics data.
size_t parameter_type
Type definition of fit parameter.
bool equals(const JString &string, const double precision=std::numeric_limits< double >::min()) const
Check equality.
static double & getParameter(JHashMap< JKey_t, JValue_t, JEvaluator_t > &buffer, const size_t index)
Get read/write access to fit parameter value at given index in buffer.
JString & sub(const JString &string)
Subtract string.
Auxiliary class to assign zero value.
Definition: JZero.hh:81
static double getParameter(const JHashMap< JKey_t, JValue_t, JEvaluator_t > &buffer, const size_t index)
Get read access to fit parameter value at given index in buffer.
JEmitter & add(const JEmitter &emitter)
Add emitter.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
JString & add(const JString &string)
Add string.
JMODEL::JString JString
Template definition of auxiliary base class for comparison of data structures.
Definition: JEquals.hh:24
JString & negate()
Negate string.
static size_t getN()
Get number of fit parameters.
Arithmetic toolkit for hash maps.
double getLengthSquared() const
Get length squared.
size_t getIndex(const JEKey &id, double JEmitter::*p) const
Get index of fit parameter for given emitter.
int getIndex()
Get index for user I/O manipulation.
Definition: JManip.hh:26
JEmitter()
Default constructor.
static void set(JHashMap< JKey_t, JValue_t, JEvaluator_t > &target, const JHashMap< JKey_t, JValue_t, JEvaluator_t > &source, const JValue_t &value)
Set values in target corresponding to keys in source.
fit times of emission of emitters and tilt angles of strings with second order correction ...
I/O manipulators.
size_t getIndex(int id, double JString::*p) const
Get index of fit parameter for given string.
JModel & sub(const JModel &model)
Subtract model.
Emitter hash key.
JOption_t getOption()
Get fit option.
JACOUSTICS::JModel::string_type string
JString & div(const double factor)
Scale string.
void reset(T &value)
Reset value.
double & operator[](const size_t index)
Read/write access to fit parameter value by index.
JACOUSTICS::JModel::emitter_type emitter
JModel & div(const double factor)
Scale model.
Map emitter key to model parameters of emitter.
size_t getN() const
Get number of fit parameters.
JModel()
Default constructor.
JString(const double tx, const double ty, const double tx2=0.0, const double ty2=0.0, const double vs=0.0)
Constructor.
JModel & add(const JModel &model)
Add model.
static bool equals(const JHashMap< JKey_t, JValue_t, JEvaluator_t > &first, const JHashMap< JKey_t, JValue_t, JEvaluator_t > &second)
Check equality of buffers.
Emitter key.
Definition: JEKey.hh:32
size_t getN() const
Get number of fit parameters.
Toolkit for JHashMap.
Base class for data structures with artithmetic capabilities.
Exception for accessing a value in a collection that is outside of its range.
Definition: JException.hh:162
Exception for accessing an index in a collection that is outside of its range.
Definition: JException.hh:90
fit only times of emission of emitters
JEmitter & negate()
Negate emitter.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:484
void reset()
Reset parameters.
JString()
Default constructor.
double getDot(const JString &string) const
Get dot product.
JEmitter & operator[](const int counter)
Get value corresponding to event counter (i.e. second part of JEKey).
double getLength() const
Get length.
JHashMapHelper(JHashMap< JEKey, JEmitter > &map, int id)
Constructor.
Map string identifier to model parameters of string.
JModel & operator=(const JMATH::JZero &zero)
Reset parameters.