Macaulay2 Engine
Loading...
Searching...
No Matches
points.cpp
Go to the documentation of this file.
1// Copyright 2005 Michael E. Stillman
2
3#include "points.hpp"
4#include "error.h"
5#include "mat.hpp"
6#include "matrix-con.hpp"
7#include "dmat.hpp"
8#include "polyring.hpp"
9#include "monideal.hpp"
10
11#include "aring-zzp.hpp"
12
14 const MutableMatrix *Pts,
15 Matrix /* or null */ **result_GB,
16 Matrix /* or null */ **result_std_monoms)
17{
18 // Branch depending on the type of K, the ring of Pts.
19 // If Pts is not a DMatrix, make it one.
20
21 // First: check that coeff ring of R is the same as ring of Pts
22
23 // Now branch depending on this type
24 const Ring *K = Pts->get_ring();
26 if (P == 0 || K != P->getCoefficients())
27 {
28 ERROR("expected polynomial ring with same coefficient ring");
29 return false;
30 }
31 const Z_mod *KZZp = K->cast_to_Z_mod();
32 if (KZZp != 0)
33 {
34 DMat<M2::ARingZZp> *Pts1 = 0;
36 P, KZZp, Pts1, *result_std_monoms);
37 return true;
38 }
39
40 ERROR("not implemented yet");
41 return false;
42}
43
45{
46 public:
49 void add(int old, int x, int *vp) { /* TO BE WRITTEN */}
50 bool remove(int &old, int &x, int *&vp) { /* TO BE WRITTEN */ return false; }
51};
52
53template <typename CoeffRing>
55 const PolynomialRing *R,
56 const typename CoeffRing::ring_type *K,
57 const DMat<CoeffRing> *Pts,
58 Matrix *&result_std_monoms)
59{
60// Declare and initialize our variables
61// int nvars = R->n_vars();
62// int npoints = Pts->n_cols();
63
64// MatrixConstructor gbG(R->make_FreeModule(1), 0);
65// DMat<CoeffRing> *P = new DMat<CoeffRing>(K, npoints, npoints+1);
66// DMat<CoeffRing> *PLU = new DMat<CoeffRing>(K, npoints, npoints+1);
67// MonomialIdeal *inG = new MonomialIdeal(R);
68// VECTOR(monomial) stdG;
69// monom_int_list monoms_todo(R);
70
71// int next_col = 0;
72// MES Place the monomials [0,0,vp], ..., [0,nvars-1,vp] onto monom list
73// MES Make the first column of P, PLU all ones.
74
75// The main loop
76#if 0
77// while (monoms_todo.remove(old,x,vp))
78// {
79// // First, see if this monomial is in inG, if so, continue.
80//
81// // Place this monomial as the 'next_col' column of P, PLU.
82//
83// // LU1
84//
85// //
86// }
87#endif
88 // THIS STILL NEEDS TO BE WRITTEN!!
89 return 0;
90}
91
93
94//#include "coeffrings.hpp"
95// template class PointsComputation<CoefficientRingZZp>;
96
97// Local Variables:
98// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
99// indent-tabs-mode: nil
100// End:
M2::ARingZZp — portable Z/p for small primes via log / exp tables.
Definition dmat.hpp:62
virtual const Ring * get_ring() const =0
Abstract base class for mutable matrices over an arbitrary engine Ring, the in-place counterpart of t...
Definition mat.hpp:79
static Matrix * points(const PolynomialRing *R, const typename CoeffRing::ring_type *K, const DMat< CoeffRing > *Pts, Matrix *&result_std_monoms)
Definition points.cpp:54
virtual const Ring * getCoefficients() const
Definition polyring.hpp:277
Abstract base for the engine's polynomial-ring hierarchy.
Definition polyring.hpp:96
virtual const PolynomialRing * cast_to_PolynomialRing() const
Definition ring.hpp:243
virtual const Z_mod * cast_to_Z_mod() const
Definition ring.hpp:237
xxx xxx xxx
Definition ring.hpp:102
Engine-side Z/p ring for small primes (p < 32767), using a discrete-log (Zech) representation.
Definition ZZp.hpp:63
void add(int old, int x, int *vp)
Definition points.cpp:49
monom_int_list(const PolynomialRing *R)
Definition points.cpp:47
bool remove(int &old, int &x, int *&vp)
Definition points.cpp:50
DMat<ACoeffRing> — dense-matrix template plus the umbrella that wires in every per-ring specialisatio...
Engine error-reporting primitives: ERROR, INTERNAL_ERROR, error, error_message.
#define Matrix
Definition factory.cpp:14
const int ERROR
Definition m2-mem.cpp:55
char M2_bool
Definition m2-types.h:82
MutableMatrix — abstract base of every mutable matrix the engine hands across the boundary.
MatrixConstructor — the mutable builder that produces an immutable Matrix.
MonomialIdeal — exponent-vector-only representation of an ideal generated by monomials.
volatile int x
M2_bool rawIdealOfPoints(const Ring *R, const MutableMatrix *Pts, Matrix **result_GB, Matrix **result_std_monoms)
Definition points.cpp:13
PointsComputation<CoeffRing>::points — ideal and standard-monomial basis of a finite point set.
PolynomialRing — abstract polynomial-ring base, the engine's most-reused class.