Since not all matrices in the edges of a constraint net are of equal size, each matrix administrates the number of its rows and columns explicitly in addition to the array itself. The element (r,c) in a score matrix is always referenced by
sm->entries[c * sm->rows + r]
The last element of a matrix always has the index
sm->rows * sm->cols -1
The type ScoreMatrix is only used in a ConstraintEdge. A similar function is fulfilled by the structure ScoreCache defined by the module Scache - Cache structures for binary LV scores, which has the advantage of being usable even without constraint edges.
Definition at line 75 of file scorematrix.c.
Data Fields | |
int | cols |
SMEntry * | entries |
int | rows |
|
number of columns in the matrix Definition at line 77 of file scorematrix.c. Referenced by smDelete(), smNew(), and smSetAllFlags(). |
|
entries in the matrix Definition at line 78 of file scorematrix.c. Referenced by smDelete(), smGetFlag(), smGetScore(), smNew(), smSetAllFlags(), smSetFlag(), and smSetScore(). |
|
number of rows in the matrix Definition at line 76 of file scorematrix.c. Referenced by smDelete(), smGetFlag(), smGetScore(), smNew(), smSetAllFlags(), smSetFlag(), and smSetScore(). |