source: git/Singular/mpsr_PutPoly.cc @ b1dfaf

spielwiese
Last change on this file since b1dfaf was b1dfaf, checked in by Frank Seelisch <seelisch@…>, 14 years ago
patch from Kai (checked for problems under Windows OS: no problems) git-svn-id: file:///usr/local/Singular/svn/trunk@13210 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 22.1 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4
5/* $Id$ */
6
7/***************************************************************
8 *
9 * File:       mpsr_PutPoly.cc
10 * Purpose:    rotines which put polys and polynomials (i.e. ring) annotations
11 * Author:     Olaf Bachmann (10/95)
12 *
13 * Change History (most recent first):
14 *  o 1/97 obachman
15 *    Updated routines to MP and MPP v1.1
16 *
17 ***************************************************************/
18#include <kernel/mod2.h>
19
20#ifdef HAVE_MPSR
21
22#include <Singular/mpsr_Put.h>
23#include <Singular/mpsr_Tok.h>
24#include "kernel/longalg.h"
25#include <omalloc/omalloc.h>
26#include <kernel/ring.h>
27#include <kernel/polys.h>
28//#include "ipid.h"
29
30#ifdef PARI_BIGINT_TEST
31#include <Singular/MP_PariBigInt.h>
32MP_Status_t MP_MyPutApIntPacket(MP_Link_pt link, MP_ApInt_t mp_apint,
33                                MP_NumAnnot_t num_annots)
34{
35  GEN pnum = _gmp_to_pari((mpz_ptr) mp_apint);
36  return MP_PutApIntPacket(link, (MP_ApInt_t) pnum, num_annots);
37}
38
39#else
40
41#define MP_MyPutApIntPacket MP_PutApIntPacket
42
43#endif
44
45/***************************************************************
46 *
47 * global variable definitions
48 *
49 ***************************************************************/
50
51static mpsr_Status_t (*PutCoeff)(MP_Link_pt link, number x);
52static mpsr_Status_t (*PutAlgAlgNumber)(MP_Link_pt link, number x);
53static MP_Uint32_t gNalgvars = 0;
54static MP_Sint32_t gNvars = 0;
55static ring        CurrPutRing = NULL;
56
57MP_Sint32_t *gTa = NULL;
58MP_Sint32_t gTa_Length = 0;
59
60/***************************************************************
61 *
62 * prototype declarations
63 *
64 ***************************************************************/
65static void        SetPutFuncs(ring r);
66static mpsr_Status_t PutModuloNumber(MP_Link_pt link, number a);
67static mpsr_Status_t PutFloatNumber(MP_Link_pt link, number a);
68static mpsr_Status_t PutRationalNumber(MP_Link_pt link, number a);
69static mpsr_Status_t PutAlgPoly(MP_Link_pt link, napoly a, ring ar);
70static mpsr_Status_t PutAlgNumber(MP_Link_pt link, number a);
71
72static mpsr_Status_t PutVarNamesAnnot(MP_Link_pt link, ring r);
73static mpsr_Status_t PutVarNumberAnnot(MP_Link_pt link, ring r, BOOLEAN mv);
74static mpsr_Status_t PutOrderingAnnot(MP_Link_pt link, ring r, BOOLEAN mv);
75static mpsr_Status_t PutSimpleOrdering(MP_Link_pt link, ring r, short index);
76static mpsr_Status_t PutProtoTypeAnnot(MP_Link_pt link, ring r, BOOLEAN mv);
77static mpsr_Status_t PutMinPolyAnnot(MP_Link_pt link, ring r);
78static mpsr_Status_t PutDefRelsAnnot(MP_Link_pt link, ring r);
79
80
81/***************************************************************
82 *
83 * Setting the global Put Functions
84 *
85 ***************************************************************/
86static void SetPutFuncs(ring r)
87{
88  CurrPutRing = r;
89  // first, we set the PutNumber function
90  gNvars = r->N;
91  mpsr_InitTempArray(gNvars+1);
92
93  if (rField_is_Q(r))
94    // rational numbers
95    PutCoeff= PutRationalNumber;
96  else if (rField_is_Zp(r) || rField_is_GF(r))
97    // Form our point of view, ModuloP numbers and numbers from
98    // GF(p,n) are the same, here. They only differ in the annots
99    PutCoeff = PutModuloNumber;
100  else if (rField_is_R(r))
101    PutCoeff = PutFloatNumber;
102  else
103  {
104    // now we come to algebraic numbers
105    gNalgvars = rPar(r);
106    mpsr_InitTempArray(gNalgvars);
107    PutCoeff = PutAlgNumber;
108    if (rField_is_Zp_a(r))
109      // first, Z/p(a)
110      PutAlgAlgNumber = PutModuloNumber;
111    else
112      PutAlgAlgNumber = PutRationalNumber;
113  }
114}
115
116
117
118/***************************************************************
119 *
120 * modulo numbers (i.e. char p, or p^n)
121 *
122 ***************************************************************/
123// we always put modulo numbers without a header, since
124// we have type-spec this before
125static mpsr_Status_t PutModuloNumber(MP_Link_pt link, number a)
126{
127  mp_return(IMP_PutUint32(link, (MP_Uint32_t) a));
128}
129
130static mpsr_Status_t PutFloatNumber(MP_Link_pt link, number a)
131{
132  mp_return(IMP_PutReal32(link , Number_2_Real32(a)));
133}
134
135/***************************************************************
136 *
137 * rational (i.e. char 0) numbers
138 *
139 ***************************************************************/
140// This supposes that number is of char 0, i.e. a rational number
141static mpsr_Status_t PutRationalNumber(MP_Link_pt link, number a)
142{
143  // Check for case number == NULL == 0
144  if (a == NULL)
145    mp_return( MP_PutSint32Packet(link, 0, 0));
146
147  // check for SR_INT type
148  if (SR_HDL(a) & SR_INT)
149    mp_return( MP_PutSint32Packet(link, SR_TO_INT(a), 0));
150
151  // check for single GMP integer
152  if ((a->s) == 3)
153    mp_return(MP_MyPutApIntPacket(link, (MP_ApInt_t) &(a->z), 0));
154
155  // Now we have a fraction
156  // normalize, if necessary
157//   if ((a->s) == 0)
158//   {
159// //    nlNormalize(a);
160//     return PutRationalNumber(link, a);
161//   }
162
163  // send number itself
164  mp_failr(MP_PutCommonOperatorPacket(link,
165                                      MP_BasicDict,
166                                      MP_CopBasicDiv,
167                                      0,
168                                      2));
169  // and now sent nominator and denominator
170  mp_failr(MP_MyPutApIntPacket(link, (MP_ApInt_t) &(a->z), 0));
171  mp_return(MP_MyPutApIntPacket(link, (MP_ApInt_t) &(a->n), 0));
172}
173
174/***************************************************************
175 *
176 * Algebraic Numbers (a la Singular)
177 *
178 ***************************************************************/
179static inline MP_Uint32_t GetPlength(napoly a)
180{
181  MP_Uint32_t i = napLength(a);
182  return i;
183}
184
185static mpsr_Status_t PutAlgNumber(MP_Link_pt link, number a)
186{
187  lnumber b;
188
189  if (a == NULL)
190    mp_return(IMP_PutUint32(link, 0));
191
192  b = (lnumber) a;
193  if ((b->n) == NULL) // NULL means there is only one number
194  {
195    // hence, we use the first case of the union
196    mp_failr(IMP_PutUint32(link, 1));
197    mp_failr(IMP_PutUint32(link, GetPlength(b->z)));
198    return PutAlgPoly(link, b->z, CurrPutRing->algring);
199  }
200  else
201  {
202    // we use the 2nd case of the union
203    mp_failr(IMP_PutUint32(link, 2));
204    mp_failr(IMP_PutUint32(link, GetPlength(b->z)));
205    failr(PutAlgPoly(link, b->z, CurrPutRing->algring));
206    mp_failr(IMP_PutUint32(link, GetPlength(b->n)));
207    return PutAlgPoly(link, b->n, CurrPutRing->algring);
208  }
209}
210
211// this is very similar to putting a Poly
212static mpsr_Status_t PutAlgPoly(MP_Link_pt link, napoly a, ring ar)
213{
214  unsigned int i;
215  int *exp;
216
217  if (gNalgvars > 1)
218    while (a != NULL)
219    {
220      failr(PutAlgAlgNumber(link, napGetCoeff(a)));
221      for (i=0; i<gNalgvars; i++)
222        gTa[i] = p_GetExp((poly)a,i+1,ar);
223      mp_failr(IMP_PutSint32Vector(link, gTa, gNalgvars));
224      pIter(a);
225    }
226  else
227  {
228    while (a != NULL)
229    {
230      failr(PutAlgAlgNumber(link, napGetCoeff(a)));
231      IMP_PutSint32(link, (MP_Sint32_t) p_GetExp((poly)a,1,ar));
232      pIter(a);
233    }
234  }
235  return mpsr_Success;
236}
237
238/***************************************************************
239 *
240 *  Putting polys
241 *
242 ***************************************************************/
243mpsr_Status_t mpsr_PutPolyData(MP_Link_pt link, poly p, ring cring)
244{
245  //if (cring != CurrPutRing)
246    SetPutFuncs(cring);
247
248#ifdef MPSR_DEBUG
249  if (currRing == cring)
250    pTest(p);
251#endif
252
253  if (gNvars > 1)
254  {
255    short i;
256    MP_Sint32_t *ta1 = &(gTa[1]);
257
258    while (p != NULL)
259    {
260      failr(PutCoeff(link, pGetCoeff(p)));
261      for (i=1; i<=gNvars; i++)
262        gTa[i] = (MP_Sint32_t) pGetExp(p, i);
263      mp_failr(IMP_PutSint32Vector(link, ta1, gNvars));
264      pIter(p);
265    }
266  }
267  else
268    while (p != NULL)
269    {
270      failr(PutCoeff(link, pGetCoeff(p)));
271      IMP_PutSint32(link, (MP_Sint32_t) pGetExp(p,1));
272      pIter(p);
273    }
274  return mpsr_Success;
275}
276
277mpsr_Status_t mpsr_PutPolyVectorData(MP_Link_pt link, poly p, ring cring)
278{
279  short i, n1;
280
281  if (cring != CurrPutRing)
282    SetPutFuncs(cring);
283
284  if (gNvars > 1)
285  {
286    short i, n1= gNvars + 1;
287    while (p != NULL)
288    {
289      failr(PutCoeff(link, pGetCoeff(p)));
290      gTa[0] = pGetComp(p);
291      for (i=1; i< n1; i++)
292        gTa[i] = (MP_Sint32_t) pGetExp(p,i);
293      mp_failr(IMP_PutSint32Vector(link, gTa, n1));
294      pIter(p);
295    }
296  }
297  else
298    while (p != NULL)
299    {
300      failr(PutCoeff(link, pGetCoeff(p)));
301      IMP_PutSint32(link, (MP_Sint32_t) pGetComp(p));
302      IMP_PutSint32(link, (MP_Sint32_t) pGetExp(p,1));
303      pIter(p);
304    }
305  return mpsr_Success;
306}
307
308/***************************************************************
309 *
310 *  The putting annotation buisness
311 *
312 ***************************************************************/
313int mpsr_GetNumOfRingAnnots(ring r, BOOLEAN mv)
314{
315  short annots = 4;
316
317  if (mv) annots++;
318  if (r->qideal != NULL) annots++;
319  // we sent the minpoly with the coefficient ring
320  if ((r->minpoly != NULL) && (r->parameter == NULL)) annots++;
321
322  return annots;
323}
324
325mpsr_Status_t mpsr_PutRingAnnots(MP_Link_pt link, ring r, BOOLEAN mv)
326{
327  failr(PutProtoTypeAnnot(link,r, mv));
328  failr(PutVarNumberAnnot(link, r, mv));
329  failr(PutVarNamesAnnot(link,r));
330  failr(PutOrderingAnnot(link,r, mv));
331
332  if (mv)
333    mp_failr(MP_PutAnnotationPacket(link,
334                                    MP_PolyDict,
335                                    MP_AnnotPolyModuleVector,
336                                    MP_AnnotRequired));
337  // Hmm .. this is not according to a "proper" Singular ring,
338  // but to be used in a recursive call of mpsr_PutRingAnnots
339  if (r->minpoly != NULL && r->parameter == NULL && r->ch > 0)
340    failr(PutMinPolyAnnot(link,r));
341
342  if (r->qideal != NULL)
343    return PutDefRelsAnnot(link, r);
344
345  return mpsr_Success;
346}
347
348static mpsr_Status_t PutProtoTypeAnnot(MP_Link_pt link, ring r,
349                                       BOOLEAN mv)
350{
351  // each element of the poly is a
352  mp_failr(MP_PutAnnotationPacket(link,
353                                  MP_ProtoDict,
354                                  MP_AnnotProtoPrototype,
355                                  MP_AnnotReqValNode));
356  // Monom represented as a struct of 2 elements
357  mp_failr(MP_PutCommonOperatorPacket(link,
358                                      MP_ProtoDict,
359                                      MP_CopProtoStruct,
360                                      0,
361                                      2));
362
363  // First element is the coefficient
364  if (rField_is_Q(r))
365  {
366    // rational numbers
367    mp_failr(MP_PutCommonMetaTypePacket(link,
368                                        MP_NumberDict,
369                                        MP_CmtNumberRational,
370                                        1));
371    // are always normalized (and made that way, if necessary)
372    mp_failr(MP_PutAnnotationPacket(link,
373                                    MP_NumberDict,
374                                    MP_AnnotNumberIsNormalized,
375                                    0));
376  }
377  else if (rField_is_Zp(r) || rField_is_GF(r))
378  {
379    // modulo p numbers
380    // are communicated as IMP_Uint32's
381    mp_failr(MP_PutCommonMetaTypePacket(link,
382                                    MP_ProtoDict,
383                                    MP_CmtProtoIMP_Uint32,
384                                    1));
385    // but are taken as modulo numbers
386    mp_failr(MP_PutAnnotationPacket(link,
387                                    MP_NumberDict,
388                                    MP_AnnotNumberModulos,
389                                    MP_AnnotValuated));
390    // with Modulo
391    mp_failr(MP_PutUint32Packet(link, rInternalChar(r), 1));
392    if (r->parameter == NULL)
393    {
394      // which is (in our case) always a prime number
395      mp_failr(MP_PutAnnotationPacket(link,
396                                      MP_NumberDict,
397                                      MP_AnnotNumberIsPrime,
398                                      0));
399    }
400    else
401    {
402      mp_failr(MP_PutAnnotationPacket(link,
403                                      MP_SingularDict,
404                                      MP_AnnotSingularGalois,
405                                      MP_AnnotValuated));
406      mp_failr(MP_PutStringPacket(link, r->parameter[0], 0));
407    }
408  }
409  else if (rField_is_R(r))
410  {
411    // floats
412    mp_failr(MP_PutCommonMetaTypePacket(link,
413                                    MP_ProtoDict,
414                                    MP_CmtProtoIMP_Real32,
415                                    0));
416  }
417  else
418  {
419    // alg numbers
420    // create temporary ring for describing the coeeficient domain
421    ring alg_r = r->algring;
422    alg_r->minpoly = r->minpoly;
423
424    // Algebraic numbers are
425    // a fraction of two Dense Dist Polys
426    mp_failr(MP_PutCommonMetaOperatorPacket(link,
427                                            MP_BasicDict,
428                                            MP_CopBasicDiv,
429                                            1,
430                                            0));
431    mp_failr(MP_PutAnnotationPacket(link,
432                                    MP_ProtoDict,
433                                    MP_AnnotProtoPrototype,
434                                    MP_AnnotReqValNode));
435    mp_failr(MP_PutCommonMetaOperatorPacket(link,
436                                            MP_PolyDict,
437                                            MP_CopPolyDenseDistPoly,
438                                            mpsr_GetNumOfRingAnnots(alg_r, 0),
439                                            0));
440    failr(mpsr_PutRingAnnots(link, alg_r, 0));
441
442    // destroy temporary ring
443    alg_r->minpoly = NULL;
444  }
445
446  // second element is the exponent vector
447  mp_failr(MP_PutCommonMetaOperatorPacket(link,
448                                          MP_ProtoDict,
449                                          MP_CopProtoArray,
450                                          1,
451                                          (mv ? r->N + 1 : r->N)));
452  mp_failr(MP_PutAnnotationPacket(link,
453                                  MP_ProtoDict,
454                                  MP_AnnotProtoPrototype,
455                                  MP_AnnotReqValNode));
456  mp_return(MP_PutCommonMetaTypePacket(link,
457                                   MP_ProtoDict,
458                                   MP_CmtProtoIMP_Sint32,
459                                   0));
460}
461
462
463static mpsr_Status_t PutVarNamesAnnot(MP_Link_pt link, ring r)
464{
465  // first, we put the annot packet, with flags (1, 0, 1, 0)
466  mp_failr(MP_PutAnnotationPacket(link,
467                                  MP_PolyDict,
468                                  MP_AnnotPolyVarNames,
469                                  MP_AnnotValuated));
470  // now, the varnames follow
471  if ((r->N) == 1)
472  {
473    // only 1 varname
474    mp_return(MP_PutIdentifierPacket(link, MP_SingularDict, *(r->names), 0));
475  }
476  else
477  {
478    // more than one varname
479    char **names = r->names;
480    int i, n = r->N;
481
482    mp_failr(MP_PutCommonOperatorPacket(link,
483                                        MP_ProtoDict,
484                                        MP_CopProtoArray,
485                                        1,
486                                        r->N));
487    mp_failr(MP_PutAnnotationPacket(link,
488                                    MP_ProtoDict,
489                                    MP_AnnotProtoPrototype,
490                                    MP_AnnotReqValNode));
491
492    mp_failr(MP_PutCommonMetaTypePacket(link,
493                                    MP_ProtoDict,
494                                    MP_CmtProtoIMP_Identifier,
495                                    0));
496    for (i=0; i<n; i++)
497      mp_failr(IMP_PutString(link, names[i]));
498
499    return mpsr_Success;
500  }
501}
502
503static mpsr_Status_t PutVarNumberAnnot(MP_Link_pt link, ring r, BOOLEAN mv)
504{
505  mp_failr(MP_PutAnnotationPacket(link,
506                                  MP_PolyDict,
507                                  MP_AnnotPolyVarNumber,
508                                  MP_AnnotValuated));
509  mp_return(MP_PutUint32Packet(link, (mv ? r->N + 1 : r->N), 0));
510}
511
512
513static mpsr_Status_t PutOrderingAnnot(MP_Link_pt link, ring r, BOOLEAN mv)
514{
515  int index = 0, nblocks = 0;
516  int *order = r->order;
517
518  mp_failr(MP_PutAnnotationPacket(link,
519                                  MP_PolyDict,
520                                  MP_AnnotPolyOrdering,
521                                  MP_AnnotValuated));
522
523  // let's see whether we have a simple ordering to sent
524  if ((mv == 0) && (order[1] == ringorder_no))
525  {
526    // ring does not contain a component entry:
527    return PutSimpleOrdering(link, r, 0);
528  }
529  if ((mv == 0) && (order[2] == ringorder_no))
530  {
531    if (order[1] == ringorder_C || order[1] == ringorder_c)
532      index = 0;
533    else
534      index = 1;
535
536    return PutSimpleOrdering(link, r, index);
537  }
538
539  // No -- so we are dealing with a product ordering
540  // First, let's find out how many blocks there are
541  while (order[nblocks] != ringorder_no) nblocks++;
542  // if we deal with a non-vector, we are not going to sent
543  // the vector ordering
544  mp_failr(MP_PutCommonOperatorPacket(link,
545                                      MP_BasicDict,
546                                      MP_CopBasicList,
547                                      0,
548                                      (mv ? nblocks : nblocks - 1)));
549
550  for (index = 0; index < nblocks; index ++)
551    // Do not sent vector ordering, if we are sending pure polys
552    if (! (mv == 0 && (order[index] == ringorder_C ||
553                       order[index] == ringorder_c)))
554    {
555      // a product ordering is sent as triple
556      mp_failr(MP_PutCommonOperatorPacket(link,
557                                          MP_BasicDict,
558                                          MP_CopBasicList,
559                                          0,
560                                          3));
561      // first element is the simple ordering
562      failr(PutSimpleOrdering(link, r, index));
563      // second and third for covered variables
564      mp_failr(MP_PutUint32Packet(link, (MP_Uint32_t) r->block0[index], 0));
565      mp_failr(MP_PutUint32Packet(link, (MP_Uint32_t) r->block1[index], 0));
566    }
567
568  return mpsr_Success;
569}
570
571
572static mpsr_Status_t PutSimpleOrdering(MP_Link_pt link, ring r, short index)
573{
574  MP_Uint32_t vlength = 0, i;
575
576  // find out the length of the weight-vector
577  if (r->wvhdl && r->wvhdl[index] != NULL)
578    vlength = r->block1[index] - r->block0[index] + 1;
579
580  mp_failr(MP_PutCommonConstantPacket(link,
581                                      MP_PolyDict,
582                                      mpsr_ord2mp(r->order[index]),
583                                      (vlength == 0 ? 0 : 1)));
584
585  if (vlength == 0) return mpsr_Success;
586
587  // deal with the weights
588  mp_failr(MP_PutAnnotationPacket(link,
589                                  MP_PolyDict,
590                                  MP_AnnotPolyWeights,
591                                  MP_AnnotValuated));
592  if (r->order[index] == ringorder_M)
593  {
594    // put the matrix header
595    mp_failr(MP_PutCommonOperatorPacket(link,
596                                        MP_MatrixDict,
597                                        MP_CopMatrixDenseMatrix,
598                                        2,
599                                        vlength*vlength));
600    mp_failr(MP_PutAnnotationPacket(link,
601                                    MP_ProtoDict,
602                                    MP_AnnotProtoPrototype,
603                                    MP_AnnotReqValNode));
604    mp_failr(MP_PutCommonMetaTypePacket(link,
605                                    MP_ProtoDict,
606                                    MP_CmtProtoIMP_Sint32,
607                                    0));
608    mp_failr(MP_PutAnnotationPacket(link,
609                                    MP_MatrixDict,
610                                    MP_AnnotMatrixDimension,
611                                    MP_AnnotReqValNode));
612    mp_failr(MP_PutCommonOperatorPacket(link,
613                                        MP_BasicDict,
614                                        MP_CopBasicList,
615                                        0, 2));
616    mp_failr(MP_PutSint32Packet(link, (MP_Sint32_t) vlength, 0));
617    mp_failr(MP_PutSint32Packet(link, (MP_Sint32_t) vlength, 0));
618    vlength *= vlength;
619  }
620  else
621  {
622    // vector header
623    mp_failr(MP_PutCommonOperatorPacket(link,
624                                        MP_MatrixDict,
625                                        MP_CopMatrixDenseVector,
626                                        1,
627                                        vlength));
628    mp_failr(MP_PutAnnotationPacket(link,
629                                    MP_ProtoDict,
630                                    MP_AnnotProtoPrototype,
631                                    MP_AnnotReqValNode));
632    mp_failr(MP_PutCommonMetaTypePacket(link,
633                                    MP_ProtoDict,
634                                    MP_CmtProtoIMP_Sint32,
635                                    0));
636  }
637
638  // weights are all what remains
639  for (i=0; i<vlength; i++)
640    mp_failr(IMP_PutSint32(link, (MP_Sint32_t) r->wvhdl[index][i]));
641
642  return mpsr_Success;
643}
644
645static mpsr_Status_t PutMinPolyAnnot(MP_Link_pt link, ring r)
646{
647  mpsr_assume(r->minpoly != NULL && r->ch > 0 && r->parameter == NULL);
648
649  number minpoly = r->minpoly;
650  r->minpoly = 0;
651
652  mp_failr(MP_PutAnnotationPacket(link,
653                                  MP_PolyDict,
654                                  MP_AnnotPolyDefRel,
655                                  MP_AnnotValuated));
656  mp_failr(MP_PutCommonOperatorPacket(link,
657                                      MP_PolyDict,
658                                      MP_CopPolyDenseDistPoly,
659                                      5,
660                                      GetPlength( ((lnumber) minpoly)->z)));
661  failr(PutProtoTypeAnnot(link, r, 0));
662  failr(PutVarNamesAnnot(link, r));
663  failr(PutVarNumberAnnot(link, r,0));
664  failr(PutOrderingAnnot(link, r, 0));
665  mp_failr(MP_PutAnnotationPacket(link,
666                                  MP_PolyDict,
667                                  MP_AnnotPolyIrreducible,
668                                  0));
669
670  // need to set PutAlgAlgnumber and gNalgVars
671  CurrPutRing = r;
672  if (rField_is_Zp(r) || rField_is_GF(r))
673    PutAlgAlgNumber = PutModuloNumber;
674  else
675    PutAlgAlgNumber = PutRationalNumber;
676  gNalgvars = r->N;
677
678  r->minpoly = minpoly;
679  return PutAlgPoly(link, ((lnumber) minpoly)->z, r);
680}
681
682
683static mpsr_Status_t PutDefRelsAnnot(MP_Link_pt link, ring r)
684{
685  int i, idn;
686  ideal id;
687
688  id = r->qideal;
689  r->qideal = NULL;
690
691  mp_failr(MP_PutAnnotationPacket(link,
692                                  MP_PolyDict,
693                                  MP_AnnotPolyDefRel,
694                                  MP_AnnotValuated));
695  failr(mpsr_PutIdeal(link, id, r));
696  r->qideal = id;
697  return mpsr_Success;
698}
699
700#endif
Note: See TracBrowser for help on using the repository browser.