Skip to content
Snippets Groups Projects
Commit 392b0ecc authored by Mark Woolrich's avatar Mark Woolrich
Browse files

Initial revision

parent f9122963
No related branches found
No related tags found
No related merge requests found
ols.h 0 → 100644
/* 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
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