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

An objective space is a context (see context.h) defining a set of result parameters of a search space. More...

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

Go to the source code of this file.

Typedefs

typedef enum ccs_objective_type_e ccs_objective_type_t
 A commodity type to represent objective types.
 

Enumerations

enum  ccs_objective_type_e { CCS_OBJECTIVE_TYPE_MINIMIZE , CCS_OBJECTIVE_TYPE_MAXIMIZE , CCS_OBJECTIVE_TYPE_MAX , CCS_OBJECTIVE_TYPE_FORCE_32BIT = INT_MAX }
 Types of a CCS objective. More...
 

Functions

ccs_result_t ccs_create_objective_space (const char *name, ccs_search_space_t search_space, size_t num_parameters, ccs_parameter_t *parameters, size_t num_objectives, ccs_expression_t *objectives, ccs_objective_type_t *types, ccs_objective_space_t *objective_space_ret)
 Create a new objective space.
 
ccs_result_t ccs_objective_space_get_search_space (ccs_objective_space_t objective_space, ccs_search_space_t *search_space_ret)
 Get the search space of an objective space.
 
ccs_result_t ccs_objective_space_get_objective (ccs_objective_space_t objective_space, size_t index, ccs_expression_t *expression_ret, ccs_objective_type_t *type_ret)
 Get the objective of rank index in a objective space.
 
ccs_result_t ccs_objective_space_get_objectives (ccs_objective_space_t objective_space, size_t num_objectives, ccs_expression_t *expressions, ccs_objective_type_t *types, size_t *num_objectives_ret)
 Get the objectives in a objective space.
 

Detailed Description

An objective space is a context (see context.h) defining a set of result parameters of a search space.

Objective spaces also define a list of expressions (see expression.h) over those parameters called objectives.

Enumeration Type Documentation

◆ ccs_objective_type_e

Types of a CCS objective.

Enumerator
CCS_OBJECTIVE_TYPE_MINIMIZE 

Objective should be minimized.

CCS_OBJECTIVE_TYPE_MAXIMIZE 

Objective should be maximized.

CCS_OBJECTIVE_TYPE_MAX 

Guard.

CCS_OBJECTIVE_TYPE_FORCE_32BIT 

Try forcing 32 bits value for bindings.

Function Documentation

◆ ccs_create_objective_space()

ccs_result_t ccs_create_objective_space ( const char *  name,
ccs_search_space_t  search_space,
size_t  num_parameters,
ccs_parameter_t parameters,
size_t  num_objectives,
ccs_expression_t objectives,
ccs_objective_type_t types,
ccs_objective_space_t objective_space_ret 
)
extern

Create a new objective space.

Parameters
[in]namepointer to a string that will be copied internally
[in]search_spacea CCS search space
[in]num_parametersthe number of provided parameters
[in]parametersan array of num_parameters parameters to add to the objective space
[in]num_objectivesthe number of provided expressions
[in]objectivesan array of num_objectives expressions to add as objectives to the objective space
[in]typesan array of num_objectives types of objectives
[out]objective_space_reta pointer to the variable that will hold the newly created objective space
Returns
CCS_RESULT_SUCCESS on success
CCS_RESULT_ERROR_INVALID_VALUE if name is NULL; or if search_space is null; or if objective_space_ret is NULL; or if parameters is NULL; or if num_parameters is NULL; or if objectives is NULL and num_objectives is greater than 0; of if types is NULL and num_objectives is greater than 0
CCS_RESULT_ERROR_INVALID_OBJECT if search_space is not a valid CCS search space; or if a parameter is not a valid CCS parameter; or if an expressions is not a valid CCS expression
CCS_RESULT_ERROR_INVALID_PARAMETER if a parameter appears more than once in parameters; or if two or more parameters share the same name; or if a parameter is already part of another context; or if an expression references a parameter that is not in parameters or in search_space or in search_space feature space if it exists
CCS_RESULT_ERROR_OUT_OF_MEMORY if there was a lack of memory to allocate the new objective space
Remarks
This function is thread-safe

◆ ccs_objective_space_get_objective()

ccs_result_t ccs_objective_space_get_objective ( ccs_objective_space_t  objective_space,
size_t  index,
ccs_expression_t expression_ret,
ccs_objective_type_t type_ret 
)
extern

Get the objective of rank index in a objective space.

Parameters
[in]objective_space
[in]indexthe index of the objective to retrieve
[out]expression_reta pointer to the variable that will contain the returned expression
[out]type_reta pointer to the variable that will contain the returned objective type
Returns
CCS_RESULT_SUCCESS on success
CCS_RESULT_ERROR_INVALID_OBJECT if objective_space is not a valid CCS objective space
CCS_RESULT_ERROR_INVALID_VALUE if expression_ret or type_ret are NULL
CCS_RESULT_ERROR_OUT_OF_BOUNDS if index is greater than the number of objectives in the objective space
Remarks
This function is thread-safe

◆ ccs_objective_space_get_objectives()

ccs_result_t ccs_objective_space_get_objectives ( ccs_objective_space_t  objective_space,
size_t  num_objectives,
ccs_expression_t expressions,
ccs_objective_type_t types,
size_t *  num_objectives_ret 
)
extern

Get the objectives in a objective space.

Parameters
[in]objective_space
[in]num_objectivesthe number of expressions that can be added to expressions. If expressions is not NULL, num_objectives must be greater than 0
[out]expressionsan array of num_objectives that will contain the returned expressions, or NULL. If the array is too big, extra values are set to NULL
[out]typesan array of num_objectives types that will contain the objective types
[out]num_objectives_reta pointer to a variable that will contain the number of expressions that are or would be returned. Can be NULL
Returns
CCS_RESULT_SUCCESS on success
CCS_RESULT_ERROR_INVALID_OBJECT if objective_space is not a valid CCS objective space
CCS_RESULT_ERROR_INVALID_VALUE if expressions is NULL and num_objectives is greater than 0; if types is NULL and num_objectives is greater than 0; or if expressions is NULL and num_objectives_ret is NULL; or if num_objectives is less than then number of expressions that would be returned
Remarks
This function is thread-safe

◆ ccs_objective_space_get_search_space()

ccs_result_t ccs_objective_space_get_search_space ( ccs_objective_space_t  objective_space,
ccs_search_space_t search_space_ret 
)
extern

Get the search space of an objective space.

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