[mlpack-svn] r13678 - mlpack/trunk/src/mlpack/bindings/matlab/emst
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Oct 10 16:47:30 EDT 2012
Author: rcurtin
Date: 2012-10-10 16:47:30 -0400 (Wed, 10 Oct 2012)
New Revision: 13678
Modified:
mlpack/trunk/src/mlpack/bindings/matlab/emst/emst.cpp
Log:
Fix includes.
Modified: mlpack/trunk/src/mlpack/bindings/matlab/emst/emst.cpp
===================================================================
--- mlpack/trunk/src/mlpack/bindings/matlab/emst/emst.cpp 2012-10-10 20:13:27 UTC (rev 13677)
+++ mlpack/trunk/src/mlpack/bindings/matlab/emst/emst.cpp 2012-10-10 20:47:30 UTC (rev 13678)
@@ -1,7 +1,7 @@
#include "mex.h"
-#include "dtb.hpp"
#include <mlpack/core.hpp>
+#include <mlpack/methods/emst/dtb.hpp>
#include <iostream>
@@ -14,12 +14,12 @@
int nrhs, const mxArray *prhs[])
{
// argument checks
- if (nrhs != 3)
+ if (nrhs != 3)
{
mexErrMsgTxt("Expecting an datapoints matrix, isBoruvka, and leafSize.");
}
- if (nlhs != 1)
+ if (nlhs != 1)
{
mexErrMsgTxt("Output required.");
}
@@ -31,9 +31,9 @@
// converting from mxArray to armadillo matrix
arma::mat dataPoints(numDimensions, numPoints);
- // setting the values.
+ // setting the values.
double * mexDataPoints = mxGetPr(prhs[0]);
- for (int i = 0, n = numPoints * numDimensions; i < n; ++i)
+ for (int i = 0, n = numPoints * numDimensions; i < n; ++i)
{
dataPoints(i) = mexDataPoints[i];
}
@@ -43,7 +43,7 @@
// running the computation
arma::mat result;
- if (isBoruvka)
+ if (isBoruvka)
{
// getting the number of leaves
const size_t leafSize = (size_t) mxGetScalar(prhs[2]);
@@ -51,7 +51,7 @@
DualTreeBoruvka<> dtb(dataPoints, false, leafSize);
dtb.ComputeMST(result);
}
- else
+ else
{
DualTreeBoruvka<> naive(dataPoints, true);
naive.ComputeMST(result);
@@ -62,7 +62,7 @@
// setting the values
double * out = mxGetPr(plhs[0]);
- for (int i = 0, n = (numPoints - 1) * 3; i < n; ++i)
+ for (int i = 0, n = (numPoints - 1) * 3; i < n; ++i)
{
out[i] = result(i);
}
More information about the mlpack-svn
mailing list