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
16namespace MEAL
17{
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
std::string get_name() const
Return the name of the class.
Definition ComplexCorrelation.h:54
Estimate< double > get_real() const
Get the real part.
Definition ComplexCorrelation.h:32
ComplexCorrelation()
Default constructor.
Definition ComplexCorrelation.C:13
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:40
void set_imag(const Estimate< double > &y)
Set the imaginary part.
Definition ComplexCorrelation.h:36
void set_real(const Estimate< double > &x)
Set the real part.
Definition ComplexCorrelation.h:28
void set(std::complex< double > &c)
Set the complex value.
Definition ComplexCorrelation.h:44
Pure virtual base class of all complex-valued functions.
Definition Complex.h:39
void set_Estimate(unsigned index, const Estimate< double > &param)
Set the Estimate of the specified parameter.
Definition Function.C:109
Estimate< double > get_Estimate(unsigned index) const
Return an Estimate of the specified parameter.
Definition Function.C:104
Namespace in which all modeling and calibration related code is declared.
Definition ExampleComplex2.h:16

Generated using doxygen 1.14.0