|
C Configuration Space and Tuning Library (CCS)
|
Parameters, when grouped together, define a tuning context (see context.h). More...

Go to the source code of this file.
Typedefs | |
| typedef enum ccs_parameter_type_e | ccs_parameter_type_t |
| A commodity type to represent a parameter type. | |
Enumerations | |
| enum | ccs_parameter_type_e { CCS_PARAMETER_TYPE_NUMERICAL , CCS_PARAMETER_TYPE_CATEGORICAL , CCS_PARAMETER_TYPE_ORDINAL , CCS_PARAMETER_TYPE_DISCRETE , CCS_PARAMETER_TYPE_STRING , CCS_PARAMETER_TYPE_MAX , CCS_PARAMETER_TYPE_FORCE_32BIT = INT_MAX } |
| CCS parameter types. More... | |
Functions | |
| ccs_result_t | ccs_create_numerical_parameter (const char *name, ccs_numeric_type_t data_type, ccs_numeric_t lower, ccs_numeric_t upper, ccs_numeric_t quantization, ccs_numeric_t default_value, ccs_parameter_t *parameter_ret) |
| Create a new numerical parameter of the specified data_type. | |
| ccs_result_t | ccs_create_int_numerical_parameter (const char *name, ccs_int_t lower, ccs_int_t upper, ccs_int_t quantization, ccs_int_t default_value, ccs_parameter_t *parameter_ret) |
| Create a new integer numerical parameter. | |
| ccs_result_t | ccs_create_float_numerical_parameter (const char *name, ccs_float_t lower, ccs_float_t upper, ccs_float_t quantization, ccs_float_t default_value, ccs_parameter_t *parameter_ret) |
| Create a new floating point numerical parameter. | |
| ccs_result_t | ccs_numerical_parameter_get_properties (ccs_parameter_t parameter, ccs_numeric_type_t *data_type_ret, ccs_numeric_t *lower_ret, ccs_numeric_t *upper_ret, ccs_numeric_t *quantization_ret) |
| Get the properties used to create a numerical parameter. | |
| ccs_result_t | ccs_create_categorical_parameter (const char *name, size_t num_possible_values, ccs_datum_t *possible_values, size_t default_value_index, ccs_parameter_t *parameter_ret) |
| Create a new categorical parameter. | |
| ccs_result_t | ccs_categorical_parameter_get_values (ccs_parameter_t parameter, size_t num_possible_values, ccs_datum_t *possible_values, size_t *num_possible_values_ret) |
| Get the possible values of a categorical parameter. | |
| ccs_result_t | ccs_create_ordinal_parameter (const char *name, size_t num_possible_values, ccs_datum_t *possible_values, size_t default_value_index, ccs_parameter_t *parameter_ret) |
| Create a new ordinal parameter. | |
| ccs_result_t | ccs_ordinal_parameter_get_values (ccs_parameter_t parameter, size_t num_possible_values, ccs_datum_t *possible_values, size_t *num_possible_values_ret) |
| Get the possible values of an ordinal parameter. | |
| ccs_result_t | ccs_ordinal_parameter_compare_values (ccs_parameter_t parameter, ccs_datum_t value1, ccs_datum_t value2, ccs_int_t *comp_ret) |
| Compare two values in the context of an ordinal parameter. | |
| ccs_result_t | ccs_create_discrete_parameter (const char *name, size_t num_possible_values, ccs_datum_t *possible_values, size_t default_value_index, ccs_parameter_t *parameter_ret) |
| Create a new discrete parameter. | |
| ccs_result_t | ccs_discrete_parameter_get_values (ccs_parameter_t parameter, size_t num_possible_values, ccs_datum_t *possible_values, size_t *num_possible_values_ret) |
| Get the possible values of an discrete parameter. | |
| ccs_result_t | ccs_create_string_parameter (const char *name, ccs_parameter_t *parameter_ret) |
| Create an new parameter representing an undetermined string, to be used within feature space. | |
| ccs_result_t | ccs_parameter_copy (ccs_parameter_t parameter, ccs_parameter_t *parameter_ret) |
| Create a copy of a parameter. | |
| ccs_result_t | ccs_parameter_get_type (ccs_parameter_t parameter, ccs_parameter_type_t *type_ret) |
| Get the type of a parameter. | |
| ccs_result_t | ccs_parameter_get_default_value (ccs_parameter_t parameter, ccs_datum_t *value_ret) |
| Get the default value of an parameter. | |
| ccs_result_t | ccs_parameter_get_name (ccs_parameter_t parameter, const char **name_ret) |
| Get the name of a parameter. | |
| ccs_result_t | ccs_parameter_get_default_distribution (ccs_parameter_t parameter, ccs_distribution_t *distribution_ret) |
| Get the default distribution of a parameter. | |
| ccs_result_t | ccs_parameter_check_value (ccs_parameter_t parameter, ccs_datum_t value, ccs_bool_t *result_ret) |
| Check if a value is acceptable for a parameter. | |
| ccs_result_t | ccs_parameter_check_values (ccs_parameter_t parameter, size_t num_values, const ccs_datum_t *values, ccs_bool_t *results) |
| Check if an array of values are acceptable for a parameter. | |
| ccs_result_t | ccs_parameter_validate_value (ccs_parameter_t parameter, ccs_datum_t value, ccs_datum_t *value_ret, ccs_bool_t *result_ret) |
| Check if a value is acceptable for a parameter and if it is return a marshalled value. | |
| ccs_result_t | ccs_parameter_validate_values (ccs_parameter_t parameter, size_t num_values, const ccs_datum_t *values, ccs_datum_t *values_ret, ccs_bool_t *results) |
| Check if an array of values are acceptable for a parameter and return marshalled values if they are valid. | |
| ccs_result_t | ccs_parameter_convert_samples (ccs_parameter_t parameter, ccs_bool_t oversampling, size_t num_values, const ccs_numeric_t *values, ccs_datum_t *results) |
| Convert numerical samples into samples from the parameter. | |
| ccs_result_t | ccs_parameter_sample (ccs_parameter_t parameter, ccs_distribution_t distribution, ccs_rng_t rng, ccs_datum_t *value_ret) |
| Get a sample from the parameter sampled by a given distribution. | |
| ccs_result_t | ccs_parameter_samples (ccs_parameter_t parameter, ccs_distribution_t distribution, ccs_rng_t rng, size_t num_values, ccs_datum_t *values) |
| Get samples from the parameter sampled by a given distribution. | |
| ccs_result_t | ccs_parameter_sampling_interval (ccs_parameter_t parameter, ccs_interval_t *interval_ret) |
| Get the valid sampling interval of the parameter. | |
Parameters, when grouped together, define a tuning context (see context.h).
Most parameters can be sampled according to a distribution's dimension (see distribution.h). Hyperparamters are immutable, except from a reference counting and callback management point of view.
| enum ccs_parameter_type_e |
CCS parameter types.
|
extern |
Get the possible values of a categorical parameter.
| [in] | parameter | |
| [in] | num_possible_values | the size of the possible_values array |
| [out] | possible_values | an array of num_possible_values values that will contain the returned possible values. Can be NULL |
| [out] | num_possible_values_ret | a pointer to a variable that will contain the number of values that are or would be returned. Can be NULL |
parameter is not a valid CCS parameter parameter is not a categorical parameter possible_values is NULL and num_possible_values is greater than 0; or if possible_values is NULL and num_possible_values_ret is NULL; or if num_possible_values is less than the number of values that would be returned
|
extern |
Create a new categorical parameter.
Categorical parameters can be sampled using distributions over integers.
| [in] | name | name of the parameter |
| [in] | num_possible_values | the size of the possible_values array |
| [in] | possible_values | an array of num_possible_values values that represent the possible values that the parameter can take |
| [in] | default_value_index | the index of the default value in the possible_values array |
| [out] | parameter_ret | a pointer to the variable that will hold the newly created categorical parameter |
name is NULL; or if parameter_ret is NULL
|
extern |
Create a new discrete parameter.
Discrete parameters can be sampled using distributions over integers. Their elements must be of type CCS_DATA_TYPE_INT or CCS_DATA_TYPE_FLOAT.
| [in] | name | name of the parameter |
| [in] | num_possible_values | the size of the possible_values array |
| [in] | possible_values | an array of num_possible_values values that represent the possible values that the parameter can take. |
| [in] | default_value_index | the index of the default value in the possible_values array |
| [out] | parameter_ret | a pointer to the variable that will hold the newly created discrete parameter |
name is NULL; or if parameter_ret is NULL
|
extern |
Create a new floating point numerical parameter.
| [in] | name | name of the parameter |
| [in] | lower | lower bound (included) |
| [in] | upper | upper bound (excluded) |
| [in] | quantization | quantization of the values. 0 means no quantization |
| [in] | default_value | default value of the parameter |
| [out] | parameter_ret | a pointer to the variable that will hold the newly created numerical parameter |
name is NULL; or if parameter_ret is NULL; or if quantization is less than 0; or if default value is not a valid value for the parameter
|
extern |
Create a new integer numerical parameter.
| [in] | name | name of the parameter |
| [in] | lower | lower bound (included) |
| [in] | upper | upper bound (excluded) |
| [in] | quantization | quantization of the values. 0 means no quantization |
| [in] | default_value | default value of the parameter |
| [out] | parameter_ret | a pointer to the variable that will hold the newly created numerical parameter |
name is NULL; or if parameter_ret is NULL; or if quantization is less than 0; or if default value is not a valid value for the parameter
|
extern |
Create a new numerical parameter of the specified data_type.
| [in] | name | name of the parameter |
| [in] | data_type | type of numerical data |
| [in] | lower | lower bound (included) |
| [in] | upper | upper bound (excluded) |
| [in] | quantization | quantization of the values. 0 means no quantization |
| [in] | default_value | default value of the parameter |
| [out] | parameter_ret | a pointer to the variable that will hold the newly created numerical parameter |
name is NULL; or if parameter_ret is NULL; or if quantization is less than 0; or if default value is not a valid value for the parameter
|
extern |
Create a new ordinal parameter.
Ordinal parameters can be sampled using distributions over integers. Their elements have an intrinsic ordering which is the same as the orders of the provided values.
| [in] | name | name of the parameter |
| [in] | num_possible_values | the size of the possible_values array |
| [in] | possible_values | an array of num_possible_values values that represent the possible values that the parameter can take |
| [in] | default_value_index | the index of the default value in the possible_values array |
| [out] | parameter_ret | a pointer to the variable that will hold the newly created ordinal parameter |
name is NULL; or if parameter_ret is NULL
|
extern |
Create an new parameter representing an undetermined string, to be used within feature space.
Cannot be sampled and thus doesn't have a default value. Checks will always return valid unless the value is not a string.
| [in] | name | name of the parameter |
| [out] | parameter_ret | a pointer to the variable that will hold the newly created string parameter |
name is NULL; or if parameter_ret is NULL
|
extern |
Get the possible values of an discrete parameter.
| [in] | parameter | |
| [in] | num_possible_values | the size of the possible_values array |
| [out] | possible_values | an array of num_possible_values values that will contain the returned possible values. Can be NULL |
| [out] | num_possible_values_ret | a pointer to a variable that will contain the number of values that are or would be returned. Can be NULL |
parameter is not a valid CCS parameter parameter is not a discrete parameter possible_values is NULL and num_possible_values is greater than 0; or if possible_values is NULL and num_possible_values_ret is NULL; or if num_possible_values is less than the number of values that would be returned
|
extern |
Get the properties used to create a numerical parameter.
| [in] | parameter | |
| [out] | data_type_ret | a pointer to the variable that will contain the data type of the numerical parameter |
| [out] | lower_ret | a pointer to the variable that will contain the lower bound of the numerical parameter |
| [out] | upper_ret | a pointer to the variable that will contain the upper bound of the numerical parameter |
| [out] | quantization_ret | a pointer that will contain the quantization of the numerical parameter |
parameter is not a valid CCS parameter parameter is not a numerical parameter data_type_ret is NULL and lower_ret is NULL and upper_ret is NULL and quantization_ret is NULL
|
extern |
Compare two values in the context of an ordinal parameter.
| [in] | parameter | |
| [in] | value1 | the first value to compare |
| [in] | value2 | the second value to compare |
| [out] | comp_ret | the result of the comparison, -1, 1, or 0 if value1 is found to be respectively lesser than, grater then or equal to value2 |
parameter is not a valid CCS parameter is not an ordinal parameter comp_ret is NULL; or if value1 or value2 are not one of the parameter possible values
|
extern |
Get the possible values of an ordinal parameter.
| [in] | parameter | |
| [in] | num_possible_values | the size of the possible_values array |
| [out] | possible_values | an array of num_possible_values values that will contain the returned possible values. Can be NULL |
| [out] | num_possible_values_ret | a pointer to a variable that will contain the number of values that are or would be returned. Can be NULL |
parameter is not a valid CCS parameter parameter is not an ordinal parameter possible_values is NULL and num_possible_values is greater than 0; or if possible_values is NULL and num_possible_values_ret is NULL; or if num_possible_values is less than the number of values that would be returned
|
extern |
Check if a value is acceptable for a parameter.
| [in] | parameter | |
| [in] | value | the value to check the validity of |
| [out] | result_ret | a pointer to the variable that will contain the result of the check |
parameter is not a valid CCS parameter result_ret is NULL
|
extern |
Check if an array of values are acceptable for a parameter.
| [in] | parameter | |
| [in] | num_values | the size of the values array |
| [in] | values | an array of num_values values to check |
| [out] | results | an array of num_values cc_bool_t values that will contain the results the individual checks |
parameter is not a valid CCS parameter values or results are NULL and num_values is greater than 0
|
extern |
Convert numerical samples into samples from the parameter.
| [in] | parameter | |
| [in] | oversampling | if CCS_TRUE values can be outside of the parameter sampling interval (see ccs_parameter_sampling_interval), else they must be within the sampling interval |
| [in] | num_values | the size of the values array |
| [in] | values | an array of num_values values to convert |
| [out] | results | an array of num_values values that will contain the converted values. If oversampling is CCS_TRUE values outside of the sampling interval will be converted to ccs_inactive |
parameter is not a valid CCS parameter values or results are NULL and num_values is greater than 0 parameter is of type CCS_PARAMETER_TYPE_STRING
|
extern |
Create a copy of a parameter.
User data are not copied.
| [in] | parameter | |
| [out] | parameter_ret | a pointer to the variable that will hold the newly created CCS parameter |
parameter_ret is NULL parameter is not a valid CCS parameter
|
extern |
Get the default distribution of a parameter.
| [in] | parameter | |
| [out] | distribution_ret | a pointer to the variable that will contained the returned distribution |
parameter is not a valid CCS parameter distribution_ret is NULL
|
extern |
Get the default value of an parameter.
| [in] | parameter | |
| [out] | value_ret | pointer to the variable that will contain the default value of the parameter |
value_ret is NULL distribution is not a valid CCS parameter
|
extern |
Get the name of a parameter.
| [in] | parameter | |
| [out] | name_ret | a pointer to the variable that will contain a pointer to the name of the parameter |
name_ret is NULL distribution is not a valid CCS parameter
|
extern |
Get the type of a parameter.
| [in] | parameter | |
| [out] | type_ret | a pointer to the variable that will contain the type of the parameter |
type_ret is NULL parameter is not a valid CCS parameter
|
extern |
Get a sample from the parameter sampled by a given distribution.
| [in] | parameter | |
| [in] | distribution | the distribution to sample the parameter with |
| [in] | rng | the random number generator to use |
| [out] | value_ret | a pointer to the variable that will contain the sampled value |
parameter is not a valid CCS parameter; or if distribution is not a valid CCS distribution; or if rng is not a valid CCS random number generator value_ret is NULL parameter is of type CCS_PARAMETER_TYPE_STRING rng is only used by one thread at a time
|
extern |
Get samples from the parameter sampled by a given distribution.
| [in] | parameter | |
| [in] | distribution | the distribution to sample the parameter with |
| [in] | rng | the random number generator to use |
| [in] | num_values | the number of queried values |
| [out] | values | an array of num_values values will contain the sampled values |
parameter is not a valid CCS parameter; or if distribution is not a valid CCS distribution; or if rng is not a valid CCS random number generator values is NULL and num_values is greater than 0 parameter is of type CCS_PARAMETER_TYPE_STRING rng is only used by one thread at a time
|
extern |
Get the valid sampling interval of the parameter.
| [in] | parameter | |
| [out] | interval_ret | a pointer to the variable that will contain the returned interval |
parameter is not a valid CCS parameter interval_ret is NULL
|
extern |
Check if a value is acceptable for a parameter and if it is return a marshalled value.
| [in] | parameter | |
| [in] | value | the value to check the validity of |
| [out] | value_ret | a pointer to the variable that will contain the marshalled value or ccs_inactive if the value is not valid |
| [out] | result_ret | a pointer to the variable that will contain the result of the check |
parameter is not a valid CCS parameter result_ret or value_ret is NULL
|
extern |
Check if an array of values are acceptable for a parameter and return marshalled values if they are valid.
| [in] | parameter | |
| [in] | num_values | the size of the values array |
| [in] | values | an array of num_values values to check |
| [out] | values_ret | an array of num_values values that will contain the marshalled values, or ccs_inactive if values are invalid |
| [out] | results | an array of num_values cc_bool_t values that will contain the results the individual checks |
parameter is not a valid CCS parameter values or results or values_ret are NULL and num_values is greater than 0