-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathGSParams.cpp
121 lines (109 loc) · 5.62 KB
/
GSParams.cpp
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/* -*- c++ -*-
* Copyright (c) 2012-2023 by the GalSim developers team on GitHub
* https://github.com/GalSim-developers
*
* This file is part of GalSim: The modular galaxy image simulation toolkit.
* https://github.com/GalSim-developers/GalSim
*
* GalSim is free software: redistribution and use in source and binary forms,
* with or without modification, are permitted provided that the following
* conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions, and the disclaimer given in the accompanying LICENSE
* file.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions, and the disclaimer given in the documentation
* and/or other materials provided with the distribution.
*/
#include "GSParams.h"
namespace galsim {
GSParams::GSParams(int _minimum_fft_size,
int _maximum_fft_size,
double _folding_threshold,
double _stepk_minimum_hlr,
double _maxk_threshold,
double _kvalue_accuracy,
double _xvalue_accuracy,
double _table_spacing,
double _realspace_relerr,
double _realspace_abserr,
double _integration_relerr,
double _integration_abserr,
double _shoot_accuracy):
minimum_fft_size(_minimum_fft_size),
maximum_fft_size(_maximum_fft_size),
folding_threshold(_folding_threshold),
stepk_minimum_hlr(_stepk_minimum_hlr),
maxk_threshold(_maxk_threshold),
kvalue_accuracy(_kvalue_accuracy),
xvalue_accuracy(_xvalue_accuracy),
table_spacing(_table_spacing),
realspace_relerr(_realspace_relerr),
realspace_abserr(_realspace_abserr),
integration_relerr(_integration_relerr),
integration_abserr(_integration_abserr),
shoot_accuracy(_shoot_accuracy)
{}
bool GSParams::operator==(const GSParams& rhs) const
{
if (this == &rhs) return true;
else if (minimum_fft_size != rhs.minimum_fft_size) return false;
else if (maximum_fft_size != rhs.maximum_fft_size) return false;
else if (folding_threshold != rhs.folding_threshold) return false;
else if (stepk_minimum_hlr != rhs.stepk_minimum_hlr) return false;
else if (maxk_threshold != rhs.maxk_threshold) return false;
else if (kvalue_accuracy != rhs.kvalue_accuracy) return false;
else if (xvalue_accuracy != rhs.xvalue_accuracy) return false;
else if (table_spacing != rhs.table_spacing) return false;
else if (realspace_relerr != rhs.realspace_relerr) return false;
else if (realspace_abserr != rhs.realspace_abserr) return false;
else if (integration_relerr != rhs.integration_relerr) return false;
else if (integration_abserr != rhs.integration_abserr) return false;
else if (shoot_accuracy != rhs.shoot_accuracy) return false;
else return true;
}
bool GSParams::operator<(const GSParams& rhs) const
{
if (this == &rhs) return false;
else if (minimum_fft_size < rhs.minimum_fft_size) return true;
else if (minimum_fft_size > rhs.minimum_fft_size) return false;
else if (maximum_fft_size < rhs.maximum_fft_size) return true;
else if (maximum_fft_size > rhs.maximum_fft_size) return false;
else if (folding_threshold < rhs.folding_threshold) return true;
else if (folding_threshold > rhs.folding_threshold) return false;
else if (stepk_minimum_hlr < rhs.stepk_minimum_hlr) return true;
else if (stepk_minimum_hlr > rhs.stepk_minimum_hlr) return false;
else if (maxk_threshold < rhs.maxk_threshold) return true;
else if (maxk_threshold > rhs.maxk_threshold) return false;
else if (kvalue_accuracy < rhs.kvalue_accuracy) return true;
else if (kvalue_accuracy > rhs.kvalue_accuracy) return false;
else if (xvalue_accuracy < rhs.xvalue_accuracy) return true;
else if (xvalue_accuracy > rhs.xvalue_accuracy) return false;
else if (table_spacing < rhs.table_spacing) return true;
else if (table_spacing > rhs.table_spacing) return false;
else if (realspace_relerr < rhs.realspace_relerr) return true;
else if (realspace_relerr > rhs.realspace_relerr) return false;
else if (realspace_abserr < rhs.realspace_abserr) return true;
else if (realspace_abserr > rhs.realspace_abserr) return false;
else if (integration_relerr < rhs.integration_relerr) return true;
else if (integration_relerr > rhs.integration_relerr) return false;
else if (integration_abserr < rhs.integration_abserr) return true;
else if (integration_abserr > rhs.integration_abserr) return false;
else if (shoot_accuracy < rhs.shoot_accuracy) return true;
else if (shoot_accuracy > rhs.shoot_accuracy) return false;
else return false;
}
std::ostream& operator<<(std::ostream& os, const GSParams& gsp)
{
os << gsp.minimum_fft_size << "," << gsp.maximum_fft_size << ", "
<< gsp.folding_threshold << "," << gsp.stepk_minimum_hlr << ","
<< gsp.maxk_threshold << ", "
<< gsp.kvalue_accuracy << "," << gsp.xvalue_accuracy << ","
<< gsp.table_spacing << ", "
<< gsp.realspace_relerr << "," << gsp.realspace_abserr << ", "
<< gsp.integration_relerr << "," << gsp.integration_abserr << ", "
<< gsp.shoot_accuracy;
return os;
}
}