public class LazyDataset extends LazyDatasetBase implements Serializable, Cloneable
| Modifier and Type | Field and Description |
|---|---|
protected LazyDataset |
base |
protected int[] |
begSlice |
protected int[] |
delSlice |
protected int |
dtype |
protected int |
isize |
protected ILazyLoader |
loader |
protected int[] |
map |
protected Map<Class<? extends MetadataType>,List<MetadataType>> |
oMetadata |
protected int[] |
oShape |
protected int |
postShape |
protected int |
prepShape |
protected long |
size |
catchExceptions, logger, metadata, name, shape| Constructor and Description |
|---|
LazyDataset(String name,
int dtype,
int[] shape,
ILazyLoader loader)
Create a lazy dataset
|
LazyDataset(String name,
int dtype,
int elements,
int[] shape,
ILazyLoader loader)
Create a lazy dataset
|
| Modifier and Type | Method and Description |
|---|---|
protected SliceND |
calcTrueSlice(SliceND slice) |
LazyDataset |
clone()
Clone dataset
|
static LazyDataset |
createLazyDataset(Dataset dataset)
Create a lazy dataset based on in-memory data (handy for testing)
|
protected SliceND |
createSlice(int[] nstart,
int[] nstop,
int[] nstep) |
boolean |
equals(Object obj) |
int |
getDType()
Can return -1 for unknown
|
int |
getElementsPerItem()
Can return -1 for unknown
|
static int |
getMaxSliceLength(ILazyDataset lazySet,
int dimension)
Gets the maximum size of a slice of a dataset in a given dimension
which should normally fit in memory.
|
int |
getSize()
The size of the dataset is the number of items in the array
|
Dataset |
getSlice(IMonitor monitor,
int[] start,
int[] stop,
int[] step)
Get a slice of the dataset.
|
Dataset |
getSlice(IMonitor monitor,
Slice... slice)
Get a slice of the dataset.
|
Dataset |
getSlice(IMonitor monitor,
SliceND slice)
Get a slice of the dataset.
|
Dataset |
getSlice(int[] start,
int[] stop,
int[] step)
Get a slice of the dataset.
|
Dataset |
getSlice(Slice... slice)
Get a slice of the dataset.
|
Dataset |
getSlice(SliceND slice)
Get a slice of the dataset.
|
LazyDataset |
getSliceView(int[] start,
int[] stop,
int[] step)
Get a slice of the dataset.
|
LazyDataset |
getSliceView(Slice... slice)
Get a slice of the dataset.
|
LazyDataset |
getSliceView(SliceND slice)
Get a slice of the dataset.
|
LazyDataset |
getTransposedView(int... axes)
Permute copy of dataset's axes so that given order is old order:
|
void |
setShape(int... shape)
Set a compatible shape for dataset.
|
LazyDataset |
squeezeEnds()
Remove dimensions of 1 from ends of shape of the dataset
|
String |
toString() |
protected IDataset |
transformInput(IDataset data) |
addMetadata, checkPermutatedAxes, clearMetadata, copyMetadata, copyMetadata, createFromSerializable, dirtyMetadata, findMetadataTypeSubInterfaces, getElementClass, getErrorMetadata, getErrors, getFirstMetadata, getMetadata, getMetadata, getMetadataMap, getName, getRank, getShape, hasErrors, hashCode, reshapeMetadata, restoreMetadata, setDirty, setErrors, setMetadata, setName, sliceMetadata, transposeMetadataprotected int[] oShape
protected long size
protected int dtype
protected int isize
protected ILazyLoader loader
protected LazyDataset base
protected int prepShape
protected int postShape
protected int[] begSlice
protected int[] delSlice
protected int[] map
protected Map<Class<? extends MetadataType>,List<MetadataType>> oMetadata
public LazyDataset(String name, int dtype, int elements, int[] shape, ILazyLoader loader)
name - dtype - dataset typeelements - shape - loader - public LazyDataset(String name, int dtype, int[] shape, ILazyLoader loader)
name - dtype - dataset typeshape - loader - public static LazyDataset createLazyDataset(Dataset dataset)
dataset - public int getDType()
getDType in class LazyDatasetBasepublic int getElementsPerItem()
getElementsPerItem in interface ILazyDatasetpublic int getSize()
ILazyDatasetgetSize in interface ILazyDatasetpublic boolean equals(Object obj)
equals in class LazyDatasetBasepublic LazyDataset clone()
ILazyDatasetclone in interface ILazyDatasetclone in class LazyDatasetBasepublic void setShape(int... shape)
ILazyDatasetsetShape in interface ILazyDatasetpublic LazyDataset squeezeEnds()
ILazyDatasetsqueezeEnds in interface ILazyDatasetpublic Dataset getSlice(int[] start, int[] stop, int[] step) throws DatasetException
ILazyDatasetgetSlice in interface ILazyDatasetstart - specifies the starting indexes (can be null for origin)stop - specifies the stopping indexes (can be null for end)step - specifies the steps in the slice (can be null for unit steps)DatasetExceptionpublic Dataset getSlice(Slice... slice) throws DatasetException
ILazyDatasetgetSlice in interface ILazyDatasetslice - an array of slice objects (the array can be null or contain nulls)DatasetExceptionpublic Dataset getSlice(SliceND slice) throws DatasetException
ILazyDatasetgetSlice in interface ILazyDatasetslice - an n-D sliceDatasetExceptionpublic Dataset getSlice(IMonitor monitor, Slice... slice) throws DatasetException
ILazyDatasetgetSlice in interface ILazyDatasetslice - an array of slice objects (the array can be null or contain nulls)DatasetExceptionpublic LazyDataset getSliceView(Slice... slice)
ILazyDatasetgetSliceView in interface ILazyDatasetslice - an array of slice objects (the array can be null or contain nulls)public LazyDataset getSliceView(int[] start, int[] stop, int[] step)
ILazyDatasetgetSliceView in interface ILazyDatasetstart - specifies the starting indexes (can be null for origin)stop - specifies the stopping indexes (can be null for end)step - specifies the steps in the slice (can be null for unit steps)public LazyDataset getSliceView(SliceND slice)
ILazyDatasetgetSliceView in interface ILazyDatasetslice - an n-D slicepublic LazyDataset getTransposedView(int... axes)
ILazyDatasetaxisPerm = (p(0), p(1),...) => newdata(n(0), n(1),...) = olddata(o(0), o(1), ...) such that n(i) = o(p(i)) for all iI.e. for a 3D dataset (1,0,2) implies the new dataset has its 1st dimension running along the old dataset's 2nd dimension and the new 2nd is the old 1st. The 3rd dimension is left unchanged.
getTransposedView in interface ILazyDatasetaxes - if zero length then axes order reversedpublic Dataset getSlice(IMonitor monitor, int[] start, int[] stop, int[] step) throws DatasetException
ILazyDatasetgetSlice in interface ILazyDatasetstart - specifies the starting indexes (can be null for origin)stop - specifies the stopping indexes (can be null for end)step - specifies the steps in the slice (can be null for unit steps)DatasetExceptionpublic Dataset getSlice(IMonitor monitor, SliceND slice) throws DatasetException
ILazyDatasetgetSlice in interface ILazyDatasetslice - an n-D sliceDatasetExceptionprotected final SliceND calcTrueSlice(SliceND slice)
protected final IDataset transformInput(IDataset data)
protected SliceND createSlice(int[] nstart, int[] nstop, int[] nstep)
public static int getMaxSliceLength(ILazyDataset lazySet, int dimension)
lazySet - dimension - Copyright © 2014–2018 Eclipse Foundation. All rights reserved.