|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.virbo.dataset.DataSetUtil
public class DataSetUtil
Constructor Summary | |
---|---|
DataSetUtil()
|
Method Summary | |
---|---|
static void |
addQube(MutablePropertyDataSet ds)
add QUBE property to dataset, maybe verifying that it is a qube. |
static int |
binarySearch(QDataSet ds,
double key,
int low,
int high)
perform a binary search for key within ds, constraining the search to between low and high. |
static WritableDataSet |
canonizeFill(QDataSet ds)
Iterate through the dataset, changing all points outside of validmin, validmax and with zero weight to fill=-1e31. |
static int |
closest(QDataSet ds,
double d,
int guess)
return the index of the closest value in ds to d, using guess as a starting point. |
static java.lang.String |
format(QDataSet ds)
|
static java.util.Map<java.lang.String,java.lang.Object> |
getProperties(QDataSet ds)
gets all the properties of the dataset. |
static java.util.Map<java.lang.String,java.lang.Object> |
getProperties(QDataSet ds,
java.util.Map def)
gets all the properties of the dataset. |
static double |
guessCadence(QDataSet xds)
calculate cadence by averaging the smallest set of consistent inter-point distance. |
static double |
guessCadence(QDataSet xds,
QDataSet yds)
calculate cadence by averaging consistent inter-point distances, taking invalid measurements into account. |
static MutablePropertyDataSet |
indexGenDataSet(int n)
creates a dataset of integers 0,1,2,...,n-1. |
static boolean |
isMonotonic(QDataSet ds)
returns true if the dataset is monotonically increasing, and contains no fill. |
static boolean |
isQube(QDataSet ds)
test to see that the dataset is a qube. |
static java.lang.String[] |
propertyNames()
|
static void |
putProperties(java.util.Map<java.lang.String,java.lang.Object> properties,
MutablePropertyDataSet ds)
copy all properties into the dataset by iterating through the map. |
static int[] |
qubeDims(QDataSet ds)
provides a convenient way of indexing qubes, returning an int[] of length ds.rank() containing each dimension's length, or null if the dataset is not a qube. |
static MutablePropertyDataSet |
replicateDataSet(int n,
double value)
creates a dataset with the given cadence, start and length. |
static java.lang.String |
statsString(QDataSet ds)
return a human readable statistical representation of the dataset. |
static MutablePropertyDataSet |
tagGenDataSet(int n,
double start,
double cadence)
creates a dataset with the given cadence, start and length. |
static java.lang.String |
toString(QDataSet ds)
cleans up code by doing the cast, and handles default value |
static boolean |
validate(QDataSet ds,
java.util.List<java.lang.String> problems)
returns true if the dataset is valid, false otherwise. |
static QDataSet |
weightsDataSet(QDataSet ds)
Provide consistent valid logic to operators by providing a QDataSet with 1.0 where the data is valid, and 0.0 where the data is invalid. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataSetUtil()
Method Detail |
---|
public static MutablePropertyDataSet indexGenDataSet(int n)
public static MutablePropertyDataSet tagGenDataSet(int n, double start, double cadence)
public static MutablePropertyDataSet replicateDataSet(int n, double value)
public static boolean isMonotonic(QDataSet ds)
public static int binarySearch(QDataSet ds, double key, int low, int high)
ds
- a rank 1 monotonic dataset.key
- the value to find.low
- high
-
public static int closest(QDataSet ds, double d, int guess)
ds
- a rank 1, monotonic dataset.d
- the value to find.guess
- a guess at a close index, or -1 if no guess should be made. In this case, a binary search is performed.
public static java.lang.String[] propertyNames()
public static java.util.Map<java.lang.String,java.lang.Object> getProperties(QDataSet ds, java.util.Map def)
public static java.util.Map<java.lang.String,java.lang.Object> getProperties(QDataSet ds)
public static void putProperties(java.util.Map<java.lang.String,java.lang.Object> properties, MutablePropertyDataSet ds)
public static java.lang.String toString(QDataSet ds)
public static double guessCadence(QDataSet xds, QDataSet yds)
public static double guessCadence(QDataSet xds)
public static boolean isQube(QDataSet ds)
ds
- QDataSet of any rank.
public static int[] qubeDims(QDataSet ds)
ds
-
public static void addQube(MutablePropertyDataSet ds) throws java.lang.IllegalArgumentException
ds
-
java.lang.IllegalArgumentException
- if the dataset is not a qubepublic static java.lang.String format(QDataSet ds)
public static java.lang.String statsString(QDataSet ds)
ds
-
public static boolean validate(QDataSet ds, java.util.List<java.lang.String> problems)
ds
- rank N dataset.problems
- insert problem descriptions here
public static QDataSet weightsDataSet(QDataSet ds)
public static WritableDataSet canonizeFill(QDataSet ds)
ds
- rank N QUBE dataset.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |