Changeset 872
- Timestamp:
- 05/04/19 23:39:39 (6 years ago)
- Location:
- cpp/frams/model/similarity
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/model/similarity/simil_model.cpp
r871 r872 75 75 //Determines whether "fuzzy vertex degree" should be used. 76 76 //Currently "fuzzy vertex degree" is inactive. 77 isFuzzy = 0;77 isFuzzy = false; 78 78 fuzzyDepth = 10; 79 79 … … 81 81 wMDS = 0; 82 82 //Determines whether best matching should be saved using hungarian similarity measure. 83 saveMatching = 0;83 saveMatching = false; 84 84 } 85 85 … … 105 105 { 106 106 logPrintf("ModelSimil", "EvaluateDistanceGreedy", LOG_ERROR, "NULL or invalid model pointer(s)"); 107 107 return 0.0; 108 108 } 109 109 … … 139 139 if ((this->*pfMatchingFunction)() == 0) 140 140 { 141 logPrintf("ModelSimil", "EvaluateDistanceGreedy", LOG_ERROR, " Matching function error");142 141 logPrintf("ModelSimil", "EvaluateDistanceGreedy", LOG_ERROR, "The matching function returned 0"); 142 return 0.0; 143 143 } 144 144 … … 151 151 if (CountPartsDistance() == 0) 152 152 { 153 logPrintf("ModelSimil", "EvaluateDistanceGreedy", LOG_ERROR, "CountPartDistance() error");154 153 logPrintf("ModelSimil", "EvaluateDistanceGreedy", LOG_ERROR, "CountPartDistance()==0"); 154 return 0.0; 155 155 } 156 156 … … 562 562 } 563 563 564 if (m_aDegrees[i] != NULL && ( isFuzzy != 1|| (m_Neighbours[i] != NULL && m_fuzzyNeighb[i] != NULL)))564 if (m_aDegrees[i] != NULL && ((!isFuzzy) || (m_Neighbours[i] != NULL && m_fuzzyNeighb[i] != NULL))) 565 565 { 566 566 // wypelnij tablice zgodnie z sensem TDN[0] - orginalny index … … 600 600 else 601 601 { 602 logPrintf("ModelSimil", " EvaluateDistanceGreedy", LOG_ERROR, "Memory error");603 602 logPrintf("ModelSimil", "CreatePartInfoTables", LOG_ERROR, "Not enough memory?"); 603 return 0; 604 604 } 605 605 // utworz tablice dla pozycji 3D Parts (wielkosc tablicy: liczba Parts organizmu) … … 931 931 int i; 932 932 int(*pfDegreeFunction) (const void*, const void*) = NULL; 933 pfDegreeFunction = (isFuzzy == 1)? &CompareFuzzyDegrees : &CompareDegrees;933 pfDegreeFunction = isFuzzy ? &CompareFuzzyDegrees : &CompareDegrees; 934 934 // sortowanie obu tablic wg stopni punktów - TDN[1] 935 935 for (i = 0; i < 2; i++) … … 943 943 // sprawdzenie wartosci parametru 944 944 DB(i = sizeof(TDN);) 945 int degreeType = (isFuzzy == 1)? FUZZ_DEG : DEGREE;945 int degreeType = isFuzzy ? FUZZ_DEG : DEGREE; 946 946 947 947 // sortowanie obu tablic m_aDegrees wedlug liczby neuronów i … … 2079 2079 { 2080 2080 logPrintf("ModelSimil", "EvaluateDistanceHungarian", LOG_ERROR, "NULL genotype pointer(s)"); 2081 2081 return 0.0; 2082 2082 } 2083 2083 // create models of objects to compare … … 2089 2089 { 2090 2090 logPrintf("ModelSimil", "EvaluateDistanceHungarian", LOG_ERROR, "NULL or invalid model pointer(s)"); 2091 2091 return 0.0; 2092 2092 } 2093 2093 … … 2165 2165 { 2166 2166 dMinSimValue = dCurrentSim; 2167 if (saveMatching == 1)2167 if (saveMatching) 2168 2168 { 2169 2169 minAssignment.clear(); … … 2174 2174 2175 2175 dResult = dMinSimValue; 2176 if (saveMatching == 1)2176 if (saveMatching) 2177 2177 std::copy(minAssignment.begin(), minAssignment.end(), assignment); 2178 2178 } -
cpp/frams/model/similarity/simil_model.h
r870 r872 77 77 /// Currently selected matching algorithm. Allowed values: 0 (more exact, slower), 1 (more greedy, faster). Details in https://doi.org/10.1007/978-3-030-16692-2_8 78 78 /// @sa EvaluateDistance 79 int matching_method;79 paInt matching_method; 80 80 81 81 /// Table of weights for weighted distance function. … … 89 89 90 90 //for Zfixed = 1, the "z" (vertical) coordinates are not taken into account during PCA alignment 91 int fixedZaxis;91 paInt fixedZaxis; 92 92 93 93 //Controls the depth of fuzzy neighbourhood 94 94 int fuzzyDepth; 95 intisFuzzy;95 bool isFuzzy; 96 96 97 97 //For wMDS = 1 weighted MDS with vertex degrees as weights is used for the alignment. 98 int wMDS;98 paInt wMDS; 99 99 100 100 //For saveMatching = 1 the best matching found will be saved. 101 intsaveMatching;101 bool saveMatching; 102 102 103 103 /// Interface to local parameters
Note: See TracChangeset
for help on using the changeset viewer.