Author: [log in to unmask]
Date: Sat Nov 21 15:15:11 2015
New Revision: 3972
Log:
changed fit function to match c code
Modified:
java/trunk/users/src/main/java/org/hps/users/baltzell/RfFitFunction.java
Modified: java/trunk/users/src/main/java/org/hps/users/baltzell/RfFitFunction.java
=============================================================================
--- java/trunk/users/src/main/java/org/hps/users/baltzell/RfFitFunction.java (original)
+++ java/trunk/users/src/main/java/org/hps/users/baltzell/RfFitFunction.java Sat Nov 21 15:15:11 2015
@@ -7,7 +7,7 @@
*/
public class RfFitFunction extends AbstractIFunction {
protected double intercept=0;
- protected double time=0;
+ //protected double time=0;
protected double slope=0;
public RfFitFunction() {
this("");
@@ -15,22 +15,25 @@
public RfFitFunction(String title) {
super();
this.variableNames=new String[]{"time"};
- this.parameterNames=new String[]{"intercept","time","slope"};
+ //this.parameterNames=new String[]{"intercept","time","slope"};
+ this.parameterNames=new String[]{"intercept","slope"};
+
init(title);
}
public double value(double [] v) {
- return intercept + (v[0]-time)*slope;
+ //return intercept + (v[0]-time)*slope;
+ return intercept + (v[0])*slope;
}
public void setParameters(double[] pars) throws IllegalArgumentException {
super.setParameters(pars);
intercept=pars[0];
- time=pars[1];
- slope=pars[2];
+ //time=pars[1];
+ slope=pars[1];
}
public void setParameter(String key,double value) throws IllegalArgumentException{
super.setParameter(key,value);
if (key.equals("intercept")) intercept=value;
- else if (key.equals("time")) time=value;
+ //else if (key.equals("time")) time=value;
else if (key.equals("slope")) slope=value;
}
}
|