Macaulay2 Engine
Loading...
Searching...
No Matches

◆ Pair()

Pair::Pair ( int a,
int b,
const IntermediateBasis & F )
inline

Definition at line 60 of file franzi-gb.cpp.

61 {
62 if (a < b)
63 {
64 i = a;
65 j = b;
66 }
67 else if (b < a)
68 {
69 i = b;
70 j = a;
71 }
72 else
73 {
74 throw "Invalid numbers in Pair";
75 }
76 IntermediateBasis::const_iterator end = F.end();
77 if (F.find(j) == end || (i >= 0 && F.find(i) == end))
78 { // fi or fj are not in F anymore
79 lcm = 0; // constant 1
80 good = false;
81 }
82 else
83 {
84 if (i < 0)
85 { // working with field polynomial
86 lcm = F.find(j)->second.LT();
87 good = true; // BRP::isDivisibleBy(lcm, BRP( 1 << n-(-i) ) );
88 }
89 else
90 {
91 unsigned long a = F.find(i)->second.LT();
92 unsigned long b = F.find(j)->second.LT();
93 lcm = a | b;
95 }
96 }
97 }
static bool isRelativelyPrime(const brMonomial &a, const brMonomial &b)
int i
Definition franzi-gb.cpp:55
bool good
Definition franzi-gb.cpp:57
int j
Definition franzi-gb.cpp:56
brMonomial lcm
Definition franzi-gb.cpp:58
TermIterator< Nterm > end(Nterm *)
Definition ringelem.cpp:5

References end(), good, i, BRP::isRelativelyPrime(), j, and lcm.

Referenced by operator<.