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
6a32d1b7
Commit
6a32d1b7
authored
19 years ago
by
Mark Woolrich
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
ec25734a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile
+1
-1
1 addition, 1 deletion
Makefile
quick.cc
+8
-23
8 additions, 23 deletions
quick.cc
t2z.cc
+15
-0
15 additions, 0 deletions
t2z.cc
t2z.h
+28
-0
28 additions, 0 deletions
t2z.h
with
52 additions
and
24 deletions
Makefile
+
1
−
1
View file @
6a32d1b7
...
...
@@ -10,7 +10,7 @@ USRLDFLAGS = -L${LIB_NEWMAT} -L${LIB_PROB} -L${LIB_ZLIB}
OBJS
=
miscmaths.o optimise.o miscprob.o kernel.o histogram.o base2z.o t2z.o f2z.o volume.o volumeseries.o minimize.o cspline.o sparse_matrix.o sparsefn.o rungekutta.o
#OBJS = miscmaths.o optimise.o miscprob.o kernel.o histogram.o base2z.o t2z.o f2z.o volume.o volumeseries.o minimize.o cspline.o
LIBS
=
-lutils
-lnewmat
-lprob
-lm
LIBS
=
-lutils
-lfslio
-lniftiio
-lznz
-lz
-lnewmat
-lprob
-lm
# The target "all" should ALWAYS be provided
# typically it will just be another target name
...
...
This diff is collapsed.
Click to expand it.
quick.cc
+
8
−
23
View file @
6a32d1b7
...
...
@@ -14,37 +14,22 @@
#define WANT_MATH
#include
"miscmaths.h"
#include
"
sparse_matrix
.h"
#include
"libprob.h"
#include
"
t2z
.h"
//
#include "libprob.h"
using
namespace
MISCMATHS
;
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
SparseMatrix
x
(
3
,
4
);
SparseMatrix
y
(
3
,
4
);
x
.
insert
(
1
,
1
,
1
);
y
.
insert
(
1
,
1
,
2
);
y
.
insert
(
1
,
2
,
3
);
float
tmp
=
atof
(
argv
[
1
]);
int
tmp2
=
atoi
(
argv
[
2
]);
x
.
insert
(
2
,
3
,
1.5
);
OUT
(
tmp
);
OUT
(
tmp2
);
y
.
insert
(
2
,
4
,
3
);
x
.
insert
(
2
,
4
,
-
1
);
y
.
insert
(
3
,
4
,
6
);
SparseMatrix
ret
;
OUT
(
x
.
AsMatrix
());
OUT
(
y
.
AsMatrix
());
add
(
x
,
y
,
ret
);
OUT
(
ret
.
AsMatrix
());
OUT
(
Z2t
::
getInstance
().
convert
(
tmp
,
tmp2
));
}
catch
(
Exception
p_excp
)
...
...
This diff is collapsed.
Click to expand it.
t2z.cc
+
15
−
0
View file @
6a32d1b7
...
...
@@ -18,7 +18,22 @@ using namespace Utilities;
namespace
MISCMATHS
{
T2z
*
T2z
::
t2z
=
NULL
;
Z2t
*
Z2t
::
z2t
=
NULL
;
float
Z2t
::
convert
(
float
z
,
int
dof
)
{
float
t
=
0.0
;
if
(
z
>
8
)
throw
Exception
(
"z is too large to convert to t"
);
double
p
=
MISCMATHS
::
ndtr
(
z
);
cerr
<<
"p = "
<<
p
<<
endl
;
t
=
MISCMATHS
::
stdtri
(
dof
,
p
);
return
t
;
}
float
T2z
::
larget2logp
(
float
t
,
int
dof
)
{
// static float logbeta[] = { 1.144729885849, 0.693147180560,
...
...
This diff is collapsed.
Click to expand it.
t2z.h
+
28
−
0
View file @
6a32d1b7
...
...
@@ -54,6 +54,34 @@ namespace MISCMATHS {
return
*
t2z
;
}
class
Z2t
{
public:
static
Z2t
&
getInstance
();
~
Z2t
()
{
delete
z2t
;
}
float
convert
(
float
t
,
int
dof
);
private
:
Z2t
()
{}
const
Z2t
&
operator
=
(
Z2t
&
);
Z2t
(
Z2t
&
);
static
Z2t
*
z2t
;
};
inline
Z2t
&
Z2t
::
getInstance
(){
if
(
z2t
==
NULL
)
z2t
=
new
Z2t
();
return
*
z2t
;
}
}
#endif
...
...
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