heur.h File Reference


Detailed Description

Heuristic management module.

#include <oski/common.h>
#include <stdio.h>

Go to the source code of this file.

Defines

#define INC_OSKI_HEUR_H
 oski/heur.h included.
#define OSKI_HEUR_METHOD(type, name)
 Retrieve the method for a particular heuristic.
#define OSKI_HEURID_METHOD(type_id, name)
 Retrieve the method for a particular heuristic type given the heuristic type id.

Functions

void oski_InitHeurManager (void)
 Open/initialize the heuristic manager.
void oski_CloseHeurManager (void)
 Shutdown heuristic manager.
oski_id_t oski_RegisterHeur (const char *name, oski_id_t id_ind, oski_id_t id_val)
 Register a new heuristic with the heuristic manager.
size_t oski_GetNumHeur (void)
 Returns the number of available heuristics.
const char * oski_LookupHeurDescById (oski_id_t id)
 Returns a short descriptive string for the specified heuristic.
oski_id_t oski_LookupHeurId (const char *name, oski_id_t id_ind, oski_id_t id_val)
 Returns the id number of a specified heuristic.
oski_id_t oski_LookupHeurIdByNum (size_t i)
 Returns the id number of the i-th heuristic.
void * oski_LookupHeurIdMethod (oski_id_t id, const char *method_name)
 Return a method stored in a heuristic module, found by heuristic id.
void * oski_LookupHeurMethod (const char *heur_name, oski_id_t id_ind, oski_id_t id_val, const char *method_name)
 Return a method stored in a heuristic module, found by heuristic type.
FILE * oski_OpenBenchmarkData (const char *filename)
 Opens a file containing off-line benchmarking data for reading.
void oski_CloseBenchmarkData (FILE *fp)
 Close an open file containing off-line benchmark data.
int oski_ReadBenchmarkLine (FILE *fp, char *buffer, size_t max_len)
 Reads the first non-comment line in the given benchmark data file.


Define Documentation

#define OSKI_HEUR_METHOD type,
name   ) 
 

Value:

Retrieve the method for a particular heuristic.

Relies on the compile-time default scalar type macros, OSKI_IND_ID and OSKI_VAL_ID.

Parameters:
[in] type Heuristic type name, as a string.
[in] name Method base name (not as a string constant).
Returns:
A function pointer of the appropriate type, or NULL on error.

#define OSKI_HEURID_METHOD type_id,
name   ) 
 

Value:

(OSKI_MAKENAME_FUNCPT(name))oski_LookupHeurIdMethod( \
        type_id, "oski_" MACRO_TO_STRING(name) \
    )
Retrieve the method for a particular heuristic type given the heuristic type id.

Parameters:
[in] type_id Heuristic type, by ID.
[in] name Method base name (not as a string constant).
Returns:
A function pointer of the appropriate type, or NULL on error.


Function Documentation

FILE* oski_OpenBenchmarkData const char *  filename  ) 
 

Opens a file containing off-line benchmarking data for reading.

Parameters:
[in] filename Name of the benchmark data file. This name should only contain a relative path.
If an environment variable named 'OSKI_BENCH_DIR' is defined, then this routine searches for 'filename' in that path first, before checking the default directory, OSKI_BENCH_DIR_DEFAULT (compile-time macro).

Returns:
Returns NULL on error, but does not call the error handler so this routine can be used to check quietly for file existence. Otherwise, returns a valid pointer to an open file for reading on success.

int oski_ReadBenchmarkLine FILE *  fp,
char *  buffer,
size_t  max_len
 

Reads the first non-comment line in the given benchmark data file.

Parameters:
[in] fp Pointer to a benchmark data file.
[in,out] buffer Buffer in which to store the next line.
[in] max_len Maximum length of 'buffer'.
Returns:
Returns 0 when the end-of-file is reached, or 1 if a non-comment line was read from the file. 'buffer' always contains the last line read from the file regardless of the return value.


Generated on Wed Sep 19 16:41:22 2007 for BeBOP Optimized Sparse Kernel Interface Library by  doxygen 1.4.6