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

Interval define ranges over numeric values. More...

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

Go to the source code of this file.

Data Structures

struct  ccs_interval_s
 A structure defining an interval over numeric values. More...
 

Typedefs

typedef struct ccs_interval_s ccs_interval_t
 A commodity type to represent CCS intervals.
 

Functions

ccs_result_t ccs_interval_empty (ccs_interval_t *interval, ccs_bool_t *empty_ret)
 Check if an interval is empty.
 
ccs_result_t ccs_interval_intersect (ccs_interval_t *interval1, ccs_interval_t *interval2, ccs_interval_t *interval_res)
 Compute the intersection of two intervals.
 
ccs_result_t ccs_interval_union (ccs_interval_t *interval1, ccs_interval_t *interval2, ccs_interval_t *interval_res)
 Compute the union of two intervals.
 
ccs_result_t ccs_interval_equal (ccs_interval_t *interval1, ccs_interval_t *interval2, ccs_bool_t *equal_res)
 Test the equality of two intervals.
 
ccs_bool_t ccs_interval_include (ccs_interval_t *interval, ccs_numeric_t value)
 Test the inclusion of a numeric value into an interval.
 

Detailed Description

Interval define ranges over numeric values.

Function Documentation

◆ ccs_interval_empty()

ccs_result_t ccs_interval_empty ( ccs_interval_t interval,
ccs_bool_t empty_ret 
)
extern

Check if an interval is empty.

Parameters
[in]intervala pointer to the interval to check
[out]empty_reta pointer to the variable that will contain the check result
Returns
CCS_RESULT_SUCCESS on success
CCS_RESULT_ERROR_INVALID_VALUE if interval or empty_ret are NULL
Remarks
This function is thread-safe

◆ ccs_interval_equal()

ccs_result_t ccs_interval_equal ( ccs_interval_t interval1,
ccs_interval_t interval2,
ccs_bool_t equal_res 
)
extern

Test the equality of two intervals.

Parameters
[in]interval1a pointer to the first interval
[in]interval2a pointer to the second interval
[out]equal_resa pointer to the variable that will contain the test result
Returns
CCS_RESULT_SUCCESS on success
CCS_RESULT_ERROR_INVALID_VALUE if interval1 or interval2 or equal_res are NULL
CCS_RESULT_ERROR_INVALID_TYPE if interval1 and interval2 are intervals over different data types
Remarks
This function is thread-safe

◆ ccs_interval_include()

ccs_bool_t ccs_interval_include ( ccs_interval_t interval,
ccs_numeric_t  value 
)
extern

Test the inclusion of a numeric value into an interval.

The user must pass a numeric of the same type as the interval, else results are undefined.

Parameters
[in]intervala pointer to the interval
[in]valuethe value to check for inclusion in the interval
Returns
CCS_TRUE if the interval includes the value
CCS_FALSE if the interval does not include the value; or if interval is NULL
Remarks
This function is thread-safe

◆ ccs_interval_intersect()

ccs_result_t ccs_interval_intersect ( ccs_interval_t interval1,
ccs_interval_t interval2,
ccs_interval_t interval_res 
)
extern

Compute the intersection of two intervals.

Parameters
[in]interval1a pointer to the first interval
[in]interval2a pointer to the second interval
[out]interval_resa pointer to the variable that will contain the intersection of interval1 and interval2
Returns
CCS_RESULT_SUCCESS on success
CCS_RESULT_ERROR_INVALID_VALUE if interval1 or interval2 orinterval_res are NULL
CCS_RESULT_ERROR_INVALID_TYPE if interval1 and interval2 are intervals over different data types
Remarks
This function is thread-safe

◆ ccs_interval_union()

ccs_result_t ccs_interval_union ( ccs_interval_t interval1,
ccs_interval_t interval2,
ccs_interval_t interval_res 
)
extern

Compute the union of two intervals.

Parameters
[in]interval1a pointer to the first interval
[in]interval2a pointer to the second interval
[out]interval_resa pointer to the variable that will contain the union of interval1 and interval2
Returns
CCS_RESULT_SUCCESS on success
CCS_RESULT_ERROR_INVALID_VALUE if interval1 or interval2 or interval_res are NULL
CCS_RESULT_ERROR_INVALID_TYPE if interval1 and interval2 are intervals over different data types
Remarks
This function is thread-safe