Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
Xavier Garrido
CAMEL
Commits
6d5069ed
Commit
6d5069ed
authored
Mar 10, 2017
by
Plaszczynski Stephane
Browse files
add names to engines
parent
74c4f0fc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
6 deletions
+28
-6
src/camel/Class/ClassEngine.hh
src/camel/Class/ClassEngine.hh
+1
-0
src/camel/Class/MnClassEngine.hh
src/camel/Class/MnClassEngine.hh
+5
-0
src/camel/Engine.cc
src/camel/Engine.cc
+1
-1
src/camel/Engine.hh
src/camel/Engine.hh
+2
-1
src/camel/exec/writeSpectraPk.cc
src/camel/exec/writeSpectraPk.cc
+17
-4
src/camel/pico/MnPicoEngine.hh
src/camel/pico/MnPicoEngine.hh
+2
-0
No files found.
src/camel/Class/ClassEngine.hh
View file @
6d5069ed
...
...
@@ -120,6 +120,7 @@ public:
//get value at l ( 2<l<lmax): in units = (micro-K)^2
//don't call if FAILURE returned previously
//throws std::execption if pb
virtual
std
::
string
name
()
const
{
return
"CLASS"
;}
double
getCl
(
Engine
::
cltype
t
,
const
long
&
l
);
void
getCls
(
const
std
::
vector
<
unsigned
>&
lVec
,
//input
...
...
src/camel/Class/MnClassEngine.hh
View file @
6d5069ed
...
...
@@ -44,6 +44,9 @@ public:
//conistent with the MnUserVariables
bool
updateParValues
(
const
std
::
vector
<
double
>&
minuitPars
);
virtual
std
::
string
name
()
const
{
return
"Minuit-CLASS"
;}
//then read with this one
inline
void
getCls
(
const
std
::
vector
<
unsigned
>&
lVec
,
//input
std
::
vector
<
double
>&
cltt
,
...
...
@@ -87,6 +90,8 @@ public:
double
rs_rec
()
const
{
return
klass
->
rs_rec
();}
double
com_distance
(
double
z
)
{
return
klass
->
com_distance
(
z
);}
virtual
double
get_Pklin
(
double
k
,
double
z
)
{
return
klass
->
get_Pklin
(
k
,
z
);}
virtual
double
get_PkNL
(
double
k
,
double
z
)
{
return
klass
->
get_PkNL
(
k
,
z
);}
void
writeCls
(
std
::
ostream
&
o
)
{
klass
->
writeCls
(
o
);}
...
...
src/camel/Engine.cc
View file @
6d5069ed
...
...
@@ -124,6 +124,6 @@ Engine::get(const std::string& key)
double
Engine
::
undef
(
const
char
*
param
)
const
{
throw
Message_error
(
string
(
"derived par="
)
+
param
+
"
cannot
be
compute
d"
);
throw
Message_error
(
name
()
+
": Engine:
cannot compute
"
+
param
);
return
-
1.
;
}
src/camel/Engine.hh
View file @
6d5069ed
...
...
@@ -42,7 +42,8 @@ public:
virtual
bool
has_Pklin
()
const
{
return
false
;}
virtual
bool
has_PkNL
()
const
{
return
false
;}
virtual
std
::
string
name
()
const
=
0
;
// units = (micro-K)^2
virtual
void
getCls
(
const
std
::
vector
<
unsigned
>&
lVec
,
//input
std
::
vector
<
double
>&
cltt
,
...
...
src/camel/exec/writeSpectraPk.cc
View file @
6d5069ed
...
...
@@ -59,15 +59,29 @@ int main(int argc,char** argv){
classparms
.
add
(
"z_max_pk"
,
z0
);
//polar +lens+clphi
//increase kmax if higher value requested
const
double
kmax
=
parser
.
params
.
find
<
double
>
(
"k_end"
,
1
);
for
(
size_t
i
=
0
;
i
<
classparms
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
classparms
.
size
();
i
++
)
{
if
(
classparms
.
key
(
i
)
==
"P_k_max_1/Mpc"
){
double
val
;
stringToData
(
classparms
.
value
(
i
),
val
);
if
(
val
<
kmax
)
{
cout
<<
"Warning: requested k_end="
<<
kmax
<<
" while P_k_max_1/Mpc="
<<
classparms
.
value
(
i
)
<<
" increasing parameter"
<<
endl
;
classparms
.
updateVal
(
i
,
dataToString
(
kmax
));
}
}
cout
<<
"CLASS
\t
--> "
<<
classparms
.
key
(
i
)
<<
"
\t
"
<<
classparms
.
value
(
i
)
<<
endl
;
}
//precision file
string
pre
=
""
;
if
(
parser
.
params
.
param_present
(
"precisionFile"
)){
pre
=
Parser
::
CheckPath
(
parser
.
params
.
find
<
string
>
(
"precisionFile"
,
""
));
}
cout
<<
"CLASS
\t
--> precision parameters taken from file="
<<
pre
<<
endl
;
e
=
new
MnClassEngine
(
parser
.
vars
(),
...
...
@@ -186,7 +200,7 @@ int main(int argc,char** argv){
std
::
vector
<
fitscolumn
>
pkcols
;
pkcols
.
push_back
(
fitscolumn
(
"k"
,
"1/Mpc"
,
1
,
TDOUBLE
));
pkcols
.
push_back
(
fitscolumn
(
"Pklin"
,
"(1/Mpc)^-3"
,
1
,
TDOUBLE
));
pkcols
.
push_back
(
fitscolumn
(
"Pknl"
,
"(1/Mpc)^-3"
,
1
,
TDOUBLE
));
if
(
do_nl
)
pkcols
.
push_back
(
fitscolumn
(
"Pknl"
,
"(1/Mpc)^-3"
,
1
,
TDOUBLE
));
fout
.
insert_bintab
(
pkcols
);
// def values
...
...
@@ -213,7 +227,6 @@ int main(int argc,char** argv){
else
{
const
int
npks
=
parser
.
params
.
find
<
int
>
(
"n_pks"
,
1000
);
const
double
kmin
=
parser
.
params
.
find
<
double
>
(
"k_beg"
,
8.e-4
);
const
double
kmax
=
parser
.
params
.
find
<
double
>
(
"k_end"
,
1
);
logspace
(
kmin
,
kmax
,
npks
,
kval
)
;
}
...
...
src/camel/pico/MnPicoEngine.hh
View file @
6d5069ed
...
...
@@ -40,6 +40,8 @@ public:
// destructor
~
MnPicoEngine
();
virtual
std
::
string
name
()
const
{
return
"MnPico"
;}
//services
bool
has_CMB_Cl
()
const
{
return
true
;}
bool
has_CMB_ClPol
()
const
{
return
true
;}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment