public class CompoundShortDataset extends AbstractCompoundDataset
Modifier and Type | Field and Description |
---|---|
protected short[] |
data |
isize
base, BLOCK_CLOSE, BLOCK_OPEN, odata, offset, size, stride, stringFormat
catchExceptions, logger, metadata, name, shape
ARRAYFLOAT32, ARRAYFLOAT64, ARRAYINT16, ARRAYINT32, ARRAYINT64, ARRAYINT8, ARRAYMUL, BOOL, COMPLEX, COMPLEX128, COMPLEX64, DATE, FLOAT, FLOAT32, FLOAT64, INT, INT16, INT32, INT64, INT8, OBJECT, RGB, STRING
Modifier and Type | Method and Description |
---|---|
ShortDataset |
asNonCompoundDataset(boolean shareData)
Get a non-compound dataset version
|
CompoundShortDataset |
clone()
Clone dataset
|
boolean |
containsInfs() |
boolean |
containsInvalidNumbers() |
boolean |
containsNans() |
void |
copyElements(Dataset destination,
int element)
Copy chosen elements from each item to another dataset
|
void |
copyItemsFromAxes(int[] pos,
boolean[] axes,
Dataset dest)
Copy content from axes in given position to array
|
protected short[] |
createArray(int size) |
static CompoundShortDataset |
createCompoundDatasetWithLastDimension(Dataset a,
boolean shareData)
Create a compound dataset using last dimension of given dataset
|
static CompoundShortDataset |
createFromObject(int itemSize,
Object obj)
Create a 1D dataset from an object which could be a Java list, array (of arrays...) or Number.
|
boolean |
equals(Object obj) |
CompoundShortDataset |
fill(Object obj)
Fill dataset with given object
|
void |
fillDataset(Dataset result,
IndexIterator iter)
Populate another dataset with part of current dataset
|
short[] |
getAbs(int index)
Get values at absolute index in the internal array.
|
void |
getAbs(int index,
short[] values)
Get values at absolute index in the internal array.
|
protected int |
getBufferLength() |
byte[] |
getByteArray() |
byte[] |
getByteArray(int... pos) |
byte[] |
getByteArray(int i) |
byte[] |
getByteArray(int i,
int j) |
short[] |
getData()
This is a typed version of
AbstractDataset.getBuffer() |
double[] |
getDoubleArray() |
double[] |
getDoubleArray(int... pos) |
double[] |
getDoubleArray(int i) |
double[] |
getDoubleArray(int i,
int j) |
void |
getDoubleArrayAbs(int index,
double[] darray)
Get an item as a double array
|
int |
getDType() |
boolean |
getElementBooleanAbs(int index)
Get an element from given absolute index as a boolean.
|
double |
getElementDoubleAbs(int index)
Get an element from given absolute index as a double.
|
long |
getElementLongAbs(int index)
Get an element from given absolute index as a long.
|
ShortDataset |
getElements(int element)
Get chosen elements from each item as a dataset
|
ShortDataset |
getElementsView(int element)
Get chosen elements from each item as a view on dataset
|
protected double |
getFirstValue() |
protected double |
getFirstValue(int... pos) |
protected double |
getFirstValue(int i) |
protected double |
getFirstValue(int i,
int j) |
float[] |
getFloatArray() |
float[] |
getFloatArray(int... pos) |
float[] |
getFloatArray(int i) |
float[] |
getFloatArray(int i,
int j) |
int[] |
getIntArray() |
int[] |
getIntArray(int... pos) |
int[] |
getIntArray(int i) |
int[] |
getIntArray(int i,
int j) |
long[] |
getLongArray() |
long[] |
getLongArray(int... pos) |
long[] |
getLongArray(int i) |
long[] |
getLongArray(int i,
int j) |
Object |
getObject()
Get first item as an object.
|
Object |
getObject(int... pos) |
Object |
getObject(int i)
Get an item from given position as an object.
|
Object |
getObject(int i,
int j)
Get an item from given position as an object.
|
Object |
getObjectAbs(int index)
Get an item from given absolute index as an object.
|
short[] |
getShortArray() |
short[] |
getShortArray(int... pos) |
short[] |
getShortArray(int i) |
short[] |
getShortArray(int i,
int j) |
CompoundShortDataset |
getSlice(SliceIterator siter)
Get a slice of the dataset.
|
String |
getString()
Get first item as a string.
|
String |
getString(int... pos) |
String |
getString(int i)
Get an item from given position as a string.
|
String |
getString(int i,
int j)
Get an item from given position as a string.
|
String |
getStringAbs(int index)
Get an item from given absolute index as a string.
|
CompoundShortDataset |
getView(boolean deepCopyMetadata) |
int |
hashCode() |
CompoundShortDataset |
iadd(Object b)
In-place addition with object o
|
CompoundShortDataset |
idivide(Object b)
In-place division with object o
|
CompoundShortDataset |
ifloor()
In-place floor
|
CompoundShortDataset |
imultiply(Object b)
In-place multiplication with object o
|
CompoundShortDataset |
ipower(Object b)
In-place raise to power of object o
|
CompoundShortDataset |
iremainder(Object b)
In-place remainder
|
CompoundShortDataset |
isubtract(Object b)
In-place subtraction with object o
|
double |
residual(Object b,
Dataset w,
boolean ignoreNaNs)
Calculate residual of dataset with object o and weight.
|
void |
resize(int... newShape)
Change shape and size of dataset in-place
|
void |
set(Object obj)
Set the value given by object at the first position.
|
void |
set(Object obj,
int... pos)
Set the value given by object at given position
|
void |
set(Object obj,
int i)
Set the value given by object at given position.
|
void |
set(Object obj,
int i,
int j)
Set the value given by object at given position.
|
void |
setAbs(int index,
short val)
Set element value at absolute index in the internal array.
|
void |
setAbs(int index,
short[] val)
Set values at absolute index in the internal array.
|
CompoundShortDataset |
setBy1DIndex(Object o,
Dataset index)
This is modelled after the NumPy set item with an index dataset
|
CompoundShortDataset |
setByBoolean(Object o,
Dataset selection)
This is modelled after the NumPy set item with a condition specified by a boolean dataset
|
CompoundShortDataset |
setByIndexes(Object o,
Object... indexes)
This is modelled after the NumPy set item with an array of indexing objects
|
protected void |
setData()
Set aliased data as base data
|
void |
setElements(Dataset source,
int element)
Set values of chosen elements from each item according to source dataset
|
void |
setItem(short[] d)
Set values at first position.
|
void |
setItem(short[] d,
int... pos)
Set values at given position
|
void |
setItem(short[] d,
int i)
Set values at given position.
|
void |
setItem(short[] d,
int i,
int j)
Set values at given position.
|
protected void |
setItemDirect(int dindex,
int sindex,
Object src)
Set item from compatible dataset in a direct and speedy way.
|
void |
setItemsOnAxes(int[] pos,
boolean[] axes,
Object src)
Set content on axes in given position to values in array
|
void |
setObjectAbs(int index,
Object obj)
Set an item at absolute index from an object.
|
CompoundShortDataset |
setSlice(Object o,
IndexIterator siter) |
argMax, argMin, cast, cast, flatten, get1DIndex, get1DIndex, get1DIndexFromShape, getBoolean, getBoolean, getBoolean, getBoolean, getBroadcastView, getBy1DIndex, getByBoolean, getByIndexes, getByte, getByte, getByte, getByte, getCompoundStats, getDouble, getDouble, getDouble, getDouble, getDoubleArray, getDoubleArray, getDoubleArray, getDoubleArray, getElementsPerItem, getError, getError, getError, getErrorArray, getErrorArray, getErrorArray, getErrors, getFloat, getFloat, getFloat, getFloat, getInt, getInt, getInt, getInt, getIterator, getIterator, getLong, getLong, getLong, getLong, getShort, getShort, getShort, getShort, getSlice, getSlice, getSlice, getSlice, getSlice, getSlice, getSliceIterator, getSliceView, getSliceView, getSliceView, getTransposedView, getUniqueItems, ifloorDivide, max, max, maxItem, maxPos, mean, mean, min, min, minItem, minPos, peakToPeak, product, reshape, rootMeanSquare, rootMeanSquare, setSlice, setSlice, sort, squeeze, squeeze, squeezeEnds, stdDeviation, stdDeviation, sum, sum, swapAxes, synchronizedCopy, transpose, variance, variance, variance
all, all, any, any, argMax, argMin, calcSteps, cast, checkAxis, checkAxis, checkCompatibility, copy, copy, copyToView, count, count, count, createStrides, createStrides, createStrides, createStrides, fillData, get1DIndex, get1DIndexFromShape, getBooleanIterator, getBooleanIterator, getBuffer, getElementClass, getError, getErrorBuffer, getFirst1DIndex, getIndices, getInternalSquaredError, getItemBytes, getIterator, getMaxLineLength, getNbytes, getNDPosition, getOffset, getPositionIterator, getRank, getRealPart, getRealView, getShape, getShapeRef, getSize, getSliceIterator, getSliceIteratorFromAxes, getStats, getStrides, getStringStats, hasFloatingPointElements, isCompatibleWith, isComplex, max, mean, min, overrideInternal, peakToPeak, peakToPeak, product, product, residual, residual, rootMeanSquare, setErrorBuffer, setMaxLineLength, setShape, setSlice, setStringFormat, stdDeviation, stdDeviation, stdDeviation, stdDeviation, sum, toString, toString, variance, variance, variance
addMetadata, checkPermutatedAxes, clearMetadata, copyMetadata, copyMetadata, createFromSerializable, dirtyMetadata, findMetadataTypeSubInterfaces, getErrorMetadata, getFirstMetadata, getMetadata, getMetadata, getMetadataMap, getName, hasErrors, reshapeMetadata, restoreMetadata, setDirty, setErrors, setMetadata, setName, sliceMetadata, transposeMetadata
finalize, getClass, notify, notifyAll, wait, wait, wait
all, all, any, any, argMax, argMin, cast, checkAxis, checkCompatibility, copy, copy, count, count, count, get1DIndex, getBooleanIterator, getBooleanIterator, getBuffer, getError, getErrorBuffer, getIndices, getIterator, getNbytes, getNDPosition, getOffset, getPositionIterator, getRealPart, getRealView, getShapeRef, getSliceIterator, getSliceIteratorFromAxes, getStrides, hasFloatingPointElements, isCompatibleWith, isComplex, max, mean, min, overrideInternal, peakToPeak, peakToPeak, product, product, residual, residual, rootMeanSquare, setDirty, setErrorBuffer, setSlice, stdDeviation, stdDeviation, stdDeviation, stdDeviation, sum, toString, variance, variance, variance
getItemBytes, getMetadata, setStringFormat
addMetadata, clearMetadata, getElementClass, getRank, getShape, getSize, hasErrors, setErrors, setMetadata, setShape
getFirstMetadata, getMetadata
protected short[] data
protected void setData()
AbstractDataset
setData
in class AbstractDataset
protected short[] createArray(int size)
public int getDType()
getDType
in interface Dataset
getDType
in class LazyDatasetBase
public boolean equals(Object obj)
equals
in class AbstractCompoundDataset
public int hashCode()
hashCode
in class AbstractCompoundDataset
public CompoundShortDataset clone()
ILazyDataset
clone
in interface CompoundDataset
clone
in interface Dataset
clone
in interface IDataset
clone
in interface ILazyDataset
clone
in class AbstractCompoundDataset
public static CompoundShortDataset createFromObject(int itemSize, Object obj)
itemSize
- obj
- public static CompoundShortDataset createCompoundDatasetWithLastDimension(Dataset a, boolean shareData)
a
- shareData
- if true, then share data when possible otherwise copy itpublic ShortDataset asNonCompoundDataset(boolean shareData)
CompoundDataset
shareData
- if true, then share data when possible otherwise copy itpublic CompoundShortDataset fill(Object obj)
Dataset
public short[] getData()
AbstractDataset.getBuffer()
protected int getBufferLength()
getBufferLength
in class AbstractDataset
public CompoundShortDataset getView(boolean deepCopyMetadata)
getView
in interface CompoundDataset
getView
in interface Dataset
getView
in class AbstractCompoundDataset
deepCopyMetadata
- if true then deep-copy metadatapublic short[] getAbs(int index)
index
- absolute indexpublic void getAbs(int index, short[] values)
index
- absolute indexvalues
- public boolean getElementBooleanAbs(int index)
Dataset
public double getElementDoubleAbs(int index)
Dataset
public long getElementLongAbs(int index)
Dataset
protected void setItemDirect(int dindex, int sindex, Object src)
AbstractDataset
setItemDirect
in class AbstractDataset
src
- is the source data bufferpublic void setAbs(int index, short[] val)
index
- absolute indexval
- new valuespublic void setAbs(int index, short val)
index
- absolute indexval
- new valuepublic Object getObject()
Dataset
public Object getObject(int i)
Dataset
public Object getObject(int i, int j)
Dataset
public byte[] getByteArray()
public byte[] getByteArray(int i)
public byte[] getByteArray(int i, int j)
public byte[] getByteArray(int... pos)
public short[] getShortArray()
public short[] getShortArray(int i)
public short[] getShortArray(int i, int j)
public short[] getShortArray(int... pos)
public int[] getIntArray()
public int[] getIntArray(int i)
public int[] getIntArray(int i, int j)
public int[] getIntArray(int... pos)
public long[] getLongArray()
public long[] getLongArray(int i)
public long[] getLongArray(int i, int j)
public long[] getLongArray(int... pos)
public float[] getFloatArray()
public float[] getFloatArray(int i)
public float[] getFloatArray(int i, int j)
public float[] getFloatArray(int... pos)
public double[] getDoubleArray()
public double[] getDoubleArray(int i)
public double[] getDoubleArray(int i, int j)
public double[] getDoubleArray(int... pos)
public void getDoubleArrayAbs(int index, double[] darray)
CompoundDataset
darray
- double array must be allocated and have sufficient lengthpublic String getString()
Dataset
public String getString(int i)
Dataset
public String getString(int i, int j)
Dataset
protected double getFirstValue()
getFirstValue
in class AbstractCompoundDataset
protected double getFirstValue(int i)
getFirstValue
in class AbstractCompoundDataset
protected double getFirstValue(int i, int j)
getFirstValue
in class AbstractCompoundDataset
protected double getFirstValue(int... pos)
getFirstValue
in class AbstractCompoundDataset
public Object getObjectAbs(int index)
Dataset
public String getStringAbs(int index)
Dataset
public void setObjectAbs(int index, Object obj)
Dataset
public void set(Object obj)
Dataset
public void set(Object obj, int i)
Dataset
public void set(Object obj, int i, int j)
Dataset
public void set(Object obj, int... pos)
IDataset
public void setItem(short[] d)
d
- public void setItem(short[] d, int i)
d
- i
- public void setItem(short[] d, int i, int j)
d
- i
- j
- public void setItem(short[] d, int... pos)
d
- pos
- public void resize(int... newShape)
IDataset
public CompoundShortDataset getSlice(SliceIterator siter)
AbstractDataset
getSlice
in class AbstractCompoundDataset
siter
- Slice iteratorpublic ShortDataset getElementsView(int element)
CompoundDataset
public ShortDataset getElements(int element)
CompoundDataset
public void copyElements(Dataset destination, int element)
CompoundDataset
public void setElements(Dataset source, int element)
CompoundDataset
public void fillDataset(Dataset result, IndexIterator iter)
Dataset
iter
- over current datasetpublic CompoundShortDataset setByBoolean(Object o, Dataset selection)
Dataset
o
- specifies the object used to set the selected itemsselection
- a boolean dataset of same shape to use for selecting itemspublic CompoundShortDataset setBy1DIndex(Object o, Dataset index)
Dataset
o
- specifies the object used to set the selected itemsindex
- an integer datasetpublic CompoundShortDataset setByIndexes(Object o, Object... indexes)
Dataset
o
- specifies the object used to set the selected itemsindexes
- an array of integer dataset, boolean dataset, slices or null entries (same as
full slices)public CompoundShortDataset setSlice(Object o, IndexIterator siter)
o
- specifies the object used to set the specified slicesiter
- specifies the slice iteratorpublic void copyItemsFromAxes(int[] pos, boolean[] axes, Dataset dest)
Dataset
pos
- - null means position at originaxes
- - true means copypublic void setItemsOnAxes(int[] pos, boolean[] axes, Object src)
Dataset
axes
- - true means copypublic boolean containsNans()
public boolean containsInfs()
public boolean containsInvalidNumbers()
public CompoundShortDataset iadd(Object b)
Dataset
public CompoundShortDataset isubtract(Object b)
Dataset
public CompoundShortDataset imultiply(Object b)
Dataset
public CompoundShortDataset idivide(Object b)
Dataset
public CompoundShortDataset ifloor()
Dataset
public CompoundShortDataset iremainder(Object b)
Dataset
public CompoundShortDataset ipower(Object b)
Dataset
public double residual(Object b, Dataset w, boolean ignoreNaNs)
Dataset
ignoreNaNs
- if true, skip NaNsCopyright © 2014–2018 Eclipse Foundation. All rights reserved.