MCPcopy Create free account
hub / github.com/Singular/Singular / sparseHeuristic

Function sparseHeuristic

factory/facSparseHensel.cc:159–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159CFList
160sparseHeuristic (const CanonicalForm& A, const CFList& biFactors,
161 CFList*& moreBiFactors, const CFList& evaluation,
162 int minFactorsLength)
163{
164 int j= A.level() - 1;
165 int i;
166
167 //initialize storage
168 CFArray *** storeFactors= new CFArray** [j];
169 for (i= 0; i < j; i++)
170 storeFactors [i]= new CFArray* [2];
171
172 CFArray eval= CFArray (j);
173 i= j - 1;
174 for (CFListIterator iter= evaluation; iter.hasItem(); iter++,i--)
175 eval[i]= iter.getItem();
176 storeFactors [0] [0]= new CFArray [minFactorsLength];
177 storeFactors [0] [1]= new CFArray [minFactorsLength];
178 for (i= 1; i < j; i++)
179 {
180 storeFactors[i] [0]= new CFArray [minFactorsLength];
181 storeFactors[i] [1]= new CFArray [minFactorsLength];
182 }
183 //
184
185 CFList * normalizingFactors= new CFList [j];
186 CFList uniFactors;
187 normalizingFactors [0]= findNormalizingFactor1 (biFactors,
188 evaluation.getLast(), uniFactors);
189 for (i= j - 1; i > 0; i--)
190 {
191 if (moreBiFactors[i-1].length() != minFactorsLength)
192 {
193 moreBiFactors[i-1]=
194 recombination (moreBiFactors [i-1], uniFactors, 1,
195 moreBiFactors[i-1].length()-uniFactors.length()+1,
196 eval[i], Variable (i + 2)
197 );
198 }
199 normalizingFactors [i]= findNormalizingFactor2 (moreBiFactors [i - 1],
200 eval[i], uniFactors);
201 }
202
203 CFList tmp;
204 tmp= normalize (biFactors, normalizingFactors[0]);
205 getTerms2 (tmp, storeFactors [0] [0]);
206 storeFactors [0] [1]= evaluate (storeFactors [0] [0], minFactorsLength,
207 evaluation.getLast(), Variable (2));
208 for (i= j - 1; i > 0; i--)
209 {
210 tmp= normalize (moreBiFactors [i-1], normalizingFactors [i]);
211 getTerms2 (tmp, storeFactors [i] [0]);
212 storeFactors [i] [1]= evaluate (storeFactors [i] [0], minFactorsLength,
213 eval[i], Variable (i + 2));
214 }
215
216

Callers 3

multiFactorizeFunction · 0.85
absFactorizeMainFunction · 0.85
multiFactorizeFunction · 0.85

Calls 15

findNormalizingFactor1Function · 0.85
recombinationFunction · 0.85
VariableFunction · 0.85
findNormalizingFactor2Function · 0.85
getTerms2Function · 0.85
degreeFunction · 0.85
searchFunction · 0.85
patchFunction · 0.85
fdividesFunction · 0.85
hasItemMethod · 0.80
normalizeFunction · 0.70
evaluateFunction · 0.70

Tested by

no test coverage detected