permlib
0.2.8
Library for permutation computations
Main Page
Classes
Files
File List
All
Classes
Functions
Variables
Typedefs
Enumerations
Friends
include
permlib
bsgs_core.h
1
// ---------------------------------------------------------------------------
2
//
3
// This file is part of PermLib.
4
//
5
// Copyright (c) 2009-2011 Thomas Rehn <thomas@carmen76.de>
6
// All rights reserved.
7
//
8
// Redistribution and use in source and binary forms, with or without
9
// modification, are permitted provided that the following conditions
10
// are met:
11
// 1. Redistributions of source code must retain the above copyright
12
// notice, this list of conditions and the following disclaimer.
13
// 2. Redistributions in binary form must reproduce the above copyright
14
// notice, this list of conditions and the following disclaimer in the
15
// documentation and/or other materials provided with the distribution.
16
// 3. The name of the author may not be used to endorse or promote products
17
// derived from this software without specific prior written permission.
18
//
19
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22
// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24
// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
//
30
// ---------------------------------------------------------------------------
31
32
#include <list>
33
#include <vector>
34
35
#ifndef BSGSCORE_H_
36
#define BSGSCORE_H_
37
38
namespace
permlib {
39
41
template
<
class
PERM,
class
TRANS>
42
struct
BSGSCore
{
43
public
:
45
typedef
PERM
PERMtype
;
47
typedef
TRANS
TRANStype
;
48
49
typedef
std::list<typename PERM::ptr> PERMlist;
50
52
virtual
~BSGSCore
() {}
53
55
std::vector<dom_int>
B
;
57
PERMlist
S
;
59
std::vector<TRANS>
U
;
61
dom_int
n
;
62
64
67
virtual
bool
operator==
(
const
BSGSCore<PERM,TRANS>
& bsgs)
const
;
68
70
virtual
bool
isSymmetricGroup
()
const
{
return
false
; }
71
protected
:
73
explicit
BSGSCore
(
unsigned
int
id
) :
m_id
(id) {}
75
BSGSCore
(
unsigned
int
id
, dom_int n_, dom_int bSize) :
B
(bSize),
n
(n_),
m_id
(id) {}
77
BSGSCore
(
unsigned
int
id
,
const
std::vector<dom_int>& B_,
const
std::vector<TRANS>& U_, dom_int n_)
78
:
B
(B_),
U
(U_.size(), TRANS(n_)),
n
(n_),
m_id
(id) {}
79
81
int
m_id
;
82
private
:
84
BSGSCore
(
const
BSGSCore<PERM,TRANS>
& copy) {}
86
BSGSCore
& operator=(
const
BSGSCore<PERM,TRANS>
& copy) {}
87
};
88
89
template
<
class
PERM,
class
TRANS>
90
bool
BSGSCore<PERM, TRANS>::operator==
(
const
BSGSCore<PERM,TRANS>
& bsgs)
const
{
91
return
bsgs.
m_id
== this->m_id;
92
}
93
94
}
95
96
#endif // BSGSCORE_H_
97
Generated on Wed Dec 5 2012 18:12:42 for permlib by
1.8.1.1