Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
miscmaths
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
miscmaths
Commits
61dc4c18
Commit
61dc4c18
authored
6 years ago
by
FSL Automated Build Engineer
Browse files
Options
Downloads
Patches
Plain Diff
new overload for melhlpfns
parent
bdf2e3ff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
t2z.cc
+10
-5
10 additions, 5 deletions
t2z.cc
t2z.h
+1
-1
1 addition, 1 deletion
t2z.h
with
11 additions
and
6 deletions
t2z.cc
+
10
−
5
View file @
61dc4c18
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
t2z.h
+
1
−
1
View file @
61dc4c18
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment