public class ObjectDatasetBase extends AbstractDataset
Modifier and Type | Field and Description |
---|---|
protected Object[] |
data |
base, BLOCK_CLOSE, BLOCK_OPEN, odata, offset, size, stride, stringFormat
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, RGB8, STRING
Modifier and Type | Method and Description |
---|---|
ObjectDatasetBase |
clone()
Clone dataset
|
boolean |
containsInfs() |
boolean |
containsInvalidNumbers() |
boolean |
containsNans() |
void |
copyItemsFromAxes(int[] pos,
boolean[] axes,
Dataset dest)
Copy content from axes in given position to array
|
protected static Object[] |
createArray(int size) |
boolean |
equals(Object obj) |
ObjectDatasetBase |
fill(Object obj)
Fill dataset with given object
|
void |
fillDataset(Dataset result,
IndexIterator iter)
Populate another dataset with part of current dataset
|
Object |
get() |
Object |
get(int... pos) |
Object |
get(int i) |
Object |
get(int i,
int j) |
Object |
getAbs(int index)
Get a value from an absolute index of the internal array.
|
boolean |
getBoolean()
Get first item as a boolean.
|
boolean |
getBoolean(int... pos) |
boolean |
getBoolean(int i)
Get an item from given position as a boolean.
|
boolean |
getBoolean(int i,
int j)
Get an item from given position as a boolean.
|
protected int |
getBufferLength() |
byte |
getByte()
Get first item as a byte.
|
byte |
getByte(int... pos) |
byte |
getByte(int i)
Get an item from given position as a byte.
|
byte |
getByte(int i,
int j)
Get an item from given positionj as a byte.
|
Object[] |
getData()
This is a typed version of
AbstractDataset.getBuffer() |
double |
getDouble()
Get first item as a double.
|
double |
getDouble(int... pos) |
double |
getDouble(int i)
Get an item from given position as a double.
|
double |
getDouble(int i,
int j)
Get an item from given position as a double.
|
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.
|
float |
getFloat()
Get first item as a float.
|
float |
getFloat(int... pos) |
float |
getFloat(int i)
Get an item from given position as a float.
|
float |
getFloat(int i,
int j)
Get an item from given position as a float.
|
int |
getInt()
Get first item as an int.
|
int |
getInt(int... pos) |
int |
getInt(int i)
Get an item from given position as an int.
|
int |
getInt(int i,
int j)
Get an item from given position as an int.
|
long |
getLong()
Get first item as a long.
|
long |
getLong(int... pos) |
long |
getLong(int i)
Get an item from given position as a long.
|
long |
getLong(int i,
int j)
Get an item from given position as a long.
|
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 |
getShort()
Get first item as a short.
|
short |
getShort(int... pos) |
short |
getShort(int i)
Get an item from given position as a short.
|
short |
getShort(int i,
int j)
Get an item from given position as a short.
|
ObjectDatasetBase |
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.
|
ObjectDatasetBase |
getUniqueItems()
Get unique items
|
ObjectDatasetBase |
getView(boolean deepCopyMetadata) |
int |
hashCode() |
ObjectDatasetBase |
iadd(Object b)
In-place addition
|
ObjectDatasetBase |
idivide(Object b)
In-place division
|
ObjectDatasetBase |
ifloor()
In-place floor
|
ObjectDatasetBase |
imultiply(Object b)
In-place multiplication
|
ObjectDatasetBase |
ipower(Object b)
In-place raise to power of argument
|
ObjectDatasetBase |
iremainder(Object b)
In-place remainder of division
|
ObjectDatasetBase |
isubtract(Object b)
In-place subtraction
|
int[] |
maxPos(boolean... ignoreInvalids) |
int[] |
minPos(boolean... ignoreInvalids) |
double |
residual(Object b,
Dataset w,
boolean ignoreNaNs)
Calculate residual of dataset with object 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,
Object val)
Set a value at absolute index in the internal array.
|
ObjectDatasetBase |
setBy1DIndex(Object obj,
Dataset index)
This is modelled after the NumPy set item with an index dataset
|
ObjectDatasetBase |
setByBoolean(Object obj,
Dataset selection)
This is modelled after the NumPy set item with a condition specified by a boolean dataset
|
ObjectDatasetBase |
setByIndexes(Object obj,
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 |
setItem(Object value)
Sets the value at first point to the passed value.
|
void |
setItem(Object value,
int... pos)
Sets the value at a particular point to the passed value
|
void |
setItem(Object value,
int i)
Sets the value at a particular point to the passed value.
|
void |
setItem(Object value,
int i,
int j)
Sets the value at a particular point to the passed value.
|
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.
|
ObjectDatasetBase |
setSlice(Object obj,
IndexIterator siter) |
ObjectDatasetBase |
sort(Integer axis)
In-place sort of dataset
|
all, all, any, any, argMax, argMax, argMin, argMin, calcSteps, cast, cast, cast, cast, checkAxis, checkAxis, checkCompatibility, copy, copy, copyToView, count, count, count, createStrides, createStrides, createStrides, createStrides, fillData, flatten, get1DIndex, get1DIndex, get1DIndex, get1DIndexFromShape, get1DIndexFromShape, getBooleanIterator, getBooleanIterator, getBroadcastView, getBuffer, getBy1DIndex, getByBoolean, getByIndexes, getDType, getElementClass, getElementsPerItem, getError, getError, getError, getError, getErrorArray, getErrorArray, getErrorArray, getErrorBuffer, getErrors, getFirst1DIndex, getIndices, getInternalSquaredError, getItemBytes, getIterator, getIterator, getMaxLineLength, getNbytes, getNDPosition, getOffset, getPositionIterator, getRank, getRealPart, getRealView, getShape, getShapeRef, getSize, getSlice, getSlice, getSlice, getSlice, getSlice, getSlice, getSliceIterator, getSliceIterator, getSliceIteratorFromAxes, getSliceView, getSliceView, getSliceView, getStats, getStrides, getStringStats, getTransposedView, hasFloatingPointElements, ifloorDivide, internalGetSliceIterator, isCompatibleWith, isComplex, max, max, max, mean, mean, mean, min, min, min, overrideInternal, peakToPeak, peakToPeak, peakToPeak, product, product, product, reshape, residual, residual, rootMeanSquare, rootMeanSquare, rootMeanSquare, setErrorBuffer, setMaxLineLength, setShape, setSlice, setSlice, setSlice, setStringFormat, squeeze, squeeze, squeezeEnds, stdDeviation, stdDeviation, stdDeviation, stdDeviation, stdDeviation, stdDeviation, sum, sum, sum, swapAxes, synchronizedCopy, toString, toString, transpose, variance, variance, variance, variance, variance, variance
addMetadata, checkPermutatedAxes, checkSliceND, 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
getMetadata
addMetadata, clearMetadata, hasErrors, setErrors, setMetadata
getFirstMetadata, getMetadata
protected void setData()
AbstractDataset
setData
in class AbstractDataset
protected static Object[] createArray(int size)
public boolean equals(Object obj)
equals
in class LazyDatasetBase
public int hashCode()
hashCode
in class AbstractDataset
public ObjectDatasetBase clone()
ILazyDataset
clone
in interface Dataset
clone
in interface IDataset
clone
in interface ILazyDataset
clone
in class AbstractDataset
public ObjectDatasetBase fill(Object obj)
Dataset
obj
- fill valuepublic Object[] getData()
AbstractDataset.getBuffer()
protected int getBufferLength()
getBufferLength
in class AbstractDataset
public ObjectDatasetBase getView(boolean deepCopyMetadata)
getView
in interface Dataset
getView
in class AbstractDataset
deepCopyMetadata
- if true then deep-copy metadatapublic Object getAbs(int index)
index
- absolute indexpublic boolean getElementBooleanAbs(int index)
Dataset
index
- in arraypublic double getElementDoubleAbs(int index)
Dataset
index
- in arraypublic long getElementLongAbs(int index)
Dataset
index
- in arraypublic Object getObjectAbs(int index)
Dataset
index
- in arraypublic String getStringAbs(int index)
Dataset
index
- in arraypublic void setAbs(int index, Object val)
index
- absolute indexval
- new valueprotected void setItemDirect(int dindex, int sindex, Object src)
AbstractDataset
setItemDirect
in class AbstractDataset
dindex
- destination indexsindex
- source indexsrc
- is the source data bufferpublic void setObjectAbs(int index, Object obj)
Dataset
index
- in arrayobj
- value to setpublic Object get(int i)
i
- position in first dimensionpublic Object get(int i, int j)
i
- position in first dimensionj
- position in second dimensionpublic Object getObject()
Dataset
public Object getObject(int i)
Dataset
i
- position in first dimensionpublic Object getObject(int i, int j)
Dataset
i
- position in first dimensionj
- position in second dimensionpublic Object getObject(int... pos)
pos
- positionpublic String getString()
Dataset
public String getString(int i)
Dataset
i
- position in first dimensionpublic String getString(int i, int j)
Dataset
i
- position in first dimensionj
- position in second dimensionpublic String getString(int... pos)
pos
- positionpublic double getDouble()
Dataset
public double getDouble(int i)
Dataset
i
- position in first dimensionpublic double getDouble(int i, int j)
Dataset
i
- position in first dimensionj
- position in second dimensionpublic double getDouble(int... pos)
pos
- positionpublic float getFloat()
Dataset
public float getFloat(int i)
Dataset
i
- position in first dimensionpublic float getFloat(int i, int j)
Dataset
i
- position in first dimensionj
- position in second dimensionpublic float getFloat(int... pos)
pos
- positionpublic long getLong()
Dataset
public long getLong(int i)
Dataset
i
- position in first dimensionpublic long getLong(int i, int j)
Dataset
i
- position in first dimensionj
- position in second dimensionpublic long getLong(int... pos)
pos
- positionpublic int getInt()
Dataset
public int getInt(int i)
Dataset
i
- position in first dimensionpublic int getInt(int i, int j)
Dataset
i
- position in first dimensionj
- position in second dimensionpublic int getInt(int... pos)
pos
- positionpublic short getShort()
Dataset
public short getShort(int i)
Dataset
i
- position in first dimensionpublic short getShort(int i, int j)
Dataset
i
- position in first dimensionj
- position in second dimensionpublic short getShort(int... pos)
pos
- positionpublic byte getByte()
Dataset
public byte getByte(int i)
Dataset
i
- position in first dimensionpublic byte getByte(int i, int j)
Dataset
i
- position in first dimensionj
- position in second dimensionpublic byte getByte(int... pos)
pos
- positionpublic boolean getBoolean()
Dataset
public boolean getBoolean(int i)
Dataset
i
- position in first dimensionpublic boolean getBoolean(int i, int j)
Dataset
i
- position in first dimensionj
- position in second dimensionpublic boolean getBoolean(int... pos)
pos
- positionpublic void setItem(Object value)
value
- to setpublic void setItem(Object value, int i)
value
- to seti
- position in first dimensionpublic void setItem(Object value, int i, int j)
value
- to seti
- position in first dimensionj
- position in second dimensionpublic void setItem(Object value, int... pos)
value
- to setpos
- positionpublic void set(Object obj)
Dataset
obj
- value to setpublic void set(Object obj, int i)
Dataset
obj
- value to seti
- position in first dimensionpublic void set(Object obj, int i, int j)
Dataset
obj
- value to seti
- position in first dimensionj
- position in second dimensionpublic void set(Object obj, int... pos)
IDataset
obj
- value to setpos
- positionpublic void resize(int... newShape)
IDataset
newShape
- to usepublic ObjectDatasetBase sort(Integer axis)
Dataset
axis
- to sort along. If null, then the flattened view is sortedpublic ObjectDatasetBase getUniqueItems()
Dataset
public ObjectDatasetBase getSlice(SliceIterator siter)
AbstractDataset
getSlice
in class AbstractDataset
siter
- Slice iteratorpublic void fillDataset(Dataset result, IndexIterator iter)
Dataset
result
- destination for items from iterationiter
- over current datasetpublic ObjectDatasetBase setByBoolean(Object obj, Dataset selection)
Dataset
obj
- specifies the object used to set the selected itemsselection
- a boolean dataset of same shape to use for selecting itemspublic ObjectDatasetBase setBy1DIndex(Object obj, Dataset index)
Dataset
obj
- specifies the object used to set the selected itemsindex
- an integer datasetpublic ObjectDatasetBase setByIndexes(Object obj, Object... indexes)
Dataset
obj
- 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 ObjectDatasetBase setSlice(Object obj, IndexIterator siter)
obj
- specifies the object used to set the specified slicesiter
- specifies the slice iteratorpublic void copyItemsFromAxes(int[] pos, boolean[] axes, Dataset dest)
Dataset
pos
- starting position (can be null for origin)axes
- if true, copydest
- destinationpublic void setItemsOnAxes(int[] pos, boolean[] axes, Object src)
Dataset
pos
- starting position (can be null for origin)axes
- if true, copysrc
- sourcepublic int[] maxPos(boolean... ignoreInvalids)
ignoreInvalids
- - see IDataset.max(boolean...)
public int[] minPos(boolean... ignoreInvalids)
ignoreInvalids
- - see IDataset.max(boolean...)
public boolean containsNans()
public boolean containsInfs()
public boolean containsInvalidNumbers()
public ObjectDatasetBase iadd(Object b)
Dataset
b
- object to usepublic ObjectDatasetBase isubtract(Object b)
Dataset
b
- object to usepublic ObjectDatasetBase imultiply(Object b)
Dataset
b
- object to usepublic ObjectDatasetBase idivide(Object b)
Dataset
b
- object to usepublic ObjectDatasetBase ifloor()
Dataset
public ObjectDatasetBase iremainder(Object b)
Dataset
b
- object to usepublic ObjectDatasetBase ipower(Object b)
Dataset
b
- object to usepublic double residual(Object b, Dataset w, boolean ignoreNaNs)
Dataset
b
- object to usew
- to useignoreNaNs
- if true, skip NaNsCopyright © 2014–2022 Eclipse Foundation. All rights reserved.