Advertisement
Guest User

Untitled

a guest
May 4th, 2022
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. //my idea is to get "half" a matrix
  2. std::vector<std::vector<bool>> fillingTable;
  3.     int count = 1;
  4.     for (int i = 0; i < states.size(); i++) {
  5.         std::vector<bool> temp(count);
  6.         fillingTable[i].resize(count);
  7.         for (int j = 0; j < count; j++) {
  8.             if (i == j) {
  9.                 temp[j] = true;
  10.             }
  11.             else if (isFinalState(states[i]) && !isFinalState(states[j])) {
  12.                 temp[j] = true;
  13.             }
  14.             else if (!isFinalState(states[i]) && isFinalState(states[j])) {
  15.                 temp[j] = true;
  16.                
  17.             }
  18.             else {
  19.                 temp[j] = false;
  20.             }
  21.            
  22.         }
  23.         fillingTable[i]=temp;
  24.         count++;
  25.        
  26.     }
  27.     for (int i = 0; i < states.size(); i++) {
  28.         for (int j = 0; j < states[i].size(); j++) {
  29.             std::cout << fillingTable[i][j] << " " << std::flush;
  30.         }
  31.         std::cout << std::endl;
  32.     }
  33.     std::cout << "-------------------------------------------" << std::endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement