vec_math
Class AbstractDataSink
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
vec_math.AbstractDataSink
- All Implemented Interfaces:
- Cloneable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, DataSink
public abstract class AbstractDataSink
- extends PropertyBundles
- implements DataSink
A skeleton implementation of a data sink. acceptsData(java.lang.String) and
metaData(java.util.Map) return true, setData(java.util.List) calls
DataSink.clearData() and addData(java.util.List), thus only those two methods
have to be implemented.
| Methods inherited from class util.PropertyResources |
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, init, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString |
| Methods inherited from interface util.PropertySupplying |
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
AbstractDataSink
protected AbstractDataSink(Map<String,String> prop)
- Constructs a new data sink.
acceptsData
public boolean acceptsData(String any)
- Returns true.
- Specified by:
acceptsData in interface DataSink
- Returns:
- True, if this sink might use thi type of data.
metaData
public boolean metaData(Map<String,? extends Serializable> m)
- Returns true.
- Specified by:
metaData in interface DataSink
- Returns:
- False, if we cannot interprete data with the information
available.
setData
public boolean setData(List<VectorG> data)
- Sets the data by calling clear and add with the vector list.
- Specified by:
setData in interface DataSink
- Returns:
- True, if we can interprete this data.
addData
public boolean addData(List<VectorG> data)
- For small data sets this method suffices to deviate to the
DataSink.addData(Map) method. On huge data set, you may override this
to increase performance.
- Specified by:
addData in interface DataSink
- Returns:
- True, if we can interprete this data.
setData
public boolean setData(Map<Object,VectorG> d)
- Sets the data by calling clear and then adding the data map.
- Specified by:
setData in interface DataSink
mapConvert
public static Map<Object,VectorG> mapConvert(List<VectorG> d)
- Converts a list of vectors to a mapping of index-to-vector. We retain
the order in the list
vectorConvert
public static List<VectorG> vectorConvert(double[][] matrix)
- Converts a two-dimensional double array into a list of vectors. First
index corresponds to the index in the list, second to the vector
elements
vectorConvert
public static List<VectorG> vectorConvert(double[] chain,
int vecdim)
- Converts a one-dimensional double array with implicit indexing along
the dimension of the vector passed over. The array is organized as
v0.x v0.y v0.z [...] v1.x v1.y [...] , i.e. the
vecor elements are all stitched together as on a chain.
getOutliers
public static List<Object> getOutliers(Map<Object,VectorG> data,
DataModel fit,
VectorG solution,
double dev)
- From the user data and a data model we extract those keys that have a
residual that is higher than the stated maximum discrepancy. Iterating
over the values in the data map must retain the order of measures
in the data model