Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
film
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
film
Commits
392b0ecc
Commit
392b0ecc
authored
24 years ago
by
Mark Woolrich
Browse files
Options
Downloads
Patches
Plain Diff
Initial revision
parent
f9122963
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ols.h
+103
-0
103 additions, 0 deletions
ols.h
with
103 additions
and
0 deletions
ols.h
0 → 100644
+
103
−
0
View file @
392b0ecc
/* ols.h
Mark Woolrich, FMRIB Image Analysis Group
Copyright (C) 1999-2000 University of Oxford */
/* CCOPYRIGHT */
#include
<iostream>
#include
<fstream>
#define WANT_STREAM
#define WANT_MATH
#include
"newmatap.h"
#include
"newmatio.h"
#if !defined(__ols_h)
#define __ols_h
#ifndef NO_NAMESPACE
using
namespace
NEWMAT
;
namespace
SIGPROC
{
#endif
#define FALSE 0
#define TRUE 1
#define BATCHSIZE 50
class
Ols
{
public:
Ols
(
const
Matrix
&
p_y
,
const
Matrix
&
p_x
,
const
Matrix
&
p_contrasts
);
const
Matrix
&
ComputeResids
();
const
ColumnVector
&
ComputeVar
();
const
ColumnVector
&
Computecb
();
const
float
ComputeVar
(
const
int
ind
);
const
float
Computecb
(
const
int
ind
);
const
ColumnVector
&
Computeb
(
const
int
ind
);
float
SetupWithV
(
const
ColumnVector
&
p_vrow
,
bool
p_justvarone
=
FALSE
);
float
SetupWithV
(
const
ColumnVector
&
p_vrow
,
const
ColumnVector
&
p_krowspec
,
ColumnVector
&
p_res
,
bool
p_justvarone
=
FALSE
,
const
int
zeropad
=
512
);
const
Matrix
&
Getr
()
const
{
return
r
;}
const
ColumnVector
&
Getvar
()
const
{
return
var
;}
const
ColumnVector
&
Getcb
()
const
{
return
cb
;}
float
Getdof
()
const
{
return
dof
;}
float
Getvarone
()
const
{
return
var_on_e
;}
void
SetContrast
(
const
int
p_num
)
{
c
=
contrasts
.
Row
(
p_num
).
t
();}
void
Setvarone
(
const
float
p_varone
)
{
var_on_e
=
p_varone
;}
private
:
Ols
();
Ols
(
const
Ols
&
);
Ols
&
operator
=
(
const
Ols
&
p_ols
);
void
ConstructV
(
const
ColumnVector
&
p_vrow
);
// y = bx + r
const
Matrix
&
y
;
const
Matrix
&
x
;
// Contrast
const
Matrix
&
contrasts
;
ColumnVector
c
;
int
numTS
;
int
sizeTS
;
Matrix
r
;
Matrix
pinv_x
;
float
var_on_e
;
ColumnVector
cb
;
ColumnVector
b
;
ColumnVector
var
;
float
dof
;
// Covariance matrix is sigma^2*V:
Matrix
V
;
Matrix
RV
;
Matrix
RMat
;
// batch stuff
int
batch_size
;
};
#endif
#ifndef NO_NAMESPACE
}
#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