Skip to content
Snippets Groups Projects
Commit 3e1a676d authored by Tim Behrens's avatar Tim Behrens
Browse files

*** empty log message ***

parent 78c7f415
No related branches found
No related tags found
No related merge requests found
......@@ -1700,6 +1700,12 @@ void ols(const Matrix& data,const Matrix& des,const Matrix& tc, Matrix& cope,Mat
}
int ols_dof(const Matrix& des){
Matrix pdes = pinv(des);
Matrix R=Identity(des.Nrows())-des*pdes;
return int(R.Trace());
}
int conjgrad(ColumnVector& x, const Matrix& A, const ColumnVector& b, int maxit,
float reltol)
{
......
/* miscmaths.h
Mark Jenkinson & Mark Woolrich & Christian Beckmann, FMRIB Image Analysis Group
Mark Jenkinson & Mark Woolrich & Christian Beckmann & Tim Behrens, FMRIB Image Analysis Group
Copyright (C) 1999-2000 University of Oxford */
......@@ -203,7 +203,8 @@ namespace MISCMATHS {
// cope and varcope will be cons x v
// but will be resized if they are wrong
void ols(const Matrix& data,const Matrix& des,const Matrix& tc, Matrix& cope,Matrix& varcope);
int ols_dof(const Matrix& des);
// Conjugate Gradient methods to solve for x in: A * x = b
// A must be symmetric and positive definite
......
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