General Purpose Geodetic Library
SgParameterCfg.h
Go to the documentation of this file.
1 /*
2  *
3  * This file is a part of Space Geodetic Library. The library is used by
4  * nuSolve, a part of CALC/SOLVE system, and designed to make analysis of
5  * geodetic VLBI observations.
6  * Copyright (C) 2010-2020 Sergei Bolotin.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 
24 #ifndef SG_EST_PARAMETER_CFG_H
25 #define SG_EST_PARAMETER_CFG_H
26 
27 
28 #ifdef HAVE_CONFIG_H
29 # include <config.h>
30 #endif
31 
32 
33 #include <QtCore/QString>
34 
35 class QDataStream;
36 
37 #include <SgAttribute.h>
38 
39 
40 
41 
42 /***===================================================================================================*/
49 {
50 public:
51  enum PMode {PM_NONE=0, PM_GLB=1, PM_ARC=2, PM_LOC=3, PM_PWL=4, PM_STC=5};
54  {
57  };
58 
59  //
60  // constructors/destructors:
61  //
65  inline SgParameterCfg();
66 
70  SgParameterCfg(const QString& name, PMode pMode, SType sType, double convAPriori, double arcStep,
71  double stocAPriori, double breakNoise, double tau, double whiteNoise,
72  double pwlStep, double pwlAPriori, int pwlNumOfPolynomials,
73  double scale = 1.0, const QString& scaleName = "unscaled");
74 
79  inline SgParameterCfg(const SgParameterCfg& p);
80 
84  inline ~SgParameterCfg();
85 
86 
87 
88  //
89  // Interfaces:
90  //
93  inline SgParameterCfg& operator=(const SgParameterCfg& a);
94 
97  inline const QString& getName() const;
98 
101  inline PMode getPMode() const;
102 
105  inline SType getSType() const;
106 
109  inline double getConvAPriori() const;
110 
113  inline double getStocAPriori() const;
114 
117  inline double getPwlAPriori() const;
118 
121  inline double getBreakNoise() const;
122 
125  inline double getTau() const;
126 
129  inline double getWhiteNoise() const;
130 
133  inline double getPwlStep() const;
134 
137  inline int getPwlNumOfPolynomials() const;
138 
141  inline double getArcStep() const;
142 
145  inline double getScale() const;
146 
149  inline const QString& getScaleName() const;
150 
154  inline void setName(const QString&);
155 
159  inline void setPMode(PMode mode);
160 
164  inline void setSType(SType type);
165 
169  inline void setConvAPriori(double);
170 
174  inline void setStocAPriori(double);
175 
179  inline void setPwlAPriori(double);
180 
184  inline void setBreakNoise(double v);
185 
189  inline void setTau(double tau);
190 
194  inline void setWhiteNoise(double w);
195 
199  inline void setPwlStep(double s);
200 
204  inline void setPwlNumOfPolynomials(int n);
205 
209  inline void setArcStep(double s);
210 
214  inline void setScale(double s);
215 
219  inline void setScaleName(const QString& units);
220 
221  //
222  // Functions:
223  //
226  static const QString className();
227 
228  static const QString& type2String(SType);
229  static const QString& mode2String(PMode);
230 
231 
232 
233  //
234  // Friends:
235  //
236 
237  //
238  // I/O:
239  //
241 
243  //
244 
245 private:
246  QString name_;
249  double scale_;
250  QString scaleName_;
251  // conventional parameter properties:
252  double convAPriori_;
253  double arcStep_;
254  // piecewise-linear parameter properties:
255  double pwlAPriori_;
256  double pwlStep_;
258  // stochastic parameter properties:
259  double stocAPriori_;
260  double breakNoise_;
261  double tau_;
262  double whiteNoise_;
263 };
264 /*=====================================================================================================*/
265 
266 
267 
268 
269 
270 
271 
272 
273 /*=====================================================================================================*/
274 /* */
275 /* SgParameterCfg inline members: */
276 /* */
277 /*=====================================================================================================*/
278 //
279 //
280 // CONSTRUCTORS:
281 //
282 // An empty constructor:
284  SgAttribute()
285 {
286  name_ = "a parameter";
287  pMode_= PM_NONE;
289  scale_ = 1.0;
290  scaleName_ = "units";
291  //
292  convAPriori_ = 1.0;
293  arcStep_ = 7.0; // one week [days]
294  //
295  pwlAPriori_ = 1.0;
296  pwlStep_ = 1.0/24.0; // 1hr [days]
298  //
299  stocAPriori_ = 1.0;
300  breakNoise_ = 1.0;
301  tau_ = 1.0;
302  whiteNoise_ = 1.0;
303 };
304 
305 
306 
307 // A regular constructor:
309  SgAttribute(pc)
310 {
311  name_ = pc.getName();
312  pMode_= pc.getPMode();
313  sType_= pc.getSType();
314  scale_ = pc.getScale();
315  scaleName_ = pc.getScaleName();
316  //
318  arcStep_ = pc.getArcStep();
319  //
320  pwlAPriori_ = pc.getPwlAPriori();
321  pwlStep_ = pc.getPwlStep();
323  //
325  breakNoise_ = pc.getBreakNoise();
326  tau_ = pc.getTau();
327  whiteNoise_ = pc.getWhiteNoise();
328 };
329 
330 
331 
332 // A destructor:
334 {
335  // nothing to do
336 };
337 
338 
339 
340 //
341 // INTERFACES:
342 //
343 //
345 {
347  name_ = pc.getName();
348  pMode_= pc.getPMode();
349  sType_= pc.getSType();
350  scale_ = pc.getScale();
351  scaleName_ = pc.getScaleName();
352  //
354  arcStep_ = pc.getArcStep();
355  //
356  pwlAPriori_ = pc.getPwlAPriori();
357  pwlStep_ = pc.getPwlStep();
359  //
361  breakNoise_ = pc.getBreakNoise();
362  tau_ = pc.getTau();
363  whiteNoise_ = pc.getWhiteNoise();
364  return *this;
365 };
366 
367 
368 
369 //
370 inline const QString& SgParameterCfg::getName() const
371 {
372  return name_;
373 };
374 
375 
376 
377 //
379 {
380  return pMode_;
381 };
382 
383 
384 
385 //
387 {
388  return sType_;
389 };
390 
391 
392 
393 //
394 inline double SgParameterCfg::getConvAPriori() const
395 {
396  return convAPriori_;
397 };
398 
399 
400 
401 //
402 inline double SgParameterCfg::getStocAPriori() const
403 {
404  return stocAPriori_;
405 };
406 
407 
408 
409 //
410 inline double SgParameterCfg::getPwlAPriori() const
411 {
412  return pwlAPriori_;
413 };
414 
415 
416 
417 //
418 inline double SgParameterCfg::getBreakNoise() const
419 {
420  return breakNoise_;
421 };
422 
423 
424 
425 //
426 inline double SgParameterCfg::getTau() const
427 {
428  return tau_;
429 };
430 
431 
432 
433 //
434 inline double SgParameterCfg::getWhiteNoise() const
435 {
436  return whiteNoise_;
437 };
438 
439 
440 
441 //
442 inline double SgParameterCfg::getPwlStep() const
443 {
444  return pwlStep_;
445 };
446 
447 
448 
449 //
451 {
452  return pwlNumOfPolynomials_;
453 };
454 
455 
456 
457 //
458 inline double SgParameterCfg::getArcStep() const
459 {
460  return arcStep_;
461 };
462 
463 
464 
465 //
466 inline double SgParameterCfg::getScale() const
467 {
468  return scale_;
469 };
470 
471 
472 
473 //
474 inline const QString& SgParameterCfg::getScaleName() const
475 {
476  return scaleName_;
477 };
478 
479 
480 
481 //
482 inline void SgParameterCfg::setName(const QString& name)
483 {
484  name_ = name;
485 };
486 
487 
488 
489 //
491 {
492  pMode_ = mode;
493 };
494 
495 
496 
497 //
499 {
500  sType_ = type;
501 };
502 
503 
504 
505 //
506 inline void SgParameterCfg::setConvAPriori(double v)
507 {
508  convAPriori_ = v;
509 };
510 
511 
512 
513 //
514 inline void SgParameterCfg::setStocAPriori(double v)
515 {
516  stocAPriori_ = v;
517 };
518 
519 
520 
521 //
522 inline void SgParameterCfg::setPwlAPriori(double v)
523 {
524  pwlAPriori_ = v;
525 };
526 
527 
528 
529 //
530 inline void SgParameterCfg::setBreakNoise(double v)
531 {
532  breakNoise_ = v;
533 };
534 
535 
536 
537 //
538 inline void SgParameterCfg::setTau(double tau)
539 {
540  tau_ = tau;
541 };
542 
543 
544 
545 //
546 inline void SgParameterCfg::setWhiteNoise(double w)
547 {
548  whiteNoise_ = w;
549 };
550 
551 
552 
553 //
554 inline void SgParameterCfg::setPwlStep(double s)
555 {
556  pwlStep_ = s;
557 };
558 
559 
560 
561 //
563 {
565 };
566 
567 
568 
569 //
570 inline void SgParameterCfg::setArcStep(double s)
571 {
572  arcStep_ = s;
573 };
574 
575 
576 
577 //
578 inline void SgParameterCfg::setScale(double s)
579 {
580  scale_ = s;
581 };
582 
583 
584 
585 //
586 inline void SgParameterCfg::setScaleName(const QString& units)
587 {
588  scaleName_ = units;
589 };
590 
591 
592 
593 
594 //
595 // FRIENDS:
596 //
597 //
598 //
599 
600 
601 /*=====================================================================================================*/
602 
603 
604 
605 
606 
607 /*=====================================================================================================*/
608 //
609 // aux functions:
610 //
611 
612 
613 /*=====================================================================================================*/
614 #endif //SG_EST_PARAMETER_CFG_H
SgAttribute & operator=(const SgAttribute &a)
Definition: SgAttribute.h:174
double getTau() const
SgParameterCfg & operator=(const SgParameterCfg &a)
bool saveIntermediateResults(QDataStream &) const
double scale_
Value of the scale factor.
double getStocAPriori() const
static const QString & type2String(SType)
void setSType(SType type)
void setName(const QString &)
void setBreakNoise(double v)
bool loadIntermediateResults(QDataStream &)
void setStocAPriori(double)
int getPwlNumOfPolynomials() const
const QString & getName() const
double getConvAPriori() const
int pwlNumOfPolynomials_
number of polynomials in the PWL model
SType getSType() const
double arcStep_
a step for arc parameter
double getPwlStep() const
void setArcStep(double s)
const QString & getScaleName() const
void setTau(double tau)
double whiteNoise_
psd of ruled white noise
static const QString className()
double getPwlAPriori() const
QString scaleName_
Name of the scale factor.
double getWhiteNoise() const
double breakNoise_
psd of noise process used for "breaks"
void setPwlStep(double s)
double getBreakNoise() const
static const QString & mode2String(PMode)
void setPwlAPriori(double)
void setWhiteNoise(double w)
double stocAPriori_
a priori std. deviation (stochastic pars)
double pwlStep_
a step for modelling by picewise linear function
double tau_
time of relaxation
void setScaleName(const QString &units)
@ Attr_IS_PROPAGATED
propagate the parameter in time;
@ Attr_IS_CONSTRAINED
the parameter needs in constrains;
void setPMode(PMode mode)
PMode getPMode() const
double getScale() const
void setPwlNumOfPolynomials(int n)
void setScale(double s)
double pwlAPriori_
a priori std. deviation (for pisewice linear B-coeffs)
double getArcStep() const
void setConvAPriori(double)
double convAPriori_
a priori std. deviation (conventional pars)