syzextra.cc
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 /*****************************************************************************\
3  * Computer Algebra System SINGULAR
4 \*****************************************************************************/
5 /** @file syzextra.cc
6  *
7  * New implementations for the computation of syzygies and resolutions
8  *
9  * ABSTRACT: Computation of Syzygies due to Schreyer
10  *
11  * @author Oleksandr Motsak
12  *
13  **/
14 /*****************************************************************************/
15 // include header file
16 #include "kernel/mod2.h"
17 #ifndef _GNU_SOURCE
18 #define _GNU_SOURCE /*for qsort_r on cygwin, must be before system includes*/
19 #endif
20 
21 #include <string.h>
22 
23 
24 #include "syzextra.h"
25 
26 #include "misc/intvec.h"
27 
28 #include "coeffs/coeffs.h"
29 
31 #include "polys/monomials/ring.h"
32 #include "polys/simpleideals.h"
33 
34 #include "kernel/polys.h"
35 #include "kernel/ideals.h"
36 
37 #include <stdio.h>
38 #include <stdlib.h>
39 
40 poly p_Tail(const poly p, const ring r)
41 {
42  if( UNLIKELY(p == NULL) )
43  return NULL;
44  else
45  return p_Copy( pNext(p), r );
46 }
47 
48 ideal id_Tail(const ideal id, const ring r)
49 {
50  if( UNLIKELY(id == NULL) )
51  return NULL;
52 
53  const ideal newid = idInit(IDELEMS(id),id->rank);
54 
55  for (int i=IDELEMS(id) - 1; i >= 0; i--)
56  newid->m[i] = p_Tail( id->m[i], r );
57 
58  newid->rank = id_RankFreeModule(newid, currRing);
59 
60  return newid;
61 }
62 
Compatiblity layer for legacy polynomial operations (over currRing)
poly p_Tail(const poly p, const ring r)
return the tail of a given polynomial or vector returns NULL if input is NULL, otherwise the result i...
Definition: syzextra.cc:40
#define UNLIKELY(X)
Definition: auxiliary.h:418
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
Computation of Syzygies.
Coefficient rings, fields and other domains suitable for Singular polynomials.
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
int i
Definition: cfEzgcd.cc:125
#define IDELEMS(i)
Definition: simpleideals.h:23
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:35
#define NULL
Definition: omList.c:12
#define pNext(p)
Definition: monomials.h:36
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
ideal id_Tail(const ideal id, const ring r)
return the tail of a given ideal or module returns NULL if input is NULL, otherwise the result is a n...
Definition: syzextra.cc:48
int p
Definition: cfModGcd.cc:4019