Bayeux  3.4.1
Core Foundation library for SuperNEMO
permutation.h
Go to the documentation of this file.
1 /* Author(s): Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2009-10-02
4  * Last modified: 2013-04-23
5  *
6  * License:
7  *
8  *
9  * Description:
10  *
11  * Interface for GSL permutation
12  *
13  * History:
14  *
15  */
16 
17 #ifndef MYGSL_PERMUTATION_H
18 #define MYGSL_PERMUTATION_H 1
19 
20 // Standard library:
21 #include <iostream>
22 #include <string>
23 
24 namespace mygsl {
25  class permutation {
26  public:
27  permutation();
28  permutation(size_t sz_);
29  permutation(const permutation& p_);
30 
31  virtual ~permutation();
32 
33  permutation& operator=(const permutation& p_);
34 
36 
38 
39  const size_t* data() const;
40 
41  size_t get(size_t i_) const;
42 
43  size_t inversions() const;
44 
45  size_t linear_cycles() const;
46 
47  size_t canonical_cycles() const;
48 
49  void swap(size_t i_, size_t j_);
50 
51  bool is_initialized() const;
52 
53  bool is_valid() const;
54 
55  size_t size() const;
56 
57  void reset();
58 
59  void init(size_t sz_);
60 
61  void reverse ();
62 
63  bool inverse(permutation& p_);
64 
66 
68 
69  bool next();
70 
71  bool previous();
72 
73  void print(std::ostream & out_, bool eol_ = false) const;
74 
75  friend std::ostream& operator<<(std::ostream& out_, const permutation& p_);
76  friend std::istream& operator>>(std::istream& in_, permutation& p_);
77 
78  private:
79  bool _check_() const;
80  //void _check_throw_(size_t i_, const std::string& where_) const;
81 
82  private:
83  struct permutation_impl;
84  permutation_impl *pImpl;
85  };
86 
87 } // end of namespace mygsl
88 
89 #endif // MYGSL_PERMUTATION_H
90 
91 /* Local Variables: */
92 /* mode: c++ */
93 /* coding: utf-8 */
94 /* End: */
size_t linear_cycles() const
Definition: permutation.h:25
void init(size_t sz_)
void print(std::ostream &out_, bool eol_=false) const
friend std::istream & operator>>(std::istream &in_, permutation &p_)
permutation & operator=(const permutation &p_)
bool is_initialized() const
bool canonical_to_linear(permutation &p_)
virtual ~permutation()
friend std::ostream & operator<<(std::ostream &out_, const permutation &p_)
bool inverse(permutation &p_)
bool linear_to_canonical(permutation &p_)
permutation & operator++()
Top-level namespace of the Bayeux/mygsl module library.
Definition: base_decay_driver.h:47
permutation & operator--()
void swap(size_t i_, size_t j_)
bool is_valid() const
size_t size() const
size_t inversions() const
size_t canonical_cycles() const
const size_t * data() const
size_t get(size_t i_) const