[7bf145] | 1 | /*****************************************************************************\ |
---|
[806c18] | 2 | * Computer Algebra System SINGULAR |
---|
[7bf145] | 3 | \*****************************************************************************/ |
---|
| 4 | /** @file facFqFactorizeUtil.h |
---|
[806c18] | 5 | * |
---|
| 6 | * This file provides utility functions for multivariate factorization |
---|
[7bf145] | 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 | |
---|
[e4fe2b] | 18 | // #include "config.h" |
---|
[7bf145] | 19 | |
---|
| 20 | #include "canonicalform.h" |
---|
[19b3c7] | 21 | #include "cf_map.h" |
---|
[7bf145] | 22 | |
---|
| 23 | /// append @a factors2 to @a factors1 and decompress |
---|
| 24 | /// |
---|
[806c18] | 25 | static inline |
---|
[7bf145] | 26 | void decompressAppend (CFList& factors1, ///< [in,out] a list of polys, |
---|
| 27 | ///< returns @a factors2 appended |
---|
[806c18] | 28 | ///< to it and everything is |
---|
[7bf145] | 29 | ///< decompressed |
---|
| 30 | const CFList& factors2, ///< [in] a list of polys |
---|
| 31 | const CFMap& N ///< [in] a map |
---|
[d52c12] | 32 | ) |
---|
| 33 | { |
---|
[806c18] | 34 | for (CFListIterator i= factors1; i.hasItem(); i++) |
---|
[d52c12] | 35 | i.getItem()= N (i.getItem()); |
---|
| 36 | for (CFListIterator i= factors2; i.hasItem(); i++) |
---|
| 37 | factors1.append (N (i.getItem())); |
---|
| 38 | } |
---|
| 39 | |
---|
[7bf145] | 40 | |
---|
| 41 | /// swap elements in @a factors2 and append them to @a factors1 |
---|
[806c18] | 42 | /// |
---|
[7bf145] | 43 | void appendSwap (CFList& factors1, ///< [in,out] a list of polys, |
---|
[806c18] | 44 | ///< returns swapped elements of @a |
---|
[7bf145] | 45 | ///< factors2 appended to it |
---|
| 46 | const CFList& factors2, ///< [in] a list of polys |
---|
[806c18] | 47 | const int swapLevel1, ///< [in] level of variable to be |
---|
[7bf145] | 48 | ///< swapped with x, 0 if no swapping |
---|
[806c18] | 49 | const int swapLevel2, ///< [in] level of variable to be |
---|
[7bf145] | 50 | ///< swapped with x, 0 if no swapping |
---|
| 51 | const Variable& x ///< [in] a variable |
---|
| 52 | ); |
---|
| 53 | |
---|
| 54 | /// swap elements in @a factors |
---|
[806c18] | 55 | void swap (CFList& factors, ///< [in] a list of polys, returns swapped |
---|
[7bf145] | 56 | ///< elements of factors |
---|
[806c18] | 57 | const int swapLevel1, ///< [in] level of variable to be |
---|
[7bf145] | 58 | ///< swapped with x, 0 if no swapping |
---|
[806c18] | 59 | const int swapLevel2, ///< [in] level of variable to be |
---|
[7bf145] | 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 |
---|
[806c18] | 65 | void appendSwapDecompress ( |
---|
[7bf145] | 66 | CFList& factors1, ///< [in,out] a list of polys, |
---|
[806c18] | 67 | ///< returns swapped elements of @a |
---|
| 68 | ///< factors2 appended to it and |
---|
[7bf145] | 69 | ///< everything is decompressed |
---|
| 70 | const CFList& factors2, ///< [in] a list of polys |
---|
| 71 | const CFMap& N, ///< [in] a map |
---|
[806c18] | 72 | const int swapLevel, ///< [in] level of variable to be |
---|
[7bf145] | 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, |
---|
[806c18] | 80 | ///< returns swapped elements of @a |
---|
| 81 | ///< factors2 appended to it and |
---|
[7bf145] | 82 | ///< everything is decompressed |
---|
| 83 | const CFList& factors2, ///< [in] a list of polys |
---|
| 84 | const CFMap& N, ///< [in] a map |
---|
[806c18] | 85 | const int swapLevel1, ///< [in] level of variable to be |
---|
[7bf145] | 86 | ///< swapped with x, 0 if no swapping |
---|
[806c18] | 87 | const int swapLevel2, ///< [in] level of variable to be |
---|
[7bf145] | 88 | ///< swapped with x, 0 if no swapping |
---|
| 89 | const Variable& x ///< [in] a variable |
---|
[806c18] | 90 | ); |
---|
[7bf145] | 91 | |
---|
| 92 | |
---|
| 93 | /// compute lifting bounds |
---|
| 94 | /// |
---|
[806c18] | 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 |
---|
[7bf145] | 98 | ///< @a biFactorizer() |
---|
| 99 | ); |
---|
| 100 | |
---|
| 101 | /// shift evaluation point to zero |
---|
[806c18] | 102 | /// @return @a shift2Zero returns @a F shifted by @a evaluation s.t. 0 is a |
---|
[7bf145] | 103 | /// valid evaluation point |
---|
[806c18] | 104 | /// @sa evalPoints(), reverseShift() |
---|
[7bf145] | 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 |
---|
[806c18] | 118 | const CFList& evaluation ///< [in] a valid |
---|
[7bf145] | 119 | ///< evaluation point |
---|
| 120 | ); |
---|
| 121 | |
---|
| 122 | #endif |
---|
| 123 | /* FAC_FQ_FACTORIZE_UTIL_H */ |
---|
| 124 | |
---|