|
C Configuration Space and Tuning Library (CCS)
|
A CCS tree space defines an search space over a tree. More...

Go to the source code of this file.
Data Structures | |
| struct | ccs_dynamic_tree_space_vector_s |
| A structure that define the callbacks the user must provide to create a dynamic tree space. More... | |
Typedefs | |
| typedef enum ccs_tree_space_type_e | ccs_tree_space_type_t |
| A commodity type to represent CCS tree space types. | |
| typedef struct ccs_dynamic_tree_space_vector_s | ccs_dynamic_tree_space_vector_t |
| A commodity type to represent a dynamic tree space callback vector. | |
Enumerations | |
| enum | ccs_tree_space_type_e { CCS_TREE_SPACE_TYPE_STATIC , CCS_TREE_SPACE_TYPE_DYNAMIC , CCS_TREE_SPACE_TYPE_MAX , CCS_TREE_SPACE_TYPE_FORCE_32BIT = INT_MAX } |
| CCS supported tree space types. More... | |
Functions | |
| ccs_result_t | ccs_create_static_tree_space (const char *name, ccs_tree_t tree, ccs_feature_space_t feature_space, ccs_rng_t rng, ccs_tree_space_t *tree_space_ret) |
| Create a new static tree space. | |
| ccs_result_t | ccs_create_dynamic_tree_space (const char *name, ccs_tree_t tree, ccs_feature_space_t feature_space, ccs_rng_t rng, ccs_dynamic_tree_space_vector_t *vector, void *tree_space_data, ccs_tree_space_t *tree_space_ret) |
| Create a new static tree space. | |
| ccs_result_t | ccs_tree_space_get_type (ccs_tree_space_t tree_space, ccs_tree_space_type_t *type_ret) |
| Get the type of a tree space. | |
| ccs_result_t | ccs_tree_space_get_name (ccs_tree_space_t tree_space, const char **name_ret) |
| Get the name of a tree space. | |
| ccs_result_t | ccs_tree_space_get_rng (ccs_tree_space_t tree_space, ccs_rng_t *rng_ret) |
| Get the internal rng of the tree space. | |
| ccs_result_t | ccs_tree_space_get_feature_space (ccs_tree_space_t tree_space, ccs_feature_space_t *feature_space_ret) |
| Get the feature space of the tree space. | |
| ccs_result_t | ccs_tree_space_get_tree (ccs_tree_space_t tree_space, ccs_tree_t *tree_ret) |
| Get the tree of a tree space. | |
| ccs_result_t | ccs_tree_space_get_node_at_position (ccs_tree_space_t tree_space, size_t position_size, const size_t *position, ccs_tree_t *tree_ret) |
| Get the node at a given position in a tree space. | |
| ccs_result_t | ccs_tree_space_get_values_at_position (ccs_tree_space_t tree_space, size_t position_size, const size_t *position, size_t num_values, ccs_datum_t *values) |
| Get the values along the path to a given position in the tree space. | |
| ccs_result_t | ccs_tree_space_sample (ccs_tree_space_t tree_space, ccs_features_t features, ccs_rng_t rng, ccs_tree_configuration_t *configuration_ret) |
| Get a tree configuration sampled randomly from a tree space. | |
| ccs_result_t | ccs_tree_space_samples (ccs_tree_space_t tree_space, ccs_features_t features, ccs_rng_t rng, size_t num_configurations, ccs_tree_configuration_t *configurations) |
| Get a given number of configurations sampled randomly from a tree space. | |
| ccs_result_t | ccs_dynamic_tree_space_get_tree_space_data (ccs_tree_space_t tree_space, void **tree_space_data_ret) |
| Get the dynamic tree space internal data pointer. | |
A CCS tree space defines an search space over a tree.
Optionally configuration space can be attached a feature space (see feature_space.h). Tree spaces can be sampled to obtain tree configurations. Configurations con point to unknown children (if they exist). This is where static tree spaces and dynamic tree spaces differ: in a static tree space, the user is responsible for modifying the tree before evaluating these configuration values or node; in a dynamic tree space, when querying a configuration validity, node or values, a callback will be invoked to define the missing children on the configuration path. Sampling a dynamic tree space, by itself, does not modify the tree.
|
extern |
Create a new static tree space.
| [in] | name | pointer to a string that will be copied internally |
| [in] | tree | the tree defining the tree space |
| [in] | feature_space | an optional CCS feature space object |
| [in] | rng | an optional CCS rng object |
| [in] | vector | the callback vector implementing the dynamic tree space interface |
| [in] | tree_space_data | a pointer to the tree space internal data structures can be NULL |
| [out] | tree_space_ret | a pointer to the variable that will hold the newly created tree space. |
name is NULL; or if tree_space_ret is NULL; or if any non optional interface pointer is NULL rng is not NULL and is not a valid CCS rng; or it feature_space is not NULL and is not a valid CCS feature space
|
extern |
Create a new static tree space.
| [in] | name | pointer to a string that will be copied internally |
| [in] | tree | the tree defining the tree space |
| [in] | feature_space | an optional CCS feature space object |
| [in] | rng | an optional CCS rng object |
| [out] | tree_space_ret | a pointer to the variable that will hold the newly created tree space. |
name is NULL; or if tree_space_ret is NULL rng is not NULL and is not a valid CCS rng; or it feature_space is not NULL and is not a valid CCS feature space
|
extern |
Get the dynamic tree space internal data pointer.
| [in] | tree_space | |
| [out] | tree_space_data_ret |
tree_space is not a valid CCS tree space tree_space is not a dynamic tree space tree_space_data_ret is NULL
|
extern |
Get the feature space of the tree space.
| [in] | tree_space | |
| [out] | feature_space_ret | a pointer to the variable that will contain the feature space |
tree_space is not a valid CCS tree space feature_space_ret is NULL
|
extern |
Get the name of a tree space.
| [in] | tree_space | |
| [out] | name_ret | a pointer to the variable that will contain a pointer to the name of the tree space |
name_ret is NULL tuner is not a valid CCS tree space
|
extern |
Get the node at a given position in a tree space.
| [in] | tree_space | |
| [in] | position_size | the number of entries in the position array |
| [in] | position | an array of indexes defining a location in the tree space. can be NULL if position_size is 0 |
| [out] | tree_ret | a pointer to the variable that will contain the node |
tree_space is not a valid CCS tree space tree_ret is NULL; or if position is NULL and position_size is greater than 0 position does not define a valid position in tree_space position is undefined and tree_space is a static tree space
|
extern |
Get the internal rng of the tree space.
| [in] | tree_space | |
| [out] | rng_ret | a pointer to the variable that will contain the rng |
tree_space is not a valid CCS tree space rng_ret is NULL
|
extern |
Get the tree of a tree space.
| [in] | tree_space | |
| [out] | tree_ret | a pointer to the variable that will contain the tree |
tree_space is not a valid CCS tree space rng_ret is NULL
|
extern |
Get the type of a tree space.
| [in] | tree_space | |
| [out] | type_ret | a pointer to the variable that will contain the returned tree space type |
tree_space is not a valid CCS tree space type_ret is NULL
|
extern |
Get the values along the path to a given position in the tree space.
| [in] | tree_space | |
| [in] | position_size | the number of entries in the position array |
| [in] | position | an array of indexes defining a location in the tree space. can be NULL if position_size is 0 |
| [in] | num_values | the size of the values array |
| [out] | values | an array of size num_values to hold the returned values, or NULL. If the array is too big, extra values are set to CCS_DATA_TYPE_NONE |
tree_space is not a valid CCS tree space position does not define a valid position in tree_space position is undefined and tree_space is a static tree space values is NULL; if num_values is less than position_size + 1; or if position is NULL and position_size is greater than 0
|
extern |
Get a tree configuration sampled randomly from a tree space.
The space is sampled according to the weight and bias of the individual tree nodes. If those are at their default values, the tree nodes are sampled uniformly.
| [in] | tree_space | |
| [in] | features | an optional features to use. Required if a feature space was provided at tree_space creation. |
| [in] | rng | an optional rng to use |
| [out] | configuration_ret | a pointer to the variable that will contain the returned tree configuration |
tree_space is not a valid CCS tree space; or if rng is not a valid CCS rng; or if features is not NULL and is not a valid CCS features tree_space creation.
|
extern |
Get a given number of configurations sampled randomly from a tree space.
The space is sampled according to the weight and bias of the individual tree nodes. If those are at their default values, the tree nodes are sampled uniformely.
| [in] | tree_space | |
| [in] | features | an optional features to use. Required if a feature space was provided at tree_space creation. |
| [in] | rng | an optional rng to use |
| [in] | num_configurations | the number of requested configurations |
| [out] | configurations | an array of num_configurations that will contain the requested configurations |
tree_space is not a valid CCS tree space; or if rng is not NULL and is not a valid CCS rng; or if features is not NULL and is not a valid CCS features tree_space creation. configurations is NULL and num_configurations is greater than 0