diff --git a/src/shogun/mathematics/ajd/JADiag.cpp b/src/shogun/mathematics/ajd/JADiag.cpp index 9e21c7a1c6c..25f0ec8be63 100644 --- a/src/shogun/mathematics/ajd/JADiag.cpp +++ b/src/shogun/mathematics/ajd/JADiag.cpp @@ -16,7 +16,7 @@ using namespace shogun; void jadiagw(double c[], double w[], int *ptn, int *ptm, double a[], double *logdet, double *decr, double *result); -static SGMatrix CJADiag::diagonalize(SGNDArray &C, SGMatrix *V0, +SGMatrix CJADiag::diagonalize(SGNDArray &C, SGMatrix *V0, double eps, int itermax) { int L = C.dims[2]; @@ -46,7 +46,7 @@ static SGMatrix CJADiag::diagonalize(SGNDArray &C, SGMatri ctot.block(0,i*d,d,d) = Ci; } - double crit; + std::vector crit; int iter = 0; while(decr > eps && iter < itermax) @@ -65,6 +65,7 @@ static SGMatrix CJADiag::diagonalize(SGNDArray &C, SGMatri &decr, &result); + crit.push_back(result); iter = iter + 1; } @@ -82,11 +83,11 @@ void jadiagw(double c[], double w[], int *ptn, int *ptm, double a[], { int n = *ptn; int m = *ptm; - int i1,j1; + //int i1,j1; int n2 = n*n, mn2 = m*n2, i, ic, ii, ij, j, jc, jj, k, k0; double sumweigh, p2, q1, p, q, - alpha, beta, gamma, a12, a21, tiny, det; + alpha, beta, gamma, a12, a21, /*tiny,*/ det; register double tmp1, tmp2, tmp, weigh; for (sumweigh = 0, i = 0; i < m; i++) diff --git a/src/shogun/mathematics/ajd/JADiag.h b/src/shogun/mathematics/ajd/JADiag.h index 11a70102d8b..2f4773e9e3b 100644 --- a/src/shogun/mathematics/ajd/JADiag.h +++ b/src/shogun/mathematics/ajd/JADiag.h @@ -12,6 +12,8 @@ #ifndef JADIAG_H_ #define JADIAG_H_ +#include "ApproxJointDiagonalizer.h" + #include #include #include @@ -67,6 +69,9 @@ class CJADiag : public CApproxJointDiagonalizer m_V = diagonalize(C,V0,eps,itermax); return m_V; } + + /** @return object name */ + virtual const char* get_name() const { return "JADiag"; } }; } #endif //JADIAG_H_