permlib
0.2.9
Library for permutation computations
Toggle main menu visibility
Loading...
Searching...
No Matches
include
permlib
search
partition
matrix_automorphism_search.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
33
#ifndef PARTITION_MATRIX_AUTOMORPHISM_SEARCH_H_
34
#define PARTITION_MATRIX_AUTOMORPHISM_SEARCH_H_
35
36
#include <permlib/search/partition/r_base.h>
37
#include <permlib/search/partition/matrix_refinement1.h>
38
#include <permlib/search/partition/refinement_family.h>
39
#include <permlib/predicate/matrix_automorphism_predicate.h>
40
41
namespace
permlib {
42
namespace
partition {
43
45
template
<
class
BSGSIN,
class
TRANSRET>
46
class
MatrixAutomorphismSearch
:
public
RBase
<BSGSIN,TRANSRET> {
47
public
:
48
typedef
typename
RBase<BSGSIN,TRANSRET>::PERM PERM;
49
51
55
MatrixAutomorphismSearch
(
const
BSGSIN& bsgs,
unsigned
int
pruningLevelDCM);
56
58
63
template
<
class
MATRIX,
class
Iterator>
64
void
construct
(
const
MATRIX& matrix, Iterator initialPartitionBegin, Iterator initialPartitionEnd);
65
67
70
template
<
class
MATRIX>
71
void
construct
(
const
MATRIX& matrix) {
construct<MATRIX, unsigned int*>
(matrix, 0, 0); }
72
};
73
74
template
<
class
BSGSIN,
class
TRANSRET>
75
MatrixAutomorphismSearch<BSGSIN,TRANSRET>::MatrixAutomorphismSearch
(
const
BSGSIN& bsgs,
unsigned
int
pruningLevelDCM)
76
:
RBase
<BSGSIN,TRANSRET>(bsgs, pruningLevelDCM)
77
{ }
78
79
template
<
class
BSGSIN,
class
TRANSRET>
80
template
<
class
MATRIX,
class
Iterator>
81
void
MatrixAutomorphismSearch<BSGSIN,TRANSRET>::construct
(
const
MATRIX& matrix, Iterator initialPartitionBegin, Iterator initialPartitionEnd) {
82
MatrixAutomorphismPredicate<PERM,MATRIX>
* matrixPred =
new
MatrixAutomorphismPredicate<PERM,MATRIX>
(matrix);
83
84
if
(initialPartitionBegin != initialPartitionEnd) {
85
// set up partitions such that the elements of initialPartition will be mapped onto itself
86
RBase<BSGSIN,TRANSRET>::m_partition
.intersect(initialPartitionBegin, initialPartitionEnd, 0);
87
RBase<BSGSIN,TRANSRET>::m_partition2.intersect(initialPartitionBegin, initialPartitionEnd, 0);
88
}
89
90
MatrixRefinement1<PERM,MATRIX>
matRef(
RBase<BSGSIN,TRANSRET>::m_bsgs
.n, matrix);
91
matRef.
initializeAndApply
(
RBase<BSGSIN,TRANSRET>::m_partition
);
92
PERM empty(
RBase<BSGSIN,TRANSRET>::m_bsgs
.n);
93
matRef.
apply2
(RBase<BSGSIN,TRANSRET>::m_partition2, empty);
94
95
RBase<BSGSIN,TRANSRET>::construct
(matrixPred,
96
new
MatrixAutomorphismRefinementFamily<PERM,MATRIX>
(
RBase<BSGSIN,TRANSRET>::m_bsgs
.n, matrix));
97
}
98
99
}
100
}
101
102
#endif
// -- PARTITION_MATRIX_AUTOMORPHISM_SEARCH_H_
permlib::BaseSearch::m_bsgs
BSGSIN m_bsgs
main BSGS to search in
Definition
base_search.h:91
permlib::MatrixAutomorphismPredicate
predicate for the automorphisms of a symmetric matrix
Definition
matrix_automorphism_predicate.h:45
permlib::partition::MatrixAutomorphismRefinementFamily
-refinements for symmetric matrix automorphisms
Definition
refinement_family.h:156
permlib::partition::MatrixAutomorphismSearch::construct
void construct(const MATRIX &matrix)
initializes search
Definition
matrix_automorphism_search.h:71
permlib::partition::MatrixAutomorphismSearch::construct
void construct(const MATRIX &matrix, Iterator initialPartitionBegin, Iterator initialPartitionEnd)
initializes search with inital partition
Definition
matrix_automorphism_search.h:81
permlib::partition::MatrixAutomorphismSearch::MatrixAutomorphismSearch
MatrixAutomorphismSearch(const BSGSIN &bsgs, unsigned int pruningLevelDCM)
constructor
Definition
matrix_automorphism_search.h:75
permlib::partition::MatrixRefinement1
concrete -refinement for symmetric matrix automorphisms
Definition
matrix_refinement1.h:48
permlib::partition::RBase::RBase
RBase(const BSGSIN &bsgs, unsigned int pruningLevelDCM, bool stopAfterFirstElement=false)
constructor
Definition
r_base.h:109
permlib::partition::RBase::construct
void construct(SubgroupPredicate< PERM > *pred, RefinementFamily< PERM > *predRefinement)
constructs an R-base for given predicate and refinement family
Definition
r_base.h:115
permlib::partition::RBase::m_partition
Partition m_partition
partition to base the backtrack tree on
Definition
r_base.h:80
permlib::partition::Refinement::apply2
virtual unsigned int apply2(Partition &pi, const PERM &t) const
applies (right-)refinement to pi which is the image of the original partition this refinement was ini...
Definition
refinement.h:156
permlib::partition::Refinement::initializeAndApply
bool initializeAndApply(Partition &pi)
applies (left-)refinement to partition and initializes refinement for future use in R-base
Definition
refinement.h:136
Generated on
for permlib by
1.17.0