Changeset 601
- Timestamp:
- 08/28/16 15:19:57 (8 years ago)
- Location:
- cpp/frams
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/_demos/simil_test.cpp
r459 r601 47 47 int nResult = 0; // a temporary result 48 48 49 if (argc < 6)49 if (argc < 7) 50 50 { 51 51 // too few parameters 52 52 printf("Too few parameters!\n"); 53 printf("Command line: [-names] <genotypesFile> <w_dP> <w_dDEG> <w_dNEU> <w_dGEO> \n\n");53 printf("Command line: [-names] <genotypesFile> <w_dP> <w_dDEG> <w_dNEU> <w_dGEO> <isZfixed>\n\n"); 54 54 printf("Parameters:\n"); 55 55 printf(" <genotypesFile> name of a file with genotypes\n"); … … 58 58 printf(" <w_dNEU> weight of the difference in neurons of matched parts\n"); 59 59 printf(" <w_dGEO> weight of the distance of matched parts\n\n"); 60 printf(" <isZFixed> should z cooridante be fixed during the alignment\n"); 60 61 printf("Switches:\n"); 61 62 printf(" -names specifies that the number and names of genotypes are to be printed to output\n"); … … 120 121 } 121 122 123 iCurrParam++; 124 szCurrParam = argv[ iCurrParam ]; 125 nResult = sscanf(szCurrParam, " %d", & M.zFixed); 126 if (nResult != 1) 127 { 128 // <isZFixed> is not a number -- error 129 printf("<isZFixed> should be a number\n"); 130 return -1; 131 } 132 else if (M.zFixed != 0 && M.zFixed !=1) 133 { 134 printf("<isZFixed>=%d. <isZFixed> should be equal to 0 or 1\n", M.zFixed); 135 return -1; 136 } 137 122 138 // read the input file 123 139 // prepare loading of genotypes from a .gen file -
cpp/frams/model/similarity/simil_model.cpp
r492 r601 1997 1997 // get the position of the Part 1998 1998 P1Pos = P1->p; 1999 if (zFixed == 1) 2000 { 2001 P1Pos.z = 0; 2002 } 1999 2003 for (iP2 = 0; iP2 < pModel->getPartCount(); iP2++) 2000 2004 { … … 2003 2007 // get the position of the Part 2004 2008 P2Pos = P2->p; 2009 if (zFixed == 1) 2010 { 2011 P2Pos.z = 0; 2012 } 2005 2013 // compute the geometric (Euclidean) distance between the Parts 2006 2014 dDistance = P1Pos.distanceTo(P2Pos); … … 2011 2019 2012 2020 MatrixTools::SVD(vEigenvalues, nSize, pDistances, m_aPositions[ iMod ]); 2021 if (zFixed == 1) 2022 { 2023 for (int coord = 0; coord < pModel->getPartCount(); coord++) 2024 { 2025 m_aPositions[ iMod ][coord].z = pModel->getPart(coord)->p.z; 2026 } 2027 } 2028 2013 2029 free(pDistances); 2014 2030 } -
cpp/frams/model/similarity/simil_model.h
r357 r601 85 85 int fuzzyDepth; 86 86 int isFuzzy; 87 //for Zfixed = 1 z coordinates are not taken into account during PCA alignment 88 int zFixed; 87 89 88 90 /// Interface to local parameters
Note: See TracChangeset
for help on using the changeset viewer.