diff src/samer/mds/GeometricFilter.java @ 0:bf79fb79ee13

Initial Mercurial check in.
author samer
date Tue, 17 Jan 2012 17:50:20 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/samer/mds/GeometricFilter.java	Tue Jan 17 17:50:20 2012 +0000
@@ -0,0 +1,21 @@
+package samer.mds;
+
+import samer.maths.*;
+import samer.tools.*;
+
+public class GeometricFilter extends AnonymousTask {
+	int				N;
+	Matrix		P;			// point positions (N by E)
+	Vec			F;			// filter coefficients (N element)
+	FunctionOfVector	fn;		// map from proximity to coeff.
+	
+	public GeometricFilter(Matrix P, Vec F, FunctionOfVector fn) {
+		this.P=P; this.F=F; this.fn=fn;
+		N=F.size();
+	}
+	public void run() { 	
+		double [][] _P=P.getArray();
+		double [] _F=F.array();
+		for (int i=0; i<N; i++) _F[i] = fn.apply(_P[i]);
+	}
+}