DegreePattern provides a functionality to create, intersect and refine degree patterns.
More...
#include "factory/DegreePattern.h"
DegreePattern provides a functionality to create, intersect and refine degree patterns.
Definition at line 31 of file DegreePattern.h.
◆ DegreePattern() [1/3]
DegreePattern::DegreePattern |
( |
| ) |
|
|
inline |
default constructor
Definition at line 117 of file DegreePattern.h.
117:
m_data(
new Pattern() ){}
struct DegreePattern::Pattern * m_data
◆ DegreePattern() [2/3]
copy constructor
- Parameters
-
[in] | degPat | some degree pattern |
Definition at line 120 of file DegreePattern.h.
122 {
125 };
#define ASSERT(expression, message)
int m_refCounter
reference counter
◆ DegreePattern() [3/3]
construct a degree pattern from a list of (univariate) polys
- Parameters
-
[in] | l | some list of (univariate) polys |
Definition at line 24 of file DegreePattern.cc.
25{
27
30 else
31 {
32
35 int d= 0;
36 char cGFName= 'Z';
38 {
41 }
45 for (
int i= 0;
i <
l.length();
i++,
k++)
47
50 ;
51
52 ASSERT (
j > 1,
"j > 1 expected" );
53
55
59
60 if (d > 1)
62 else
64 }
65}
#define GaloisFieldDomain
class to iterate through CanonicalForm's
int getLength() const
getter
factory's class for variables
int status int void * buf
◆ ~DegreePattern()
DegreePattern::~DegreePattern |
( |
| ) |
|
|
inline |
destructor
Definition at line 148 of file DegreePattern.h.
149 {
153 }
void release()
clear m_data
◆ find()
int DegreePattern::find |
( |
const int |
x | ) |
const |
|
inline |
find an element x
- Returns
- find returns the index + 1 of x, if x is an element of the degree pattern, 0 otherwise
- Parameters
-
Definition at line 159 of file DegreePattern.h.
161 {
164 if ((*
this)[
i] ==
x)
return i + 1;
165 return 0;
166 };
◆ getLength()
int DegreePattern::getLength |
( |
| ) |
const |
|
inline |
getter
- Returns
- getLength returns the length of the degree pattern
Definition at line 86 of file DegreePattern.h.
87 {
90 }
int m_length
length of m_pattern
◆ getPattern()
int * DegreePattern::getPattern |
( |
| ) |
const |
|
inlineprivate |
getter
- Returns
- getPattern returns a degree pattern
Definition at line 74 of file DegreePattern.h.
75 {
79 }
int * m_pattern
some array containing the degree pattern
◆ init()
void DegreePattern::init |
( |
int |
n | ) |
|
|
inlineprivate |
◆ intersect()
intersect two degree patterns
- Parameters
-
[in] | degPat | some degree pattern |
Definition at line 68 of file DegreePattern.cc.
69{
71 {
73 *this= degPat;
75 }
76
81 {
82 if (degPat.
find ((*
this)[
i]))
83 {
86 }
87 else
89 }
91
95 {
97 {
100 }
101 }
103}
DegreePattern provides a functionality to create, intersect and refine degree patterns.
int find(const int x) const
find an element x
void intersect(const DegreePattern °Pat)
intersect two degree patterns
void init(int n)
initialise a DegreePattern
template CanonicalForm tmin(const CanonicalForm &, const CanonicalForm &)
static BOOLEAN length(leftv result, leftv arg)
int status int void size_t count
◆ operator=()
assignment
- Parameters
-
[in] | degPat | some degree pattern |
Definition at line 132 of file DegreePattern.h.
135 {
139 {
142 }
143
144 return *this;
145 }
◆ operator[]() [1/2]
int & DegreePattern::operator[] |
( |
const int |
index | ) |
|
|
inline |
operator []
- Returns
- operator[] sets the element at index
- Parameters
-
Definition at line 107 of file DegreePattern.h.
109 {
114 }
int * getPattern() const
getter
static int index(p_Length length, p_Ord ord)
◆ operator[]() [2/2]
int DegreePattern::operator[] |
( |
const int |
index | ) |
const |
|
inline |
operator []
- Returns
- operator[] returns the element at index
- Parameters
-
Definition at line 95 of file DegreePattern.h.
◆ refine()
void DegreePattern::refine |
( |
| ) |
|
Refine a degree pattern. Assumes that (*this)[0]:= d is the degree of the poly to be factored. Now for every other entry a there should be some entry b such that a+b= d. Elements which do not satisfy this relation are removed.
Definition at line 105 of file DegreePattern.cc.
106{
108 return;
111 int d= (*this) [0];
112 int pos;
116 {
117 pos= (*this).find (d - (*
this)[
i]);
118 if (pos)
119 {
122 }
123 }
127 {
129 return;
130 }
132
137 {
139 {
142 }
143 }
144
146 return;
147}
◆ release()
void DegreePattern::release |
( |
| ) |
|
|
inlineprivate |
◆ m_data
The documentation for this class was generated from the following files: