+++ /dev/null
-#include "muscle.h"\r
-#include "distfunc.h"\r
-\r
-const float INFINITY = float(1e29);\r
-const unsigned NILL = uInsane;\r
-\r
-static float *ShortestPathEstimate;\r
-static unsigned *Predecessor;\r
-\r
-static void GetMostDistantPair(DistFunc &DF, unsigned *ptrIndex1, unsigned *ptrIndex2)\r
- {\r
- const unsigned uNodeCount = DF.GetCount();\r
- if (uNodeCount < 2)\r
- Quit("GetMostDistantPair: < 2 seqs");\r
-\r
- float MaxDist = -1; \r
- unsigned Index1 = uInsane;\r
- unsigned Index2 = uInsane;\r
- for (unsigned i = 0; i < uNodeCount; ++i)\r
- {\r
- for (unsigned j = i + 1; j < uNodeCount; ++j)\r
- {\r
- float d = DF.GetDist(i, j);\r
- if (d > MaxDist)\r
- {\r
- MaxDist = d;\r
- Index1 = i;\r
- Index2 = j;\r
- }\r
- }\r
- }\r
-\r
- assert(Index1 != uInsane);\r
- assert(Index2 != uInsane);\r
-\r
- *ptrIndex1 = Index1;\r
- *ptrIndex2 = Index2;\r
- }\r
-\r
-static void InitializeSingleSource(DistFunc &DF, unsigned uIndex)\r
- {\r
- const unsigned uNodeCount = 0;\r
-\r
- for (unsigned i = 0; i < uNodeCount; ++i)\r
- {\r
- ShortestPathEstimate[i] = INFINITY;\r
- Predecessor[i] = NILL;\r
- }\r
- ShortestPathEstimate[uIndex] = 0;\r
- }\r
-\r
-static void Relax(DistFunc &DF, unsigned u, unsigned v)\r
- {\r
- float w = DF.GetDist(u, v);\r
- float d = ShortestPathEstimate[u] + w;\r
- if (ShortestPathEstimate[v] > d)\r
- {\r
- ShortestPathEstimate[v] = d;\r
- Predecessor[v] = u;\r
- }\r
- }\r
-\r
-void ShortestPath(DistFunc &DF, unsigned uIndex)\r
- {\r
- }\r