C Configuration Space and Tuning Library (CCS)
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
evaluation.h File Reference

An evaluation is a binding (see binding.h) over an objective space (see objective_space.h) given a specific search configuration. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef enum ccs_comparison_e ccs_comparison_t
 A commodity type to represent CCS the result of comparing evaluations.
 

Enumerations

enum  ccs_comparison_e {
  CCS_COMPARISON_BETTER = -1 , CCS_COMPARISON_EQUIVALENT = 0 , CCS_COMPARISON_WORSE = 1 , CCS_COMPARISON_NOT_COMPARABLE = 2 ,
  CCS_COMPARISON_MAX , CCS_COMPARISON_FORCE_32BIT = INT32_MAX
}
 The different possible return codes when comparing two evaluations. More...
 

Functions

ccs_result_t ccs_create_evaluation (ccs_objective_space_t objective_space, ccs_search_configuration_t configuration, ccs_evaluation_result_t result, size_t num_values, ccs_datum_t *values, ccs_evaluation_t *evaluation_ret)
 Create a new instance of an evaluation on a given objective_space for a given configuration.
 
ccs_result_t ccs_evaluation_get_objective_space (ccs_evaluation_t evaluation, ccs_objective_space_t *objective_space_ret)
 Get the objective space associated with an evaluation.
 
ccs_result_t ccs_evaluation_get_configuration (ccs_evaluation_t evaluation, ccs_search_configuration_t *configuration_ret)
 Get the configuration associated with an evaluation.
 
ccs_result_t ccs_evaluation_get_features (ccs_evaluation_t evaluation, ccs_features_t *features_ret)
 Get the features associated with an evaluation.
 
ccs_result_t ccs_evaluation_get_result (ccs_evaluation_t evaluation, ccs_evaluation_result_t *result_ret)
 Get the result code associated with an evaluation.
 
ccs_result_t ccs_evaluation_get_objective_value (ccs_evaluation_t evaluation, size_t index, ccs_datum_t *value_ret)
 Get the value of an objective for a valid evaluation in the context of its objective space.
 
ccs_result_t ccs_evaluation_get_objective_values (ccs_evaluation_t evaluation, size_t num_values, ccs_datum_t *values, size_t *num_values_ret)
 Get the values of the objectives for a valid evaluation in the context of its objective space.
 
ccs_result_t ccs_evaluation_compare (ccs_evaluation_t evaluation, ccs_evaluation_t other_evaluation, ccs_comparison_t *result_ret)
 Compare two successful evaluations objectives.
 

Detailed Description

An evaluation is a binding (see binding.h) over an objective space (see objective_space.h) given a specific search configuration.

Successful evaluations over the same objective space are weakly ordered by their objective values. Evaluation that have failed must report a result code different than CCS_RESULT_SUCCESS.

Enumeration Type Documentation

◆ ccs_comparison_e

The different possible return codes when comparing two evaluations.

Enumerator
CCS_COMPARISON_BETTER 

The first configuration is better then the second.

CCS_COMPARISON_EQUIVALENT 

The two configurations are equivalent.

CCS_COMPARISON_WORSE 

The first configuration is worse than the second.

CCS_COMPARISON_NOT_COMPARABLE 

The two configurations cannot be compared.

CCS_COMPARISON_MAX 

Guard.

CCS_COMPARISON_FORCE_32BIT 

Try forcing 32 bits value for bindings.

Function Documentation

◆ ccs_create_evaluation()

ccs_result_t ccs_create_evaluation ( ccs_objective_space_t  objective_space,
ccs_search_configuration_t  configuration,
ccs_evaluation_result_t  result,
size_t  num_values,
ccs_datum_t values,
ccs_evaluation_t evaluation_ret 
)
extern

Create a new instance of an evaluation on a given objective_space for a given configuration.

Parameters
[in]objective_spacethe objective space to associate with the evaluation
[in]configurationthe configuration to associate with the evaluation
[in]resultthe result code associated with the evaluation
[in]num_valuesthe number of provided values to initialize the evaluation
[in]valuesan optional array of values to initialize the evaluation
[out]evaluation_reta pointer to the variable that will hold the newly created evaluation
Returns
CCS_RESULT_SUCCESS on success
CCS_RESULT_ERROR_INVALID_OBJECT if objective_space is not a valid CCS objective space; or if configuration is not a valid CCS search configuration
CCS_RESULT_ERROR_INVALID_CONFIGURATION if configuration search space is not the same as objective_space search space
CCS_RESULT_ERROR_INVALID_VALUE if evaluation_ret is NULL; or if values is NULL and num_values is greater than 0; or if the number of values provided is not equal to the number of parameters in the objective space
CCS_RESULT_ERROR_OUT_OF_MEMORY if there was a lack of memory to allocate the new evaluation
Remarks
This function is thread-safe

◆ ccs_evaluation_compare()

ccs_result_t ccs_evaluation_compare ( ccs_evaluation_t  evaluation,
ccs_evaluation_t  other_evaluation,
ccs_comparison_t result_ret 
)
extern

Compare two successful evaluations objectives.

