Inspect search and problem stats.
More...
|
|
typedef int | clingo_stats_type_t |
| | Corresponding type to clingo_stats_type.
|
| |
|
typedef struct clingo_statistic | clingo_stats_t |
| | Handle for the solver stats.
|
| |
|
| CLINGO_VISIBILITY_DEFAULT bool | clingo_stats_map_size (clingo_stats_t const *stats, uint64_t key, size_t *size) |
| | Get the number of subkeys of a map entry.
|
| |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_stats_map_has_subkey (clingo_stats_t const *stats, uint64_t key, char const *name, size_t size, bool *result) |
| | Test if the given map contains a specific subkey.
|
| |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_stats_map_subkey_name (clingo_stats_t const *stats, uint64_t key, size_t offset, clingo_string_t *name) |
| | Get the name associated with the offset-th subkey.
|
| |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_stats_map_at (clingo_stats_t const *stats, uint64_t key, char const *name, size_t size, uint64_t *subkey) |
| | Lookup a subkey under the given name.
|
| |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_stats_map_add_subkey (clingo_stats_t *stats, uint64_t key, char const *name, size_t size, clingo_stats_type_t type, uint64_t *subkey) |
| | Add a subkey with the given name.
|
| |
Inspect search and problem stats.
For an example, see stats.c.
◆ clingo_stats_type_e
Enumeration for entries of the stats.
| Enumerator |
|---|
| clingo_stats_type_value | the entry is a (double) value
|
| clingo_stats_type_array | the entry is an array
|
| clingo_stats_type_map | the entry is a map
|
◆ clingo_control_stats()
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_stats |
( |
clingo_control_t * |
control, |
|
|
clingo_stats_t const ** |
stats |
|
) |
| |
Get the solver stats.
- Parameters
-
| [in] | control | the target control object |
| [out] | stats | the resulting stats object |
- Returns
- whether the call was successful
◆ clingo_stats_array_at()
| CLINGO_VISIBILITY_DEFAULT bool clingo_stats_array_at |
( |
clingo_stats_t const * |
stats, |
|
|
uint64_t |
key, |
|
|
size_t |
offset, |
|
|
uint64_t * |
subkey |
|
) |
| |
Get the subkey at the given offset of an array entry.
- Precondition
- The type of the entry must be clingo_stats_type_array.
- Parameters
-
| [in] | stats | the target stats |
| [in] | key | the key |
| [in] | offset | the offset in the array |
| [out] | subkey | the resulting subkey |
- Returns
- whether the call was successful
◆ clingo_stats_array_push()
Create the subkey at the end of an array entry.
- Precondition
- The type of the entry must be clingo_stats_type_array.
- Parameters
-
| [in] | stats | the target stats |
| [in] | key | the key |
| [in] | type | the type of the new subkey |
| [out] | subkey | the resulting subkey |
- Returns
- whether the call was successful
◆ clingo_stats_array_size()
| CLINGO_VISIBILITY_DEFAULT bool clingo_stats_array_size |
( |
clingo_stats_t const * |
stats, |
|
|
uint64_t |
key, |
|
|
size_t * |
size |
|
) |
| |
Get the size of an array entry.
- Precondition
- The type of the entry must be clingo_stats_type_array.
- Parameters
-
| [in] | stats | the target stats |
| [in] | key | the key |
| [out] | size | the resulting size |
- Returns
- whether the call was successful
◆ clingo_stats_map_add_subkey()
| CLINGO_VISIBILITY_DEFAULT bool clingo_stats_map_add_subkey |
( |
clingo_stats_t * |
stats, |
|
|
uint64_t |
key, |
|
|
char const * |
name, |
|
|
size_t |
size, |
|
|
clingo_stats_type_t |
type, |
|
|
uint64_t * |
subkey |
|
) |
| |
Add a subkey with the given name.
- Precondition
- The type of the entry must be clingo_stats_type_map.
- Parameters
-
| [in] | stats | the target stats |
| [in] | key | the key |
| [in] | name | the name of the new subkey |
| [in] | size | the size of the name |
| [in] | type | the type of the new subkey |
| [out] | subkey | the index of the resulting subkey |
- Returns
- whether the call was successful
◆ clingo_stats_map_at()
| CLINGO_VISIBILITY_DEFAULT bool clingo_stats_map_at |
( |
clingo_stats_t const * |
stats, |
|
|
uint64_t |
key, |
|
|
char const * |
name, |
|
|
size_t |
size, |
|
|
uint64_t * |
subkey |
|
) |
| |
Lookup a subkey under the given name.
- Precondition
- The type of the entry must be clingo_stats_type_map.
- Note
- Multiple levels can be looked up by concatenating keys with a period.
- Parameters
-
| [in] | stats | the target stats |
| [in] | key | the key |
| [in] | name | the name to look up the subkey |
| [in] | size | the size of the name |
| [out] | subkey | the resulting subkey |
- Returns
- whether the call was successful
◆ clingo_stats_map_has_subkey()
| CLINGO_VISIBILITY_DEFAULT bool clingo_stats_map_has_subkey |
( |
clingo_stats_t const * |
stats, |
|
|
uint64_t |
key, |
|
|
char const * |
name, |
|
|
size_t |
size, |
|
|
bool * |
result |
|
) |
| |
Test if the given map contains a specific subkey.
- Precondition
- The type of the entry must be clingo_stats_type_map.
- Parameters
-
| [in] | stats | the target stats |
| [in] | key | the key |
| [in] | name | name of the subkey |
| [in] | size | the size of the name |
| [out] | result | true if the map has a subkey with the given name |
- Returns
- whether the call was successful
◆ clingo_stats_map_size()
| CLINGO_VISIBILITY_DEFAULT bool clingo_stats_map_size |
( |
clingo_stats_t const * |
stats, |
|
|
uint64_t |
key, |
|
|
size_t * |
size |
|
) |
| |
Get the number of subkeys of a map entry.
- Precondition
- The type of the entry must be clingo_stats_type_map.
- Parameters
-
| [in] | stats | the target stats |
| [in] | key | the key |
| [out] | size | the resulting number |
- Returns
- whether the call was successful
◆ clingo_stats_map_subkey_name()
| CLINGO_VISIBILITY_DEFAULT bool clingo_stats_map_subkey_name |
( |
clingo_stats_t const * |
stats, |
|
|
uint64_t |
key, |
|
|
size_t |
offset, |
|
|
clingo_string_t * |
name |
|
) |
| |
Get the name associated with the offset-th subkey.
- Precondition
- The type of the entry must be clingo_stats_type_map.
- Parameters
-
| [in] | stats | the target stats |
| [in] | key | the key |
| [in] | offset | the offset of the name |
| [out] | name | the resulting name |
- Returns
- whether the call was successful
◆ clingo_stats_root()
| CLINGO_VISIBILITY_DEFAULT bool clingo_stats_root |
( |
clingo_stats_t const * |
stats, |
|
|
uint64_t * |
key |
|
) |
| |
Get the root key of the stats.
- Parameters
-
| [in] | stats | the target stats |
| [out] | key | the root key |
- Returns
- whether the call was successful
◆ clingo_stats_to_string()
Get a string representation of the statistics.
The representation is in a YAML-like format.
- Parameters
-
| stats | the stats |
| key | the key |
| builder | the builder |
- Returns
- whether the call was successful
◆ clingo_stats_type()
Get the type of a key.
- Parameters
-
| [in] | stats | the target stats |
| [in] | key | the key |
| [out] | type | the resulting type |
- Returns
- whether the call was successful
◆ clingo_stats_value_get()
| CLINGO_VISIBILITY_DEFAULT bool clingo_stats_value_get |
( |
clingo_stats_t const * |
stats, |
|
|
uint64_t |
key, |
|
|
double * |
value |
|
) |
| |
Get the value of the given entry.
- Precondition
- The type of the entry must be clingo_stats_type_value.
- Parameters
-
| [in] | stats | the target stats |
| [in] | key | the key |
| [out] | value | the resulting value |
- Returns
- whether the call was successful
◆ clingo_stats_value_set()
| CLINGO_VISIBILITY_DEFAULT bool clingo_stats_value_set |
( |
clingo_stats_t * |
stats, |
|
|
uint64_t |
key, |
|
|
double |
value |
|
) |
| |
Set the value of the given entry.
- Precondition
- The type of the entry must be clingo_stats_type_value.
- Parameters
-
| [in] | stats | the target stats |
| [in] | key | the key |
| [out] | value | the new value |
- Returns
- whether the call was successful