417 | | } |
| 417 | ivec unique_complement (const ivec &in, const ivec &base) |
| 418 | { |
| 419 | // almost a copy of unique |
| 420 | ivec uniq (0); |
| 421 | int j = 0; |
| 422 | bool found = false; |
| 423 | for (int i = 0;i < in.length(); i++) { |
| 424 | found = false; |
| 425 | j = 0; |
| 426 | while ( (!found) && (j < uniq.length())) { |
| 427 | if (in (i) == uniq (j)) found = true; |
| 428 | j++; |
| 429 | } |
| 430 | j=0; |
| 431 | while ( (!found) && (j < base.length())) { |
| 432 | if (in (i) == uniq (j)) found = true; |
| 433 | j++; |
| 434 | } |
| 435 | if (!found) uniq = concat (uniq, in (i)); |
| 436 | } |
| 437 | return uniq; |
| 438 | } |
| 439 | |
| 440 | } |