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

◆ alg1_min_prime_generator()

void MinimalPrimes::alg1_min_prime_generator ( int * which,
int depth )
private

Definition at line 111 of file monideal-minprimes.cpp.

120{
121 for (;;)
122 {
123 if (*which == 0)
124 {
125 alg1_grab_prime(depth);
126 return;
127 }
128 switch (alg1_reduce_exp(which + 1, exp))
129 {
130 case 0:
131 which = which + *which;
132 break;
133 case -1:
134 return;
135 case 1:
136 if (depth > depth_limit)
137 {
138 int *m = which + 1;
139 while (*m != 0)
140 {
141 int v = *m;
142 if (exp[v] == 0)
143 {
144 exp[v] = 1;
145 alg1_min_prime_generator(which + *which, depth - 1);
146 exp[v] = depth;
147 }
148 m++;
149 }
150 // This code sets the 'exp' array back to the way it was
151 m = which + 1;
152 while (*m != 0)
153 {
154 int v = *m;
155 if (exp[v] == depth) exp[v] = 0;
156 m++;
157 }
158 }
159 return;
160 }
161 }
162}
void alg1_grab_prime(int depth)
void alg1_min_prime_generator(int *which, int depth)
static int alg1_reduce_exp(const int *m, const int *exp)

References alg1_grab_prime(), alg1_min_prime_generator(), alg1_reduce_exp(), depth_limit, and exp.

Referenced by alg1_min_prime_generator(), and alg1_min_primes().