Projection.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2004 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/MEAL/MEAL/Projection.h
10
11#ifndef __Projection_H
12#define __Projection_H
13
14#include "Reference.h"
15
16namespace MEAL {
17
18 class Function;
19 class Composite;
20
22 class Projection : public Reference::Able {
23
24 friend class Composite;
25
26 public:
28 Projection (Function* model=0, Composite* meta=0);
29
31 ~Projection ();
32
34 unsigned get_imap (unsigned index) const;
35
37 void get_imap (std::vector<unsigned>& get) const { get = imap; }
38
41
43 void set_Function (Function* _model);
44
45 protected:
46
49
51 std::vector<unsigned> imap;
52
55 };
56
57
59 template<class Component>
60 class Project : public Reference::To<Component> {
61
62 public:
63
65 Project (Component* model = 0)
66 {
68 projection = new Projection (model);
69 }
70
72 const Project& operator = (Component* model)
73 {
75 projection->set_Function (model);
76 return *this;
77 }
78
81 {
82 return projection;
83 }
84
86 const Projection* get_map () const
87 {
88 return projection;
89 }
90
92 unsigned get_imap (unsigned index) const
93 {
94 return projection->get_imap (index);
95 }
96
97 protected:
98
101
102 };
103
104}
105
106
107#endif
108
Parameter policy for composite functions.
Definition Composite.h:20
Pure virtual base class of all functions.
Definition Function.h:49
Reference::To< Projection > projection
The Projection.
Definition Projection.h:100
unsigned get_imap(unsigned index) const
Return the mapped index.
Definition Projection.h:92
Project(Component *model=0)
Default constructor.
Definition Projection.h:65
Projection * get_map()
Return the Projection.
Definition Projection.h:80
const Projection * get_map() const
Return the const Projection.
Definition Projection.h:86
const Project & operator=(Component *model)
Assignment operator.
Definition Projection.h:72
Manages a Function and the mapping of its parameters into a Composite.
Definition Projection.h:22
void set_Function(Function *_model)
Set the model.
Definition Projection.C:55
Reference::To< Function > model
The Function that is mapped into a Composite.
Definition Projection.h:48
~Projection()
Destructor.
Definition Projection.C:20
Reference::To< Composite, false > meta
The Composite into which the model is mapped.
Definition Projection.h:54
Function * get_Function()
Return the model.
Definition Projection.C:50
Projection(Function *model=0, Composite *meta=0)
Default constructor.
Definition Projection.C:12
void get_imap(std::vector< unsigned > &get) const
Return all mapped indeces.
Definition Projection.h:37
std::vector< unsigned > imap
The parameter index mapping into Composite.
Definition Projection.h:51
unsigned get_imap(unsigned index) const
Return the mapped index.
Definition Projection.C:25
To & operator=(const To &)
Namespace in which all modeling and calibration related code is declared.
Definition ExampleComplex2.h:16

Generated using doxygen 1.14.0