source: git/factory/facFqFactorizeUtil.h @ 9752db

spielwiese
Last change on this file since 9752db was 6deedd, checked in by Martin Lee <martinlee84@…>, 12 years ago
modified some helper functions and removed unneccessary inclusion of config.h
  • Property mode set to 100644
File size: 5.8 KB
Line 
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#include "canonicalform.h"
20#include "cf_map.h"
21
22/// append @a factors2 to @a factors1 and decompress
23///
24static inline
25void decompressAppend (CFList& factors1,       ///< [in,out] a list of polys,
26                                               ///< returns @a factors2 appended
27                                               ///< to it and everything is
28                                               ///< decompressed
29                       const CFList& factors2, ///< [in] a list of polys
30                       const CFMap& N          ///< [in] a map
31                      )
32{
33  for (CFListIterator i= factors1; i.hasItem(); i++)
34    i.getItem()= N (i.getItem());
35  for (CFListIterator i= factors2; i.hasItem(); i++)
36    factors1.append (N (i.getItem()));
37}
38
39
40/// swap elements in @a factors2 and append them to @a factors1
41///
42void appendSwap (CFList& factors1,       ///< [in,out] a list of polys,
43                                         ///< returns swapped elements of @a
44                                         ///< factors2 appended to it
45                 const CFList& factors2, ///< [in] a list of polys
46                 const int swapLevel1,   ///< [in] level of variable to be
47                                         ///< swapped with x, 0 if no swapping
48                 const int swapLevel2,   ///< [in] level of variable to be
49                                         ///< swapped with x, 0 if no swapping
50                 const Variable& x       ///< [in] a variable
51                );
52
53/// swap elements in @a factors
54void swap (CFList& factors,       ///< [in] a list of polys, returns swapped
55                                  ///< elements of factors
56           const int swapLevel1, ///< [in] level of variable to be
57                                  ///< swapped with x, 0 if no swapping
58           const int swapLevel2, ///< [in] level of variable to be
59                                  ///< swapped with x, 0 if no swapping
60           const Variable& x      ///< [in] a variable
61          );
62
63/// swap elements of @a factors2, append them to @a factors1 and decompress
64void appendSwapDecompress (
65                  CFList& factors1,       ///< [in,out] a list of polys,
66                                          ///< returns swapped elements of @a
67                                          ///< factors2 appended to it and
68                                          ///< everything is decompressed
69                  const CFList& factors2, ///< [in] a list of polys
70                  const CFMap& N,         ///< [in] a map
71                  const int swapLevel,    ///< [in] level of variable to be
72                                          ///< swapped with x, 0 if no swapping
73                  const Variable& x       ///< [in] a variable
74                          );
75
76/// swap elements of @a factors2, append them to @a factors1 and decompress
77void appendSwapDecompress (
78                  CFList& factors1,       ///< [in,out] a list of polys,
79                                          ///< returns swapped elements of @a
80                                          ///< factors2 appended to it and
81                                          ///< everything is decompressed
82                  const CFList& factors2, ///< [in] a list of polys
83                  const CFMap& N,         ///< [in] a map
84                  const int swapLevel1,   ///< [in] level of variable to be
85                                          ///< swapped with x, 0 if no swapping
86                  const int swapLevel2,   ///< [in] level of variable to be
87                                          ///< swapped with x, 0 if no swapping
88                  const Variable& x       ///< [in] a variable
89                          );
90
91
92/// compute lifting bounds
93///
94/// @return @a liftingBounds returns an array containing the lift bounds for A
95int* liftingBounds (const CanonicalForm& A,    ///< [in] a compressed poly
96                    const int& bivarLiftBound  ///< [in] lift bound for
97                                               ///< @a biFactorizer()
98                   );
99
100/// shift evaluation point to zero
101/// @return @a shift2Zero returns @a F shifted by @a evaluation s.t. 0 is a
102///         valid evaluation point
103/// @sa evalPoints(), reverseShift()
104CanonicalForm
105shift2Zero (const CanonicalForm& F,  ///< [in] a compressed poly
106            CFList& Feval,           ///< [in,out] an empty list, returns
107                                     ///< @a F successively evaluated
108                                     ///< at 0
109            const CFList& evaluation,///< [in] a valid evaluation point
110            int l= 2                 ///< [in] level at which the evaluation
111                                     ///< starts
112           );
113
114/// reverse shifting the evaluation point to zero
115///
116/// @return @a reverseShift returns a poly whose shift to zero is reversed
117/// @sa shift2Zero(), evalPoints()
118CanonicalForm reverseShift (const CanonicalForm& F,  ///< [in] a compressed poly
119                            const CFList& evaluation,///< [in] a valid
120                                                     ///< evaluation point
121                            int l= 2                 ///< [in] level at which
122                                                     ///< the evaluation starts
123                           );
124
125#endif
126/* FAC_FQ_FACTORIZE_UTIL_H */
127
Note: See TracBrowser for help on using the repository browser.