Changeset 893 for cpp/frams


Ignore:
Timestamp:
09/06/19 11:40:57 (5 years ago)
Author:
oriona
Message:

Similarity modified and expanded to include both old (greedy) and new (hungarian) measures.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/_demos/simil_test.cpp

    r732 r893  
    2828        int nResult = 0; // a temporary result
    2929
    30         if (argc < 7)
     30        if (argc < 8)
    3131        {
    3232                printf("Too few parameters!\n");
    33                 printf("Command line: [-names] <genotypesFile> <w_dP> <w_dDEG> <w_dNEU> <w_dGEO> <fixZaxis?>\n\n");
     33                printf("Command line: [-names] <genotypesFile> <measure> <w_dP> <w_dDEG> <w_dNEU> <w_dGEO> <fixZaxis?>\n\n");
    3434
    3535                printf("Parameters:\n");
    3636                printf("  <genotypesFile> name of a file with genotypes\n");
     37                printf("  <measure> similarity measure\n");
    3738                printf("  <w_dP> weight of the difference in the number of parts\n");
    3839                printf("  <w_dDEG> weight of the difference in degrees of matched parts\n");
     
    7778                M.m_adFactors[i] = -1.0;
    7879        }
     80       
     81        iCurrParam++;
     82        szCurrParam = argv[iCurrParam];
     83        int measure_type = -1;
     84        nResult = sscanf(szCurrParam, " %d ", &measure_type);
     85        if (nResult != 1)
     86        {
     87                printf("Measure type should be a number!\n");
     88                return -1;
     89        }
     90       
     91        if (measure_type != 0 && measure_type != 1)
     92        {
     93                printf("Measure type should be 0 (flexible criteria order and optimal matching) or 1 (vertex degree order and greedy matching)!\n");
     94                return -1;             
     95        }
     96       
     97        M.matching_method = measure_type;
    7998
    8099        const char *params[] = { "<w_dP>", "<w_dDEG>", "<w_dNEU>", "<w_dGEO>" };
Note: See TracChangeset for help on using the changeset viewer.