DataPipe, DataPipeForked, IDataSink, IDataSourceAccumulatorAverageCovariance, AccumulatorMimicMupublic class AccumulatorAverageFixed extends AccumulatorAverage
This accumulator accepts any type of Data
The average value is based on block averages -- it does not include samples that are not part of blocks. Average and error are computed using a formulation that reduces numeric roundoff.
The standard deviation does include samples not included in a complete block and uses a simpler formulation that is more vulnerable to roundoff.
AccumulatorAverage.StatType| Modifier and Type | Field | Description |
|---|---|---|
protected IDataSink |
blockDataSink |
|
protected java.lang.String |
blockFilename |
|
protected IData |
blockVarSum |
|
protected IData |
correlationSum |
|
protected IData |
currentBlockAvg |
|
protected IData |
firstBlock |
|
protected IData |
mostRecentBlock |
|
protected IFunction |
negativeChop |
|
protected int |
numSavedBlockData |
|
protected IFunction |
sanityCheckBC |
|
protected double[][] |
savedBlockData |
|
protected IData |
sumSquare |
|
protected IData |
work |
|
protected IData |
work2 |
average, AVERAGE, BLOCK_CORRELATION, blockCorrelation, blockCountDown, blockSize, count, dataGroup, doIncludeACInError, error, ERROR, MOST_RECENT, mostRecent, STANDARD_DEVIATION, standardDeviationactive, hasUnpushedData, pushInterval, putCountdataInfo, dataSink, tag| Constructor | Description |
|---|---|
AccumulatorAverageFixed() |
Default constructor sets block size to 1000 and sets the
interval for pushing the output data (pushInterval) to 100.
|
AccumulatorAverageFixed(long blockSize) |
Constructs with interval for pushing the output data set to 100.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
addData(IData data) |
Add the given values to the sums and block sums.
|
protected void |
doBlockSum() |
Performs the block sum after blockSize calls to addData.
|
IDataSink |
getBlockDataSink() |
|
IData |
getData() |
|
boolean |
getDoStrictBlockData() |
|
IDataInfo |
processDataInfo(IDataInfo incomingDataInfo) |
Prepares the accumulator for input data.
|
void |
putDataInfo(IDataInfo inputDataInfo) |
Invokes processDataInfo on the given DataInfo, and passes the returned
DataInfo to the dataSink (if not null).
|
void |
readBlockData(java.lang.String filename) |
Reads block data from the given file.
|
void |
reset() |
Resets all sums to zero.
|
void |
setBlockDataSink(IDataSink blockDataSink) |
Allows individual block data to be passed to a data sink.
|
void |
setWriteBlocks(java.lang.String filename) |
Configures the accumulator to write block data to the given file.
|
void |
writeBlockData() |
addDataSink, doIncludeACInError, getBlockCount, getBlockSize, getData, getSampleCount, getTag, setBlockSize, setIncludeACInError, statChoicesgetPushInterval, isActive, processData, setActive, setPushInterval, toStringgetDataInfo, getTag, putDataaddDataSink, getDataSink, getDataSinks, removeDataSink, setDataSink, setDataSinksgetDataInfo, getTagprotected final IFunction negativeChop
protected final IFunction sanityCheckBC
protected IData blockVarSum
protected IData currentBlockAvg
protected IData sumSquare
protected IData mostRecentBlock
protected IData correlationSum
protected IData firstBlock
protected IData work
protected IData work2
protected IDataSink blockDataSink
protected java.lang.String blockFilename
protected double[][] savedBlockData
protected int numSavedBlockData
public AccumulatorAverageFixed()
public AccumulatorAverageFixed(long blockSize)
blockSize - size of the block.public boolean getDoStrictBlockData()
public IDataSink getBlockDataSink()
public void setWriteBlocks(java.lang.String filename)
public void readBlockData(java.lang.String filename)
public void writeBlockData()
public void setBlockDataSink(IDataSink blockDataSink)
blockDataSink - the sink where the blocks are to be passed. For
multiple streams, this could be a DataFork.public boolean addData(IData data)
addData in class DataAccumulatordata - data to be added.public void putDataInfo(IDataInfo inputDataInfo)
DataProcessorputDataInfo in interface IDataSinkputDataInfo in class DataProcessorprotected void doBlockSum()
public IData getData()
getData in interface IDataSourcegetData in class DataAccumulatorpublic void reset()
AccumulatorAveragereset in class AccumulatorAveragepublic IDataInfo processDataInfo(IDataInfo incomingDataInfo)
AccumulatorAverageprocessDataInfo in class AccumulatorAverageincomingDataInfo - the DataInfo instance for the data that will be given to
addData