source: git/factory/cfNewtonPolygon.h @ 667ba1

spielwiese
Last change on this file since 667ba1 was 6fd83c4, checked in by Martin Lee <martinlee84@…>, 12 years ago
chg/fix: remove redundant points from polygon add: new function to obtain the slopes of the right edges of a polygon
  • Property mode set to 100644
File size: 3.4 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 * @internal
12 * @version \$Id$
13 *
14 **/
15/*****************************************************************************/
16
17#ifndef CF_NEWTON_POLYGON_H
18#define CF_NEWTON_POLYGON_H
19
20// #include "config.h"
21
22#ifdef HAVE_NTL
23#include "NTLconvert.h"
24#endif
25
26/// compute a polygon
27///
28/// @return an integer n such that the first n entries of @a points are the
29///         vertices of the convex hull of @a points
30int polygon (int** points, ///< [in,out] an array of points in the plane
31             int sizePoints///< [in] number of elements in @a points
32            );
33
34/// compute the Newton polygon of a bivariate polynomial
35///
36/// @return an array of points in the plane which are the vertices of the Newton
37///         polygon of F
38int ** newtonPolygon (const CanonicalForm& F,///< [in] a bivariate polynomial
39                      int& sizeOfNewtonPoly  ///< [in, out] size of the result
40                     );
41
42/// check if @a point is inside a polygon described by points
43///
44/// @return true if @a point is inside a polygon described by points
45bool isInPolygon (int ** points, ///< [in] an array of points in the
46                                 ///< plane describing a polygon
47                  int sizePoints,///< [in] size of @a points
48                  int* point     ///< [in] a point in the plane
49                 );
50
51/// get the y-direction slopes of all edges with positive slope in y-direction
52/// of a convex polygon with at least one point of the polygon lying on the
53/// x-axis and one lying on the y-axis
54///
55/// @return an array containing the slopes as described above
56int* getRightSide (int** polygon,     ///<[in] vertices of a polygon
57                   int sizeOfPolygon, ///<[in] number of vertices
58                   int& sizeOfOutput  ///<[in,out] size of the output
59                  );
60
61#ifdef HAVE_NTL
62/// Algorithm 5 as described in Convex-Dense Bivariate Polynomial Factorization
63/// by Berthomieu, Lecerf
64void convexDense (int** points,  ///< [in, out] a set of points in Z^2, returns
65                                 ///< M (points)+A
66                  int sizePoints,///< [in] size of points
67                  mat_ZZ& M,     ///< [in,out] returns an invertible matrix
68                  vec_ZZ& A      ///< [in,out] returns translation
69                 );
70
71/// compress a bivariate poly
72///
73/// @return @a compress returns a compressed bivariate poly
74/// @sa convexDense, decompress
75CanonicalForm
76compress (const CanonicalForm& F, ///< [in] compressed, i.e. F.level()==2,
77                                  ///< bivariate poly
78          mat_ZZ& inverseM,       ///< [in,out] returns the inverse of M
79          vec_ZZ& A               ///< [in,out] returns translation
80         );
81
82/// decompress a bivariate poly
83///
84/// @return @a decompress returns a decompressed bivariate poly
85/// @sa convexDense, decompress
86CanonicalForm
87decompress (const CanonicalForm& F,///< [in] compressed, i.e. F.level()<= 2,
88                                   ///< uni- or bivariate poly
89            const mat_ZZ& M,       ///< [in] matrix M obtained from compress
90            const vec_ZZ& A        ///< [in] vector A obtained from compress
91           );
92#endif
93
94#endif
95
Note: See TracBrowser for help on using the repository browser.