Changeset fafb80 in git


Ignore:
Timestamp:
Oct 17, 2019, 12:18:50 PM (5 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
ceddead1eb12221030b1cd0d0ab3119014bd54c2
Parents:
eac8bc42b876bf2245703a2512bd05e9985dc1bf
Message:
new module: loctriv.so
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Singular/dyn_modules/Makefile.am

    reac8bc4 rfafb80  
    11ACLOCAL_AMFLAGS = -I ../m4
    22
    3 SUBDIRS=staticdemo bigintm subsets syzextra pyobject customstd gfanlib python gitfan polymake singmathic Order interval cohomo freealgebra partialgb systhreads
     3SUBDIRS=staticdemo bigintm subsets syzextra pyobject customstd gfanlib python gitfan polymake singmathic Order interval cohomo freealgebra partialgb systhreads loctriv
  • Singular/dyn_modules/loctriv/loctriv.cc

    reac8bc4 rfafb80  
    1 %{
    21/*
    32 *
     
    76 *
    87 */
    9 #include <kernel/ideals.h>
    10 #include <kernel/ring.h>
    11 #include <kernel/GBEngine/kstd1.h>
    12 #include <kernel/prCopy.h>
    13 %}
     8#include "kernel/ideals.h"
     9#include "libpolys/polys/monomials/ring.h"
     10#include "kernel/GBEngine/kstd1.h"
     11#include "libpolys/polys/prCopy.h"
     12#include "Singular/tok.h"
     13#include "Singular/ipshell.h"
     14#include "Singular/mod_lib.h"
     15#include "Singular/ipid.h"
    1416
    15 //#package="loctriv";
    16 package="kstd";
    17 version="$Id $";
    18 info="LIBRARY: partstd.lib  EXTERNALLY CONTROLLED GROEBNER\\n\\n kstd(module i1, int i2);       externally controlled std.\\n";
    19 
    20 %procedures
    21 
    22 module kstd (
    23   module h1,
    24   int k
    25 )
     17static BOOLEAN kstd(leftv res, leftv args)
    2618{
    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)
     19  const short t1[]={2,MODUL_CMD,INT_CMD};
     20  if (iiCheckTypes(args,t1,1))
    4521  {
    46     s_h1=idrCopyR_NoSort(h1,orig_ring);
     22    ideal h1=(ideal)args->CopyD();
     23    int k=(int)(long)args->next->Data();
     24    ideal s_h1;
     25    ideal s_h3;
     26    int j;
     27    ring orig_ring;
     28    ring syz_ring;
     29    intvec *w=NULL;
     30 
     31    assume(currRing != NULL);
     32    orig_ring=currRing;
     33    syz_ring=rAssure_SyzComp(orig_ring);
     34    rSetSyzComp(k,syz_ring);
     35    rChangeCurrRing(syz_ring);
     36 
     37    if (orig_ring != syz_ring)
     38    {
     39      s_h1=idrCopyR_NoSort(h1,orig_ring,syz_ring);
     40    }
     41    else
     42    {
     43      s_h1 = h1;
     44    }
     45 
     46    s_h3=kStd(s_h1,NULL,testHomog,&w,NULL,k);
     47 
     48    if (orig_ring != syz_ring)
     49    {
     50      idDelete(&s_h1);
     51      idSkipZeroes(s_h3);
     52      rChangeCurrRing(orig_ring);
     53      s_h3 = idrMoveR_NoSort(s_h3, syz_ring, orig_ring);
     54      rKill(syz_ring);
     55    }
     56    else
     57    {
     58      idSkipZeroes(s_h3);
     59    }
     60    res->data=(void *)s_h3;
     61    res->rtyp=MODUL_CMD;
     62    return FALSE;
    4763  }
    4864  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;
     65    return TRUE;
    7366}
    7467
    75 %C
     68//------------------------------------------------------------------------
     69// initialisation of the module
     70extern "C" int SI_MOD_INIT(loctriv)(SModulFunctions* p)
     71{
     72  p->iiAddCproc("loctriv.so","kstd",FALSE,kstd);
     73  return (MAX_TOK);
     74}
     75
  • configure.ac

    reac8bc4 rfafb80  
    295295AC_CONFIG_FILES([Singular/dyn_modules/cohomo/Makefile])
    296296AC_CONFIG_FILES([Singular/dyn_modules/systhreads/Makefile])
     297AC_CONFIG_FILES([Singular/dyn_modules/loctriv/Makefile])
    297298
    298299AC_CONFIG_FILES([Singular/Makefile])
  • m4/options.m4

    reac8bc4 rfafb80  
    335335  bi_interval=false
    336336  bi_systhreads=false
     337  bi_loctriv=false
    337338
    338339
     
    373374       interval ) bi_interval=true ;;
    374375       systhreads ) bi_systhreads=true;;
     376       loctriv ) bi_loctriv=true;;
    375377      esac
    376378
     
    415417 AM_CONDITIONAL([SI_BUILTIN_INTERVAL], [test x$bi_interval = xtrue])
    416418 AM_CONDITIONAL([SI_BUILTIN_SYSTHREADS], [test x$bi_systhreads = xtrue])
     419 AM_CONDITIONAL([SI_BUILTIN_LOCTRIV], [test x$bi_loctriv = xtrue])
    417420
    418421 AC_MSG_CHECKING([BUILTIN_LIBS...])
Note: See TracChangeset for help on using the changeset viewer.