ComplexCorrelation.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2010 - 2013 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/MEAL/MEAL/ComplexCorrelation.h
10 
11 #ifndef __MEAL_ComplexCorrelation_H
12 #define __MEAL_ComplexCorrelation_H
13 
14 #include "MEAL/Complex.h"
15 
16 namespace MEAL
17 {
19  class ComplexCorrelation : public Complex
20  {
21 
22  public:
23 
26 
28  void set_real (const Estimate<double>& x)
29  { this->set_Estimate (0, x); }
30 
32  Estimate<double> get_real () const
33  { return this->get_Estimate (0); }
34 
36  void set_imag (const Estimate<double>& y)
37  { this->set_Estimate (1, y); }
38 
40  Estimate<double> get_imag () const
41  { return this->get_Estimate (1); }
42 
44  void set (std::complex<double>& c)
45  { set_real(c.real()); set_imag(c.imag()); }
46 
47  // ///////////////////////////////////////////////////////////////////
48  //
49  // Function implementation
50  //
51  // ///////////////////////////////////////////////////////////////////
52 
54  std::string get_name () const
55  { return "ComplexCorrelation"; }
56 
57  protected:
58 
59  typedef std::complex<double> Return;
60 
62  void calculate (Return& result, std::vector<Return>* gradient);
63  };
64 
65 }
66 
67 #endif
Abstract base class implements parameter storage and access.
Definition: Parameters.h:28
std::string get_name() const
Return the name of the class.
Definition: ComplexCorrelation.h:64
Estimate< double > get_real() const
Get the real part.
Definition: ComplexCorrelation.h:42
void calculate(Return &result, std::vector< Return > *gradient)
Calculate the result and its gradient.
Definition: ComplexCorrelation.C:35
Estimate< double > get_imag() const
Get the imaginary part.
Definition: ComplexCorrelation.h:50
void set(std::complex< double > &c)
Set the complex value.
Definition: ComplexCorrelation.h:54
ComplexCorrelation()
Default constructor.
Definition: ComplexCorrelation.C:13
const ScalarMath abs(const ScalarMath &x)
Return a ScalarMath instance representing |x|.
Definition: ScalarMath.C:208
void set_Estimate(unsigned index, const Estimate< double > &param)
Set the Estimate of the specified parameter.
Definition: Function.C:109
void set_real(const Estimate< double > &x)
Set the real part.
Definition: ComplexCorrelation.h:38
const ScalarMath tanh(const ScalarMath &x)
Return a ScalarMath instance representing tanh(x)
Definition: ScalarMath.C:200
Namespace in which all modeling and calibration related code is declared.
Definition: ExampleComplex2.h:16
const ScalarMath cosh(const ScalarMath &x)
Return a ScalarMath instance representing cosh(x)
Definition: ScalarMath.C:192
void set_name(unsigned index, const std::string &name)
Return the name of the specified parameter.
Definition: Parameters.h:69
void set_imag(const Estimate< double > &y)
Set the imaginary part.
Definition: ComplexCorrelation.h:46
Estimate< double > get_Estimate(unsigned index) const
Return an Estimate of the specified parameter.
Definition: Function.C:104

Generated using doxygen 1.8.17