Changeset 1044 for cpp/frams/model
- Timestamp:
- 12/10/20 22:33:22 (4 years ago)
- Location:
- cpp/frams/model/similarity
- Files:
-
- 13 added
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/model/similarity/simil-match.cpp
r1043 r1044 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-20 19Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2020 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 5 5 #include <assert.h> 6 6 #include <stdio.h> 7 #include "simil _match.h"7 #include "simil-match.h" 8 8 9 9 /** Creates an empty matching for two objects of specified size. … … 63 63 @return Size of the object (in elements). 64 64 */ 65 int SimilMatching:: GetObjectSize(int Obj)65 int SimilMatching::getObjectSize(int Obj) 66 66 { 67 67 // check parameter … … 81 81 82 82 */ 83 void SimilMatching:: Match(int Obj0, int Index0, int Obj1, int Index1)83 void SimilMatching::match(int Obj0, int Index0, int Obj1, int Index1) 84 84 { 85 85 // check parameters of object 0 … … 103 103 @return true if the given element is matched, false otherwise. 104 104 */ 105 bool SimilMatching:: IsMatched(int Obj, int Index)105 bool SimilMatching::isMatched(int Obj, int Index) 106 106 { 107 107 // check parameters … … 128 128 (check IsMatched() before using GetMatchedIndex()). 129 129 */ 130 int SimilMatching:: GetMatchedIndex(int Obj, int Index)130 int SimilMatching::getMatchedIndex(int Obj, int Index) 131 131 { 132 132 // check parameters … … 142 142 @return true if matching is full, false otherwise. 143 143 */ 144 bool SimilMatching:: IsFull()144 bool SimilMatching::isFull() 145 145 { 146 146 // assume that the matching is full … … 177 177 @return true if matching is empty, otherwise - false. 178 178 */ 179 bool SimilMatching:: IsEmpty()179 bool SimilMatching::isEmpty() 180 180 { 181 181 // result - assume that matching is empty … … 201 201 /** Makes the matching completely empty. After a call to this method IsEmpty() should return true. 202 202 */ 203 void SimilMatching:: Empty()203 void SimilMatching::empty() 204 204 { 205 205 for (int iObj = 0; iObj < 2; iObj++) // a counter of objects … … 215 215 216 216 // the exit condition 217 assert( IsEmpty() == true);217 assert(isEmpty() == true); 218 218 } 219 219 220 220 /** Prints the current state of the matching 221 221 */ 222 void SimilMatching:: PrintMatching()222 void SimilMatching::printMatching() 223 223 { 224 224 int nBigger; … … 249 249 for (unsigned int i = 0; i < m_apvMatched[nObj]->size(); i++) 250 250 { 251 if ( IsMatched(nObj, i))251 if (isMatched(nObj, i)) 252 252 { 253 253 // if the element is matched - print the index 254 printf("%2d ", GetMatchedIndex(nObj, i));254 printf("%2d ", getMatchedIndex(nObj, i)); 255 255 } 256 256 else -
cpp/frams/model/similarity/simil-match.h
r1043 r1044 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-20 19Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2020 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 26 26 SimilMatching(const SimilMatching &Source); 27 27 ~SimilMatching(); 28 int GetObjectSize(int Obj);29 void Match(int Obj0, int Index0, int Obj1, int Index1);30 bool IsMatched(int Obj, int Index);31 int GetMatchedIndex(int Obj, int index);32 bool IsFull();33 bool IsEmpty();34 void Empty();35 void PrintMatching();28 int getObjectSize(int Obj); 29 void match(int Obj0, int Index0, int Obj1, int Index1); 30 bool isMatched(int Obj, int Index); 31 int getMatchedIndex(int Obj, int index); 32 bool isFull(); 33 bool isEmpty(); 34 void empty(); 35 void printMatching(); 36 36 }; 37 37
Note: See TracChangeset
for help on using the changeset viewer.