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 
17 namespace 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 
60  Reference::To<Composite> composite;
61 
62  };
63 
64 }
65 
66 #endif
ScalarVector()
Default contructor.
Definition: ScalarVector.C:12
void calculate(double &result, std::vector< double > *grad)
Return the result and its gradient.
Definition: Union.C:56
~Union()
Destructor.
Definition: Union.h:45
Parameter policy for composite functions.
Definition: Composite.h:25
Represents the union of disjoint vector subspaces.
Definition: Union.h:25
Scalar functions that depend on an index.
Definition: ScalarVector.h:26
Namespace in which all modeling and calibration related code is declared.
Definition: ExampleComplex2.h:16
std::string get_name() const
Return the name of the class.
Definition: Union.h:54
Union & operator=(const Union &copy)
Assignment operator.
Definition: Union.C:31
virtual unsigned size() const =0
Get the size of the position angle array.
Union(Composite *policy=0)
Default constructor.
Definition: Union.C:13
unsigned size() const
Get the dimension of the union.
Definition: Union.h:51
Template combines a reference to a Component and its Projection.
Definition: Projection.h:65
virtual void copy(const Function *model)
Does the work for operator =.
Definition: Function.C:58
void push_back(ScalarVector *)
Add a vector space.
Definition: Union.C:46

Generated using doxygen 1.8.17