DataPipe
, DataPipeForked
, IDataSink
, IDataSource
AccumulatorAverageCovariance
, AccumulatorMimicMu
public 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, standardDeviation
active, hasUnpushedData, pushInterval, putCount
dataInfo, 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, statChoices
getPushInterval, isActive, processData, setActive, setPushInterval, toString
getDataInfo, getTag, putData
addDataSink, getDataSink, getDataSinks, removeDataSink, setDataSink, setDataSinks
getDataInfo, getTag
protected 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 DataAccumulator
data
- data to be added.public void putDataInfo(IDataInfo inputDataInfo)
DataProcessor
putDataInfo
in interface IDataSink
putDataInfo
in class DataProcessor
protected void doBlockSum()
public IData getData()
getData
in interface IDataSource
getData
in class DataAccumulator
public void reset()
AccumulatorAverage
reset
in class AccumulatorAverage
public IDataInfo processDataInfo(IDataInfo incomingDataInfo)
AccumulatorAverage
processDataInfo
in class AccumulatorAverage
incomingDataInfo
- the DataInfo instance for the data that will be given to
addData