Union.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2011 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9/* psrchive/More/MEAL/MEAL/Union.h,v */
10
11#ifndef __MEAL_Union_H
12#define __MEAL_Union_H
13
14#include "MEAL/ScalarVector.h"
15#include "MEAL/Composite.h"
16
17namespace MEAL {
18
20 class Union : public ScalarVector
21 {
22
23 public:
24
26 Union (Composite* policy = 0);
27
29 Union (const Union& v);
30
32 Union& operator = (const Union& copy);
33
35 ~Union () { }
36
38 void push_back (ScalarVector*);
39
41 unsigned size () const { return dimension; }
42
44 std::string get_name () const { return "Union"; }
45
46 protected:
47
49 void calculate (double& result, std::vector<double>* grad);
50
51 private:
52
54 std::vector< Project<ScalarVector> > model;
55
57 unsigned dimension;
58
61
62 };
63
64}
65
66#endif
Parameter policy for composite functions.
Definition Composite.h:20
virtual void copy(const Function *model)
Does the work for operator =.
Definition Function.C:58
Scalar functions that depend on an index.
Definition ScalarVector.h:22
ScalarVector()
Default contructor.
Definition ScalarVector.C:12
unsigned size() const
Get the dimension of the union.
Definition Union.h:41
~Union()
Destructor.
Definition Union.h:35
std::string get_name() const
Return the name of the class.
Definition Union.h:44
void push_back(ScalarVector *)
Add a vector space.
Definition Union.C:46
Union & operator=(const Union &copy)
Assignment operator.
Definition Union.C:31
void calculate(double &result, std::vector< double > *grad)
Return the result and its gradient.
Definition Union.C:56
Union(Composite *policy=0)
Default constructor.
Definition Union.C:13
Namespace in which all modeling and calibration related code is declared.
Definition ExampleComplex2.h:16

Generated using doxygen 1.14.0