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
d2be317d
Commit
d2be317d
authored
Mar 15, 2017
by
Plaszczynski Stephane
Browse files
access to vector of P(k)
parent
6d5069ed
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
11 deletions
+22
-11
src/camel/Class/ClassEngine.cc
src/camel/Class/ClassEngine.cc
+5
-3
src/camel/Class/ClassEngine.hh
src/camel/Class/ClassEngine.hh
+0
-1
src/camel/Engine.cc
src/camel/Engine.cc
+1
-0
src/camel/Engine.hh
src/camel/Engine.hh
+16
-7
No files found.
src/camel/Class/ClassEngine.cc
View file @
d2be317d
...
...
@@ -85,8 +85,9 @@ void ClassParams::updateVal(const unsigned& i,const string& newval) {pars[i].sec
//---------------
// Constructors --
//----------------
ClassEngine
::
ClassEngine
(
const
ClassParams
&
pars
)
:
cl
(
0
),
dofree
(
true
),
_nonlin
(
false
){
ClassEngine
::
ClassEngine
(
const
ClassParams
&
pars
)
:
cl
(
0
),
dofree
(
true
){
_nonlin
=
false
;
_lmax
=-
1
;
//default
cout
<<
"Running CLASS version "
<<
_VERSION_
<<
endl
;
...
...
@@ -134,8 +135,9 @@ ClassEngine::ClassEngine(const ClassParams& pars): cl(0),dofree(true),_nonlin(fa
}
ClassEngine
::
ClassEngine
(
const
ClassParams
&
pars
,
const
string
&
precision_file
)
:
cl
(
0
),
dofree
(
true
)
,
_nonlin
(
false
)
{
ClassEngine
::
ClassEngine
(
const
ClassParams
&
pars
,
const
string
&
precision_file
)
:
cl
(
0
),
dofree
(
true
){
_nonlin
=
false
;
cout
<<
"Running CLASS version "
<<
_VERSION_
<<
endl
;
struct
file_content
fc_precision
;
...
...
src/camel/Class/ClassEngine.hh
View file @
d2be317d
...
...
@@ -226,7 +226,6 @@ private:
protected:
std
::
string
_output
;
bool
_nonlin
;
};
#endif
...
...
src/camel/Engine.cc
View file @
d2be317d
...
...
@@ -33,6 +33,7 @@ using namespace std;
//----------------
Engine
::
Engine
()
:
_lmax
(
-
1
)
{
_nonlin
=
has_PkNL
();
}
//--------------
// Destructor --
...
...
src/camel/Engine.hh
View file @
d2be317d
...
...
@@ -81,15 +81,24 @@ public:
//distance (comobile Mpc)
virtual
double
com_distance
(
double
z
)
{
return
undef
(
"com_distance"
);}
//P(K): convention if NL defined
used
it, oterwise lin
virtual
double
get_Pk
(
double
k
,
double
z
=
0
)
//access to P(k,z)
//P(K): convention if NL
is
defined
return it
it, oterwise lin
inline
virtual
double
get_Pk
(
double
k
,
double
z
=
0
)
{
return
(
has_PkNL
()
?
get_PkNL
(
k
,
z
)
:
get_Pklin
(
k
,
z
));
return
(
_nonlin
?
get_PkNL
(
k
,
z
)
:
get_Pklin
(
k
,
z
));
}
//rathe prefer explicit calls
virtual
double
get_Pklin
(
double
k
,
double
z
)
{
return
undef
(
"getpklin"
);}
virtual
double
get_PkNL
(
double
k
,
double
z
)
{
return
undef
(
"getpknl"
);}
virtual
double
get_Pklin
(
double
k
,
double
z
)
{
return
undef
(
"get_Pklin"
);}
virtual
double
get_PkNL
(
double
k
,
double
z
)
{
return
undef
(
"get_Pknl"
);}
//access through k input vector. output vector pks should be sized the same
//default implementation: calls P(k,z) -> override for better performances
inline
virtual
void
get_Pks
(
const
std
::
vector
<
double
>&
k
,
std
::
vector
<
double
>&
pks
,
double
z
){
for
(
size_t
i
=
0
;
i
<
k
.
size
();
i
++
)
pks
[
i
]
=
get_Pk
(
k
[
i
],
z
);
}
//access thtought keyword: convention is that kw is name of previous methods without "get_"
// z values can be specified by appending them in parenthesis, eg. "H(0.57)" for get_H(0.57).
...
...
@@ -105,7 +114,7 @@ public:
protected:
int
_lmax
;
bool
_nonlin
;
virtual
double
undef
(
const
char
*
msg
)
const
;
};
...
...
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