Mercurial > hg > jslab
view src/samer/functions/LogisticHyperplane.java @ 0:bf79fb79ee13
Initial Mercurial check in.
author | samer |
---|---|
date | Tue, 17 Jan 2012 17:50:20 +0000 |
parents | |
children |
line wrap: on
line source
package samer.functions; import samer.maths.*; public class LogisticHyperplane extends FunctionOfVector { double[] norm; double offset; Function fn; public LogisticHyperplane(int n) { this(new double[n],0); } public LogisticHyperplane(double [] norm, double offset) { this.offset=offset; this.norm=norm; fn=new Step(); } public void setFunction(Function f) { fn=f; } public void setOffset(double r) { offset=r; } public void setNormal(double [] n) { norm=n; } public double getOffset() { return offset; } public double[] getNormal() { return norm; } public double apply(double [] in) { return fn.apply(Mathx.dot(in,norm)-offset); } }