-
Notifications
You must be signed in to change notification settings - Fork 7
/
compcontainer.h
65 lines (55 loc) · 1.6 KB
/
compcontainer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef _COMPCONTAINER_H_
#define _COMPCONTAINER_H_
#include "common.h"
#include "prototype.h"
/*
component container
int npar: number of parameters (all of the models)
int nmodel: number of models
component *model: array containing pointers to model
info: print information of the component
calc: calculate the model including all of the components
int num: length of x and y
double *x: wavelength array (Angstrom)
double *y: flux array (erg/s/cm2/Angstrom)
double *p: parameter array
addfix: add fix
c: component
p: parameter
val: value
addtie: add tie
c: component
p: parameter
ct: target component
pt: target parameter
type: tie type ("ratio":0, "offset":1)
val: value (ratio or offset)
*/
class compcontainer
{
public:
compcontainer();
//~compcontainer();
int ncomp, npar;
component *comp[NCOMP_MAX];
int nfix, ntie;
int fix[NCOMP_MAX * NPAR_MAX][2];
double fixval[NCOMP_MAX * NPAR_MAX];
int tie[NCOMP_MAX * NPAR_MAX][5];
double tieval[NCOMP_MAX * NPAR_MAX];
void add(component *m);
void info();
void calc_totpar(int num, double *x, double *y, double *p);
void calc(int num, double *x, double *y, double *p);
void pars2l(double *p, double *ptot);
void parl2s(double *ptot, double *p);
void parerrs2l(double *p, double *ptot);
int findpar(int c, int p);
void clean();
void addfix(int c, int p, double val);
void addtie(int c, int p, int ct, int pt, std::string type, double val);
void addtie_profile(int c, int ct);
void addtie_flux_profile(int c, int ct, double val);
int netnpar();
};
#endif