Skip to content

Commit

Permalink
missing function
Browse files Browse the repository at this point in the history
  • Loading branch information
msuchard committed Sep 25, 2023
1 parent 036828f commit eb2a370
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,25 @@ public static double[] getQQPlus(double[] eigenVectors, double[] inverseEigenVec
return result;
}

public static double[] getQPlusQ(double[] eigenVectors, double[] inverseEigenVectors, int index, int stateCount) {

double[] result = new double[stateCount * stateCount];

for (int i = 0; i < stateCount; ++i) {
for (int j = 0; j < stateCount; ++j) {
double sum = 0.0;
for (int k = 0; k < stateCount; ++k) {
if (k != index) {
sum += inverseEigenVectors[i * stateCount + k] * eigenVectors[k * stateCount + j];
}
}
result[i * stateCount + j] = sum;
}
}

return result;
}

private static int index12(int i, int j, int stateCount) {
return i * stateCount + j;
}
Expand Down

0 comments on commit eb2a370

Please sign in to comment.