Parameters
[in]evaluationthe first evaluation
[in]other_evaluationthe second evaluation
[out]result_reta pointer to the variable that will contain the result of the comparison. Will contain CCS_COMPARISON_BETTER, CCS_COMPARISON_EQUIVALENT, CCS_COMPARISON_WORSE, or CCS_COMPARISON_NOT_COMPARABLE if the first evaluation is found to be respectively better, equivalent, worse, or not comparable with the second evaluation.
Returns
CCS_RESULT_SUCCESS on success
CCS_RESULT_ERROR_INVALID_OBJECT if evaluation or other_evaluation are not valid CCS evaluations; or if evaluation and other_evaluation do not share the same objective space; or if any of the the evaluation is associated a result code different than CCS_RESULT_SUCCESS; or if both evaluations are not of the same type
CCS_RESULT_ERROR_INVALID_VALUE if result_ret is NULL; or if there was an issue evaluating any of the objectives
Remarks
This function is thread-safe

◆ ccs_evaluation_get_configuration()

ccs_result_t ccs_evaluation_get_configuration ( ccs_evaluation_t  evaluation,
ccs_search_configuration_t configuration_ret 
)
extern

Get the configuration associated with an evaluation.

Parameters
[in]evaluation
[out]configuration_reta pointer to the variable that will contain the configuration
Returns
CCS_RESULT_SUCCESS on success
CCS_RESULT_ERROR_INVALID_OBJECT if evaluation is not a valid CCS evaluation
CCS_RESULT_ERROR_INVALID_VALUE if configuration_ret is NULL
Remarks
This function is thread-safe

◆ ccs_evaluation_get_features()

ccs_result_t ccs_evaluation_get_features ( ccs_evaluation_t  evaluation,
ccs_features_t features_ret 
)
extern

Get the features associated with an evaluation.

Parameters
[in]evaluation
[out]features_reta pointer to the variable that will contain the features
Returns
CCS_RESULT_SUCCESS on success
CCS_RESULT_ERROR_INVALID_OBJECT if evaluation is not a valid CCS evaluation
CCS_RESULT_ERROR_INVALID_VALUE if features_ret is NULL
Remarks
This function is thread-safe

◆ ccs_evaluation_get_objective_space()

ccs_result_t ccs_evaluation_get_objective_space ( ccs_evaluation_t  evaluation,
ccs_objective_space_t objective_space_ret 
)
extern

Get the objective space associated with an evaluation.

Parameters
[in]evaluation
[out]objective_space_reta pointer to the variable that will contain the objective space
Returns
CCS_RESULT_SUCCESS on success
CCS_RESULT_ERROR_INVALID_OBJECT if evaluation is not a valid CCS evaluation
CCS_RESULT_ERROR_INVALID_VALUE if objective_space_ret is NULL
Remarks
This function is thread-safe

◆ ccs_evaluation_get_objective_value()

ccs_result_t ccs_evaluation_get_objective_value ( ccs_evaluation_t  evaluation,
size_t  index,
ccs_datum_t value_ret 
)
extern

Get the value of an objective for a valid evaluation in the context of its objective space.

Parameters
[in]evaluation
[in]indexthe index of the objective in the objective space
[out]value_reta pointer to the variable that will contain the value of the objective
Returns
CCS_RESULT_SUCCESS on success
CCS_RESULT_ERROR_INVALID_OBJECT if evaluation is not a valid CCS evaluation
CCS_RESULT_ERROR_INVALID_VALUE if value_ret is NULL; or if there was an issue evaluating the objective
CCS_RESULT_ERROR_OUT_OF_BOUNDS if index is greater than the number of objective in the objective space
Remarks
This function is thread-safe

◆ ccs_evaluation_get_objective_values()

ccs_result_t ccs_evaluation_get_objective_values ( ccs_evaluation_t  evaluation,
size_t  num_values,
ccs_datum_t values,
size_t *  num_values_ret 
)
extern

Get the values of the objectives for a valid evaluation in the context of its objective space.

Parameters
[in]evaluation
[in]num_valuesthe number of values that values can contain
[out]valuesan optional array of values that will contain the returned objective values. If values is bigger than the number of objectives, extra values will be set to CCS_DATA_TYPE_NONE
[out]num_values_retan optional pointer to a variable that will contain the number of values that are or would be returned. Can be NULL
Returns
CCS_RESULT_SUCCESS on success
CCS_RESULT_ERROR_INVALID_OBJECT if evaluation is not a valid CCS evaluation
CCS_RESULT_ERROR_INVALID_VALUE if values is NULL and num_values is greater than 0; or if values is NULL and num_values_ret is NULL; or if there was an issue evaluating any of the objectives
Remarks
This function is thread-safe

◆ ccs_evaluation_get_result()

ccs_result_t ccs_evaluation_get_result ( ccs_evaluation_t  evaluation,
ccs_evaluation_result_t result_ret 
)
extern

Get the result code associated with an evaluation.

Parameters
[in]evaluation
[out]result_reta pointer to the variable that will contain the returned result code
Returns
CCS_RESULT_SUCCESS on success
CCS_RESULT_ERROR_INVALID_OBJECT if evaluation is not a valid CCS evaluation
CCS_RESULT_ERROR_INVALID_VALUE if result_ret is NULL
Remarks
This function is thread-safe