changeset 10221:3d5555c5aeef octave-forge

__kernel_weights: remove the .m file implementation of the function since we have a C++ implementation for more than 4 years already
author carandraug
date Fri, 11 May 2012 12:15:24 +0000
parents b841303c4c4a
children 77cb74e47659
files main/econometrics/inst/__kernel_weights.m main/econometrics/src/Makefile main/econometrics/src/__kernel_weights.cc
diffstat 3 files changed, 10 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/main/econometrics/inst/__kernel_weights.m	Fri May 11 11:51:45 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-## Copyright (C) 2006, 2007 Michael Creel <michael.creel@uab.es>
-##
-## This program is free software; you can redistribute it and/or modify it under
-## the terms of the GNU General Public License as published by the Free Software
-## Foundation; either version 3 of the License, or (at your option) any later
-## version.
-##
-## This program is distributed in the hope that it will be useful, but WITHOUT
-## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-## details.
-##
-## You should have received a copy of the GNU General Public License along with
-## this program; if not, see <http://www.gnu.org/licenses/>.
-
-## __kernel_weights: for internal use by kernel_regression and kernel_density. There
-## is also a faster .oct file version that should be be found automatically.
-
-function W = __kernel_weights(data, evalpoints, kernel)
-
-	# calculate distances
-	nn = rows(evalpoints);
-	n = rows(data);
-	W = zeros(nn,n);
-	for i = 1:nn
-		zz = data - repmat(evalpoints(i,:), n, 1);
-		zz = feval(kernel, zz);
-		W(i,:) = zz';
-	endfor
-endfunction
--- a/main/econometrics/src/Makefile	Fri May 11 11:51:45 2012 +0000
+++ b/main/econometrics/src/Makefile	Fri May 11 12:15:24 2012 +0000
@@ -1,7 +1,11 @@
-all: __kernel_weights.oct
+MKOCTFILE = mkoctfile -Wall
+
+PROGS = $(patsubst %.cc,%.oct,$(wildcard *.cc))
+
+all: $(PROGS)
 
 %.oct: %.cc
-	mkoctfile -s $<
+	$(MKOCTFILE) $<
 
 clean:
-	-rm *.o core octave-core *.oct *~
+	rm -f *.o octave-core core *.oct *~
--- a/main/econometrics/src/__kernel_weights.cc	Fri May 11 11:51:45 2012 +0000
+++ b/main/econometrics/src/__kernel_weights.cc	Fri May 11 12:15:24 2012 +0000
@@ -14,6 +14,9 @@
 // this program; if not, see <http://www.gnu.org/licenses/>.
 
 // __kernel_weights: for internal use by kernel density and regression functions
+// This function was originally written as .m file and eventually rewritten in
+// C++ for performance. the .m file was removed from the package on revision
+// 10407 by carandraug
 
 #include <oct.h>
 #include <octave/parse.h>