Geogram
Version 1.9.1-rc
A programming library of geometric algorithms
|
Functions to manipulate permutations. More...
#include <geogram/basic/common.h>
#include <geogram/basic/numeric.h>
#include <geogram/basic/memory.h>
Go to the source code of this file.
Namespaces | |
GEO | |
Global Vorpaline namespace. | |
GEO::Permutation | |
Utilities for manipulating permutations. | |
Functions | |
bool | GEO::Permutation::is_valid (const vector< index_t > &permutation) |
Checks whether a vector is a valid permutation. More... | |
void | GEO::Permutation::mark (vector< index_t > &permutation, index_t i) |
Marks a permutation element as visited. More... | |
bool | GEO::Permutation::is_marked (const vector< index_t > &permutation, index_t i) |
Checks if a permutation element has been visited. More... | |
void | GEO::Permutation::unmark (vector< index_t > &permutation, index_t i) |
Unmarks a permutation element. More... | |
void | GEO::Permutation::apply (void *data, const vector< index_t > &permutation_in, index_t elemsize) |
Applies a permutation in-place. Permutes the first N elements of size elemsize in array data using permutation permutation where N is the number of elements in permutation . The result of the permutation is left in data . The array data must contain at least permutation.size() elements otherwise memory corruption will happen. More... | |
template<class T > | |
void | GEO::Permutation::apply (vector< T > &data, const vector< index_t > &permutation_in) |
Applies a permutation in-place. Permutes the first N elements of vector data using permutation permutation where N is the number of elements in permutation . The result of the permutation is left in data . The array data must contain at least permutation.size() elements otherwise the function throws an out_of_range exception. More... | |
void | GEO::Permutation::invert (vector< index_t > &permutation) |
Inverts a permutation in-place. More... | |
void | GEO::Permutation::invert (const vector< index_t > &permutation, vector< index_t > &invert) |
Inverts a permutation. More... | |
Functions to manipulate permutations.
Definition in file permutation.h.