Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
melodic
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
melodic
Commits
a29e5290
Commit
a29e5290
authored
11 years ago
by
Matthew Webster
Browse files
Options
Downloads
Patches
Plain Diff
removed redundant calc_corr
parent
96143800
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
melhlprfns.cc
+3
-49
3 additions, 49 deletions
melhlprfns.cc
melhlprfns.h
+0
-2
0 additions, 2 deletions
melhlprfns.h
with
3 additions
and
51 deletions
melhlprfns.cc
+
3
−
49
View file @
a29e5290
...
...
@@ -211,53 +211,6 @@ namespace Melodic{
return
out
;
}
Matrix
calc_corr
(
const
Matrix
&
in
,
const
Matrix
&
weights
,
int
econ
)
{
Matrix
Res
;
int
nrows
=
in
.
Nrows
();
int
ncols
=
in
.
Ncols
();
Res
=
zeros
(
nrows
,
nrows
);
RowVector
localweights
;
if
(
weights
.
Storage
()
==
0
)
localweights
=
ones
(
1
,
ncols
);
else
localweights
=
weights
;
if
(
econ
>
0
){
RowVector
colmeans
(
ncols
);
for
(
int
n
=
1
;
n
<=
ncols
;
n
++
)
{
colmeans
(
n
)
=
0
;
for
(
int
m
=
1
;
m
<=
nrows
;
m
++
)
{
colmeans
(
n
)
+=
in
(
m
,
n
);
}
colmeans
(
n
)
/=
nrows
;
}
int
dcol
=
econ
;
Matrix
suba
;
for
(
int
ctr
=
1
;
ctr
<=
in
.
Ncols
();
ctr
+=
dcol
){
suba
=
in
.
SubMatrix
(
1
,
nrows
,
ctr
,
Min
(
ctr
+
dcol
-
1
,
ncols
));
int
scolmax
=
suba
.
Ncols
();
for
(
int
n
=
1
;
n
<=
scolmax
;
n
++
)
{
double
cmean
=
colmeans
(
ctr
+
n
-
1
);
double
locw
=
localweights
(
ctr
+
n
-
1
);
for
(
int
m
=
1
;
m
<=
nrows
;
m
++
)
{
suba
(
m
,
n
)
-=
cmean
;
suba
(
m
,
n
)
*=
locw
;
}
}
Res
+=
suba
*
suba
.
t
()
/
ncols
;
}
}
else
{
Res
=
SP2
(
in
,
localweights
);
Res
=
cov_r
(
Res
,
false
,
econ
);
}
return
Res
;
}
//Matrix calc_corr
float
calc_white
(
const
Matrix
&
tmpE
,
const
RowVector
&
tmpD
,
const
RowVector
&
PercEV
,
int
dim
,
Matrix
&
param
,
Matrix
&
paramS
,
Matrix
&
white
,
Matrix
&
dewhite
)
{
...
...
@@ -335,7 +288,7 @@ namespace Melodic{
tmp2
=
calc_white
(
tmpE
,
tmpD
,
tmp
,
dim
,
param
,
paramS
,
white
,
dewhite
);
}
//Matrix calc_white
void
calc_white
(
const
SymmetricMatrix
&
Corr
,
int
dim
,
Matrix
&
white
,
Matrix
&
dewhite
)
void
calc_white
(
const
SymmetricMatrix
&
Corr
,
int
dim
,
Matrix
&
white
,
Matrix
&
dewhite
)
{
Matrix
RE
;
DiagonalMatrix
RD
;
...
...
@@ -349,9 +302,10 @@ namespace Melodic{
void
std_pca
(
const
Matrix
&
Mat
,
const
Matrix
&
weights
,
SymmetricMatrix
&
Corr
,
Matrix
&
evecs
,
RowVector
&
evals
,
int
econ
)
{
if
(
weights
.
Storage
()
>
0
)
Corr
<<
calc_cor
r
(
Mat
,
weights
,
econ
);
Corr
=
cov_
r
(
Mat
,
weights
,
econ
);
else
Corr
=
cov_r
(
Mat
,
false
,
econ
);
DiagonalMatrix
tmpD
;
EigenValues
(
Corr
,
tmpD
,
evecs
);
evals
=
tmpD
.
AsRow
();
...
...
This diff is collapsed.
Click to expand it.
melhlprfns.h
+
0
−
2
View file @
a29e5290
...
...
@@ -56,8 +56,6 @@ namespace Melodic{
Matrix
corrcoef
(
const
Matrix
&
in1
,
const
Matrix
&
in2
);
Matrix
corrcoef
(
const
Matrix
&
in1
,
const
Matrix
&
in2
,
const
Matrix
&
part
);
Matrix
calc_corr
(
const
Matrix
&
in
,
const
Matrix
&
weights
,
int
econ
=
20000
);
float
calc_white
(
const
Matrix
&
tmpE
,
const
RowVector
&
tmpD
,
const
RowVector
&
PercEV
,
int
dim
,
Matrix
&
param
,
Matrix
&
paramS
,
Matrix
&
white
,
Matrix
&
dewhite
);
float
calc_white
(
const
Matrix
&
tmpE
,
const
RowVector
&
tmpD
,
const
RowVector
&
PercEV
,
int
dim
,
Matrix
&
white
,
Matrix
&
dewhite
);
void
calc_white
(
const
Matrix
&
tmpE
,
const
RowVector
&
tmpD
,
int
dim
,
Matrix
&
param
,
Matrix
&
paramS
,
Matrix
&
white
,
Matrix
&
dewhite
);
...
...
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