1 #ifndef BLISS_UTILS_HH
2 #define BLISS_UTILS_HH
3 
4 /*
5   Copyright (c) 2003-2021 Tommi Junttila
6   Released under the GNU Lesser General Public License version 3.
7 
8   This file is part of bliss.
9 
10   bliss is free software: you can redistribute it and/or modify
11   it under the terms of the GNU Lesser General Public License as published by
12   the Free Software Foundation, version 3 of the License.
13 
14   bliss is distributed in the hope that it will be useful,
15   but WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   GNU Lesser General Public License for more details.
18 
19   You should have received a copy of the GNU Lesser General Public License
20   along with bliss.  If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 /**
24  * \file
25  * \brief Some small utilities.
26  */
27 
28 #include <vector>
29 
30 namespace bliss {
31 
32 /**
33  * Check whether \a perm is a valid permutation on {0,...,N-1}.
34  * Slow, mainly for debugging and validation purposes.
35  */
36 bool is_permutation(const unsigned int N, const unsigned int* perm);
37 
38 /**
39  * Check whether \a perm is a valid permutation on {0,...,N-1}.
40  * Slow, mainly for debugging and validation purposes.
41  */
42 bool is_permutation(const std::vector<unsigned int>& perm);
43 
44 } // namespace bliss
45 
46 #endif // BLISS_UTILS_HH
47