Lines Matching defs:afterLength
32 const int afterLength = policy->getString1Length();
33 float dp[(beforeLength + 1) * (afterLength + 1)];
35 dp[(afterLength + 1) * i] = i * policy->getInsertionCost(i - 1, -1);
37 for (int i = 0; i <= afterLength; ++i) {
42 for (int j = 0; j < afterLength; ++j) {
43 dp[(afterLength + 1) * (i + 1) + (j + 1)] = std::min(
44 dp[(afterLength + 1) * i + (j + 1)] + policy->getInsertionCost(i, j),
46 dp[(afterLength + 1) * (i + 1) + j] + policy->getDeletionCost(i, j),
47 dp[(afterLength + 1) * i + j] + policy->getSubstitutionCost(i, j)));
49 dp[(afterLength + 1) * (i + 1) + (j + 1)] = std::min(
50 dp[(afterLength + 1) * (i + 1) + (j + 1)],
51 dp[(afterLength + 1) * (i - 1) + (j - 1)]
57 AKLOGI("IN = %d, OUT = %d", beforeLength, afterLength);
59 for (int j = 0; j < afterLength + 1; ++j) {
60 AKLOGI("EDIT[%d][%d], %f", i, j, dp[(afterLength + 1) * i + j]);
64 return dp[(beforeLength + 1) * (afterLength + 1) - 1];