public class DTypeUtils extends Object
| Constructor and Description |
|---|
DTypeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Object |
fromDoublesToBiggestPrimitives(double[] x,
int dtype) |
static Number |
fromDoubleToBiggestNumber(double x,
int dtype) |
static int |
getBestDType(int atype,
int btype)
Find dataset type that best fits given types The best type takes into account complex and array datasets
|
static int |
getBestFloatDType(Class<? extends Object> cls)
Find floating point dataset type that best fits given class The best type takes into account complex and array
datasets
|
static int |
getBestFloatDType(int dtype)
Find floating point dataset type that best fits given types.
|
static String |
getDatasetName(Class<? extends Dataset> clazz,
int itemSize) |
static String |
getDatasetName(Dataset a) |
static String |
getDatasetName(ILazyDataset a) |
static int |
getDType(Class<? extends Dataset> clazz) |
static int |
getDType(ILazyDataset d)
Get dataset type from given dataset
|
static int |
getDTypeFromClass(Class<? extends Object> cls)
Get dataset type from an element class
|
static int |
getDTypeFromClass(Class<? extends Object> cls,
int itemSize)
Get dataset type from an element class
|
static int |
getDTypeFromObject(Object obj)
Get dataset type from an object.
|
static String |
getDTypeName(Dataset a) |
static String |
getDTypeName(ILazyDataset a) |
static String |
getDTypeName(int dtype,
int itemSize) |
static int |
getElementalDType(int dtype) |
static Class<?> |
getElementClass(int dtype) |
static int |
getElementsPerItem(int dtype) |
static Class<? extends Dataset> |
getInterface(int dtype) |
static int |
getItemBytes(int dtype) |
static int |
getItemBytes(int dtype,
int isize) |
static Class<? extends Dataset> |
getLargestDataset(Class<? extends Dataset> clazz)
The largest dataset class suitable for a summation of around a few thousand items without changing from the "kind"
of dataset
|
static int |
getLargestDType(int dtype)
The largest dataset type suitable for a summation of around a few thousand items without changing from the "kind"
of dataset
|
static int |
getLength(Object b) |
static boolean |
isClassSupportedAsElement(Class<? extends Object> clazz)
Deprecated.
|
static boolean |
isDTypeComplex(int dtype) |
static boolean |
isDTypeElemental(int dtype) |
static boolean |
isDTypeFloating(int dtype) |
static boolean |
isDTypeInteger(int dtype) |
static boolean |
isDTypeNumerical(int dtype) |
static boolean |
toBoolean(Object b) |
static byte[] |
toByteArray(Object b,
int itemSize) |
static double[] |
toDoubleArray(Object b,
int itemSize) |
static float[] |
toFloatArray(Object b,
int itemSize) |
static double |
toImag(Object b) |
static int[] |
toIntegerArray(Object b,
int itemSize) |
static long |
toLong(double d) |
static long |
toLong(float d) |
static long |
toLong(Object b) |
static long[] |
toLongArray(Object b,
int itemSize) |
static double |
toReal(Object b) |
static short[] |
toShortArray(Object b,
int itemSize) |
public DTypeUtils()
public static String getDTypeName(Dataset a)
a - inputpublic static String getDTypeName(ILazyDataset a)
a - inputpublic static String getDTypeName(int dtype, int itemSize)
dtype - dataset typeitemSize - item sizepublic static int getDType(Class<? extends Dataset> clazz)
clazz - dataset classpublic static boolean isDTypeElemental(int dtype)
dtype - dataset typepublic static boolean isDTypeInteger(int dtype)
dtype - dataset typepublic static boolean isDTypeFloating(int dtype)
dtype - dataset typepublic static boolean isDTypeComplex(int dtype)
dtype - dataset typepublic static boolean isDTypeNumerical(int dtype)
dtype - dataset typepublic static int getBestDType(int atype, int btype)
atype - first dataset typebtype - second dataset typepublic static int getBestFloatDType(int dtype)
dtype - dataset typepublic static int getBestFloatDType(Class<? extends Object> cls)
cls - of an item or elementpublic static int getDTypeFromClass(Class<? extends Object> cls)
cls - element classpublic static int getDTypeFromClass(Class<? extends Object> cls, int itemSize)
cls - element classitemSize - item sizepublic static int getDTypeFromObject(Object obj)
obj - inputpublic static int getDType(ILazyDataset d)
d - datasetpublic static int getLargestDType(int dtype)
dtype - dataset typepublic static Class<? extends Dataset> getLargestDataset(Class<? extends Dataset> clazz)
clazz - dataset sub-interfacepublic static int getElementalDType(int dtype)
dtype - dataset typepublic static int getElementsPerItem(int dtype)
dtype - dataset typepublic static int getItemBytes(int dtype)
dtype - dataset typepublic static int getItemBytes(int dtype, int isize)
dtype - dataset typeisize - number of elements in an itempublic static boolean toBoolean(Object b)
b - inputpublic static final long toLong(double d)
d - valuepublic static final long toLong(float d)
d - valuepublic static double[] toDoubleArray(Object b, int itemSize)
b - inputitemSize - item sizepublic static float[] toFloatArray(Object b, int itemSize)
b - inputitemSize - item sizepublic static long[] toLongArray(Object b, int itemSize)
b - inputitemSize - item sizepublic static int[] toIntegerArray(Object b, int itemSize)
b - inputitemSize - item sizepublic static short[] toShortArray(Object b, int itemSize)
b - inputitemSize - item sizepublic static byte[] toByteArray(Object b, int itemSize)
b - inputitemSize - item sizepublic static Object fromDoublesToBiggestPrimitives(double[] x, int dtype)
x - inputdtype - dataset type primitive arraypublic static Class<?> getElementClass(int dtype)
dtype - dataset typepublic static Class<? extends Dataset> getInterface(int dtype)
dtype - dataset typepublic static Number fromDoubleToBiggestNumber(double x, int dtype)
x - valuedtype - dataset type@Deprecated public static boolean isClassSupportedAsElement(Class<? extends Object> clazz)
InterfaceUtils.isElementSupported(Class)clazz - element classpublic static final int getLength(Object b)
b - inputpublic static String getDatasetName(Dataset a)
a - inputpublic static String getDatasetName(ILazyDataset a)
a - inputpublic static String getDatasetName(Class<? extends Dataset> clazz, int itemSize)
clazz - dataset interfaceitemSize - item sizeCopyright © 2014–2022 Eclipse Foundation. All rights reserved.