Field
A field maps geoms in a domain space to geoms in a feature
space. Operations access the spaces and the feature of a particular
object in the domain space.
Implementations:
- Field_Function
The user provides functions to get and set features.
Constructor args: function get_feature, function set_feature, Space
domain, Space range, int domain_dim, int range_dim.
- Field_Map
Maintains an explicit map from a domain Geom to its feature Geom.
Constructor args: Space domain, Space range, int domain_dim, int
range_dim.
Member functions:
- domain_space: Field -> Metric_Space
Returns the domain space of the field.
- feature_space: Field -> Metric_Space
Returns the feature space of the field.
- domain_dimension: Field -> int
Returns the dimension for the domain space.
- feature_dimension: Field: -> int
Returns the dimension for the feature space.
- feature: Field . Geom -> Geom
Returns the feature of the geom.
- feature_space: Field -> Metric_Space
Returns the feature space.
- set_feature: Field . Geom -> void
Sets the feature for the geom.
Secondary operations:
- add: Field . Field . Field -> void
Sets the
coordinates of geoms in the third field from the sum of the
coordinates of corresponding geoms in the first two fields.
- associated_features: Space . Field . Space -> void
Stores in the second space the features of the objects in the first
space in the field.
- binary_feature Field . Geom -> bool
Casts the
object's feature's centroid's first coordinate to a boolean value.
- feature_coords: Field . Geom -> Coords
Returns the geom's feature's centroid.
- fill: Field . * -> void
Various methods to initialize a field full of empty objects:
- Domain space already filled; provide prototypes for feature
objects (default: points).
- Provide number of objects and prototypes for both domain and
feature objects (default: points).
- Domain space already filled; provide function to get feature value.
- Domain space already filled; fill features with scalar value
(either initial value or returned by function).
- magnitude: Field . Field -> void
Sets the
coordinates of geoms in the second field from the magnitude of the
coordinates of the corresponding geoms in the first field.
- normalize: Field . Field -> void
Sets the
coordinates of geoms in the second field from the normalized coordinates
of the corresponding geoms in the first field.
- scalar_feature Field . Geom -> double
Casts the
object's feature's centroid's first coordinate to a double value.
- scale: Field . double . Field -> void
Sets the
coordinates of geoms in the second field from the scaled
coordinates of the corresponding geoms in the first field.
- set_binary_feature Field . Geom . bool -> void
Sets the object's feature's centroid's first coordinate from the boolean value.
- set_feature_coord Field . Geom . int . double -> void
Sets the object's feature's centroid's nth coordinate from the
- set_scalar_feature Field . Geom . double -> void
Sets the object's feature's centroid's first coordinate from the double value.
double value.
- subtract: Field . Field . Field -> void
Sets the
coordinates of geoms in the third field from the difference of the
coordinates of corresponding geoms in the first two fields.