Skip to content

Commit

Permalink
fixed some minor mistakes so that it builds
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinhughes27 committed Jul 3, 2013
1 parent 3c3592a commit 37cb7ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/shogun/mathematics/ajd/JADiag.cpp
Expand Up @@ -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<float64_t> CJADiag::diagonalize(SGNDArray<float64_t> &C, SGMatrix<float64_t> *V0,
SGMatrix<float64_t> CJADiag::diagonalize(SGNDArray<float64_t> &C, SGMatrix<float64_t> *V0,
double eps, int itermax)
{
int L = C.dims[2];
Expand Down Expand Up @@ -46,7 +46,7 @@ static SGMatrix<float64_t> CJADiag::diagonalize(SGNDArray<float64_t> &C, SGMatri
ctot.block(0,i*d,d,d) = Ci;
}

double crit;
std::vector<double> crit;
int iter = 0;

while(decr > eps && iter < itermax)
Expand All @@ -65,6 +65,7 @@ static SGMatrix<float64_t> CJADiag::diagonalize(SGNDArray<float64_t> &C, SGMatri
&decr,
&result);

crit.push_back(result);
iter = iter + 1;
}

Expand All @@ -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++)
Expand Down
5 changes: 5 additions & 0 deletions src/shogun/mathematics/ajd/JADiag.h
Expand Up @@ -12,6 +12,8 @@
#ifndef JADIAG_H_
#define JADIAG_H_

#include "ApproxJointDiagonalizer.h"

#include <shogun/lib/common.h>
#include <shogun/base/SGObject.h>
#include <shogun/lib/SGMatrix.h>
Expand Down Expand Up @@ -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_

0 comments on commit 37cb7ba

Please sign in to comment.