Updated HelperA.h

parent ccaffb6f
Pipeline #57079 failed with stage
in 32 seconds
#ifndef HELPERA_H
#define HELPERA_H
#define _GLIBCXX_USE_CXX11_ABI 0
#include <iostream>
#include "armadillo.h"
#include <stdarg.h>
......@@ -24,7 +23,7 @@ return eigenValues;
static mat getKMeansClusters(mat A, int k){
mat clusters;
kmeans(clusters,A.t(),k,random_subset,20,true);
printf("cluster centroid calculation done\n");
/*printf("cluster centroid calculation done\n");
std::ofstream myfile;
myfile.open("data after cluster.txt");
myfile << A;
......@@ -33,14 +32,14 @@ std::ofstream myfile;
std::ofstream myfile2;
myfile2.open("cluster centroids.txt");
myfile2 << clusters;
myfile2.close();
myfile2.close();*/
mat indexedData=getKMeansClustersIndexData(A.t(), clusters);
std::ofstream myfile3;
/*std::ofstream myfile3;
myfile3.open("data after index.txt");
myfile3 << indexedData;
myfile3.close();
*/
return indexedData;
}
......@@ -77,12 +76,8 @@ static double getEuclideanDistance(mat A, int colIndexA, mat B, int colIndexB){
}
static mat getSqrtMat(mat A){
for(int i=0;i<A.n_rows;++i){
double curVal = A(i,i);
A(i,i) = sqrt(curVal);
}
return A;
cx_mat result=sqrtmat(A);
return real(result);
}
static mat getSqrtMatDiag(mat A){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment