Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //my idea is to get "half" a matrix
- std::vector<std::vector<bool>> fillingTable;
- int count = 1;
- for (int i = 0; i < states.size(); i++) {
- std::vector<bool> temp(count);
- fillingTable[i].resize(count);
- for (int j = 0; j < count; j++) {
- if (i == j) {
- temp[j] = true;
- }
- else if (isFinalState(states[i]) && !isFinalState(states[j])) {
- temp[j] = true;
- }
- else if (!isFinalState(states[i]) && isFinalState(states[j])) {
- temp[j] = true;
- }
- else {
- temp[j] = false;
- }
- }
- fillingTable[i]=temp;
- count++;
- }
- for (int i = 0; i < states.size(); i++) {
- for (int j = 0; j < states[i].size(); j++) {
- std::cout << fillingTable[i][j] << " " << std::flush;
- }
- std::cout << std::endl;
- }
- std::cout << "-------------------------------------------" << std::endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement