QECadExtension.mesa
Last Edited by: Arnon, October 8, 1986 11:38:33 am PDT
DIRECTORY
Rope,
IO,
AlgebraClasses,
BigRats,
RatIntervals,
VariableSequences,
Polynomials,
AlgebraicNumbers,
Sequences,
Formulas,
SamplePoints,
CoveringSets,
Cells;
QECadExtension: CEDAR DEFINITIONS
~ BEGIN OPEN AC: AlgebraClasses, BR: BigRats, RI: RatIntervals, AN: AlgebraicNumbers, SEQ: Sequences, POL: Polynomials, QFF: Formulas, SP: SamplePoints, CS: CoveringSets;
Extension Phase
Information to save to pass to adjacency algorithms:
E1 to E2: For each 0-cell in E1: isolating intervals (perhaps expanded to be strictly open) and corresponding algebraic basis elements over it; for each element F of integral bivariate basis, a sequence of length m of positive integers, such that F has m real roots over it, and ith element of sequence is section (or element) of overall stack which is ith real root of F.
Use this list to modify cell indices of section-section adjacencies produced by adjacency algorithms.
E2 to E3: For each 0-cell and 1-cell in E2: isolating intervals (perhaps expanded to be strictly open) and corresponding algebraic basis elements over it; for each element F of integral trivariate basis, a sequence of length m of positive integers, such that F has m real roots over it, and ith element of sequence is section of overall stack which is ith real root of F.
RegionExtendCadToCad: PROC [cad: Cad];
Extend cad of dimension-1 space to dimension space, using the largest signed regions (wrt primarySignatures) that can be constructed in the graph for dimension-1 space.
Let i = dimension.
Assume that in E^(i-1), with primaryPolynomials ← CompleteFactors(inputPolynomials), primarySignatures of cells are set.
1. MaximalSignedRegions[i-1, cad, TRUE]; regions ← ExtractSignedRegions[i-1, cad, TRUE]; sort regions in order of decreasing dimension (for i-1 = 2, put degenerate 0-dimensional regions after nondegenerate).
2. cad.cells ← NIL; Go down sorted list of regions, for each:
2a. currentCells ← ExtendRegionToCells[i, currentRegion, cad]; newAdjacencies ← NIL;
If currentRegion is a 0-cell, then as each element of (trivariate) basis is evaluated at sample point, check for identically zero; if so, then add that basis element to identicallyZeroBasisElements field of the 0-cell. If identicallyZeroBasisElements#NIL when all basis elements have been evaluated, i.e. if this is a degenerate 0-cell, then do the extra work required to determine the elements of the stack over this cell (RES sets, etc.), otherwise just isolate the roots of the algebraic basis of evaluated (trivariate integral) basis.
2b. Do this step only if i = 2 or 3. If dimension of currentRegion < i-1, then determine adjacent regions of larger dimension. Sort these into order of increasing dimension. Go down this list, and for each region on it, find all cell-cell adjacencies between currentRegion and this region. Sort these adjacencies into decreasing sum of cell dimensions. For the next such adjacency, newAdjacencies ← AdjacenciesOverAdjacency[i, adjacency, cad]. If newAdjacencies = NIL, i.e. if needed auxiliary E^(i-1) cell-cell adjacencies, or non-NIL sample points, cannot be found, then go to the next cell-cell adjacency between current region and this region. If needed auxiliary adjacencies and/or non-NIL sample points cannot be found for any cell-cell adjacency between current region and this region, give up on building adjacencies in E^i between stacks over current region and this region.
Note that there is no need to worry about whether regions have the boundary property; Note the specification that we try to find an adjacency (that we can build adjacencies over) between each pair of adjacent regions; the lower dimensional cell in such an adjacency necessarily belongs to the portion of the lower dimensional region contained in the boundary of the larger dimensional region.
2c. Insert cells of currentCells into cad.cells in lexicographical order. IF newAdjacencies # NIL, then enter its adjacencies into the appropriate cells of cad.cells.
3. If i-space cad.localizationFormula # NIL, then delete all cells of cad.cells which don't satisfy it, and all adjacencies involving those cells .
4. For i = 1, 2 or 3, if no localization, we now have a graph for the cad of E^i in which a maximal signed regions computation will yield (signed) components (in 1 and 2-space, we can have all adjacencies, in 3-space, probably only a proper subset of all adjacencies.)
ExtendRegionToCells: PROC [dimension: CARDINAL, region: SignedRegion, cad: Cad] RETURNS [newCells: SEQ.Sequence];
Extend region in dimension-1 space to cells in dimension-space. cad is dimension-space cad.
Fill in basisSignatures, and, if desired, (with primaryPolynomials ← CompleteFactors(inputPolynomials)), primarySignatures, of newCells. Also fill in induced adjacencies, and intrastack adjacencies, among newCells.
(Let i = dimension). Method: Evaluate polys at base sample point, irreducible basis of algebraic polys, isolate roots, construct extended sample points, eval gsfd of i-variate polynomial at endpoints of isolating interval, or i-variate polynomial itself at easy primitive sector sample point, when we want its sign.
ExtendCellToStacks: PROC [i: CARDINAL, cell: Cells.Cell, cad: Cad] RETURNS [StacksInEi: SEQ.Sequence];
Return a StackSeq of length one consisting of the stack over cell in E^(i-1).
ExtendStacksToStacks: PROC [i: CARDINAL, StacksInEiM1: SEQ.Sequence, cad: Cad] RETURNS [StacksInEi: SEQ.Sequence];
StacksInEi returned in lexicographical order by base
RatApproxSamplePoint: PROC [cell: Cells.Cell, ratApproxBound: BR.BigRat] RETURNS [PTS.Point];
Return a rational approximation to cell sample point, each coordinate accurate to within ratApproxBound. Should have the property that always produces the same RatPoint for given RealFieldPoint and ratApproxBound inputs.
END.