Module org.scijava.ops.flim
Package org.scijava.ops.flim.impl
Class AbstractSingleFitWorker<I extends RealType<I>>
- java.lang.Object
-
- org.scijava.ops.flim.impl.AbstractFitWorker<I>
-
- org.scijava.ops.flim.impl.AbstractSingleFitWorker<I>
-
- All Implemented Interfaces:
FitWorker<I>
- Direct Known Subclasses:
BayesFit.BayesFitWorker,LMAFit.LMAFitWorker,PhasorFit.PhasorFitWorker,RLDFit.RLDFitWorker
public abstract class AbstractSingleFitWorker<I extends RealType<I>> extends AbstractFitWorker<I>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.scijava.ops.flim.FitWorker
FitWorker.FitEventHandler<I extends RealType<I>>
-
-
Field Summary
Fields Modifier and Type Field Description protected float[]chisqBufferData buffers, all except fortransBufferare writableprotected float[]fittedBufferData buffers, all except fortransBufferare writableprotected float[]paramBufferData buffers, all except fortransBufferare writableprotected float[]residualBufferData buffers, all except fortransBufferare writableprotected float[]transBufferData buffers, all except fortransBufferare writable-
Fields inherited from class org.scijava.ops.flim.impl.AbstractFitWorker
adjFitEnd, adjFitStart, nData, nDataTotal, nParam, params, rawChisq_target, results
-
-
Constructor Summary
Constructors Constructor Description AbstractSingleFitWorker(FitParams<I> params, FitResults results)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidafterFit()A routine called afterdoFit().protected voidbeforeFit()A routine called beforedoFit().protected abstract voiddoFit()Does the actual implementation-specific fitting routine.protected abstract AbstractSingleFitWorker<I>duplicate(FitParams<I> params, FitResults rslts)Make a worker of the same kind but does not share any writable buffers (thread safe) if that buffer is null.voidfitBatch(List<int[]> pos, FitWorker.FitEventHandler<I> handler)Fit all coordinates listed and handles fit events.voidfitSingle()Fit the data in the buffer.protected voidonThreadInit()Called on the worker thread after worker duplication.protected booleanrunMultiThreaded()-
Methods inherited from class org.scijava.ops.flim.impl.AbstractFitWorker
nDataOut, nParamOut, populate
-
-
-
-
Field Detail
-
paramBuffer
protected final float[] paramBuffer
Data buffers, all except fortransBufferare writable
-
transBuffer
protected final float[] transBuffer
Data buffers, all except fortransBufferare writable
-
chisqBuffer
protected final float[] chisqBuffer
Data buffers, all except fortransBufferare writable
-
fittedBuffer
protected final float[] fittedBuffer
Data buffers, all except fortransBufferare writable
-
residualBuffer
protected final float[] residualBuffer
Data buffers, all except fortransBufferare writable
-
-
Constructor Detail
-
AbstractSingleFitWorker
public AbstractSingleFitWorker(FitParams<I> params, FitResults results)
-
-
Method Detail
-
beforeFit
protected void beforeFit()
A routine called beforedoFit(). Can be used to throw away the left-overs from the previous run.
-
doFit
protected abstract void doFit()
Does the actual implementation-specific fitting routine.
-
afterFit
protected void afterFit()
A routine called afterdoFit(). Can be used to copy back results from buffers.
-
fitSingle
public void fitSingle()
Fit the data in the buffer.
-
duplicate
protected abstract AbstractSingleFitWorker<I> duplicate(FitParams<I> params, FitResults rslts)
Make a worker of the same kind but does not share any writable buffers (thread safe) if that buffer is null.- Parameters:
params- the parametersrslts- the results- Returns:
- a worker of the same kind.
-
onThreadInit
protected void onThreadInit()
Called on the worker thread after worker duplication. Can be used to initialize thread-local globals such as Bayesian search grid parameters.- See Also:
BayesFit.BayesFitWorker.onThreadInit()
-
runMultiThreaded
protected boolean runMultiThreaded()
-
fitBatch
public void fitBatch(List<int[]> pos, FitWorker.FitEventHandler<I> handler)
Description copied from interface:FitWorkerFit all coordinates listed and handles fit events.- Parameters:
pos- the coordinates of trans to fithandler- the fit event handler
-
-