public class LazyDataset extends LazyDatasetBase implements Serializable, Cloneable
Modifier and Type | Field and Description |
---|---|
protected int[] |
begSlice |
protected int[] |
delSlice |
protected int |
isize |
protected ILazyLoader |
loader |
protected int[] |
map |
protected Map<Class<? extends MetadataType>,List<MetadataType>> |
oMetadata |
protected int[] |
oShape |
protected int[] |
padding |
protected long |
size |
protected int[] |
sShape |
catchExceptions, logger, metadata, name, shape
Constructor and Description |
---|
LazyDataset(ILazyLoader loader,
String name,
Class<? extends Dataset> clazz,
int... shape)
Create a lazy dataset
|
LazyDataset(ILazyLoader loader,
String name,
int elements,
Class<? extends Dataset> clazz,
int... shape)
Create a lazy dataset
|
LazyDataset(String name,
int dtype,
int[] shape,
ILazyLoader loader)
Deprecated.
|
LazyDataset(String name,
int dtype,
int elements,
int[] shape,
ILazyLoader loader)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected SliceND |
calcTrueSlice(SliceND slice)
Calculate absolute 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
|
Class<? extends Dataset> |
getInterface() |
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:
|
int |
hashCode() |
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() |
addMetadata, checkPermutatedAxes, clearMetadata, copyMetadata, copyMetadata, createFromSerializable, dirtyMetadata, findMetadataTypeSubInterfaces, getElementClass, getErrorMetadata, getErrors, getFirstMetadata, getMetadata, getMetadata, getMetadataMap, getName, getRank, getShape, hasErrors, reshapeMetadata, restoreMetadata, setDirty, setErrors, setMetadata, setName, sliceMetadata, transposeMetadata
protected Map<Class<? extends MetadataType>,List<MetadataType>> oMetadata
protected int[] oShape
protected long size
protected int isize
protected ILazyLoader loader
protected int[] begSlice
protected int[] delSlice
protected int[] sShape
protected int[] padding
protected int[] map
public LazyDataset(ILazyLoader loader, String name, int elements, Class<? extends Dataset> clazz, int... shape)
loader
- name
- elements
- clazz
- dataset interfaceshape
- public LazyDataset(ILazyLoader loader, String name, Class<? extends Dataset> clazz, int... shape)
loader
- name
- clazz
- dataset interfaceshape
- @Deprecated public LazyDataset(String name, int dtype, int elements, int[] shape, ILazyLoader loader)
LazyDataset(ILazyLoader, String, int, Class, int[])
name
- dtype
- dataset typeelements
- shape
- loader
- @Deprecated public LazyDataset(String name, int dtype, int[] shape, ILazyLoader loader)
LazyDataset(ILazyLoader, String, int, Class, int[])
name
- dtype
- dataset typeshape
- loader
- public static LazyDataset createLazyDataset(Dataset dataset)
dataset
- public int getDType()
getDType
in class LazyDatasetBase
public Class<? extends Dataset> getInterface()
public int getElementsPerItem()
getElementsPerItem
in interface ILazyDataset
public int getSize()
ILazyDataset
getSize
in interface ILazyDataset
public int hashCode()
hashCode
in class LazyDatasetBase
public boolean equals(Object obj)
equals
in class LazyDatasetBase
public LazyDataset clone()
ILazyDataset
clone
in interface ILazyDataset
clone
in class LazyDatasetBase
public void setShape(int... shape)
ILazyDataset
setShape
in interface ILazyDataset
public LazyDataset squeezeEnds()
ILazyDataset
squeezeEnds
in interface ILazyDataset
public Dataset getSlice(int[] start, int[] stop, int[] step) throws DatasetException
ILazyDataset
getSlice
in interface ILazyDataset
start
- 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)DatasetException
public Dataset getSlice(Slice... slice) throws DatasetException
ILazyDataset
getSlice
in interface ILazyDataset
slice
- an array of slice objects (the array can be null or contain nulls)DatasetException
public Dataset getSlice(SliceND slice) throws DatasetException
ILazyDataset
getSlice
in interface ILazyDataset
slice
- an n-D sliceDatasetException
public Dataset getSlice(IMonitor monitor, Slice... slice) throws DatasetException
ILazyDataset
getSlice
in interface ILazyDataset
slice
- an array of slice objects (the array can be null or contain nulls)DatasetException
public LazyDataset getSliceView(Slice... slice)
ILazyDataset
getSliceView
in interface ILazyDataset
slice
- an array of slice objects (the array can be null or contain nulls)public LazyDataset getSliceView(int[] start, int[] stop, int[] step)
ILazyDataset
getSliceView
in interface ILazyDataset
start
- 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)
ILazyDataset
getSliceView
in interface ILazyDataset
slice
- an n-D slicepublic Dataset getSlice(IMonitor monitor, int[] start, int[] stop, int[] step) throws DatasetException
ILazyDataset
getSlice
in interface ILazyDataset
start
- 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)DatasetException
public Dataset getSlice(IMonitor monitor, SliceND slice) throws DatasetException
ILazyDataset
getSlice
in interface ILazyDataset
slice
- an n-D sliceDatasetException
public LazyDataset getTransposedView(int... axes)
ILazyDataset
axisPerm = (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 ILazyDataset
axes
- if zero length then axes order reversedprotected final SliceND calcTrueSlice(SliceND slice)
slice
- protected SliceND createSlice(int[] nstart, int[] nstop, int[] nstep)
public static int getMaxSliceLength(ILazyDataset lazySet, int dimension)
lazySet
- dimension
- Copyright © 2014–2019 Eclipse Foundation. All rights reserved.