projects
/
epclust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
save state; test clustering not OK, all others OK
[epclust.git]
/
epclust
/
src
/
computeMedoidsIndices.cpp
diff --git
a/epclust/src/computeMedoidsIndices.cpp
b/epclust/src/computeMedoidsIndices.cpp
index
6934181
..
f247584
100644
(file)
--- a/
epclust/src/computeMedoidsIndices.cpp
+++ b/
epclust/src/computeMedoidsIndices.cpp
@@
-21,9
+21,9
@@
IntegerVector computeMedoidsIndices(SEXP pMedoids, NumericMatrix ref_series)
{
XPtr<BigMatrix> pMed(pMedoids);
MatrixAccessor<double> medoids = MatrixAccessor<double>(*pMed);
{
XPtr<BigMatrix> pMed(pMedoids);
MatrixAccessor<double> medoids = MatrixAccessor<double>(*pMed);
- int nb_series = ref_series.n
row
(),
- K = pMed->n
row
(),
- L = pMed->n
col
();
+ int nb_series = ref_series.n
col
(),
+ K = pMed->n
col
(),
+ L = pMed->n
row
();
IntegerVector mi(nb_series);
for (int i=0; i<nb_series ; i++)
IntegerVector mi(nb_series);
for (int i=0; i<nb_series ; i++)
@@
-36,7
+36,7
@@
IntegerVector computeMedoidsIndices(SEXP pMedoids, NumericMatrix ref_series)
double dist_ij = 0.;
for (int k=0; k<L; k++)
{
double dist_ij = 0.;
for (int k=0; k<L; k++)
{
- double delta = ref_series(
i,k) - *(medoids[k]+j
);
+ double delta = ref_series(
k,i) - *(medoids[j]+k
);
dist_ij += delta * delta;
}
if (dist_ij < best_dist)
dist_ij += delta * delta;
}
if (dist_ij < best_dist)