Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/* glm.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"
#ifndef NO_NAMESPACE
using namespace NEWMAT;
namespace SIGPROC {
#endif
#if !defined(__glm_h)
#define __glm_h
#define FALSE 0
#define TRUE 1
#define BATCHSIZE 50
class Glm
{
public:
Glm() : y(NULL),
x(NULL),
contrasts(NULL) {}
void setData(Matrix& p_y, Matrix& p_x, Matrix& p_contrasts);
const Matrix& ComputeResids();
const float ComputeVar();
const float Computecb();
const ColumnVector& Computeb();
const ColumnVector& Getb() const {return b;}
const Matrix& Getr() const {return r;}
void SetContrast(const int p_num) {c = contrasts->Row(p_num).t();}
private:
Glm(const Glm&);
Glm& operator=(const Glm& p_glm);
// y = bx + r
Matrix* y;
Matrix* x;
// Contrast
Matrix* contrasts;
ColumnVector c;
int numTS;
int sizeTS;
Matrix r;
Matrix inv_xx;
float cb;
ColumnVector b;
float var;
};
#ifndef NO_NAMESPACE
}
#endif
#endif