1 | /*****************************************************************************\ |
---|
2 | * Computer Algebra System SINGULAR |
---|
3 | \*****************************************************************************/ |
---|
4 | /** @file facFqFactorizeUtil.h |
---|
5 | * |
---|
6 | * This file provides utility functions for multivariate factorization |
---|
7 | * |
---|
8 | * @author Martin Lee |
---|
9 | * |
---|
10 | * @internal @version \$Id$ |
---|
11 | * |
---|
12 | **/ |
---|
13 | /*****************************************************************************/ |
---|
14 | |
---|
15 | #ifndef FAC_FQ_FACTORIZE_UTIL_H |
---|
16 | #define FAC_FQ_FACTORIZE_UTIL_H |
---|
17 | |
---|
18 | #include <config.h> |
---|
19 | |
---|
20 | #include "canonicalform.h" |
---|
21 | #include "cf_map.h" |
---|
22 | |
---|
23 | /// append @a factors2 to @a factors1 and decompress |
---|
24 | /// |
---|
25 | static inline |
---|
26 | void decompressAppend (CFList& factors1, ///< [in,out] a list of polys, |
---|
27 | ///< returns @a factors2 appended |
---|
28 | ///< to it and everything is |
---|
29 | ///< decompressed |
---|
30 | const CFList& factors2, ///< [in] a list of polys |
---|
31 | const CFMap& N ///< [in] a map |
---|
32 | ) |
---|
33 | { |
---|
34 | for (CFListIterator i= factors1; i.hasItem(); i++) |
---|
35 | i.getItem()= N (i.getItem()); |
---|
36 | for (CFListIterator i= factors2; i.hasItem(); i++) |
---|
37 | factors1.append (N (i.getItem())); |
---|
38 | } |
---|
39 | |
---|
40 | |
---|
41 | /// swap elements in @a factors2 and append them to @a factors1 |
---|
42 | /// |
---|
43 | void appendSwap (CFList& factors1, ///< [in,out] a list of polys, |
---|
44 | ///< returns swapped elements of @a |
---|
45 | ///< factors2 appended to it |
---|
46 | const CFList& factors2, ///< [in] a list of polys |
---|
47 | const int swapLevel1, ///< [in] level of variable to be |
---|
48 | ///< swapped with x, 0 if no swapping |
---|
49 | const int swapLevel2, ///< [in] level of variable to be |
---|
50 | ///< swapped with x, 0 if no swapping |
---|
51 | const Variable& x ///< [in] a variable |
---|
52 | ); |
---|
53 | |
---|
54 | /// swap elements in @a factors |
---|
55 | void swap (CFList& factors, ///< [in] a list of polys, returns swapped |
---|
56 | ///< elements of factors |
---|
57 | const int swapLevel1, ///< [in] level of variable to be |
---|
58 | ///< swapped with x, 0 if no swapping |
---|
59 | const int swapLevel2, ///< [in] level of variable to be |
---|
60 | ///< swapped with x, 0 if no swapping |
---|
61 | const Variable& x ///< [in] a variable |
---|
62 | ); |
---|
63 | |
---|
64 | /// swap elements of @a factors2, append them to @a factors1 and decompress |
---|
65 | void appendSwapDecompress ( |
---|
66 | CFList& factors1, ///< [in,out] a list of polys, |
---|
67 | ///< returns swapped elements of @a |
---|
68 | ///< factors2 appended to it and |
---|
69 | ///< everything is decompressed |
---|
70 | const CFList& factors2, ///< [in] a list of polys |
---|
71 | const CFMap& N, ///< [in] a map |
---|
72 | const int swapLevel, ///< [in] level of variable to be |
---|
73 | ///< swapped with x, 0 if no swapping |
---|
74 | const Variable& x ///< [in] a variable |
---|
75 | ); |
---|
76 | |
---|
77 | /// swap elements of @a factors2, append them to @a factors1 and decompress |
---|
78 | void appendSwapDecompress ( |
---|
79 | CFList& factors1, ///< [in,out] a list of polys, |
---|
80 | ///< returns swapped elements of @a |
---|
81 | ///< factors2 appended to it and |
---|
82 | ///< everything is decompressed |
---|
83 | const CFList& factors2, ///< [in] a list of polys |
---|
84 | const CFMap& N, ///< [in] a map |
---|
85 | const int swapLevel1, ///< [in] level of variable to be |
---|
86 | ///< swapped with x, 0 if no swapping |
---|
87 | const int swapLevel2, ///< [in] level of variable to be |
---|
88 | ///< swapped with x, 0 if no swapping |
---|
89 | const Variable& x ///< [in] a variable |
---|
90 | ); |
---|
91 | |
---|
92 | |
---|
93 | /// compute lifting bounds |
---|
94 | /// |
---|
95 | /// @return @a liftingBounds returns an array containing the lift bounds for A |
---|
96 | int* liftingBounds (const CanonicalForm& A, ///< [in] a compressed poly |
---|
97 | const int& bivarLiftBound ///< [in] lift bound for |
---|
98 | ///< @a biFactorizer() |
---|
99 | ); |
---|
100 | |
---|
101 | /// shift evaluation point to zero |
---|
102 | /// @return @a shift2Zero returns @a F shifted by @a evaluation s.t. 0 is a |
---|
103 | /// valid evaluation point |
---|
104 | /// @sa evalPoints(), reverseShift() |
---|
105 | CanonicalForm |
---|
106 | shift2Zero (const CanonicalForm& F, ///< [in] a compressed poly |
---|
107 | CFList& Feval, ///< [in,out] an empty list, returns |
---|
108 | ///< @a F successively evaluated |
---|
109 | ///< at 0 |
---|
110 | const CFList& evaluation ///< [in] a valid evaluation point |
---|
111 | ); |
---|
112 | |
---|
113 | /// reverse shifting the evaluation point to zero |
---|
114 | /// |
---|
115 | /// @return @a reverseShift returns a poly whose shift to zero is reversed |
---|
116 | /// @sa shift2Zero(), evalPoints() |
---|
117 | CanonicalForm reverseShift (const CanonicalForm& F, ///< [in] a compressed poly |
---|
118 | const CFList& evaluation ///< [in] a valid |
---|
119 | ///< evaluation point |
---|
120 | ); |
---|
121 | |
---|
122 | #endif |
---|
123 | /* FAC_FQ_FACTORIZE_UTIL_H */ |
---|
124 | |
---|