# source:git/factory/cfNewtonPolygon.h@36ef97a

jengelh-datetimespielwiese
Last change on this file since 36ef97a was 36ef97a, checked in by Martin Lee <martinlee84@…>, 10 years ago
• Property mode set to `100644`
File size: 4.9 KB
Line
1/*****************************************************************************\
2 * Computer Algebra System SINGULAR
3\*****************************************************************************/
4/** @file cfNewtonPolygon.h
5 *
6 * This file provides functions to compute the Newton polygon of a bivariate
7 * polynomial
8 *
9 * @author Martin Lee
10 *
11 **/
12/*****************************************************************************/
13
14#ifndef CF_NEWTON_POLYGON_H
15#define CF_NEWTON_POLYGON_H
16
17// #include "config.h"
18
19#ifdef HAVE_NTL
20#include "NTLconvert.h"
21#endif
22
23/// compute a polygon
24///
25/// @return an integer n such that the first n entries of @a points are the
26///         vertices of the convex hull of @a points
27int polygon (int** points, ///< [in,out] an array of points in the plane
28             int sizePoints///< [in] number of elements in @a points
29            );
30
31/// compute the Newton polygon of a bivariate polynomial
32///
33/// @return an array of points in the plane which are the vertices of the Newton
34///         polygon of F
35int ** newtonPolygon (const CanonicalForm& F,///< [in] a bivariate polynomial
36                      int& sizeOfNewtonPoly  ///< [in, out] size of the result
37                     );
38
39/// compute the convex hull of the support of two bivariate polynomials
40///
41/// @return an array of points in the plane which are the vertices of the convex
42///         hull of the support of F and G
43int ** newtonPolygon (const CanonicalForm& F,///< [in] a bivariate polynomial
44                      const CanonicalForm& G,///< [in] a bivariate polynomial
45                      int& sizeOfNewtonPoly  ///< [in, out] size of the result
46                     );
47
48/// check if @a point is inside a polygon described by points
49///
50/// @return true if @a point is inside a polygon described by points
51bool isInPolygon (int ** points, ///< [in] an array of points in the
52                                 ///< plane describing a polygon
53                  int sizePoints,///< [in] size of @a points
54                  int* point     ///< [in] a point in the plane
55                 );
56
57/// get the y-direction slopes of all edges with positive slope in y-direction
58/// of a convex polygon with at least one point of the polygon lying on the
59/// x-axis and one lying on the y-axis
60///
61/// @return an array containing the slopes as described above
62int* getRightSide (int** polygon,     ///<[in] vertices of a polygon
63                   int sizeOfPolygon, ///<[in] number of vertices
64                   int& sizeOfOutput  ///<[in,out] size of the output
65                  );
66
67/// computes the Newton polygon of F and checks if it satisfies the
68/// irreducibility criterion from S.Gao "Absolute irreducibility of polynomials
69/// via polytopes", Example 1
70///
71/// @return true if it satisfies the above criterion, false otherwise
72bool
73irreducibilityTest (const CanonicalForm& F ///<[in] a bivariate polynomial
74                   );
75
76/// absolute irreducibility test as described in "Modular Las Vegas Algorithms
77/// for Polynomial Absolute Factorization" by C. Bertone, G. Cheze, A. Galligo
78///
79/// @return true if F satisfies condition (C) from the above paper and thus
80/// is absolutely irreducible, false otherwise
81bool
82absIrredTest (const CanonicalForm& F ///< [in] a bivariate polynomial
83                                     ///< irreducible over ground field
84             );
85
86//TODO add modular test from "Modular Las Vegas Algorithms
87// for Polynomial Absolute Factorization" by C. Bertone, G. Cheze, A. Galligo
88
89#ifdef HAVE_NTL
90/// Algorithm 5 as described in Convex-Dense Bivariate Polynomial Factorization
91/// by Berthomieu, Lecerf
92void convexDense (int** points,  ///< [in, out] a set of points in Z^2, returns
93                                 ///< M (points)+A
94                  int sizePoints,///< [in] size of points
95                  mat_ZZ& M,     ///< [in,out] returns an invertible matrix
96                  vec_ZZ& A      ///< [in,out] returns translation
97                 );
98
99/// compress a bivariate poly
100///
101/// @return @a compress returns a compressed bivariate poly
102/// @sa convexDense, decompress
103CanonicalForm
104compress (const CanonicalForm& F, ///< [in] compressed, i.e. F.level()==2,
105                                  ///< bivariate poly
106          mat_ZZ& inverseM,       ///< [in,out] returns the inverse of M,
107                                  ///< if computeMA==true, M otherwise
108          vec_ZZ& A,              ///< [in,out] returns translation
109          bool computeMA= true    ///< [in] whether to compute M and A
110         );
111
112/// decompress a bivariate poly
113///
114/// @return @a decompress returns a decompressed bivariate poly
115/// @sa convexDense, decompress
116CanonicalForm
117decompress (const CanonicalForm& F,///< [in] compressed, i.e. F.level()<= 2,
118                                   ///< uni- or bivariate poly
119            const mat_ZZ& M,       ///< [in] matrix M obtained from compress
120            const vec_ZZ& A        ///< [in] vector A obtained from compress
121           );
122#endif
123
124#endif
125
Note: See TracBrowser for help on using the repository browser.