Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Related Pages

Scorematrix - The matrix of scores appearing in each ConstraintEdge


Detailed Description

Author:
Ingo Schroeder
Date:
6/3/97
Note: The functions for accessing these matrices check whether the matrix is non- NULL, but they do not check whether the index is meaningful. Hence the behaviour of these functions is undefined if an invalid array index is passed to them.


Data Structures

struct  ScoreMatrixStruct
struct  SMEntryStruct

Typedefs

typedef ScoreMatrixStructScoreMatrix
typedef ScoreMatrixStruct ScoreMatrixStruct
typedef SMEntryStructSMEntry
typedef SMEntryStruct SMEntryStruct

Functions

void smDelete (ScoreMatrix sm)
Boolean smGetFlag (ScoreMatrix sm, int r, int c)
double smGetScore (ScoreMatrix sm, int r, int c)
ScoreMatrix smNew (int r, int c)
void smSetAllFlags (ScoreMatrix sm, Boolean flag)
Boolean smSetFlag (ScoreMatrix sm, Boolean flag, int r, int c)
double smSetScore (ScoreMatrix sm, double score, int r, int c)


Typedef Documentation

typedef struct ScoreMatrixStruct* ScoreMatrix
 

type of matrix structure pointer Definition at line 27 of file scorematrix.h.

Referenced by smDelete(), smGetFlag(), smGetScore(), smNew(), smSetAllFlags(), smSetFlag(), and smSetScore().

typedef struct ScoreMatrixStruct ScoreMatrixStruct
 

type of score matrix structure Definition at line 81 of file scorematrix.c.

Referenced by smNew().

typedef SMEntryStruct* SMEntry
 

type of matrix entry pointer Definition at line 54 of file scorematrix.c.

Referenced by smNew().

typedef struct SMEntryStruct SMEntryStruct
 

type of matrix entry structure Definition at line 51 of file scorematrix.c.

Referenced by smNew().


Function Documentation

void smDelete ScoreMatrix  sm  ) 
 

deletes score matrix

This function deallocates a ScoreMatrix. It first deallocates all elements of sm->entries[] and then the array itself as well as the ScoreMatrixStruct. Definition at line 122 of file scorematrix.c.

References CDG_ERROR, cdgPrintf(), ScoreMatrixStruct::cols, ScoreMatrixStruct::entries, NULL, ScoreMatrixStruct::rows, and ScoreMatrix.

Referenced by cnBuildEdges(), and cnDeleteEdge().

Boolean smGetFlag ScoreMatrix  sm,
int  r,
int  c
 

retrieves a score matrix element flag

Returns:
the flag of the specified element.
Definition at line 211 of file scorematrix.c.

References CDG_ERROR, cdgPrintf(), ScoreMatrixStruct::entries, SMEntryStruct::flag, NULL, ScoreMatrixStruct::rows, and ScoreMatrix.

double smGetScore ScoreMatrix  sm,
int  r,
int  c
 

retrieves a score matrix element score Definition at line 197 of file scorematrix.c.

References CDG_ERROR, cdgPrintf(), ScoreMatrixStruct::entries, NULL, ScoreMatrixStruct::rows, SMEntryStruct::score, and ScoreMatrix.

Referenced by cnPrintEdge().

ScoreMatrix smNew int  r,
int  c
 

creates and returns a new score matrix

This function allocates a new ScoreMatrix and returns a pointer to it. It allocates an array of size r * c . All elements are initialized to pairs of the form (0.0, FALSE) . Definition at line 94 of file scorematrix.c.

References ScoreMatrixStruct::cols, ScoreMatrixStruct::entries, FALSE, SMEntryStruct::flag, ScoreMatrixStruct::rows, SMEntryStruct::score, ScoreMatrix, ScoreMatrixStruct, SMEntry, and SMEntryStruct.

Referenced by cnBuildEdges().

void smSetAllFlags ScoreMatrix  sm,
Boolean  f
 

sets flags of all matrix elements to a new value

This function sets the flag of all elements of sm->entries[] to flag. Definition at line 180 of file scorematrix.c.

References CDG_ERROR, cdgPrintf(), ScoreMatrixStruct::cols, ScoreMatrixStruct::entries, SMEntryStruct::flag, NULL, ScoreMatrixStruct::rows, and ScoreMatrix.

Boolean smSetFlag ScoreMatrix  sm,
Boolean  f,
int  r,
int  c
 

sets a flag matrix element to a new value, returns old value Definition at line 159 of file scorematrix.c.

References CDG_ERROR, cdgPrintf(), ScoreMatrixStruct::entries, SMEntryStruct::flag, NULL, ScoreMatrixStruct::rows, and ScoreMatrix.

Referenced by cnBuildEdges().

double smSetScore ScoreMatrix  sm,
double  d,
int  r,
int  c
 

sets a score matrix element to a new value, returns old value Definition at line 141 of file scorematrix.c.

References CDG_ERROR, cdgPrintf(), ScoreMatrixStruct::entries, NULL, ScoreMatrixStruct::rows, SMEntryStruct::score, and ScoreMatrix.

Referenced by cnBuildEdges().


CDG 0.95 (20 Oct 2004)