#include "qrMatrix.h" // Constructor qrMatrix::qrMatrix(Alignment *aln) { //printf(" entering qrMatrix(Alignment aln)\n"); int tempIndex = 0; cMi = aln->maximumSequenceLength; cMj = 4; cMk = aln->nSequences; coordMatrix = new float**[cMi]; for (int i=0; isequences[k].isGap[i]) { coordMatrix[i][j][k] = 1.0; // THIS SHOULD BE NORMED } else { coordMatrix[i][j][k] = 0.0; } } else if (aln->sequences[k].isGap[i]) { coordMatrix[i][j][k] = 0.0; } else { //printf(" here1\n"); tempIndex = aln->sequences[k].residuesIndexToResiduesWithoutGapsIndex[i]; //printf(" here2\n"); coordMatrix[i][j][k] = aln->sequences[k].structure.caCoordinates[tempIndex][j]; //printf(" here3\n"); } } } } columnList = new int[cMk]; for (int k=0; k= 0) ? 1.0 : -1.0; alpha = -sign * sqrt(alpha); hhVector = new float[cMi]; for (i=0; i maxNorm) { maxCol = k; maxNorm = norms[k]; } } delete norms; //printf("frontCol: %d\n",frontCol); //printf("maxCol: %d\n",maxCol); int tempMaxCol = columnList[maxCol]; int tempFrontCol = columnList[frontCol]; //printf(" tempFrontCol: %d\n",tempFrontCol); //printf(" tempMaxCol: %d\n",tempMaxCol); columnList[frontCol] = tempMaxCol; columnList[maxCol] = tempFrontCol; //printColumns(); return 0; } // frobeniusNormSeq // Get the frobenius norm for the matrix corresponding // to the data for one sequence // frobeniusNorm(A) = sqrt( sum( all Aij ) ); float qrMatrix::frobeniusNormSeq(int k, int currentRow) { float fNorm = 0; for (int i=currentRow; i