Skip to content
Snippets Groups Projects
Commit 61dc4c18 authored by FSL Automated Build Engineer's avatar FSL Automated Build Engineer
Browse files

new overload for melhlpfns

parent bdf2e3ff
No related branches found
No related tags found
No related merge requests found
......@@ -114,25 +114,30 @@ namespace MISCMATHS {
return (logp < -14.5);
}
float T2z::convert(float t, int dof) {
float T2z::convert(float t, int dof, double *newlogp) {
float z = 0.0, logp=0.0;
double p(0);
if(!islarget(t,dof,logp)) {
// cerr << "t = " << t << endl;
double p = MISCMATHS::stdtr(dof, t);
p = MISCMATHS::stdtr(dof, t);
//cerr << "p = " << p << endl;
logp=log(1.0-p); //reversed as we output 1-0
z = MISCMATHS::ndtri(p);
}
else {
z = logp2largez(logp);
// cerr<<endl<<"logp="<<logp<<endl;
if (t<0) z=-z;
if (t<0) {
z=-z;
logp=-1.0e-12; //to match function below
}
}
if ( newlogp )
*newlogp=logp;
return z;
}
......
......@@ -25,7 +25,7 @@ namespace MISCMATHS {
static T2z& getInstance();
~T2z() { delete t2z; }
float convert(float t, int dof);
float convert(float t, int dof,double *newp=NULL);
float converttologp(float t, int dof);
static void ComputePs(const ColumnVector& p_vars, const ColumnVector& p_cbs, int p_dof, ColumnVector& p_ps);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment