My Project  UNKNOWN_GIT_VERSION
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 "omalloc/omalloc.h"
27 
28 #include "misc/intvec.h"
29 
30 #include "coeffs/coeffs.h"
31 
33 #include "polys/monomials/ring.h"
34 #include "polys/simpleideals.h"
35 
36 #include "kernel/polys.h"
37 #include "kernel/ideals.h"
38 
39 #include <stdio.h>
40 #include <stdlib.h>
41 
42 poly p_Tail(const poly p, const ring r)
43 {
44  if( UNLIKELY(p == NULL) )
45  return NULL;
46  else
47  return p_Copy( pNext(p), r );
48 }
49 
50 ideal id_Tail(const ideal id, const ring r)
51 {
52  if( UNLIKELY(id == NULL) )
53  return NULL;
54 
55  const ideal newid = idInit(IDELEMS(id),id->rank);
56 
57  for (int i=IDELEMS(id) - 1; i >= 0; i--)
58  newid->m[i] = p_Tail( id->m[i], r );
59 
60  newid->rank = id_RankFreeModule(newid, currRing);
61 
62  return newid;
63 }
64 
omalloc.h
UNLIKELY
#define UNLIKELY(X)
Definition: auxiliary.h:418
polys.h
Compatiblity layer for legacy polynomial operations (over currRing)
simpleideals.h
syzextra.h
Computation of Syzygies.
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:813
currRing
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
i
int i
Definition: cfEzgcd.cc:125
id_RankFreeModule
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
Definition: simpleideals.cc:782
id_Tail
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:50
p_Tail
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:42
mod2.h
p_polys.h
intvec.h
ring.h
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:37
NULL
#define NULL
Definition: omList.c:10
ideals.h
p
int p
Definition: cfModGcd.cc:4019
IDELEMS
#define IDELEMS(i)
Definition: simpleideals.h:24
pNext
#define pNext(p)
Definition: monomials.h:37
coeffs.h
Coefficient rings, fields and other domains suitable for Singular polynomials.