MCPcopy Create free account
hub / github.com/Martinsos/edlib / getBlockCellValues

Function getBlockCellValues

edlib/src/edlib.cpp:467–479  ·  view source on GitHub ↗

* @param [in] block * @return Values of cells in block, starting with bottom cell in block. */

Source from the content-addressed store, hash-verified

465 * @return Values of cells in block, starting with bottom cell in block.
466 */
467static inline vector<int> getBlockCellValues(const Block block) {
468 vector<int> scores(WORD_SIZE);
469 int score = block.score;
470 Word mask = HIGH_BIT_MASK;
471 for (int i = 0; i < WORD_SIZE - 1; i++) {
472 scores[i] = score;
473 if (block.P & mask) score--;
474 if (block.M & mask) score++;
475 mask >>= 1;
476 }
477 scores[WORD_SIZE - 1] = score;
478 return scores;
479}
480
481/**
482 * Writes values of cells in block into given array, starting with first/top cell.

Callers 3

allBlockCellsLargerFunction · 0.85
myersCalcEditDistanceNWFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected