source: git/dyn_modules/loctriv.mod @ e4e36c

spielwiese
Last change on this file since e4e36c was 6ce030f, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
removal of the $Id$ svn tag from everywhere NOTE: the git SHA1 may be used instead (only on special places) NOTE: the libraries Singular/LIB/*.lib still contain the marker due to our current use of svn
  • Property mode set to 100644
File size: 1.2 KB
Line 
1%{
2/*
3 *
4 *
5 *  Module file for computing locally trivial vector fields
6 *  by a Groebner basis computation similar to the syzygies
7 *
8 */
9#include <kernel/ideals.h>
10#include <kernel/ring.h>
11#include <kernel/kstd1.h>
12#include <kernel/prCopy.h>
13%}
14
15//#package="loctriv";
16package="kstd";
17version="$Id $";
18info="LIBRARY: partstd.lib  EXTERNALLY CONTROLLED GROEBNER\\n\\n kstd(module i1, int i2);       externally controlled std.\\n";
19
20%procedures
21
22module kstd (
23  module h1,
24  int k
25)
26{
27%declaration;
28
29  ideal s_h1;
30  ideal s_h3;
31  int j;
32  ring orig_ring;
33  ring syz_ring;
34  intvec *w=NULL;
35
36%typecheck;
37
38  assume(currRing != NULL);
39  orig_ring=currRing;
40  syz_ring=rCurrRingAssure_SyzComp();
41
42  rSetSyzComp(k);
43
44  if (orig_ring != syz_ring)
45  {
46    s_h1=idrCopyR_NoSort(h1,orig_ring);
47  }
48  else
49  {
50    s_h1 = h1;
51  }
52
53  s_h3=kStd(s_h1,NULL,testHomog,&w,NULL,k);
54
55  if (s_h3==NULL)
56  {
57    %return = (void *)(idFreeModule(IDELEMS(h1)));
58  }
59
60  if (orig_ring != syz_ring)
61  {
62    idDelete(&s_h1);
63    idSkipZeroes(s_h3);
64    rChangeCurrRing(orig_ring);
65    s_h3 = idrMoveR_NoSort(s_h3, syz_ring);
66    rKill(syz_ring);
67  }
68  else
69  {
70    idSkipZeroes(s_h3);
71  }
72  %return = (void *)s_h3;
73}
74
75%C
Note: See TracBrowser for help on using the repository browser.