[mlpack-svn] r13725 - 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 17 14:58:30 EDT 2012
Author: rcurtin
Date: 2012-10-17 14:58:30 -0400 (Wed, 17 Oct 2012)
New Revision: 13725
Modified:
mlpack/trunk/src/mlpack/bindings/matlab/emst/CMakeLists.txt
mlpack/trunk/src/mlpack/bindings/matlab/emst/emst.m
Log:
Change name of output and update MATLAB binding accordingly.
Modified: mlpack/trunk/src/mlpack/bindings/matlab/emst/CMakeLists.txt
===================================================================
--- mlpack/trunk/src/mlpack/bindings/matlab/emst/CMakeLists.txt 2012-10-17 02:55:28 UTC (rev 13724)
+++ mlpack/trunk/src/mlpack/bindings/matlab/emst/CMakeLists.txt 2012-10-17 18:58:30 UTC (rev 13725)
@@ -1,5 +1,6 @@
# Simple rules for building mex file. The _mex suffix is necessary to avoid
-# target name conflicts.
+# target name conflicts, and the mex file must have a different name than the .m
+# file.
add_library(emst_mex SHARED
emst.cpp
)
@@ -8,11 +9,6 @@
${LIBXML2_LIBRARIES}
)
-# Change the name of the output library.
-set_target_properties(emst_mex
- PROPERTIES OUTPUT_NAME emst
-)
-
# Installation rule. Install both the mex and the MATLAB file.
install(TARGETS emst_mex
LIBRARY DESTINATION "${MATLAB_TOOLBOX_DIR}/mlpack/"
Modified: mlpack/trunk/src/mlpack/bindings/matlab/emst/emst.m
===================================================================
--- mlpack/trunk/src/mlpack/bindings/matlab/emst/emst.m 2012-10-17 02:55:28 UTC (rev 13724)
+++ mlpack/trunk/src/mlpack/bindings/matlab/emst/emst.m 2012-10-17 18:58:30 UTC (rev 13725)
@@ -1,25 +1,25 @@
function result = emst(dataPoints, varargin)
% Fast Euclidean Minimum Spanning Tree. This script can compute
-% the Euclidean minimum spanning tree of a set of input points using the
+% the Euclidean minimum spanning tree of a set of input points using the
% dual-tree Boruvka algorithm.
-%
+%
% The output is saved in a three-column matrix, where each row indicates an
% edge. The first column corresponds to the lesser index of the edge; the
% second column corresponds to the greater index of the edge; and the third
% column corresponds to the distance between the two points.
%
% Parameters:
-% dataPoints - the matrix of data points. Columns are assumed to represent dimensions,
-% with rows representing seperate points.
-% method - the algorithm for computing the tree. 'naive' or 'boruvka', with
+% dataPoints - the matrix of data points. Columns are assumed to represent dimensions,
+% with rows representing seperate points.
+% method - the algorithm for computing the tree. 'naive' or 'boruvka', with
% 'boruvka' being the default algorithm.
-% leafSize - Leaf size in the kd-tree. One-element leaves give the
+% leafSize - Leaf size in the kd-tree. One-element leaves give the
% empirically best performance, but at the cost of greater memory
-% requirements. One is default.
-%
+% requirements. One is default.
+%
% Examples:
% result = emst(dataPoints);
-% or
+% or
% esult = emst(dataPoints,'method','naive');
% a parser for the inputs
@@ -31,13 +31,13 @@
p.parse(varargin{:});
parsed = p.Results;
-% interfacing with mlpack. transposing to machine learning standards.
+% interfacing with mlpack. transposing to machine learning standards.
if strcmpi(parsed.method, 'boruvka')
- result = mex_emst(dataPoints', 1, parsed.leafSize);
+ result = emst_mex(dataPoints', 1, parsed.leafSize);
result = result';
return;
else
- result = mex_emst(dataPoints', 0, 1);
+ result = emst_mex(dataPoints', 0, 1);
result = result';
return;
end
More information about the mlpack-svn
mailing list