Changeset 973 for cpp/frams/_demos
- Timestamp:
- 07/03/20 00:37:13 (5 years ago)
- Location:
- cpp/frams/_demos
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified cpp/frams/_demos/genooper_test.cpp ¶
r955 r973 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-20 15Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2020 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 9 9 { 10 10 printf("Genotype: %s\nFormat: %s\nValid: %s\nComment: %s\n", 11 g.getGenes().c_str(), g.getFormat().c_str(), g.isValid() ? "yes" : "no", g.getComment().len() == 0 ? "(empty)" : g.getComment().c_str());11 g.getGenes().c_str(), g.getFormat().c_str(), g.isValid() ? "yes" : "no", g.getComment().length() == 0 ? "(empty)" : g.getComment().c_str()); 12 12 } 13 13 -
TabularUnified cpp/frams/_demos/loader_test_geno.cpp ¶
r732 r973 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-20 15Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2020 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 20 20 "If a genotype is indicated (by providing the optional genotype identifier), the program will output the raw genotype, suitable for Framsticks Theater's genotype viewer mode. If a genotype and a field name is given, the field value (instead of the raw genotype) is printed. If the second argument is not given, the genotype names from the file will be listed.\n" 21 21 "Example: loader_test walking.gen \"Basic Quadruped\" | theater -g -\n" 22 22 ); 23 23 return 1; 24 24 } … … 29 29 const char* selected = (argc < 3) ? NULL : argv[2]; 30 30 const char* field_name = (argc < 4) ? NULL : argv[3]; 31 int selected_index = (selected &&isdigit(selected[0])) ? atol(selected) : 0;31 int selected_index = (selected && isdigit(selected[0])) ? atol(selected) : 0; 32 32 // using char* constructor (passing the file name to open) 33 33 GenotypeMini *loaded; … … 36 36 // loaded into MiniGenotype object 37 37 count++; 38 totalsize += loaded->genotype.len ();38 totalsize += loaded->genotype.length(); 39 39 if (selected) 40 40 { … … 65 65 return 0; 66 66 } 67 fprintf(stderr, "%d. %s\t(%d characters)\n", count, loaded->name.c_str(), loaded->genotype.len ());67 fprintf(stderr, "%d. %s\t(%d characters)\n", count, loaded->name.c_str(), loaded->genotype.length()); 68 68 } 69 69 // the loop repeats until loaded==NULL, which could be beacause of error -
TabularUnified cpp/frams/_demos/paramtree_stdin_test.cpp ¶
r744 r973 45 45 while (group_names.getNextToken(pos, line, '\n')) 46 46 { 47 if ((line.len () > 0) && (line[line.len() - 1] == '\r')) //support for reading \r\n files...48 line = line.substr(0, line.len () - 1);49 if (line.len () > 0 && line[0] != '#') //skip empty lines and #commment lines47 if ((line.length() > 0) && (line[line.length() - 1] == '\r')) //support for reading \r\n files... 48 line = line.substr(0, line.length() - 1); 49 if (line.length() > 0 && line[0] != '#') //skip empty lines and #commment lines 50 50 param.addGroup(line.c_str()); 51 51 } -
TabularUnified cpp/frams/_demos/printconvmap.cpp ¶
r739 r973 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-20 18Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2020 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 48 48 return; 49 49 } 50 len1 = gen1.len ();50 len1 = gen1.length(); 51 51 SString g1 = gen1; 52 52 stripstring(g1); … … 73 73 y2 = len1; 74 74 } 75 else 75 else { 76 76 id = map.findMappingId(y); 77 77 mr = &map.getMapping(id)->to; … … 80 80 if ((y2 - y) > left_column_padding) y2 = y + left_column_padding; 81 81 if (y2 > (y + len1)) y2 = y + len1; 82 printmapping(g + y, y2 - y, *mr, g2.c_str(), g2.len (), left_column_padding);82 printmapping(g + y, y2 - y, *mr, g2.c_str(), g2.length(), left_column_padding); 83 83 y = y2; 84 84 } -
TabularUnified cpp/frams/_demos/simil_test.cpp ¶
r895 r973 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-20 16Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2020 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 78 78 M.m_adFactors[i] = -1.0; 79 79 } 80 80 81 81 iCurrParam++; 82 82 szCurrParam = argv[iCurrParam]; 83 int measure_type = -1; 83 int measure_type = -1; 84 84 nResult = sscanf(szCurrParam, "%d", &measure_type); 85 85 if (nResult != 1) … … 88 88 return -1; 89 89 } 90 90 91 91 if (measure_type != 0 && measure_type != 1) 92 92 { 93 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 94 return -1; 95 } 96 97 97 M.matching_method = measure_type; 98 98 … … 150 150 // while a valid genotype was loaded 151 151 count++; 152 totalsize += loaded->genotype.len ();152 totalsize += loaded->genotype.length(); 153 153 // create a Geno object based on the MiniGenotype 154 154 Geno *pNextGenotype = new Geno(loaded->genotype); … … 156 156 { 157 157 pvGenos.push_back(pNextGenotype); 158 char *szNewName = new char[loaded->name.len () + 1];158 char *szNewName = new char[loaded->name.length() + 1]; 159 159 strcpy(szNewName, loaded->name.c_str()); 160 160 pvNames.push_back(szNewName);
Note: See TracChangeset
for help on using the changeset viewer.