casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FunctionalProxy.h
Go to the documentation of this file.
1 //# FunctionFactory.h: a class for creating Function objects from Records
2 //# Copyright (C) 2002
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //#
27 //# $Id$
28 
29 #ifndef SCIMATH_FUNCTIONALSPROXY_H
30 #define SCIMATH_FUNCTIONALSPROXY_H
31 
32 #include <casacore/casa/aips.h>
38 
39 namespace casacore { //# NAMESPACE CASACORE - BEGIN
40 
42 public:
44  // type 0==Double, other == DComplex
45  FunctionalProxy(const Record& rec, Int type=0);
46  virtual ~FunctionalProxy();
47  Vector<Double> f(const Vector<Double>& val);
48  Vector<Double> fdf(const Vector<Double>& val);
49  void add(const FunctionalProxy& func);
52  void addc(const FunctionalProxy& func);
53  Record asrecord();
54  Int npar() const;
55  uInt ndim() const;
56  void setparameters(const Vector<Double>& val);
57  void setparametersc(const Vector<DComplex>& val);
58  void setmasks(const Vector<Bool>& val);
59 
60  void setmask(Int i, Bool val);
61  void setpar(Int i, Double val);
62  void setparc(Int i, DComplex val);
63 
64  Vector<Bool> masks() const;
65  Vector<Double> parameters() const;
67 
68 private:
69  Record fhd2rec();
70  Record fhdc2rec();
71  void rec2fhdc(const Record& rec);
72  void rec2fhd(const Record& rec);
76 
77 
78 };
79 }
80 #endif
int Int
Definition: aipstype.h:50
Vector< DComplex > parametersc() const
Vector< Bool > masks() const
void setparameters(const Vector< Double > &val)
void setpar(Int i, Double val)
void rec2fhdc(const Record &rec)
virtual casacore::String type() const
Implements RegionShape::type.
Definition: RegionShapes.h:548
void addc(const FunctionalProxy &func)
Vector< Double > parameters() const
Vector< DComplex > fc(const Vector< DComplex > &val)
void add(const FunctionalProxy &func)
double Double
Definition: aipstype.h:55
Vector< Double > fdf(const Vector< Double > &val)
void rec2fhd(const Record &rec)
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
void setparametersc(const Vector< DComplex > &val)
void setmasks(const Vector< Bool > &val)
void setparc(Int i, DComplex val)
Vector< DComplex > fdfc(const Vector< Double > &val)
FunctionHolder< Double > fhd_
FunctionHolder< DComplex > fhdc_
Vector< Double > f(const Vector< Double > &val)
void setmask(Int i, Bool val)
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42