INGOR
Public Member Functions | Public Attributes | List of all members
Score Class Reference

#include <score/Score.h>

Public Member Functions

ScoreScore_get (const char *name)
 Returns the specified score function. More...
 

Public Attributes

char * name
 Score name.
 
void *(* init )(ytData *data, ytKeyValues *args)
 Initializer.
 
double(* score )(void *buff, const int j, const int *parents, const int q)
 Score function.
 
void(* reinit )(void *buff, ytData *data)
 Re-initializer.
 
void(* cache )(void *buff, int on)
 Enable and/or disable cache.
 
void(* edgeProp )(void *buff, const int j, const int *parents, const int q, const int k, ytEdge *edge)
 
void(* nodeProp )(void *buff, int i, ytNode *node)
 
void(* finalize )(void *buff)
 
void(* partialResidual )(void *buff, const int j, const int *parents, const int q, FILE **fp, double *ll)
 
void(* setEdgeProp )(void *buff, const int j, const int *parents, const int q, const int k, const ytEdge *edge)
 
void(* setNodeProp )(void *buff, const int j, const ytNode *node)
 
void(* status )(void *buff)
 
void(* setParam )(void *buff, const char *key, ytObject *value)
 
void * buff
 Pointer to the score buffer that is used by the score functions.
 

Detailed Description

This class defines the interface of score functions.

Currently available score functions are: BNRC and BNDC.

How to Use Score Functions

ytData * data;
// Set something in 'data' ...
// Obtains the score function.
Score * sc = Score_get("BNRC");
// Score initialization by the ytData instance.
sc->buff = sc->init(data);
// Score calculation. A Score::score methods simply receives four
// parameters: its score buffer, the target node index, a list of
// parents, and the length of the list.
int parents[3] = {1, 2, 3};
double s = sc->score(sc->buff, 0, parents, 3);
// Call the finalizer before quiting the program.
sc->finalize(sc->buff);
Definition: Score.h:45
double(* score)(void *buff, const int j, const int *parents, const int q)
Score function.
Definition: Score.h:53
void *(* init)(ytData *data, ytKeyValues *args)
Initializer.
Definition: Score.h:50
void * buff
Pointer to the score buffer that is used by the score functions.
Definition: Score.h:81
Score * Score_get(const char *name)
Returns the specified score function.
Definition: Score.c:87
General data container.
Definition: ytData.h:73

Member Function Documentation

◆ Score_get()

Score * Score_get ( const char *  name)

Returns the specified score function.

The returned instance of the Score structure has several functions (methods) and a pointer to the score buffer (Score::buff).

Parameters
nameName of the score function to return.
Returns
Pointer to the Score instance. If not found, NULL is returned.

The documentation for this class was generated from the following files: