Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit d2be317d authored by Plaszczynski Stephane's avatar Plaszczynski Stephane
Browse files

access to vector of P(k)

parent 6d5069ed
......@@ -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;
......
......@@ -226,7 +226,6 @@ private:
protected:
std::string _output;
bool _nonlin;
};
#endif
......
......@@ -33,6 +33,7 @@ using namespace std;
//----------------
Engine::Engine():_lmax(-1)
{
_nonlin=has_PkNL();
}
//--------------
// Destructor --
......
......@@ -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;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment