public class MultiDimDoubleDataSet extends AbstractDataSet<MultiDimDoubleDataSet> implements EditableDataSet
DataSet interface which stores x,y,... values in nDim separate arrays. It provides
methods allowing easy manipulation of data points.| Modifier and Type | Field and Description |
|---|---|
protected it.unimi.dsi.fastutil.doubles.DoubleArrayList[] |
values |
TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT| Constructor and Description |
|---|
MultiDimDoubleDataSet(DataSet another)
Creates a new instance of
MultiDimDoubleDataSet as copy of another (deep-copy). |
MultiDimDoubleDataSet(String name,
boolean deepCopy,
double[]... values)
Creates a new instance of
MultiDimDoubleDataSet. |
MultiDimDoubleDataSet(String name,
int nDim)
Creates a new instance of
MultiDimDoubleDataSet. |
MultiDimDoubleDataSet(String name,
int nDims,
int... initialSizes)
Creates a new instance of
MultiDimDoubleDataSet. |
| Modifier and Type | Method and Description |
|---|---|
MultiDimDoubleDataSet |
add(double... newValues)
Add point to the end of the data set
|
MultiDimDoubleDataSet |
add(double[][] valuesNew)
Add array vectors to data set.
|
MultiDimDoubleDataSet |
add(double[] newValues,
String label)
Add point to the data set.
|
MultiDimDoubleDataSet |
add(int index,
double... newValues)
add point to the data set
|
MultiDimDoubleDataSet |
add(int index,
double[][] newValues)
add point to the data set
|
MultiDimDoubleDataSet |
add(int index,
double[] newValues,
String label)
add point to the data set
|
MultiDimDoubleDataSet |
clearData()
clear all data points
|
double |
get(int dimIndex,
int index)
Gets the x value of the data point with the index i
|
int |
getCapacity() |
int |
getDataCount(int dimIndex)
Get the number of data points in the data set for a specific dimension.
|
double |
getValue(int dimIndex,
double x)
Gets the interpolated y value of the data point for given x coordinate
|
double[] |
getValues(int dimIndex) |
MultiDimDoubleDataSet |
increaseCapacity(int amount) |
EditableDataSet |
remove(int index)
remove point from data set
|
MultiDimDoubleDataSet |
remove(int fromIndex,
int toIndex)
removes sub-range of data points
|
MultiDimDoubleDataSet |
resize(int size)
ensures minimum size, enlarges if necessary
|
MultiDimDoubleDataSet |
set(DataSet other)
clear old data and overwrite with data from 'other' data set (deep copy)
|
MultiDimDoubleDataSet |
set(double[][] values)
Initialises the data set with specified data.
|
MultiDimDoubleDataSet |
set(double[][] values,
boolean copy)
Initialises the data set with specified data.
|
MultiDimDoubleDataSet |
set(int index,
double... newValue)
replaces point coordinate of existing data point
|
MultiDimDoubleDataSet |
set(int index,
double[][] values)
Sets the values of the DataSet from index onwards.
|
MultiDimDoubleDataSet |
setValues(int dimIndex,
double[] values,
boolean copy)
Update the data for a given dimension
|
MultiDimDoubleDataSet |
trim()
Trims the arrays list so that the capacity is equal to the size.
|
addDataLabel, addDataStyle, autoNotification, binarySearch, clearMetaInfo, equalDataLabels, equalEditConstraints, equalErrorValues, equalMetaData, equals, equals, equalValues, fireInvalidated, getAxisDescriptions, getDataLabel, getDataLabelMap, getDataStyleMap, getDimension, getEditConstraints, getErrorList, getIndex, getInfoList, getMetaInfo, getName, getStyle, getThis, getWarningList, hashCode, lock, minNeigbourSearchX, recomputeLimits, removeDataLabel, removeStyle, setEditConstraints, setName, toString, updateEventListenergetStyle, setStyleclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetEditConstraints, setEditConstraints, setNamegetAxisDescription, getAxisDescriptions, getDataCount, getDataLabel, getDimension, getIndex, getName, getStyle, getStyle, lock, recomputeLimits, setStyleaddListener, autoNotification, invokeListener, invokeListener, invokeListener, isAutoNotification, removeListener, updateEventListenerpublic MultiDimDoubleDataSet(DataSet another)
MultiDimDoubleDataSet as copy of another (deep-copy).another - another Dataset to copy the content frompublic MultiDimDoubleDataSet(String name, int nDim)
MultiDimDoubleDataSet.name - name of this DataSet.nDim - the number of dimensionsIllegalArgumentException - if name is nullpublic MultiDimDoubleDataSet(String name, boolean deepCopy, double[]... values)
Creates a new instance of MultiDimDoubleDataSet.
name - name of this data set.deepCopy - if true, the input array is copiedvalues - the values for the new dataset double[nDims][nDataPoints]IllegalArgumentException - if any of the parameters is null or if arrays with coordinates have
different lengthspublic MultiDimDoubleDataSet(String name, int nDims, int... initialSizes)
MultiDimDoubleDataSet.name - name of this DataSet.nDims - the number of dimensionsinitialSizes - initial capacity of buffer. If multiple sizes are supplied, they are used to after one
another
and afterwards the product of all sizes is used, e.g. nDims=3 and initialSizes=4,5 results in a
three-dimensional dataset with 4 points in x, 5 points in y and 20 points in z direction.IllegalArgumentException - if name is nullpublic MultiDimDoubleDataSet add(double... newValues)
newValues - the coordinate of the new valuepublic MultiDimDoubleDataSet add(double[] newValues, String label)
newValues - the coordinate of the new valuelabel - the data labelpublic MultiDimDoubleDataSet add(double[][] valuesNew)
valuesNew - the coordinates of the new valuepublic MultiDimDoubleDataSet add(int index, double... newValues)
add in interface EditableDataSetindex - data point index at which the new data point should be addednewValues - the coordinates for the new pointpublic MultiDimDoubleDataSet add(int index, double[] newValues, String label)
index - data point index at which the new data point should be addednewValues - coordinate of the new data pointlabel - data point label (see CategoryAxis)public MultiDimDoubleDataSet add(int index, double[][] newValues)
index - data point index at which the new data points should be addednewValues - the coordinates of the new pointspublic MultiDimDoubleDataSet clearData()
public final double get(int dimIndex,
int index)
DataSetpublic int getCapacity()
public final double[] getValues(int dimIndex)
public MultiDimDoubleDataSet increaseCapacity(int amount)
amount - storage capacity increasepublic EditableDataSet remove(int index)
remove in interface EditableDataSetindex - data point which should be removedpublic MultiDimDoubleDataSet remove(int fromIndex, int toIndex)
fromIndex - start index (inclusive)toIndex - stop index (exclusive)public MultiDimDoubleDataSet resize(int size)
size - the actually used array lengthspublic MultiDimDoubleDataSet set(DataSet other)
other - the source data setpublic MultiDimDoubleDataSet set(double[][] values)
Initialises the data set with specified data.
Note: The method copies values from specified double arrays.values - coordinatespublic MultiDimDoubleDataSet set(double[][] values, boolean copy)
Initialises the data set with specified data.
Note: The method copies values from specified double arrays.values - coordinatescopy - true: makes an internal copy, false: use the pointer as is (saves memory allocationpublic MultiDimDoubleDataSet setValues(int dimIndex, double[] values, boolean copy)
Update the data for a given dimension
dimIndex - dimension index (e.g. DataSet.DIM_X)values - values for dimensioncopy - true: makes an internal copy, false: use the pointer as is (saves memory allocationpublic MultiDimDoubleDataSet set(int index, double... newValue)
set in interface EditableDataSetindex - data point index at which the new data point should be addednewValue - new data point coordinatepublic MultiDimDoubleDataSet set(int index, double[][] values)
index - start index of the datavalues - coordinates for the new pointspublic MultiDimDoubleDataSet trim()
ArrayList.trimToSize()public int getDataCount(int dimIndex)
DataSetgetDataCount in interface DataSetdimIndex - the dimension index (ie. '0' equals 'X', '1' equals 'Y')public double getValue(int dimIndex,
double x)
DataSetCopyright © 2020 GSI Helmholtzzentrum für Schwerionenforschung GmbH. All rights reserved.