Changeset 7288 for branches/maven


Ignore:
Timestamp:
12/01/10 19:54:59 (10 years ago)
Author:
aivar
Message:

Added function to get number of components in the fit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/maven/projects/curve-fitter/src/main/java/loci/curvefitter/AbstractCurveFitter.java

    r7025 r7288  
    3838 * Abstract base class for curve fitters. 
    3939 * 
    40  * <dl><dt><b>Source code:</b></dt> 
    41  * <dd><a href="http://dev.loci.wisc.edu/trac/java/browser/trunk/projects/curve-fitter/src/main/java/loci/curvefitter/AbstractCurveFitter.java">Trac</a>, 
    42  * <a href="http://dev.loci.wisc.edu/svn/java/trunk/projects/curve-fitter/src/main/java/loci/curvefitter/AbstractCurveFitter.java">SVN</a></dd></dl> 
     40 * @author Aivar Grislis 
    4341 * 
    44  * @author Aivar Grislis grislis at wisc.edu 
    4542 */ 
    4643public abstract class AbstractCurveFitter implements ICurveFitter { 
    47     int m_curveType = ICurveFitter.EXPONENTIAL; 
     44    FitFunction m_fitFunction; 
    4845    double m_xInc = ICurveFitter.DEFAULT_X_INC; 
    4946    boolean[] m_free; 
     
    5350     * @inheritDoc 
    5451     */ 
    55     public int getCurveType() { 
    56         return m_curveType; 
     52    public FitFunction getFitFunction() { 
     53        return m_fitFunction; 
    5754    } 
    5855     
     
    6057     * @inheritDoc 
    6158     */ 
    62     public void setCurveType(int curveType) { 
    63         m_curveType = curveType; 
     59    public void setFitFunction(FitFunction function) { 
     60        m_fitFunction = function; 
     61    } 
     62 
     63    /** 
     64     * @inheritDoc 
     65     */ 
     66    public int getNumberComponents() { 
     67        int number = 0; 
     68        if (null != m_fitFunction) { 
     69            int fitFunctionComponents[] = { 1, 2, 3, 1 }; 
     70            number = fitFunctionComponents[m_fitFunction.ordinal()]; 
     71        } 
     72        return number; 
    6473    } 
    6574 
Note: See TracChangeset for help on using the changeset viewer.