My Project  UNKNOWN_GIT_VERSION
Macros | Functions
extra.cc File Reference
#include "kernel/mod2.h"
#include "misc/sirandom.h"
#include "resources/omFindExec.h"
#include "factory/factory.h"
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
#include "misc/options.h"
#include "coeffs/coeffs.h"
#include "coeffs/mpr_complex.h"
#include "coeffs/AE.h"
#include "coeffs/AEp.h"
#include "coeffs/AEQ.h"
#include "resources/feResource.h"
#include "polys/monomials/ring.h"
#include "kernel/polys.h"
#include "polys/monomials/maps.h"
#include "polys/matpol.h"
#include "polys/weight.h"
#include "coeffs/bigintmat.h"
#include "kernel/fast_mult.h"
#include "kernel/digitech.h"
#include "kernel/combinatorics/stairc.h"
#include "kernel/ideals.h"
#include "kernel/GBEngine/kstd1.h"
#include "kernel/GBEngine/syz.h"
#include "kernel/GBEngine/kutil.h"
#include "kernel/GBEngine/shiftgb.h"
#include "kernel/linear_algebra/linearAlgebra.h"
#include "kernel/combinatorics/hutil.h"
#include "kernel/GBEngine/tgb.h"
#include "kernel/linear_algebra/minpoly.h"
#include "numeric/mpr_base.h"
#include "tok.h"
#include "ipid.h"
#include "lists.h"
#include "cntrlc.h"
#include "ipshell.h"
#include "sdb.h"
#include "feOpt.h"
#include "fehelp.h"
#include "distrib.h"
#include "misc_ip.h"
#include "attrib.h"
#include "links/silink.h"
#include "links/ssiLink.h"
#include "walk.h"
#include "Singular/newstruct.h"
#include "Singular/blackbox.h"
#include "Singular/pyobject_setup.h"
#include "kernel/GBEngine/ringgb.h"
#include "kernel/GBEngine/f5gb.h"
#include "kernel/spectrum/spectrum.h"
#include "polys/nc/nc.h"
#include "polys/nc/ncSAMult.h"
#include "polys/nc/sca.h"
#include "kernel/GBEngine/nc.h"
#include "ipconv.h"
#include "kernel/GBEngine/ratgring.h"
#include "polys/flintconv.h"
#include "polys/clapconv.h"
#include "kernel/GBEngine/kstdfac.h"
#include "polys/clapsing.h"
#include "eigenval_ip.h"
#include "gms.h"
#include "Singular/links/simpleipc.h"
#include "pcv.h"
#include "kernel/fglm/fglm.h"
#include "hc_newton.h"
#include "polys/mod_raw.h"

Go to the source code of this file.

Macros

#define HAVE_WALK   1
 
#define HAVE_EXTENDED_SYSTEM   1
 
#define TEST_FOR(A)   if(strcmp(s,A)==0) res->data=(void *)1; else
 
#define HAVE_SHEAFCOH_TRICKS   1
 

Functions

static BOOLEAN jjEXTENDED_SYSTEM (leftv res, leftv h)
 
unsigned long ** singularMatrixToLongMatrix (matrix singularMatrix)
 
poly longCoeffsToSingularPoly (unsigned long *polyCoeffs, const int degree)
 
BOOLEAN jjSYSTEM (leftv res, leftv args)
 

Macro Definition Documentation

◆ HAVE_EXTENDED_SYSTEM

#define HAVE_EXTENDED_SYSTEM   1

Definition at line 140 of file extra.cc.

◆ HAVE_SHEAFCOH_TRICKS

#define HAVE_SHEAFCOH_TRICKS   1

◆ HAVE_WALK

#define HAVE_WALK   1

Definition at line 12 of file extra.cc.

◆ TEST_FOR

#define TEST_FOR (   A)    if(strcmp(s,A)==0) res->data=(void *)1; else

Function Documentation

◆ jjEXTENDED_SYSTEM()

static BOOLEAN jjEXTENDED_SYSTEM ( leftv  res,
leftv  h 
)
static

Definition at line 2372 of file extra.cc.

2373 {
2374  if(h->Typ() == STRING_CMD)
2375  {
2376  char *sys_cmd=(char *)(h->Data());
2377  h=h->next;
2378  /*==================== test syz strat =================*/
2379  if (strcmp(sys_cmd, "syz") == 0)
2380  {
2381  if ((h!=NULL) && (h->Typ()==STRING_CMD))
2382  {
2383  const char *s=(const char *)h->Data();
2384  if (strcmp(s,"posInT_EcartFDegpLength")==0)
2386  else if (strcmp(s,"posInT_FDegpLength")==0)
2388  else if (strcmp(s,"posInT_pLength")==0)
2390  else if (strcmp(s,"posInT0")==0)
2392  else if (strcmp(s,"posInT1")==0)
2394  else if (strcmp(s,"posInT2")==0)
2396  else if (strcmp(s,"posInT11")==0)
2398  else if (strcmp(s,"posInT110")==0)
2400  else if (strcmp(s,"posInT13")==0)
2402  else if (strcmp(s,"posInT15")==0)
2404  else if (strcmp(s,"posInT17")==0)
2406  else if (strcmp(s,"posInT17_c")==0)
2408  else if (strcmp(s,"posInT19")==0)
2410  else PrintS("valid posInT:0,1,2,11,110,13,15,17,17_c,19,_EcartFDegpLength,_FDegpLength,_pLength,_EcartpLength\n");
2411  }
2412  else
2413  {
2414  test_PosInT=NULL;
2415  test_PosInL=NULL;
2416  }
2417  si_opt_2|=Sy_bit(23);
2418  return FALSE;
2419  }
2420  else
2421  /*==================== locNF ======================================*/
2422  if(strcmp(sys_cmd,"locNF")==0)
2423  {
2424  const short t[]={4,VECTOR_CMD,MODUL_CMD,INT_CMD,INTVEC_CMD};
2425  if (iiCheckTypes(h,t,1))
2426  {
2427  poly f=(poly)h->Data();
2428  h=h->next;
2429  ideal m=(ideal)h->Data();
2430  assumeStdFlag(h);
2431  h=h->next;
2432  int n=(int)((long)h->Data());
2433  h=h->next;
2434  intvec *v=(intvec *)h->Data();
2435 
2436  /* == now the work starts == */
2437 
2438  short * iv=iv2array(v, currRing);
2439  poly r=0;
2440  poly hp=ppJetW(f,n,iv);
2441  int s=MATCOLS(m);
2442  int j=0;
2443  matrix T=mp_InitI(s,1,0, currRing);
2444 
2445  while (hp != NULL)
2446  {
2447  if (pDivisibleBy(m->m[j],hp))
2448  {
2449  if (MATELEM(T,j+1,1)==0)
2450  {
2451  MATELEM(T,j+1,1)=pDivideM(pHead(hp),pHead(m->m[j]));
2452  }
2453  else
2454  {
2455  pAdd(MATELEM(T,j+1,1),pDivideM(pHead(hp),pHead(m->m[j])));
2456  }
2457  hp=ppJetW(ksOldSpolyRed(m->m[j],hp,0),n,iv);
2458  j=0;
2459  }
2460  else
2461  {
2462  if (j==s-1)
2463  {
2464  r=pAdd(r,pHead(hp));
2465  hp=pLmDeleteAndNext(hp); /* hp=pSub(hp,pHead(hp));*/
2466  j=0;
2467  }
2468  else
2469  {
2470  j++;
2471  }
2472  }
2473  }
2474 
2477  for (int k=1;k<=MATROWS(Temp);k++)
2478  {
2479  MATELEM(R,k,1)=MATELEM(Temp,k,1);
2480  }
2481 
2483  L->Init(2);
2484  L->m[0].rtyp=MATRIX_CMD; L->m[0].data=(void *)R;
2485  L->m[1].rtyp=MATRIX_CMD; L->m[1].data=(void *)T;
2486  res->data=L;
2487  res->rtyp=LIST_CMD;
2488  // iv aufraeumen
2489  omFree(iv);
2490  return FALSE;
2491  }
2492  else
2493  return TRUE;
2494  }
2495  else
2496  /*==================== poly debug ==================================*/
2497  if(strcmp(sys_cmd,"p")==0)
2498  {
2499 # ifdef RDEBUG
2500  p_DebugPrint((poly)h->Data(), currRing);
2501 # else
2502  WarnS("Sorry: not available for release build!");
2503 # endif
2504  return FALSE;
2505  }
2506  else
2507  /*==================== setsyzcomp ==================================*/
2508  if(strcmp(sys_cmd,"setsyzcomp")==0)
2509  {
2510  if ((h!=NULL) && (h->Typ()==INT_CMD))
2511  {
2512  int k = (int)(long)h->Data();
2513  if ( currRing->order[0] == ringorder_s )
2514  {
2516  }
2517  }
2518  }
2519  /*==================== ring debug ==================================*/
2520  if(strcmp(sys_cmd,"r")==0)
2521  {
2522 # ifdef RDEBUG
2523  rDebugPrint((ring)h->Data());
2524 # else
2525  WarnS("Sorry: not available for release build!");
2526 # endif
2527  return FALSE;
2528  }
2529  else
2530  /*==================== changeRing ========================*/
2531  /* The following code changes the names of the variables in the
2532  current ring to "x1", "x2", ..., "xN", where N is the number
2533  of variables in the current ring.
2534  The purpose of this rewriting is to eliminate indexed variables,
2535  as they may cause problems when generating scripts for Magma,
2536  Maple, or Macaulay2. */
2537  if(strcmp(sys_cmd,"changeRing")==0)
2538  {
2539  int varN = currRing->N;
2540  char h[12];
2541  for (int i = 1; i <= varN; i++)
2542  {
2543  omFree(currRing->names[i - 1]);
2544  sprintf(h, "x%d", i);
2545  currRing->names[i - 1] = omStrDup(h);
2546  }
2548  res->rtyp = INT_CMD;
2549  res->data = (void*)0L;
2550  return FALSE;
2551  }
2552  else
2553  /*==================== mtrack ==================================*/
2554  if(strcmp(sys_cmd,"mtrack")==0)
2555  {
2556  #ifdef OM_TRACK
2557  om_Opts.MarkAsStatic = 1;
2558  FILE *fd = NULL;
2559  int max = 5;
2560  while (h != NULL)
2561  {
2563  if (fd == NULL && h->Typ()==STRING_CMD)
2564  {
2565  char *fn=(char*) h->Data();
2566  fd = fopen(fn, "w");
2567  if (fd == NULL)
2568  Warn("Can not open %s for writing og mtrack. Using stdout",fn);
2569  }
2570  else if (h->Typ() == INT_CMD)
2571  {
2572  max = (int)(long)h->Data();
2573  }
2574  h = h->Next();
2575  }
2576  omPrintUsedTrackAddrs((fd == NULL ? stdout : fd), max);
2577  if (fd != NULL) fclose(fd);
2578  om_Opts.MarkAsStatic = 0;
2579  return FALSE;
2580  #else
2581  WerrorS("system(\"mtrack\",..) is not implemented in this version");
2582  return TRUE;
2583  #endif
2584  }
2585  else
2586  /*==================== backtrace ==================================*/
2587  #ifndef OM_NDEBUG
2588  if(strcmp(sys_cmd,"backtrace")==0)
2589  {
2590  omPrintCurrentBackTrace(stdout);
2591  return FALSE;
2592  }
2593  else
2594  #endif
2595 
2596 #if !defined(OM_NDEBUG)
2597  /*==================== omMemoryTest ==================================*/
2598  if (strcmp(sys_cmd,"omMemoryTest")==0)
2599  {
2600 
2601 #ifdef OM_STATS_H
2602  PrintS("\n[om_Info]: \n");
2603  omUpdateInfo();
2604 #define OM_PRINT(name) Print(" %-22s : %10ld \n", #name, om_Info . name)
2605  OM_PRINT(MaxBytesSystem);
2606  OM_PRINT(CurrentBytesSystem);
2607  OM_PRINT(MaxBytesSbrk);
2608  OM_PRINT(CurrentBytesSbrk);
2609  OM_PRINT(MaxBytesMmap);
2610  OM_PRINT(CurrentBytesMmap);
2611  OM_PRINT(UsedBytes);
2612  OM_PRINT(AvailBytes);
2613  OM_PRINT(UsedBytesMalloc);
2614  OM_PRINT(AvailBytesMalloc);
2615  OM_PRINT(MaxBytesFromMalloc);
2616  OM_PRINT(CurrentBytesFromMalloc);
2617  OM_PRINT(MaxBytesFromValloc);
2618  OM_PRINT(CurrentBytesFromValloc);
2619  OM_PRINT(UsedBytesFromValloc);
2620  OM_PRINT(AvailBytesFromValloc);
2621  OM_PRINT(MaxPages);
2622  OM_PRINT(UsedPages);
2623  OM_PRINT(AvailPages);
2624  OM_PRINT(MaxRegionsAlloc);
2625  OM_PRINT(CurrentRegionsAlloc);
2626 #undef OM_PRINT
2627 #endif
2628 
2629 #ifdef OM_OPTS_H
2630  PrintS("\n[om_Opts]: \n");
2631 #define OM_PRINT(format, name) Print(" %-22s : %10" format"\n", #name, om_Opts . name)
2632  OM_PRINT("d", MinTrack);
2633  OM_PRINT("d", MinCheck);
2634  OM_PRINT("d", MaxTrack);
2635  OM_PRINT("d", MaxCheck);
2636  OM_PRINT("d", Keep);
2637  OM_PRINT("d", HowToReportErrors);
2638  OM_PRINT("d", MarkAsStatic);
2639  OM_PRINT("u", PagesPerRegion);
2640  OM_PRINT("p", OutOfMemoryFunc);
2641  OM_PRINT("p", MemoryLowFunc);
2642  OM_PRINT("p", ErrorHook);
2643 #undef OM_PRINT
2644 #endif
2645 
2646 #ifdef OM_ERROR_H
2647  Print("\n\n[om_ErrorStatus] : '%s' (%s)\n",
2650  Print("[om_InternalErrorStatus]: '%s' (%s)\n",
2653 
2654 #endif
2655 
2656 // omTestMemory(1);
2657 // omtTestErrors();
2658  return FALSE;
2659  }
2660  else
2661 #endif
2662  /*==================== pDivStat =============================*/
2663  #if defined(PDEBUG) || defined(PDIV_DEBUG)
2664  if(strcmp(sys_cmd,"pDivStat")==0)
2665  {
2666  extern void pPrintDivisbleByStat();
2668  return FALSE;
2669  }
2670  else
2671  #endif
2672  /*==================== red =============================*/
2673  #if 0
2674  if(strcmp(sys_cmd,"red")==0)
2675  {
2676  if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
2677  {
2678  res->rtyp=IDEAL_CMD;
2679  res->data=(void *)kStdred((ideal)h->Data(),NULL,testHomog,NULL);
2680  setFlag(res,FLAG_STD);
2681  return FALSE;
2682  }
2683  else
2684  WerrorS("ideal expected");
2685  }
2686  else
2687  #endif
2688  /*==================== fastcomb =============================*/
2689  if(strcmp(sys_cmd,"fastcomb")==0)
2690  {
2691  if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
2692  {
2693  if (h->next!=NULL)
2694  {
2695  if (h->next->Typ()!=POLY_CMD)
2696  {
2697  WarnS("Wrong types for poly= comb(ideal,poly)");
2698  }
2699  }
2700  res->rtyp=POLY_CMD;
2701  res->data=(void *) fglmLinearCombination(
2702  (ideal)h->Data(),(poly)h->next->Data());
2703  return FALSE;
2704  }
2705  else
2706  WerrorS("ideal expected");
2707  }
2708  else
2709  /*==================== comb =============================*/
2710  if(strcmp(sys_cmd,"comb")==0)
2711  {
2712  if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
2713  {
2714  if (h->next!=NULL)
2715  {
2716  if (h->next->Typ()!=POLY_CMD)
2717  {
2718  WarnS("Wrong types for poly= comb(ideal,poly)");
2719  }
2720  }
2721  res->rtyp=POLY_CMD;
2722  res->data=(void *)fglmNewLinearCombination(
2723  (ideal)h->Data(),(poly)h->next->Data());
2724  return FALSE;
2725  }
2726  else
2727  WerrorS("ideal expected");
2728  }
2729  else
2730  #if 0 /* debug only */
2731  /*==================== listall ===================================*/
2732  if(strcmp(sys_cmd,"listall")==0)
2733  {
2734  void listall(int showproc);
2735  int showproc=0;
2736  if ((h!=NULL) && (h->Typ()==INT_CMD)) showproc=(int)((long)h->Data());
2737  listall(showproc);
2738  return FALSE;
2739  }
2740  else
2741  #endif
2742  #if 0 /* debug only */
2743  /*==================== proclist =================================*/
2744  if(strcmp(sys_cmd,"proclist")==0)
2745  {
2746  void piShowProcList();
2747  piShowProcList();
2748  return FALSE;
2749  }
2750  else
2751  #endif
2752  /* ==================== newton ================================*/
2753  #ifdef HAVE_NEWTON
2754  if(strcmp(sys_cmd,"newton")==0)
2755  {
2756  if ((h->Typ()!=POLY_CMD)
2757  || (h->next->Typ()!=INT_CMD)
2758  || (h->next->next->Typ()!=INT_CMD))
2759  {
2760  WerrorS("system(\"newton\",<poly>,<int>,<int>) expected");
2761  return TRUE;
2762  }
2763  poly p=(poly)(h->Data());
2764  int l=pLength(p);
2765  short *points=(short *)omAlloc(currRing->N*l*sizeof(short));
2766  int i,j,k;
2767  k=0;
2768  poly pp=p;
2769  for (i=0;pp!=NULL;i++)
2770  {
2771  for(j=1;j<=currRing->N;j++)
2772  {
2773  points[k]=pGetExp(pp,j);
2774  k++;
2775  }
2776  pIter(pp);
2777  }
2778  hc_ERG r=hc_KOENIG(currRing->N, // dimension
2779  l, // number of points
2780  (short*) points, // points: x_1, y_1,z_1, x_2,y_2,z2,...
2781  currRing->OrdSgn==-1,
2782  (int) (h->next->Data()), // 1: Milnor, 0: Newton
2783  (int) (h->next->next->Data()) // debug
2784  );
2785  //----<>---Output-----------------------
2786 
2787 
2788  // PrintS("Bin jetzt in extra.cc bei der Auswertung.\n"); // **********
2789 
2790 
2792  L->Init(6);
2793  L->m[0].rtyp=STRING_CMD; // newtonnumber;
2794  L->m[0].data=(void *)omStrDup(r.nZahl);
2795  L->m[1].rtyp=INT_CMD;
2796  L->m[1].data=(void *)(long)r.achse; // flag for unoccupied axes
2797  L->m[2].rtyp=INT_CMD;
2798  L->m[2].data=(void *)(long)r.deg; // #degenerations
2799  if ( r.deg != 0) // only if degenerations exist
2800  {
2801  L->m[3].rtyp=INT_CMD;
2802  L->m[3].data=(void *)(long)r.anz_punkte; // #points
2803  //---<>--number of points------
2804  int anz = r.anz_punkte; // number of points
2805  int dim = (currRing->N); // dimension
2806  intvec* v = new intvec( anz*dim );
2807  for (i=0; i<anz*dim; i++) // copy points
2808  (*v)[i] = r.pu[i];
2809  L->m[4].rtyp=INTVEC_CMD;
2810  L->m[4].data=(void *)v;
2811  //---<>--degenerations---------
2812  int deg = r.deg; // number of points
2813  intvec* w = new intvec( r.speicher ); // necessary memory
2814  i=0; // start copying
2815  do
2816  {
2817  (*w)[i] = r.deg_tab[i];
2818  i++;
2819  }
2820  while (r.deg_tab[i-1] != -2); // mark for end of list
2821  L->m[5].rtyp=INTVEC_CMD;
2822  L->m[5].data=(void *)w;
2823  }
2824  else
2825  {
2826  L->m[3].rtyp=INT_CMD; L->m[3].data=(char *)0;
2827  L->m[4].rtyp=DEF_CMD;
2828  L->m[5].rtyp=DEF_CMD;
2829  }
2830 
2831  res->data=(void *)L;
2832  res->rtyp=LIST_CMD;
2833  // free all pointer in r:
2834  delete[] r.nZahl;
2835  delete[] r.pu;
2836  delete[] r.deg_tab; // Ist das ein Problem??
2837 
2838  omFreeSize((ADDRESS)points,currRing->N*l*sizeof(short));
2839  return FALSE;
2840  }
2841  else
2842  #endif
2843  /*==== connection to Sebastian Jambor's code ======*/
2844  /* This code connects Sebastian Jambor's code for
2845  computing the minimal polynomial of an (n x n) matrix
2846  with entries in F_p to SINGULAR. Two conversion methods
2847  are needed; see further up in this file:
2848  (1) conversion of a matrix with long entries to
2849  a SINGULAR matrix with number entries, where
2850  the numbers are coefficients in currRing;
2851  (2) conversion of an array of longs (encoding the
2852  coefficients of the minimal polynomial) to a
2853  SINGULAR poly living in currRing. */
2854  if (strcmp(sys_cmd, "minpoly") == 0)
2855  {
2856  if ((h == NULL) || (h->Typ() != MATRIX_CMD) || h->next != NULL)
2857  {
2858  Werror("expected exactly one argument: %s",
2859  "a square matrix with number entries");
2860  return TRUE;
2861  }
2862  else
2863  {
2864  matrix m = (matrix)h->Data();
2865  int n = m->rows();
2866  unsigned long p = (unsigned long)n_GetChar(currRing->cf);
2867  if (n != m->cols())
2868  {
2869  WerrorS("expected exactly one argument: "
2870  "a square matrix with number entries");
2871  return TRUE;
2872  }
2873  unsigned long** ml = singularMatrixToLongMatrix(m);
2874  unsigned long* polyCoeffs = computeMinimalPolynomial(ml, n, p);
2875  poly theMinPoly = longCoeffsToSingularPoly(polyCoeffs, n);
2876  res->rtyp = POLY_CMD;
2877  res->data = (void *)theMinPoly;
2878  for (int i = 0; i < n; i++) delete[] ml[i];
2879  delete[] ml;
2880  delete[] polyCoeffs;
2881  return FALSE;
2882  }
2883  }
2884  else
2885  /*==================== sdb_flags =================*/
2886  #ifdef HAVE_SDB
2887  if (strcmp(sys_cmd, "sdb_flags") == 0)
2888  {
2889  if ((h!=NULL) && (h->Typ()==INT_CMD))
2890  {
2891  sdb_flags=(int)((long)h->Data());
2892  }
2893  else
2894  {
2895  WerrorS("system(\"sdb_flags\",`int`) expected");
2896  return TRUE;
2897  }
2898  return FALSE;
2899  }
2900  else
2901  #endif
2902  /*==================== sdb_edit =================*/
2903  #ifdef HAVE_SDB
2904  if (strcmp(sys_cmd, "sdb_edit") == 0)
2905  {
2906  if ((h!=NULL) && (h->Typ()==PROC_CMD))
2907  {
2908  procinfov p=(procinfov)h->Data();
2909  sdb_edit(p);
2910  }
2911  else
2912  {
2913  WerrorS("system(\"sdb_edit\",`proc`) expected");
2914  return TRUE;
2915  }
2916  return FALSE;
2917  }
2918  else
2919  #endif
2920  /*==================== GF =================*/
2921  #if 0 // for testing only
2922  if (strcmp(sys_cmd, "GF") == 0)
2923  {
2924  if ((h!=NULL) && (h->Typ()==POLY_CMD))
2925  {
2926  int c=rChar(currRing);
2927  setCharacteristic( c,nfMinPoly[0], currRing->parameter[0][0] );
2928  CanonicalForm F( convSingGFFactoryGF( (poly)h->Data(), currRing ) );
2929  res->rtyp=POLY_CMD;
2930  res->data=convFactoryGFSingGF( F, currRing );
2931  return FALSE;
2932  }
2933  else { WerrorS("wrong typ"); return TRUE;}
2934  }
2935  else
2936  #endif
2937  /*==================== SVD =================*/
2938  #ifdef HAVE_SVD
2939  if (strcmp(sys_cmd, "svd") == 0)
2940  {
2941  extern lists testsvd(matrix M);
2942  res->rtyp=LIST_CMD;
2943  res->data=(char*)(testsvd((matrix)h->Data()));
2944  return FALSE;
2945  }
2946  else
2947  #endif
2948 
2949 
2950  /*==================== DLL =================*/
2951  #ifdef __CYGWIN__
2952  #ifdef HAVE_DL
2953  /* testing the DLL functionality under Win32 */
2954  if (strcmp(sys_cmd, "DLL") == 0)
2955  {
2956  typedef void (*Void_Func)();
2957  typedef int (*Int_Func)(int);
2958  void *hh=dynl_open("WinDllTest.dll");
2959  if ((h!=NULL) && (h->Typ()==INT_CMD))
2960  {
2961  int (*f)(int);
2962  if (hh!=NULL)
2963  {
2964  int (*f)(int);
2965  f=(Int_Func)dynl_sym(hh,"PlusDll");
2966  int i=10;
2967  if (f!=NULL) printf("%d\n",f(i));
2968  else PrintS("cannot find PlusDll\n");
2969  }
2970  }
2971  else
2972  {
2973  void (*f)();
2974  f= (Void_Func)dynl_sym(hh,"TestDll");
2975  if (f!=NULL) f();
2976  else PrintS("cannot find TestDll\n");
2977  }
2978  return FALSE;
2979  }
2980  else
2981  #endif
2982  #endif
2983  #ifdef HAVE_RING2TOM
2984  /*==================== ring-GB ==================================*/
2985  if (strcmp(sys_cmd, "findZeroPoly")==0)
2986  {
2987  ring r = currRing;
2988  poly f = (poly) h->Data();
2989  res->rtyp=POLY_CMD;
2990  res->data=(poly) kFindZeroPoly(f, r, r);
2991  return(FALSE);
2992  }
2993  else
2994  /*==================== Creating zero polynomials =================*/
2995  #ifdef HAVE_VANIDEAL
2996  if (strcmp(sys_cmd, "createG0")==0)
2997  {
2998  /* long exp[50];
2999  int N = 0;
3000  while (h != NULL)
3001  {
3002  N += 1;
3003  exp[N] = (long) h->Data();
3004  // if (exp[i] % 2 != 0) exp[i] -= 1;
3005  h = h->next;
3006  }
3007  for (int k = 1; N + k <= currRing->N; k++) exp[k] = 0;
3008 
3009  poly t_p;
3010  res->rtyp=POLY_CMD;
3011  res->data= (poly) kCreateZeroPoly(exp, -1, &t_p, currRing, currRing);
3012  return(FALSE); */
3013 
3014  res->rtyp = IDEAL_CMD;
3015  res->data = (ideal) createG0();
3016  return(FALSE);
3017  }
3018  else
3019  #endif
3020  /*==================== redNF_ring =================*/
3021  if (strcmp(sys_cmd, "redNF_ring")==0)
3022  {
3023  ring r = currRing;
3024  poly f = (poly) h->Data();
3025  h = h->next;
3026  ideal G = (ideal) h->Data();
3027  res->rtyp=POLY_CMD;
3028  res->data=(poly) ringRedNF(f, G, r);
3029  return(FALSE);
3030  }
3031  else
3032  #endif
3033  /*==================== Roune Hilb =================*/
3034  if (strcmp(sys_cmd, "hilbroune") == 0)
3035  {
3036  if ((h!=NULL) && (h->Typ()==IDEAL_CMD))
3037  {
3038  slicehilb((ideal)h->Data());
3039  }
3040  else return TRUE;
3041  return FALSE;
3042  }
3043  else
3044  /*==================== F5 Implementation =================*/
3045  #ifdef HAVE_F5
3046  if (strcmp(sys_cmd, "f5")==0)
3047  {
3048  if (h->Typ()!=IDEAL_CMD)
3049  {
3050  WerrorS("ideal expected");
3051  return TRUE;
3052  }
3053 
3054  ring r = currRing;
3055  ideal G = (ideal) h->Data();
3056  h = h->next;
3057  int opt;
3058  if(h != NULL) {
3059  opt = (int) (long) h->Data();
3060  }
3061  else {
3062  opt = 2;
3063  }
3064  h = h->next;
3065  int plus;
3066  if(h != NULL) {
3067  plus = (int) (long) h->Data();
3068  }
3069  else {
3070  plus = 0;
3071  }
3072  h = h->next;
3073  int termination;
3074  if(h != NULL) {
3075  termination = (int) (long) h->Data();
3076  }
3077  else {
3078  termination = 0;
3079  }
3080  res->rtyp=IDEAL_CMD;
3081  res->data=(ideal) F5main(G,r,opt,plus,termination);
3082  return FALSE;
3083  }
3084  else
3085  #endif
3086  /*==================== Testing groebner basis =================*/
3087  #ifdef HAVE_RINGS
3088  if (strcmp(sys_cmd, "NF_ring")==0)
3089  {
3090  ring r = currRing;
3091  poly f = (poly) h->Data();
3092  h = h->next;
3093  ideal G = (ideal) h->Data();
3094  res->rtyp=POLY_CMD;
3095  res->data=(poly) ringNF(f, G, r);
3096  return(FALSE);
3097  }
3098  else
3099  if (strcmp(sys_cmd, "spoly")==0)
3100  {
3101  poly f = pCopy((poly) h->Data());
3102  h = h->next;
3103  poly g = pCopy((poly) h->Data());
3104 
3105  res->rtyp=POLY_CMD;
3106  res->data=(poly) plain_spoly(f,g);
3107  return(FALSE);
3108  }
3109  else
3110  if (strcmp(sys_cmd, "testGB")==0)
3111  {
3112  ideal I = (ideal) h->Data();
3113  h = h->next;
3114  ideal GI = (ideal) h->Data();
3115  res->rtyp = INT_CMD;
3116  res->data = (void *)(long) testGB(I, GI);
3117  return(FALSE);
3118  }
3119  else
3120  #endif
3121  /*==================== sca:AltVar ==================================*/
3122  #ifdef HAVE_PLURAL
3123  if ( (strcmp(sys_cmd, "AltVarStart") == 0) || (strcmp(sys_cmd, "AltVarEnd") == 0) )
3124  {
3125  ring r = currRing;
3126 
3127  if((h!=NULL) && (h->Typ()==RING_CMD)) r = (ring)h->Data(); else
3128  {
3129  WerrorS("`system(\"AltVarStart/End\"[,<ring>])` expected");
3130  return TRUE;
3131  }
3132 
3133  res->rtyp=INT_CMD;
3134 
3135  if (rIsSCA(r))
3136  {
3137  if(strcmp(sys_cmd, "AltVarStart") == 0)
3138  res->data = (void*)(long)scaFirstAltVar(r);
3139  else
3140  res->data = (void*)(long)scaLastAltVar(r);
3141  return FALSE;
3142  }
3143 
3144  WerrorS("`system(\"AltVarStart/End\",<ring>) requires a SCA ring");
3145  return TRUE;
3146  }
3147  else
3148  #endif
3149  /*==================== RatNF, noncomm rational coeffs =================*/
3150  #ifdef HAVE_RATGRING
3151  if (strcmp(sys_cmd, "intratNF") == 0)
3152  {
3153  poly p;
3154  poly *q;
3155  ideal I;
3156  int is, k, id;
3157  if ((h!=NULL) && (h->Typ()==POLY_CMD))
3158  {
3159  p=(poly)h->CopyD();
3160  h=h->next;
3161  // PrintS("poly is done\n");
3162  }
3163  else return TRUE;
3164  if ((h!=NULL) && (h->Typ()==IDEAL_CMD))
3165  {
3166  I=(ideal)h->CopyD();
3167  q = I->m;
3168  h=h->next;
3169  // PrintS("ideal is done\n");
3170  }
3171  else return TRUE;
3172  if ((h!=NULL) && (h->Typ()==INT_CMD))
3173  {
3174  is=(int)((long)(h->Data()));
3175  // res->rtyp=INT_CMD;
3176  // PrintS("int is done\n");
3177  // res->rtyp=IDEAL_CMD;
3178  if (rIsPluralRing(currRing))
3179  {
3180  id = IDELEMS(I);
3181  int *pl=(int*)omAlloc0(IDELEMS(I)*sizeof(int));
3182  for(k=0; k < id; k++)
3183  {
3184  pl[k] = pLength(I->m[k]);
3185  }
3186  PrintS("starting redRat\n");
3187  //res->data = (char *)
3188  redRat(&p, q, pl, (int)IDELEMS(I),is,currRing);
3189  res->data=p;
3190  res->rtyp=POLY_CMD;
3191  // res->data = ncGCD(p,q,currRing);
3192  }
3193  else
3194  {
3195  res->rtyp=POLY_CMD;
3196  res->data=p;
3197  }
3198  }
3199  else return TRUE;
3200  return FALSE;
3201  }
3202  else
3203  /*==================== RatNF, noncomm rational coeffs =================*/
3204  if (strcmp(sys_cmd, "ratNF") == 0)
3205  {
3206  poly p,q;
3207  int is, htype;
3208  if ((h!=NULL) && ( (h->Typ()==POLY_CMD) || (h->Typ()==VECTOR_CMD) ) )
3209  {
3210  p=(poly)h->CopyD();
3211  h=h->next;
3212  htype = h->Typ();
3213  }
3214  else return TRUE;
3215  if ((h!=NULL) && ( (h->Typ()==POLY_CMD) || (h->Typ()==VECTOR_CMD) ) )
3216  {
3217  q=(poly)h->CopyD();
3218  h=h->next;
3219  }
3220  else return TRUE;
3221  if ((h!=NULL) && (h->Typ()==INT_CMD))
3222  {
3223  is=(int)((long)(h->Data()));
3224  res->rtyp=htype;
3225  // res->rtyp=IDEAL_CMD;
3226  if (rIsPluralRing(currRing))
3227  {
3228  res->data = nc_rat_ReduceSpolyNew(q,p,is, currRing);
3229  // res->data = ncGCD(p,q,currRing);
3230  }
3231  else res->data=p;
3232  }
3233  else return TRUE;
3234  return FALSE;
3235  }
3236  else
3237  /*==================== RatSpoly, noncomm rational coeffs =================*/
3238  if (strcmp(sys_cmd, "ratSpoly") == 0)
3239  {
3240  poly p,q;
3241  int is;
3242  if ((h!=NULL) && (h->Typ()==POLY_CMD))
3243  {
3244  p=(poly)h->CopyD();
3245  h=h->next;
3246  }
3247  else return TRUE;
3248  if ((h!=NULL) && (h->Typ()==POLY_CMD))
3249  {
3250  q=(poly)h->CopyD();
3251  h=h->next;
3252  }
3253  else return TRUE;
3254  if ((h!=NULL) && (h->Typ()==INT_CMD))
3255  {
3256  is=(int)((long)(h->Data()));
3257  res->rtyp=POLY_CMD;
3258  // res->rtyp=IDEAL_CMD;
3259  if (rIsPluralRing(currRing))
3260  {
3261  res->data = nc_rat_CreateSpoly(p,q,is,currRing);
3262  // res->data = ncGCD(p,q,currRing);
3263  }
3264  else res->data=p;
3265  }
3266  else return TRUE;
3267  return FALSE;
3268  }
3269  else
3270  #endif // HAVE_RATGRING
3271  /*==================== Rat def =================*/
3272  if (strcmp(sys_cmd, "ratVar") == 0)
3273  {
3274  int start,end;
3275  if ((h!=NULL) && (h->Typ()==POLY_CMD))
3276  {
3277  start=pIsPurePower((poly)h->Data());
3278  h=h->next;
3279  }
3280  else return TRUE;
3281  if ((h!=NULL) && (h->Typ()==POLY_CMD))
3282  {
3283  end=pIsPurePower((poly)h->Data());
3284  h=h->next;
3285  }
3286  else return TRUE;
3287  currRing->real_var_start=start;
3288  currRing->real_var_end=end;
3289  return (start==0)||(end==0)||(start>end);
3290  }
3291  else
3292  /*==================== t-rep-GB ==================================*/
3293  if (strcmp(sys_cmd, "unifastmult")==0)
3294  {
3295  poly f = (poly)h->Data();
3296  h=h->next;
3297  poly g=(poly)h->Data();
3298  res->rtyp=POLY_CMD;
3299  res->data=unifastmult(f,g,currRing);
3300  return(FALSE);
3301  }
3302  else
3303  if (strcmp(sys_cmd, "multifastmult")==0)
3304  {
3305  poly f = (poly)h->Data();
3306  h=h->next;
3307  poly g=(poly)h->Data();
3308  res->rtyp=POLY_CMD;
3309  res->data=multifastmult(f,g,currRing);
3310  return(FALSE);
3311  }
3312  else
3313  if (strcmp(sys_cmd, "mults")==0)
3314  {
3315  res->rtyp=INT_CMD ;
3316  res->data=(void*)(long) Mults();
3317  return(FALSE);
3318  }
3319  else
3320  if (strcmp(sys_cmd, "fastpower")==0)
3321  {
3322  ring r = currRing;
3323  poly f = (poly)h->Data();
3324  h=h->next;
3325  int n=(int)((long)h->Data());
3326  res->rtyp=POLY_CMD ;
3327  res->data=(void*) pFastPower(f,n,r);
3328  return(FALSE);
3329  }
3330  else
3331  if (strcmp(sys_cmd, "normalpower")==0)
3332  {
3333  poly f = (poly)h->Data();
3334  h=h->next;
3335  int n=(int)((long)h->Data());
3336  res->rtyp=POLY_CMD ;
3337  res->data=(void*) pPower(pCopy(f),n);
3338  return(FALSE);
3339  }
3340  else
3341  if (strcmp(sys_cmd, "MCpower")==0)
3342  {
3343  ring r = currRing;
3344  poly f = (poly)h->Data();
3345  h=h->next;
3346  int n=(int)((long)h->Data());
3347  res->rtyp=POLY_CMD ;
3348  res->data=(void*) pFastPowerMC(f,n,r);
3349  return(FALSE);
3350  }
3351  else
3352  if (strcmp(sys_cmd, "bit_subst")==0)
3353  {
3354  ring r = currRing;
3355  poly outer = (poly)h->Data();
3356  h=h->next;
3357  poly inner=(poly)h->Data();
3358  res->rtyp=POLY_CMD ;
3359  res->data=(void*) uni_subst_bits(outer, inner,r);
3360  return(FALSE);
3361  }
3362  else
3363  /*==================== gcd-varianten =================*/
3364  if (strcmp(sys_cmd, "gcd") == 0)
3365  {
3366  if (h==NULL)
3367  {
3368  Print("EZGCD:%d (use EZGCD for gcd of polynomials in char 0)\n",isOn(SW_USE_EZGCD));
3369  Print("EZGCD_P:%d (use EZGCD_P for gcd of polynomials in char p)\n",isOn(SW_USE_EZGCD_P));
3370  Print("CRGCD:%d (use chinese Remainder for gcd of polynomials in char 0)\n",isOn(SW_USE_CHINREM_GCD));
3371  Print("QGCD:%d (use QGCD for gcd of polynomials in alg. ext.)\n",isOn(SW_USE_QGCD));
3372  Print("homog:%d (use homog. test for factorization of polynomials)\n",singular_homog_flag);
3373  return FALSE;
3374  }
3375  else
3376  if ((h!=NULL) && (h->Typ()==STRING_CMD)
3377  && (h->next!=NULL) && (h->next->Typ()==INT_CMD))
3378  {
3379  int d=(int)(long)h->next->Data();
3380  char *s=(char *)h->Data();
3381 #ifdef HAVE_PLURAL
3382  if (strcmp(s,"EZGCD")==0) { if (d) On(SW_USE_EZGCD); else Off(SW_USE_EZGCD); } else
3383  if (strcmp(s,"EZGCD_P")==0) { if (d) On(SW_USE_EZGCD_P); else Off(SW_USE_EZGCD_P); } else
3384  if (strcmp(s,"CRGCD")==0) { if (d) On(SW_USE_CHINREM_GCD); else Off(SW_USE_CHINREM_GCD); } else
3385  if (strcmp(s,"QGCD")==0) { if (d) On(SW_USE_QGCD); else Off(SW_USE_QGCD); } else
3386 #endif
3387  if (strcmp(s,"homog")==0) { if (d) singular_homog_flag=1; else singular_homog_flag=0; } else
3388  return TRUE;
3389  return FALSE;
3390  }
3391  else return TRUE;
3392  }
3393  else
3394  /*==================== subring =================*/
3395  if (strcmp(sys_cmd, "subring") == 0)
3396  {
3397  if (h!=NULL)
3398  {
3399  extern ring rSubring(ring r,leftv v); /* ipshell.cc*/
3400  res->data=(char *)rSubring(currRing,h);
3401  res->rtyp=RING_CMD;
3402  return res->data==NULL;
3403  }
3404  else return TRUE;
3405  }
3406  else
3407  /*==================== HNF =================*/
3408  #ifdef HAVE_NTL
3409  if (strcmp(sys_cmd, "HNF") == 0)
3410  {
3411  if (h!=NULL)
3412  {
3413  res->rtyp=h->Typ();
3414  if (h->Typ()==MATRIX_CMD)
3415  {
3416  res->data=(char *)singntl_HNF((matrix)h->Data(), currRing);
3417  return FALSE;
3418  }
3419  else if (h->Typ()==INTMAT_CMD)
3420  {
3421  res->data=(char *)singntl_HNF((intvec*)h->Data());
3422  return FALSE;
3423  }
3424  else if (h->Typ()==INTMAT_CMD)
3425  {
3426  res->data=(char *)singntl_HNF((intvec*)h->Data());
3427  return FALSE;
3428  }
3429  else
3430  {
3431  WerrorS("expected `system(\"HNF\",<matrix|intmat|bigintmat>)`");
3432  return TRUE;
3433  }
3434  }
3435  else return TRUE;
3436  }
3437  else
3438  /*================= probIrredTest ======================*/
3439  if (strcmp (sys_cmd, "probIrredTest") == 0)
3440  {
3441  if (h!=NULL && (h->Typ()== POLY_CMD) && ((h->next != NULL) && h->next->Typ() == STRING_CMD))
3442  {
3443  CanonicalForm F= convSingPFactoryP((poly)(h->Data()), currRing);
3444  char *s=(char *)h->next->Data();
3445  double error= atof (s);
3446  int irred= probIrredTest (F, error);
3447  res->rtyp= INT_CMD;
3448  res->data= (void*)(long)irred;
3449  return FALSE;
3450  }
3451  else return TRUE;
3452  }
3453  else
3454  #endif
3455  /*==================== mpz_t loader ======================*/
3456  if(strcmp(sys_cmd, "GNUmpLoad")==0)
3457  {
3458  if ((h != NULL) && (h->Typ() == STRING_CMD))
3459  {
3460  char* filename = (char*)h->Data();
3461  FILE* f = fopen(filename, "r");
3462  if (f == NULL)
3463  {
3464  WerrorS( "invalid file name (in paths use '/')");
3465  return FALSE;
3466  }
3467  mpz_t m; mpz_init(m);
3468  mpz_inp_str(m, f, 10);
3469  fclose(f);
3470  number n = n_InitMPZ(m, coeffs_BIGINT);
3471  res->rtyp = BIGINT_CMD;
3472  res->data = (void*)n;
3473  return FALSE;
3474  }
3475  else
3476  {
3477  WerrorS( "expected valid file name as a string");
3478  return TRUE;
3479  }
3480  }
3481  else
3482  /*==================== intvec matching ======================*/
3483  /* Given two non-empty intvecs, the call
3484  'system("intvecMatchingSegments", ivec, jvec);'
3485  computes all occurences of jvec in ivec, i.e., it returns
3486  a list of int indices k such that ivec[k..size(jvec)+k-1] = jvec.
3487  If no such k exists (e.g. when ivec is shorter than jvec), an
3488  intvec with the single entry 0 is being returned. */
3489  if(strcmp(sys_cmd, "intvecMatchingSegments")==0)
3490  {
3491  if ((h != NULL) && (h->Typ() == INTVEC_CMD) &&
3492  (h->next != NULL) && (h->next->Typ() == INTVEC_CMD) &&
3493  (h->next->next == NULL))
3494  {
3495  intvec* ivec = (intvec*)h->Data();
3496  intvec* jvec = (intvec*)h->next->Data();
3497  intvec* r = new intvec(1); (*r)[0] = 0;
3498  int validEntries = 0;
3499  for (int k = 0; k <= ivec->rows() - jvec->rows(); k++)
3500  {
3501  if (memcmp(&(*ivec)[k], &(*jvec)[0],
3502  sizeof(int) * jvec->rows()) == 0)
3503  {
3504  if (validEntries == 0)
3505  (*r)[0] = k + 1;
3506  else
3507  {
3508  r->resize(validEntries + 1);
3509  (*r)[validEntries] = k + 1;
3510  }
3511  validEntries++;
3512  }
3513  }
3514  res->rtyp = INTVEC_CMD;
3515  res->data = (void*)r;
3516  return FALSE;
3517  }
3518  else
3519  {
3520  WerrorS("expected two non-empty intvecs as arguments");
3521  return TRUE;
3522  }
3523  }
3524  else
3525  /* ================== intvecOverlap ======================= */
3526  /* Given two non-empty intvecs, the call
3527  'system("intvecOverlap", ivec, jvec);'
3528  computes the longest intvec kvec such that ivec ends with kvec
3529  and jvec starts with kvec. The length of this overlap is being
3530  returned. If there is no overlap at all, then 0 is being returned. */
3531  if(strcmp(sys_cmd, "intvecOverlap")==0)
3532  {
3533  if ((h != NULL) && (h->Typ() == INTVEC_CMD) &&
3534  (h->next != NULL) && (h->next->Typ() == INTVEC_CMD) &&
3535  (h->next->next == NULL))
3536  {
3537  intvec* ivec = (intvec*)h->Data();
3538  intvec* jvec = (intvec*)h->next->Data();
3539  int ir = ivec->rows(); int jr = jvec->rows();
3540  int r = jr; if (ir < jr) r = ir; /* r = min{ir, jr} */
3541  while ((r >= 1) && (memcmp(&(*ivec)[ir - r], &(*jvec)[0],
3542  sizeof(int) * r) != 0))
3543  r--;
3544  res->rtyp = INT_CMD;
3545  res->data = (void*)(long)r;
3546  return FALSE;
3547  }
3548  else
3549  {
3550  WerrorS("expected two non-empty intvecs as arguments");
3551  return TRUE;
3552  }
3553  }
3554  else
3555  /*==================== Hensel's lemma ======================*/
3556  if(strcmp(sys_cmd, "henselfactors")==0)
3557  {
3558  if ((h != NULL) && (h->Typ() == INT_CMD) &&
3559  (h->next != NULL) && (h->next->Typ() == INT_CMD) &&
3560  (h->next->next != NULL) && (h->next->next->Typ() == POLY_CMD) &&
3561  (h->next->next->next != NULL) &&
3562  (h->next->next->next->Typ() == POLY_CMD) &&
3563  (h->next->next->next->next != NULL) &&
3564  (h->next->next->next->next->Typ() == POLY_CMD) &&
3565  (h->next->next->next->next->next != NULL) &&
3566  (h->next->next->next->next->next->Typ() == INT_CMD) &&
3567  (h->next->next->next->next->next->next == NULL))
3568  {
3569  int xIndex = (int)(long)h->Data();
3570  int yIndex = (int)(long)h->next->Data();
3571  poly hh = (poly)h->next->next->Data();
3572  poly f0 = (poly)h->next->next->next->Data();
3573  poly g0 = (poly)h->next->next->next->next->Data();
3574  int d = (int)(long)h->next->next->next->next->next->Data();
3575  poly f; poly g;
3576  henselFactors(xIndex, yIndex, hh, f0, g0, d, f, g);
3578  L->Init(2);
3579  L->m[0].rtyp = POLY_CMD; L->m[0].data=(void*)f;
3580  L->m[1].rtyp = POLY_CMD; L->m[1].data=(void*)g;
3581  res->rtyp = LIST_CMD;
3582  res->data = (char *)L;
3583  return FALSE;
3584  }
3585  else
3586  {
3587  WerrorS( "expected argument list (int, int, poly, poly, poly, int)");
3588  return TRUE;
3589  }
3590  }
3591  else
3592  /*==================== Approx_Step =================*/
3593  #ifdef HAVE_PLURAL
3594  if (strcmp(sys_cmd, "astep") == 0)
3595  {
3596  ideal I;
3597  if ((h!=NULL) && (h->Typ()==IDEAL_CMD))
3598  {
3599  I=(ideal)h->CopyD();
3600  res->rtyp=IDEAL_CMD;
3601  if (rIsPluralRing(currRing)) res->data=Approx_Step(I);
3602  else res->data=I;
3603  setFlag(res,FLAG_STD);
3604  }
3605  else return TRUE;
3606  return FALSE;
3607  }
3608  else
3609  #endif
3610  /*==================== PrintMat =================*/
3611  #ifdef HAVE_PLURAL
3612  if (strcmp(sys_cmd, "PrintMat") == 0)
3613  {
3614  int a;
3615  int b;
3616  ring r;
3617  int metric;
3618  if (h!=NULL)
3619  {
3620  if (h->Typ()==INT_CMD)
3621  {
3622  a=(int)((long)(h->Data()));
3623  h=h->next;
3624  }
3625  else if (h->Typ()==INT_CMD)
3626  {
3627  b=(int)((long)(h->Data()));
3628  h=h->next;
3629  }
3630  else if (h->Typ()==RING_CMD)
3631  {
3632  r=(ring)h->Data();
3633  h=h->next;
3634  }
3635  else
3636  return TRUE;
3637  }
3638  else
3639  return TRUE;
3640  if ((h!=NULL) && (h->Typ()==INT_CMD))
3641  {
3642  metric=(int)((long)(h->Data()));
3643  }
3644  res->rtyp=MATRIX_CMD;
3645  if (rIsPluralRing(r)) res->data=nc_PrintMat(a,b,r,metric);
3646  else res->data=NULL;
3647  return FALSE;
3648  }
3649  else
3650  #endif
3651 /* ============ NCUseExtensions ======================== */
3652  #ifdef HAVE_PLURAL
3653  if(strcmp(sys_cmd,"NCUseExtensions")==0)
3654  {
3655  if ((h!=NULL) && (h->Typ()==INT_CMD))
3656  res->data=(void *)(long)setNCExtensions( (int)((long)(h->Data())) );
3657  else
3658  res->data=(void *)(long)getNCExtensions();
3659  res->rtyp=INT_CMD;
3660  return FALSE;
3661  }
3662  else
3663  #endif
3664 /* ============ NCGetType ======================== */
3665  #ifdef HAVE_PLURAL
3666  if(strcmp(sys_cmd,"NCGetType")==0)
3667  {
3668  res->rtyp=INT_CMD;
3669  if( rIsPluralRing(currRing) )
3670  res->data=(void *)(long)ncRingType(currRing);
3671  else
3672  res->data=(void *)(-1L);
3673  return FALSE;
3674  }
3675  else
3676  #endif
3677 /* ============ ForceSCA ======================== */
3678  #ifdef HAVE_PLURAL
3679  if(strcmp(sys_cmd,"ForceSCA")==0)
3680  {
3681  if( !rIsPluralRing(currRing) )
3682  return TRUE;
3683  int b, e;
3684  if ((h!=NULL) && (h->Typ()==INT_CMD))
3685  {
3686  b = (int)((long)(h->Data()));
3687  h=h->next;
3688  }
3689  else return TRUE;
3690  if ((h!=NULL) && (h->Typ()==INT_CMD))
3691  {
3692  e = (int)((long)(h->Data()));
3693  }
3694  else return TRUE;
3695  if( !sca_Force(currRing, b, e) )
3696  return TRUE;
3697  return FALSE;
3698  }
3699  else
3700  #endif
3701 /* ============ ForceNewNCMultiplication ======================== */
3702  #ifdef HAVE_PLURAL
3703  if(strcmp(sys_cmd,"ForceNewNCMultiplication")==0)
3704  {
3705  if( !rIsPluralRing(currRing) )
3706  return TRUE;
3707  if( !ncInitSpecialPairMultiplication(currRing) ) // No Plural!
3708  return TRUE;
3709  return FALSE;
3710  }
3711  else
3712  #endif
3713 /* ============ ForceNewOldNCMultiplication ======================== */
3714  #ifdef HAVE_PLURAL
3715  if(strcmp(sys_cmd,"ForceNewOldNCMultiplication")==0)
3716  {
3717  if( !rIsPluralRing(currRing) )
3718  return TRUE;
3719  if( !ncInitSpecialPowersMultiplication(currRing) ) // Enable Formula for Plural (depends on swiches)!
3720  return TRUE;
3721  return FALSE;
3722  }
3723  else
3724  #endif
3725 /*==================== test64 =================*/
3726  #if 0
3727  if(strcmp(sys_cmd,"test64")==0)
3728  {
3729  long l=8;int i;
3730  for(i=1;i<62;i++)
3731  {
3732  l=l<<1;
3733  number n=n_Init(l,coeffs_BIGINT);
3734  Print("%ld= ",l);n_Print(n,coeffs_BIGINT);
3736  n_Delete(&n,coeffs_BIGINT);
3738  PrintS(" F:");
3740  PrintLn();
3741  n_Delete(&n,coeffs_BIGINT);
3742  }
3743  Print("SIZEOF_LONG=%d\n",SIZEOF_LONG);
3744  return FALSE;
3745  }
3746  else
3747  #endif
3748 /*==================== n_SwitchChinRem =================*/
3749  if(strcmp(sys_cmd,"cache_chinrem")==0)
3750  {
3751  extern int n_SwitchChinRem;
3752  Print("caching inverse in chines remainder:%d\n",n_SwitchChinRem);
3753  if ((h!=NULL)&&(h->Typ()==INT_CMD))
3754  n_SwitchChinRem=(int)(long)h->Data();
3755  return FALSE;
3756  }
3757  else
3758 /*==================== LU for bigintmat =================*/
3759 #ifdef SINGULAR_4_2
3760  if(strcmp(sys_cmd,"LU")==0)
3761  {
3762  if ((h!=NULL) && (h->Typ()==CMATRIX_CMD))
3763  {
3764  // get the argument:
3765  bigintmat *b=(bigintmat *)h->Data();
3766  // just for tests: simply transpose
3767  bigintmat *bb=b->transpose();
3768  // return the result:
3769  res->rtyp=CMATRIX_CMD;
3770  res->data=(char*)bb;
3771  return FALSE;
3772  }
3773  else
3774  {
3775  WerrorS("system(\"LU\",<cmatrix>) expected");
3776  return TRUE;
3777  }
3778  }
3779  else
3780 #endif
3781 /*==================== sort =================*/
3782  if(strcmp(sys_cmd,"sort")==0)
3783  {
3784  extern BOOLEAN jjSORTLIST(leftv,leftv);
3785  if (h->Typ()==LIST_CMD)
3786  return jjSORTLIST(res,h);
3787  else
3788  return TRUE;
3789  }
3790  else
3791 /*==================== uniq =================*/
3792  if(strcmp(sys_cmd,"uniq")==0)
3793  {
3794  extern BOOLEAN jjUNIQLIST(leftv, leftv);
3795  if (h->Typ()==LIST_CMD)
3796  return jjUNIQLIST(res,h);
3797  else
3798  return TRUE;
3799  }
3800  else
3801 /*==================== GF(p,n) ==================================*/
3802  if(strcmp(sys_cmd,"GF")==0)
3803  {
3804  const short t[]={3,INT_CMD,INT_CMD,STRING_CMD};
3805  if (iiCheckTypes(h,t,1))
3806  {
3807  int p=(int)(long)h->Data();
3808  int n=(int)(long)h->next->Data();
3809  char *v=(char*)h->next->next->CopyD();
3810  GFInfo param;
3811  param.GFChar = p;
3812  param.GFDegree = n;
3813  param.GFPar_name = v;
3814  coeffs cf= nInitChar(n_GF, &param);
3815  res->rtyp=CRING_CMD;
3816  res->data=cf;
3817  return FALSE;
3818  }
3819  else
3820  return TRUE;
3821  }
3822  else
3823 /*==================== power* ==================================*/
3824  #if 0
3825  if(strcmp(sys_cmd,"power1")==0)
3826  {
3827  res->rtyp=POLY_CMD;
3828  poly f=(poly)h->CopyD();
3829  poly g=pPower(f,2000);
3830  res->data=(void *)g;
3831  return FALSE;
3832  }
3833  else
3834  if(strcmp(sys_cmd,"power2")==0)
3835  {
3836  res->rtyp=POLY_CMD;
3837  poly f=(poly)h->Data();
3838  poly g=pOne();
3839  for(int i=0;i<2000;i++)
3840  g=pMult(g,pCopy(f));
3841  res->data=(void *)g;
3842  return FALSE;
3843  }
3844  if(strcmp(sys_cmd,"power3")==0)
3845  {
3846  res->rtyp=POLY_CMD;
3847  poly f=(poly)h->Data();
3848  poly p2=pMult(pCopy(f),pCopy(f));
3849  poly p4=pMult(pCopy(p2),pCopy(p2));
3850  poly p8=pMult(pCopy(p4),pCopy(p4));
3851  poly p16=pMult(pCopy(p8),pCopy(p8));
3852  poly p32=pMult(pCopy(p16),pCopy(p16));
3853  poly p64=pMult(pCopy(p32),pCopy(p32));
3854  poly p128=pMult(pCopy(p64),pCopy(p64));
3855  poly p256=pMult(pCopy(p128),pCopy(p128));
3856  poly p512=pMult(pCopy(p256),pCopy(p256));
3857  poly p1024=pMult(pCopy(p512),pCopy(p512));
3858  poly p1536=pMult(p1024,p512);
3859  poly p1792=pMult(p1536,p256);
3860  poly p1920=pMult(p1792,p128);
3861  poly p1984=pMult(p1920,p64);
3862  poly p2000=pMult(p1984,p16);
3863  res->data=(void *)p2000;
3864  pDelete(&p2);
3865  pDelete(&p4);
3866  pDelete(&p8);
3867  //pDelete(&p16);
3868  pDelete(&p32);
3869  //pDelete(&p64);
3870  //pDelete(&p128);
3871  //pDelete(&p256);
3872  //pDelete(&p512);
3873  //pDelete(&p1024);
3874  //pDelete(&p1536);
3875  //pDelete(&p1792);
3876  //pDelete(&p1920);
3877  //pDelete(&p1984);
3878  return FALSE;
3879  }
3880  else
3881  #endif
3882 /*==================== Error =================*/
3883  Werror( "(extended) system(\"%s\",...) %s", sys_cmd, feNotImplemented );
3884  }
3885  return TRUE;
3886 }

◆ jjSYSTEM()

BOOLEAN jjSYSTEM ( leftv  res,
leftv  args 
)

Definition at line 228 of file extra.cc.

229 {
230  if(args->Typ() == STRING_CMD)
231  {
232  const char *sys_cmd=(char *)(args->Data());
233  leftv h=args->next;
234 // ONLY documented system calls go here
235 // Undocumented system calls go down into jjEXTENDED_SYSTEM (#ifdef HAVE_EXTENDED_SYSTEM)
236 /*==================== nblocks ==================================*/
237  if (strcmp(sys_cmd, "nblocks") == 0)
238  {
239  ring r;
240  if (h == NULL)
241  {
242  if (currRingHdl != NULL)
243  {
244  r = IDRING(currRingHdl);
245  }
246  else
247  {
248  WerrorS("no ring active");
249  return TRUE;
250  }
251  }
252  else
253  {
254  if (h->Typ() != RING_CMD)
255  {
256  WerrorS("ring expected");
257  return TRUE;
258  }
259  r = (ring) h->Data();
260  }
261  res->rtyp = INT_CMD;
262  res->data = (void*) (long)(rBlocks(r) - 1);
263  return FALSE;
264  }
265 /*==================== version ==================================*/
266  if(strcmp(sys_cmd,"version")==0)
267  {
268  res->rtyp=INT_CMD;
269  res->data=(void *)SINGULAR_VERSION;
270  return FALSE;
271  }
272  else
273 /*==================== alarm ==================================*/
274  if(strcmp(sys_cmd,"alarm")==0)
275  {
276  if ((h!=NULL) &&(h->Typ()==INT_CMD))
277  {
278  // standard variant -> SIGALARM (standard: abort)
279  //alarm((unsigned)h->next->Data());
280  // process time (user +system): SIGVTALARM
281  struct itimerval t,o;
282  memset(&t,0,sizeof(t));
283  t.it_value.tv_sec =(unsigned)((unsigned long)h->Data());
284  setitimer(ITIMER_VIRTUAL,&t,&o);
285  return FALSE;
286  }
287  else
288  WerrorS("int expected");
289  }
290  else
291 /*==================== cpu ==================================*/
292  if(strcmp(sys_cmd,"cpu")==0)
293  {
294  long cpu=1; //feOptValue(FE_OPT_CPUS);
295  #ifdef _SC_NPROCESSORS_ONLN
296  cpu=sysconf(_SC_NPROCESSORS_ONLN);
297  #elif defined(_SC_NPROCESSORS_CONF)
298  cpu=sysconf(_SC_NPROCESSORS_CONF);
299  #endif
300  res->data=(void *)cpu;
301  res->rtyp=INT_CMD;
302  return FALSE;
303  }
304  else
305 /*==================== executable ==================================*/
306  if(strcmp(sys_cmd,"executable")==0)
307  {
308  if ((h!=NULL) && (h->Typ()==STRING_CMD))
309  {
310  char tbuf[MAXPATHLEN];
311  char *s=omFindExec((char*)h->Data(),tbuf);
312  if(s==NULL) s=(char*)"";
313  res->data=(void *)omStrDup(s);
314  res->rtyp=STRING_CMD;
315  return FALSE;
316  }
317  return TRUE;
318  }
319  else
320  /*==================== flatten =============================*/
321  if(strcmp(sys_cmd,"flatten")==0)
322  {
323  if ((h!=NULL) &&(h->Typ()==SMATRIX_CMD))
324  {
325  res->data=(char*)sm_Flatten((ideal)h->Data(),currRing);
326  res->rtyp=SMATRIX_CMD;
327  return FALSE;
328  }
329  else
330  WerrorS("smatrix expected");
331  }
332  else
333  /*==================== unflatten =============================*/
334  if(strcmp(sys_cmd,"unflatten")==0)
335  {
336  const short t1[]={2,SMATRIX_CMD,INT_CMD};
337  if (iiCheckTypes(h,t1,1))
338  {
339  res->data=(char*)sm_UnFlatten((ideal)h->Data(),(int)(long)h->next->Data(),currRing);
340  res->rtyp=SMATRIX_CMD;
341  return res->data==NULL;
342  }
343  else return TRUE;
344  }
345  else
346  /*==================== neworder =============================*/
347  if(strcmp(sys_cmd,"neworder")==0)
348  {
349  if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
350  {
351  res->rtyp=STRING_CMD;
352  res->data=(void *)singclap_neworder((ideal)h->Data(), currRing);
353  return FALSE;
354  }
355  else
356  WerrorS("ideal expected");
357  }
358  else
359 /*===== nc_hilb ===============================================*/
360  // Hilbert series of non-commutative monomial algebras
361  if(strcmp(sys_cmd,"nc_hilb") == 0)
362  {
363  ideal i; int lV;
364  bool ig = FALSE;
365  bool mgrad = FALSE;
366  bool autop = FALSE;
367  int trunDegHs=0;
368  if((h != NULL)&&(h->Typ() == IDEAL_CMD))
369  i = (ideal)h->Data();
370  else
371  {
372  WerrorS("nc_Hilb:ideal expected");
373  return TRUE;
374  }
375  h = h->next;
376  if((h != NULL)&&(h->Typ() == INT_CMD))
377  lV = (int)(long)h->Data();
378  else
379  {
380  WerrorS("nc_Hilb:int expected");
381  return TRUE;
382  }
383  h = h->next;
384  while(h != NULL)
385  {
386  if((int)(long)h->Data() == 1)
387  ig = TRUE;
388  else if((int)(long)h->Data() == 2)
389  mgrad = TRUE;
390  else if(h->Typ()==STRING_CMD)
391  autop = TRUE;
392  else if(h->Typ() == INT_CMD)
393  trunDegHs = (int)(long)h->Data();
394  h = h->next;
395  }
396  if(h != NULL)
397  {
398  WerrorS("nc_Hilb:int 1,2, total degree for the truncation, and a string for printing the details are expected");
399  return TRUE;
400  }
401 
402  HilbertSeries_OrbitData(i, lV, ig, mgrad, autop, trunDegHs);
403  return(FALSE);
404  }
405  else
406 /*===== rcolon ===============================================*/
407  if(strcmp(sys_cmd,"rcolon") == 0)
408  {
409  const short t1[]={3,IDEAL_CMD,POLY_CMD,INT_CMD};
410  if (iiCheckTypes(h,t1,1))
411  {
412  ideal i = (ideal)h->Data();
413  h = h->next;
414  poly w=(poly)h->Data();
415  h = h->next;
416  int lV = (int)(long)h->Data();
417  res->rtyp = IDEAL_CMD;
418  res->data = RightColonOperation(i, w, lV);
419  return(FALSE);
420  }
421  else
422  return TRUE;
423  }
424  else
425 
426 /*==================== sh ==================================*/
427  if(strcmp(sys_cmd,"sh")==0)
428  {
429  if (feOptValue(FE_OPT_NO_SHELL))
430  {
431  WerrorS("shell execution is disallowed in restricted mode");
432  return TRUE;
433  }
434  res->rtyp=INT_CMD;
435  if (h==NULL) res->data = (void *)(long) system("sh");
436  else if (h->Typ()==STRING_CMD)
437  res->data = (void*)(long) system((char*)(h->Data()));
438  else
439  WerrorS("string expected");
440  return FALSE;
441  }
442  else
443 /*========reduce procedure like the global one but with jet bounds=======*/
444  if(strcmp(sys_cmd,"reduce_bound")==0)
445  {
446  poly p;
447  ideal pid=NULL;
448  const short t1[]={3,POLY_CMD,IDEAL_CMD,INT_CMD};
449  const short t2[]={3,IDEAL_CMD,IDEAL_CMD,INT_CMD};
450  const short t3[]={3,VECTOR_CMD,MODUL_CMD,INT_CMD};
451  const short t4[]={3,MODUL_CMD,MODUL_CMD,INT_CMD};
452  if ((iiCheckTypes(h,t1,0))||((iiCheckTypes(h,t3,0))))
453  {
454  p = (poly)h->CopyD();
455  }
456  else if ((iiCheckTypes(h,t2,0))||(iiCheckTypes(h,t4,1)))
457  {
458  pid = (ideal)h->CopyD();
459  }
460  else return TRUE;
461  //int htype;
462  res->rtyp= h->Typ(); /*htype*/
463  ideal q = (ideal)h->next->CopyD();
464  int bound = (int)(long)h->next->next->Data();
465  if (pid==NULL) /*(htype == POLY_CMD || htype == VECTOR_CMD)*/
466  res->data = (char *)kNFBound(q,currRing->qideal,p,bound);
467  else /*(htype == IDEAL_CMD || htype == MODUL_CMD)*/
468  res->data = (char *)kNFBound(q,currRing->qideal,pid,bound);
469  return FALSE;
470  }
471  else
472 /*==================== uname ==================================*/
473  if(strcmp(sys_cmd,"uname")==0)
474  {
475  res->rtyp=STRING_CMD;
476  res->data = omStrDup(S_UNAME);
477  return FALSE;
478  }
479  else
480 /*==================== with ==================================*/
481  if(strcmp(sys_cmd,"with")==0)
482  {
483  if (h==NULL)
484  {
485  res->rtyp=STRING_CMD;
486  res->data=(void *)versionString();
487  return FALSE;
488  }
489  else if (h->Typ()==STRING_CMD)
490  {
491  #define TEST_FOR(A) if(strcmp(s,A)==0) res->data=(void *)1; else
492  char *s=(char *)h->Data();
493  res->rtyp=INT_CMD;
494  #ifdef HAVE_DBM
495  TEST_FOR("DBM")
496  #endif
497  #ifdef HAVE_DLD
498  TEST_FOR("DLD")
499  #endif
500  //TEST_FOR("factory")
501  //TEST_FOR("libfac")
502  #ifdef HAVE_READLINE
503  TEST_FOR("readline")
504  #endif
505  #ifdef TEST_MAC_ORDER
506  TEST_FOR("MAC_ORDER")
507  #endif
508  // unconditional since 3-1-0-6
509  TEST_FOR("Namespaces")
510  #ifdef HAVE_DYNAMIC_LOADING
511  TEST_FOR("DynamicLoading")
512  #endif
513  #ifdef HAVE_EIGENVAL
514  TEST_FOR("eigenval")
515  #endif
516  #ifdef HAVE_GMS
517  TEST_FOR("gms")
518  #endif
519  #ifdef OM_NDEBUG
520  TEST_FOR("om_ndebug")
521  #endif
522  #ifdef SING_NDEBUG
523  TEST_FOR("ndebug")
524  #endif
525  {};
526  return FALSE;
527  #undef TEST_FOR
528  }
529  return TRUE;
530  }
531  else
532  /*==================== browsers ==================================*/
533  if (strcmp(sys_cmd,"browsers")==0)
534  {
535  res->rtyp = STRING_CMD;
536  StringSetS("");
538  res->data = StringEndS();
539  return FALSE;
540  }
541  else
542  /*==================== pid ==================================*/
543  if (strcmp(sys_cmd,"pid")==0)
544  {
545  res->rtyp=INT_CMD;
546  res->data=(void *)(long) getpid();
547  return FALSE;
548  }
549  else
550  /*==================== getenv ==================================*/
551  if (strcmp(sys_cmd,"getenv")==0)
552  {
553  if ((h!=NULL) && (h->Typ()==STRING_CMD))
554  {
555  res->rtyp=STRING_CMD;
556  const char *r=getenv((char *)h->Data());
557  if (r==NULL) r="";
558  res->data=(void *)omStrDup(r);
559  return FALSE;
560  }
561  else
562  {
563  WerrorS("string expected");
564  return TRUE;
565  }
566  }
567  else
568  /*==================== setenv ==================================*/
569  if (strcmp(sys_cmd,"setenv")==0)
570  {
571  #ifdef HAVE_SETENV
572  const short t[]={2,STRING_CMD,STRING_CMD};
573  if (iiCheckTypes(h,t,1))
574  {
575  res->rtyp=STRING_CMD;
576  setenv((char *)h->Data(), (char *)h->next->Data(), 1);
577  res->data=(void *)omStrDup((char *)h->next->Data());
579  return FALSE;
580  }
581  else
582  {
583  return TRUE;
584  }
585  #else
586  WerrorS("setenv not supported on this platform");
587  return TRUE;
588  #endif
589  }
590  else
591  /*==================== Singular ==================================*/
592  if (strcmp(sys_cmd, "Singular") == 0)
593  {
594  res->rtyp=STRING_CMD;
595  const char *r=feResource("Singular");
596  if (r == NULL) r="";
597  res->data = (void*) omStrDup( r );
598  return FALSE;
599  }
600  else
601  if (strcmp(sys_cmd, "SingularLib") == 0)
602  {
603  res->rtyp=STRING_CMD;
604  const char *r=feResource("SearchPath");
605  if (r == NULL) r="";
606  res->data = (void*) omStrDup( r );
607  return FALSE;
608  }
609  else
610  /*==================== options ==================================*/
611  if (strstr(sys_cmd, "--") == sys_cmd)
612  {
613  if (strcmp(sys_cmd, "--") == 0)
614  {
616  return FALSE;
617  }
618  feOptIndex opt = feGetOptIndex(&sys_cmd[2]);
619  if (opt == FE_OPT_UNDEF)
620  {
621  Werror("Unknown option %s", sys_cmd);
622  WerrorS("Use 'system(\"--\");' for listing of available options");
623  return TRUE;
624  }
625  // for Untyped Options (help version),
626  // setting it just triggers action
627  if (feOptSpec[opt].type == feOptUntyped)
628  {
629  feSetOptValue(opt,0);
630  return FALSE;
631  }
632  if (h == NULL)
633  {
634  if (feOptSpec[opt].type == feOptString)
635  {
636  res->rtyp = STRING_CMD;
637  const char *r=(const char*)feOptSpec[opt].value;
638  if (r == NULL) r="";
639  res->data = omStrDup(r);
640  }
641  else
642  {
643  res->rtyp = INT_CMD;
644  res->data = feOptSpec[opt].value;
645  }
646  return FALSE;
647  }
648  if (h->Typ() != STRING_CMD &&
649  h->Typ() != INT_CMD)
650  {
651  WerrorS("Need string or int argument to set option value");
652  return TRUE;
653  }
654  const char* errormsg;
655  if (h->Typ() == INT_CMD)
656  {
657  if (feOptSpec[opt].type == feOptString)
658  {
659  Werror("Need string argument to set value of option %s", sys_cmd);
660  return TRUE;
661  }
662  errormsg = feSetOptValue(opt, (int)((long) h->Data()));
663  if (errormsg != NULL)
664  Werror("Option '--%s=%d' %s", sys_cmd, (int) ((long)h->Data()), errormsg);
665  }
666  else
667  {
668  errormsg = feSetOptValue(opt, (char*) h->Data());
669  if (errormsg != NULL)
670  Werror("Option '--%s=%s' %s", sys_cmd, (char*) h->Data(), errormsg);
671  }
672  if (errormsg != NULL) return TRUE;
673  return FALSE;
674  }
675  else
676  /*==================== HC ==================================*/
677  if (strcmp(sys_cmd,"HC")==0)
678  {
679  res->rtyp=INT_CMD;
680  res->data=(void *)(long) HCord;
681  return FALSE;
682  }
683  else
684  /*==================== random ==================================*/
685  if(strcmp(sys_cmd,"random")==0)
686  {
687  const short t[]={1,INT_CMD};
688  if (h!=NULL)
689  {
690  if (iiCheckTypes(h,t,1))
691  {
692  siRandomStart=(int)((long)h->Data());
695  return FALSE;
696  }
697  else
698  {
699  return TRUE;
700  }
701  }
702  res->rtyp=INT_CMD;
703  res->data=(void*)(long) siSeed;
704  return FALSE;
705  }
706  else
707  /*==================== std_syz =================*/
708  if (strcmp(sys_cmd, "std_syz") == 0)
709  {
710  ideal i1;
711  int i2;
712  if ((h!=NULL) && (h->Typ()==MODUL_CMD))
713  {
714  i1=(ideal)h->CopyD();
715  h=h->next;
716  }
717  else return TRUE;
718  if ((h!=NULL) && (h->Typ()==INT_CMD))
719  {
720  i2=(int)((long)h->Data());
721  }
722  else return TRUE;
723  res->rtyp=MODUL_CMD;
724  res->data=idXXX(i1,i2);
725  return FALSE;
726  }
727  else
728  /*======================= demon_list =====================*/
729  if (strcmp(sys_cmd,"denom_list")==0)
730  {
731  res->rtyp=LIST_CMD;
732  extern lists get_denom_list();
733  res->data=(lists)get_denom_list();
734  return FALSE;
735  }
736  else
737  /*==================== complexNearZero ======================*/
738  if(strcmp(sys_cmd,"complexNearZero")==0)
739  {
740  const short t[]={2,NUMBER_CMD,INT_CMD};
741  if (iiCheckTypes(h,t,1))
742  {
743  if ( !rField_is_long_C(currRing) )
744  {
745  WerrorS( "unsupported ground field!");
746  return TRUE;
747  }
748  else
749  {
750  res->rtyp=INT_CMD;
751  res->data=(void*)complexNearZero((gmp_complex*)h->Data(),
752  (int)((long)(h->next->Data())));
753  return FALSE;
754  }
755  }
756  else
757  {
758  return TRUE;
759  }
760  }
761  else
762  /*==================== getPrecDigits ======================*/
763  if(strcmp(sys_cmd,"getPrecDigits")==0)
764  {
765  if ( (currRing==NULL)
767  {
768  WerrorS( "unsupported ground field!");
769  return TRUE;
770  }
771  res->rtyp=INT_CMD;
772  res->data=(void*)(long)gmp_output_digits;
773  //if (gmp_output_digits!=getGMPFloatDigits())
774  //{ Print("%d, %d\n",getGMPFloatDigits(),gmp_output_digits);}
775  return FALSE;
776  }
777  else
778  /*==================== lduDecomp ======================*/
779  if(strcmp(sys_cmd, "lduDecomp")==0)
780  {
781  const short t[]={1,MATRIX_CMD};
782  if (iiCheckTypes(h,t,1))
783  {
784  matrix aMat = (matrix)h->Data();
785  matrix pMat; matrix lMat; matrix dMat; matrix uMat;
786  poly l; poly u; poly prodLU;
787  lduDecomp(aMat, pMat, lMat, dMat, uMat, l, u, prodLU);
789  L->Init(7);
790  L->m[0].rtyp = MATRIX_CMD; L->m[0].data=(void*)pMat;
791  L->m[1].rtyp = MATRIX_CMD; L->m[1].data=(void*)lMat;
792  L->m[2].rtyp = MATRIX_CMD; L->m[2].data=(void*)dMat;
793  L->m[3].rtyp = MATRIX_CMD; L->m[3].data=(void*)uMat;
794  L->m[4].rtyp = POLY_CMD; L->m[4].data=(void*)l;
795  L->m[5].rtyp = POLY_CMD; L->m[5].data=(void*)u;
796  L->m[6].rtyp = POLY_CMD; L->m[6].data=(void*)prodLU;
797  res->rtyp = LIST_CMD;
798  res->data = (char *)L;
799  return FALSE;
800  }
801  else
802  {
803  return TRUE;
804  }
805  }
806  else
807  /*==================== lduSolve ======================*/
808  if(strcmp(sys_cmd, "lduSolve")==0)
809  {
810  /* for solving a linear equation system A * x = b, via the
811  given LDU-decomposition of the matrix A;
812  There is one valid parametrisation:
813  1) exactly eight arguments P, L, D, U, l, u, lTimesU, b;
814  P, L, D, and U realise the LDU-decomposition of A, that is,
815  P * A = L * D^(-1) * U, and P, L, D, and U satisfy the
816  properties decribed in method 'luSolveViaLDUDecomp' in
817  linearAlgebra.h; see there;
818  l, u, and lTimesU are as described in the same location;
819  b is the right-hand side vector of the linear equation system;
820  The method will return a list of either 1 entry or three entries:
821  1) [0] if there is no solution to the system;
822  2) [1, x, H] if there is at least one solution;
823  x is any solution of the given linear system,
824  H is the matrix with column vectors spanning the homogeneous
825  solution space.
826  The method produces an error if matrix and vector sizes do not
827  fit. */
829  if (!iiCheckTypes(h,t,1))
830  {
831  return TRUE;
832  }
834  {
835  WerrorS("field required");
836  return TRUE;
837  }
838  matrix pMat = (matrix)h->Data();
839  matrix lMat = (matrix)h->next->Data();
840  matrix dMat = (matrix)h->next->next->Data();
841  matrix uMat = (matrix)h->next->next->next->Data();
842  poly l = (poly) h->next->next->next->next->Data();
843  poly u = (poly) h->next->next->next->next->next->Data();
844  poly lTimesU = (poly) h->next->next->next->next->next->next->Data();
845  matrix bVec = (matrix)h->next->next->next->next->next->next->next->Data();
846  matrix xVec; int solvable; matrix homogSolSpace;
847  if (pMat->rows() != pMat->cols())
848  {
849  Werror("first matrix (%d x %d) is not quadratic",
850  pMat->rows(), pMat->cols());
851  return TRUE;
852  }
853  if (lMat->rows() != lMat->cols())
854  {
855  Werror("second matrix (%d x %d) is not quadratic",
856  lMat->rows(), lMat->cols());
857  return TRUE;
858  }
859  if (dMat->rows() != dMat->cols())
860  {
861  Werror("third matrix (%d x %d) is not quadratic",
862  dMat->rows(), dMat->cols());
863  return TRUE;
864  }
865  if (dMat->cols() != uMat->rows())
866  {
867  Werror("third matrix (%d x %d) and fourth matrix (%d x %d) %s",
868  dMat->rows(), dMat->cols(), uMat->rows(), uMat->cols(),
869  "do not t");
870  return TRUE;
871  }
872  if (uMat->rows() != bVec->rows())
873  {
874  Werror("fourth matrix (%d x %d) and vector (%d x 1) do not fit",
875  uMat->rows(), uMat->cols(), bVec->rows());
876  return TRUE;
877  }
878  solvable = luSolveViaLDUDecomp(pMat, lMat, dMat, uMat, l, u, lTimesU,
879  bVec, xVec, homogSolSpace);
880 
881  /* build the return structure; a list with either one or
882  three entries */
884  if (solvable)
885  {
886  ll->Init(3);
887  ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)solvable;
888  ll->m[1].rtyp=MATRIX_CMD; ll->m[1].data=(void *)xVec;
889  ll->m[2].rtyp=MATRIX_CMD; ll->m[2].data=(void *)homogSolSpace;
890  }
891  else
892  {
893  ll->Init(1);
894  ll->m[0].rtyp=INT_CMD; ll->m[0].data=(void *)(long)solvable;
895  }
896  res->rtyp = LIST_CMD;
897  res->data=(char*)ll;
898  return FALSE;
899  }
900  else
901  /*==== countedref: reference and shared ====*/
902  if (strcmp(sys_cmd, "shared") == 0)
903  {
904  #ifndef SI_COUNTEDREF_AUTOLOAD
905  void countedref_shared_load();
907  #endif
908  res->rtyp = NONE;
909  return FALSE;
910  }
911  else if (strcmp(sys_cmd, "reference") == 0)
912  {
913  #ifndef SI_COUNTEDREF_AUTOLOAD
916  #endif
917  res->rtyp = NONE;
918  return FALSE;
919  }
920  else
921 /*==================== semaphore =================*/
922 #ifdef HAVE_SIMPLEIPC
923  if (strcmp(sys_cmd,"semaphore")==0)
924  {
925  if((h!=NULL) && (h->Typ()==STRING_CMD) && (h->next!=NULL) && (h->next->Typ()==INT_CMD))
926  {
927  int v=1;
928  if ((h->next->next!=NULL)&& (h->next->next->Typ()==INT_CMD))
929  v=(int)(long)h->next->next->Data();
930  res->data=(char *)(long)simpleipc_cmd((char *)h->Data(),(int)(long)h->next->Data(),v);
931  res->rtyp=INT_CMD;
932  return FALSE;
933  }
934  else
935  {
936  WerrorS("Usage: system(\"semaphore\",<cmd>,int)");
937  return TRUE;
938  }
939  }
940  else
941 #endif
942 /*==================== reserved port =================*/
943  if (strcmp(sys_cmd,"reserve")==0)
944  {
945  int ssiReservePort(int clients);
946  const short t[]={1,INT_CMD};
947  if (iiCheckTypes(h,t,1))
948  {
949  res->rtyp=INT_CMD;
950  int p=ssiReservePort((int)(long)h->Data());
951  res->data=(void*)(long)p;
952  return (p==0);
953  }
954  return TRUE;
955  }
956  else
957 /*==================== reserved link =================*/
958  if (strcmp(sys_cmd,"reservedLink")==0)
959  {
960  res->rtyp=LINK_CMD;
962  res->data=(void*)p;
963  return (p==NULL);
964  }
965  else
966 /*==================== install newstruct =================*/
967  if (strcmp(sys_cmd,"install")==0)
968  {
969  const short t[]={4,STRING_CMD,STRING_CMD,PROC_CMD,INT_CMD};
970  if (iiCheckTypes(h,t,1))
971  {
972  return newstruct_set_proc((char*)h->Data(),(char*)h->next->Data(),
973  (int)(long)h->next->next->next->Data(),
974  (procinfov)h->next->next->Data());
975  }
976  return TRUE;
977  }
978  else
979 /*==================== newstruct =================*/
980  if (strcmp(sys_cmd,"newstruct")==0)
981  {
982  const short t[]={1,STRING_CMD};
983  if (iiCheckTypes(h,t,1))
984  {
985  int id=0;
986  char *n=(char*)h->Data();
987  blackboxIsCmd(n,id);
988  if (id>0)
989  {
990  blackbox *bb=getBlackboxStuff(id);
991  if (BB_LIKE_LIST(bb))
992  {
993  newstruct_desc desc=(newstruct_desc)bb->data;
994  newstructShow(desc);
995  return FALSE;
996  }
997  else Werror("'%s' is not a newstruct",n);
998  }
999  else Werror("'%s' is not a blackbox object",n);
1000  }
1001  return TRUE;
1002  }
1003  else
1004 /*==================== blackbox =================*/
1005  if (strcmp(sys_cmd,"blackbox")==0)
1006  {
1008  return FALSE;
1009  }
1010  else
1011  /*================= absBiFact ======================*/
1012  #ifdef HAVE_NTL
1013  if (strcmp(sys_cmd, "absFact") == 0)
1014  {
1015  const short t[]={1,POLY_CMD};
1016  if (iiCheckTypes(h,t,1)
1017  && (currRing!=NULL)
1018  && (getCoeffType(currRing->cf)==n_transExt))
1019  {
1020  res->rtyp=LIST_CMD;
1021  intvec *v=NULL;
1022  ideal mipos= NULL;
1023  int n= 0;
1024  ideal f=singclap_absFactorize((poly)(h->Data()), mipos, &v, n, currRing);
1025  if (f==NULL) return TRUE;
1026  ivTest(v);
1028  l->Init(4);
1029  l->m[0].rtyp=IDEAL_CMD;
1030  l->m[0].data=(void *)f;
1031  l->m[1].rtyp=INTVEC_CMD;
1032  l->m[1].data=(void *)v;
1033  l->m[2].rtyp=IDEAL_CMD;
1034  l->m[2].data=(void*) mipos;
1035  l->m[3].rtyp=INT_CMD;
1036  l->m[3].data=(void*) (long) n;
1037  res->data=(void *)l;
1038  return FALSE;
1039  }
1040  else return TRUE;
1041  }
1042  else
1043  #endif
1044  /* =================== LLL via NTL ==============================*/
1045  #ifdef HAVE_NTL
1046  if (strcmp(sys_cmd, "LLL") == 0)
1047  {
1048  if (h!=NULL)
1049  {
1050  res->rtyp=h->Typ();
1051  if (h->Typ()==MATRIX_CMD)
1052  {
1053  res->data=(char *)singntl_LLL((matrix)h->Data(), currRing);
1054  return FALSE;
1055  }
1056  else if (h->Typ()==INTMAT_CMD)
1057  {
1058  res->data=(char *)singntl_LLL((intvec*)h->Data());
1059  return FALSE;
1060  }
1061  else return TRUE;
1062  }
1063  else return TRUE;
1064  }
1065  else
1066  #endif
1067  /* =================== LLL via Flint ==============================*/
1068  #ifdef HAVE_FLINT
1069  #if __FLINT_RELEASE >= 20500
1070  if (strcmp(sys_cmd, "LLL_Flint") == 0)
1071  {
1072  if (h!=NULL)
1073  {
1074  if(h->next == NULL)
1075  {
1076  res->rtyp=h->Typ();
1077  if (h->Typ()==BIGINTMAT_CMD)
1078  {
1079  res->data=(char *)singflint_LLL((bigintmat*)h->Data(), NULL);
1080  return FALSE;
1081  }
1082  else if (h->Typ()==INTMAT_CMD)
1083  {
1084  res->data=(char *)singflint_LLL((intvec*)h->Data(), NULL);
1085  return FALSE;
1086  }
1087  else return TRUE;
1088  }
1089  if(h->next->Typ()!= INT_CMD)
1090  {
1091  WerrorS("matrix,int or bigint,int expected");
1092  return TRUE;
1093  }
1094  if(h->next->Typ()== INT_CMD)
1095  {
1096  if(((int)((long)(h->next->Data())) != 0) && (int)((long)(h->next->Data()) != 1))
1097  {
1098  WerrorS("int is different from 0, 1");
1099  return TRUE;
1100  }
1101  res->rtyp=h->Typ();
1102  if((long)(h->next->Data()) == 0)
1103  {
1104  if (h->Typ()==BIGINTMAT_CMD)
1105  {
1106  res->data=(char *)singflint_LLL((bigintmat*)h->Data(), NULL);
1107  return FALSE;
1108  }
1109  else if (h->Typ()==INTMAT_CMD)
1110  {
1111  res->data=(char *)singflint_LLL((intvec*)h->Data(), NULL);
1112  return FALSE;
1113  }
1114  else return TRUE;
1115  }
1116  // This will give also the transformation matrix U s.t. res = U * m
1117  if((long)(h->next->Data()) == 1)
1118  {
1119  if (h->Typ()==BIGINTMAT_CMD)
1120  {
1121  bigintmat* m = (bigintmat*)h->Data();
1122  bigintmat* T = new bigintmat(m->rows(),m->rows(),m->basecoeffs());
1123  for(int i = 1; i<=m->rows(); i++)
1124  {
1125  n_Delete(&(BIMATELEM(*T,i,i)),T->basecoeffs());
1126  BIMATELEM(*T,i,i)=n_Init(1, T->basecoeffs());
1127  }
1128  m = singflint_LLL(m,T);
1130  L->Init(2);
1131  L->m[0].rtyp = BIGINTMAT_CMD; L->m[0].data = (void*)m;
1132  L->m[1].rtyp = BIGINTMAT_CMD; L->m[1].data = (void*)T;
1133  res->data=L;
1134  res->rtyp=LIST_CMD;
1135  return FALSE;
1136  }
1137  else if (h->Typ()==INTMAT_CMD)
1138  {
1139  intvec* m = (intvec*)h->Data();
1140  intvec* T = new intvec(m->rows(),m->rows(),(int)0);
1141  for(int i = 1; i<=m->rows(); i++)
1142  IMATELEM(*T,i,i)=1;
1143  m = singflint_LLL(m,T);
1145  L->Init(2);
1146  L->m[0].rtyp = INTMAT_CMD; L->m[0].data = (void*)m;
1147  L->m[1].rtyp = INTMAT_CMD; L->m[1].data = (void*)T;
1148  res->data=L;
1149  res->rtyp=LIST_CMD;
1150  return FALSE;
1151  }
1152  else return TRUE;
1153  }
1154  }
1155 
1156  }
1157  else return TRUE;
1158  }
1159  else
1160  #endif
1161  #endif
1162  /*==================== shift-test for freeGB =================*/
1163  #ifdef HAVE_SHIFTBBA
1164  if (strcmp(sys_cmd, "stest") == 0)
1165  {
1166  const short t[]={4,POLY_CMD,INT_CMD,INT_CMD,INT_CMD};
1167  if (iiCheckTypes(h,t,1))
1168  {
1169  poly p=(poly)h->CopyD();
1170  h=h->next;
1171  int sh=(int)((long)(h->Data()));
1172  h=h->next;
1173  int uptodeg=(int)((long)(h->Data()));
1174  h=h->next;
1175  int lVblock=(int)((long)(h->Data()));
1176  if (sh<0)
1177  {
1178  WerrorS("negative shift for pLPshift");
1179  return TRUE;
1180  }
1181  int L = pLastVblock(p,lVblock);
1182  if (L+sh > uptodeg)
1183  {
1184  WerrorS("pLPshift: too big shift requested\n");
1185  return TRUE;
1186  }
1187  res->data = p_LPshift(p,sh,uptodeg,lVblock,currRing);
1188  res->rtyp = POLY_CMD;
1189  return FALSE;
1190  }
1191  else return TRUE;
1192  }
1193  else
1194  #endif
1195  /*==================== block-test for freeGB =================*/
1196  #ifdef HAVE_SHIFTBBA
1197  if (strcmp(sys_cmd, "btest") == 0)
1198  {
1199  const short t[]={2,POLY_CMD,INT_CMD};
1200  if (iiCheckTypes(h,t,1))
1201  {
1202  poly p=(poly)h->CopyD();
1203  h=h->next;
1204  int lV=(int)((long)(h->Data()));
1205  res->rtyp = INT_CMD;
1206  res->data = (void*)(long)pLastVblock(p, lV);
1207  return FALSE;
1208  }
1209  else return TRUE;
1210  }
1211  else
1212  #endif
1213  /*==================== shrink-test for freeGB =================*/
1214  #ifdef HAVE_SHIFTBBA
1215  if (strcmp(sys_cmd, "shrinktest") == 0)
1216  {
1217  const short t[]={2,POLY_CMD,INT_CMD};
1218  if (iiCheckTypes(h,t,1))
1219  {
1220  poly p=(poly)h->Data();
1221  h=h->next;
1222  int lV=(int)((long)(h->Data()));
1223  res->rtyp = POLY_CMD;
1224  // res->data = p_mShrink(p, lV, currRing);
1225  // kStrategy strat=new skStrategy;
1226  // strat->tailRing = currRing;
1227  res->data = p_Shrink(p, lV, currRing);
1228  return FALSE;
1229  }
1230  else return TRUE;
1231  }
1232  else
1233  #endif
1234  /*==================== pcv ==================================*/
1235  #ifdef HAVE_PCV
1236  if(strcmp(sys_cmd,"pcvLAddL")==0)
1237  {
1238  return pcvLAddL(res,h);
1239  }
1240  else
1241  if(strcmp(sys_cmd,"pcvPMulL")==0)
1242  {
1243  return pcvPMulL(res,h);
1244  }
1245  else
1246  if(strcmp(sys_cmd,"pcvMinDeg")==0)
1247  {
1248  return pcvMinDeg(res,h);
1249  }
1250  else
1251  if(strcmp(sys_cmd,"pcvP2CV")==0)
1252  {
1253  return pcvP2CV(res,h);
1254  }
1255  else
1256  if(strcmp(sys_cmd,"pcvCV2P")==0)
1257  {
1258  return pcvCV2P(res,h);
1259  }
1260  else
1261  if(strcmp(sys_cmd,"pcvDim")==0)
1262  {
1263  return pcvDim(res,h);
1264  }
1265  else
1266  if(strcmp(sys_cmd,"pcvBasis")==0)
1267  {
1268  return pcvBasis(res,h);
1269  }
1270  else
1271  #endif
1272  /*==================== hessenberg/eigenvalues ==================================*/
1273  #ifdef HAVE_EIGENVAL
1274  if(strcmp(sys_cmd,"hessenberg")==0)
1275  {
1276  return evHessenberg(res,h);
1277  }
1278  else
1279  #endif
1280  /*==================== eigenvalues ==================================*/
1281  #ifdef HAVE_EIGENVAL
1282  if(strcmp(sys_cmd,"eigenvals")==0)
1283  {
1284  return evEigenvals(res,h);
1285  }
1286  else
1287  #endif
1288  /*==================== rowelim ==================================*/
1289  #ifdef HAVE_EIGENVAL
1290  if(strcmp(sys_cmd,"rowelim")==0)
1291  {
1292  return evRowElim(res,h);
1293  }
1294  else
1295  #endif
1296  /*==================== rowcolswap ==================================*/
1297  #ifdef HAVE_EIGENVAL
1298  if(strcmp(sys_cmd,"rowcolswap")==0)
1299  {
1300  return evSwap(res,h);
1301  }
1302  else
1303  #endif
1304  /*==================== Gauss-Manin system ==================================*/
1305  #ifdef HAVE_GMS
1306  if(strcmp(sys_cmd,"gmsnf")==0)
1307  {
1308  return gmsNF(res,h);
1309  }
1310  else
1311  #endif
1312  /*==================== contributors =============================*/
1313  if(strcmp(sys_cmd,"contributors") == 0)
1314  {
1315  res->rtyp=STRING_CMD;
1316  res->data=(void *)omStrDup(
1317  "Olaf Bachmann, Michael Brickenstein, Hubert Grassmann, Kai Krueger, Victor Levandovskyy, Wolfgang Neumann, Thomas Nuessler, Wilfred Pohl, Jens Schmidt, Mathias Schulze, Thomas Siebert, Ruediger Stobbe, Moritz Wenk, Tim Wichmann");
1318  return FALSE;
1319  }
1320  else
1321  /*==================== spectrum =============================*/
1322  #ifdef HAVE_SPECTRUM
1323  if(strcmp(sys_cmd,"spectrum") == 0)
1324  {
1325  if ((h==NULL) || (h->Typ()!=POLY_CMD))
1326  {
1327  WerrorS("poly expected");
1328  return TRUE;
1329  }
1330  if (h->next==NULL)
1331  return spectrumProc(res,h);
1332  if (h->next->Typ()!=INT_CMD)
1333  {
1334  WerrorS("poly,int expected");
1335  return TRUE;
1336  }
1337  if(((long)h->next->Data())==1L)
1338  return spectrumfProc(res,h);
1339  return spectrumProc(res,h);
1340  }
1341  else
1342  /*==================== semic =============================*/
1343  if(strcmp(sys_cmd,"semic") == 0)
1344  {
1345  if ((h->next!=NULL)
1346  && (h->Typ()==LIST_CMD)
1347  && (h->next->Typ()==LIST_CMD))
1348  {
1349  if (h->next->next==NULL)
1350  return semicProc(res,h,h->next);
1351  else if (h->next->next->Typ()==INT_CMD)
1352  return semicProc3(res,h,h->next,h->next->next);
1353  }
1354  return TRUE;
1355  }
1356  else
1357  /*==================== spadd =============================*/
1358  if(strcmp(sys_cmd,"spadd") == 0)
1359  {
1360  const short t[]={2,LIST_CMD,LIST_CMD};
1361  if (iiCheckTypes(h,t,1))
1362  {
1363  return spaddProc(res,h,h->next);
1364  }
1365  return TRUE;
1366  }
1367  else
1368  /*==================== spmul =============================*/
1369  if(strcmp(sys_cmd,"spmul") == 0)
1370  {
1371  const short t[]={2,LIST_CMD,INT_CMD};
1372  if (iiCheckTypes(h,t,1))
1373  {
1374  return spmulProc(res,h,h->next);
1375  }
1376  return TRUE;
1377  }
1378  else
1379  #endif
1380 /*==================== tensorModuleMult ========================= */
1381  #define HAVE_SHEAFCOH_TRICKS 1
1382 
1383  #ifdef HAVE_SHEAFCOH_TRICKS
1384  if(strcmp(sys_cmd,"tensorModuleMult")==0)
1385  {
1386  const short t[]={2,INT_CMD,MODUL_CMD};
1387  // WarnS("tensorModuleMult!");
1388  if (iiCheckTypes(h,t,1))
1389  {
1390  int m = (int)( (long)h->Data() );
1391  ideal M = (ideal)h->next->Data();
1392  res->rtyp=MODUL_CMD;
1393  res->data=(void *)id_TensorModuleMult(m, M, currRing);
1394  return FALSE;
1395  }
1396  return TRUE;
1397  }
1398  else
1399  #endif
1400  /*==================== twostd =================*/
1401  #ifdef HAVE_PLURAL
1402  if (strcmp(sys_cmd, "twostd") == 0)
1403  {
1404  ideal I;
1405  if ((h!=NULL) && (h->Typ()==IDEAL_CMD))
1406  {
1407  I=(ideal)h->CopyD();
1408  res->rtyp=IDEAL_CMD;
1409  if (rIsPluralRing(currRing)) res->data=twostd(I);
1410  else res->data=I;
1412  setFlag(res,FLAG_STD);
1413  }
1414  else return TRUE;
1415  return FALSE;
1416  }
1417  else
1418  #endif
1419  /*==================== lie bracket =================*/
1420  #ifdef HAVE_PLURAL
1421  if (strcmp(sys_cmd, "bracket") == 0)
1422  {
1423  const short t[]={2,POLY_CMD,POLY_CMD};
1424  if (iiCheckTypes(h,t,1))
1425  {
1426  poly p=(poly)h->CopyD();
1427  h=h->next;
1428  poly q=(poly)h->Data();
1429  res->rtyp=POLY_CMD;
1431  return FALSE;
1432  }
1433  return TRUE;
1434  }
1435  else
1436  #endif
1437  /*==================== env ==================================*/
1438  #ifdef HAVE_PLURAL
1439  if (strcmp(sys_cmd, "env")==0)
1440  {
1441  if ((h!=NULL) && (h->Typ()==RING_CMD))
1442  {
1443  ring r = (ring)h->Data();
1444  res->data = rEnvelope(r);
1445  res->rtyp = RING_CMD;
1446  return FALSE;
1447  }
1448  else
1449  {
1450  WerrorS("`system(\"env\",<ring>)` expected");
1451  return TRUE;
1452  }
1453  }
1454  else
1455  #endif
1456 /* ============ opp ======================== */
1457  #ifdef HAVE_PLURAL
1458  if (strcmp(sys_cmd, "opp")==0)
1459  {
1460  if ((h!=NULL) && (h->Typ()==RING_CMD))
1461  {
1462  ring r=(ring)h->Data();
1463  res->data=rOpposite(r);
1464  res->rtyp=RING_CMD;
1465  return FALSE;
1466  }
1467  else
1468  {
1469  WerrorS("`system(\"opp\",<ring>)` expected");
1470  return TRUE;
1471  }
1472  }
1473  else
1474  #endif
1475  /*==================== oppose ==================================*/
1476  #ifdef HAVE_PLURAL
1477  if (strcmp(sys_cmd, "oppose")==0)
1478  {
1479  if ((h!=NULL) && (h->Typ()==RING_CMD)
1480  && (h->next!= NULL))
1481  {
1482  ring Rop = (ring)h->Data();
1483  h = h->next;
1484  idhdl w;
1485  if ((w=Rop->idroot->get(h->Name(),myynest))!=NULL)
1486  {
1487  poly p = (poly)IDDATA(w);
1488  res->data = pOppose(Rop, p, currRing); // into CurrRing?
1489  res->rtyp = POLY_CMD;
1490  return FALSE;
1491  }
1492  }
1493  else
1494  {
1495  WerrorS("`system(\"oppose\",<ring>,<poly>)` expected");
1496  return TRUE;
1497  }
1498  }
1499  else
1500  #endif
1501  /*==================== freeGB, twosided GB in free algebra =================*/
1502  #ifdef HAVE_PLURAL
1503  #ifdef HAVE_SHIFTBBA
1504  if (strcmp(sys_cmd, "freegb") == 0)
1505  {
1506  const short t[]={3,IDEAL_CMD,INT_CMD,INT_CMD};
1507  const short tM[]={3,MODUL_CMD,INT_CMD,INT_CMD};
1508  if (iiCheckTypes(h,tM,0)
1509  || (iiCheckTypes(h,t,0)))
1510  {
1511  res->rtyp=h->Typ();
1512  ideal I=(ideal)h->CopyD();
1513  h=h->next;
1514  int uptodeg=(int)((long)(h->Data()));
1515  h=h->next;
1516  int lVblock=(int)((long)(h->Data()));
1517  res->data = freegb(I,uptodeg,lVblock);
1518  if (res->data == NULL)
1519  {
1520  /* that is there were input errors */
1521  res->data = I;
1522  }
1523  return FALSE;
1524  }
1525  else
1526  {
1527  WerrorS("system(\"freegb\",`ideal/module`,`int`,`int`) expected");
1528  return TRUE;
1529  }
1530  }
1531  else
1532  #endif /*SHIFTBBA*/
1533  #endif /*PLURAL*/
1534  /*==================== walk stuff =================*/
1535  /*==================== walkNextWeight =================*/
1536  #ifdef HAVE_WALK
1537  #ifdef OWNW
1538  if (strcmp(sys_cmd, "walkNextWeight") == 0)
1539  {
1540  const short t[]={3,INTVEC_CMD,INTVEC_CMD,IDEAL_CMD};
1541  if (!iiCheckTypes(h,t,1)) return TRUE;
1542  if (((intvec*) h->Data())->length() != currRing->N ||
1543  ((intvec*) h->next->Data())->length() != currRing->N)
1544  {
1545  Werror("system(\"walkNextWeight\" ...) intvecs not of length %d\n",
1546  currRing->N);
1547  return TRUE;
1548  }
1549  res->data = (void*) walkNextWeight(((intvec*) h->Data()),
1550  ((intvec*) h->next->Data()),
1551  (ideal) h->next->next->Data());
1552  if (res->data == NULL || res->data == (void*) 1L)
1553  {
1554  res->rtyp = INT_CMD;
1555  }
1556  else
1557  {
1558  res->rtyp = INTVEC_CMD;
1559  }
1560  return FALSE;
1561  }
1562  else
1563  #endif
1564  #endif
1565  /*==================== walkNextWeight =================*/
1566  #ifdef HAVE_WALK
1567  #ifdef OWNW
1568  if (strcmp(sys_cmd, "walkInitials") == 0)
1569  {
1570  if (h == NULL || h->Typ() != IDEAL_CMD)
1571  {
1572  WerrorS("system(\"walkInitials\", ideal) expected");
1573  return TRUE;
1574  }
1575  res->data = (void*) walkInitials((ideal) h->Data());
1576  res->rtyp = IDEAL_CMD;
1577  return FALSE;
1578  }
1579  else
1580  #endif
1581  #endif
1582  /*==================== walkAddIntVec =================*/
1583  #ifdef HAVE_WALK
1584  #ifdef WAIV
1585  if (strcmp(sys_cmd, "walkAddIntVec") == 0)
1586  {
1587  const short t[]={2,INTVEC_CMD,INTVEC_CMD};
1588  if (!iiCheckTypes(h,t,1)) return TRUE;
1589  intvec* arg1 = (intvec*) h->Data();
1590  intvec* arg2 = (intvec*) h->next->Data();
1591  res->data = (intvec*) walkAddIntVec(arg1, arg2);
1592  res->rtyp = INTVEC_CMD;
1593  return FALSE;
1594  }
1595  else
1596  #endif
1597  #endif
1598  /*==================== MwalkNextWeight =================*/
1599  #ifdef HAVE_WALK
1600  #ifdef MwaklNextWeight
1601  if (strcmp(sys_cmd, "MwalkNextWeight") == 0)
1602  {
1603  const short t[]={3,INTVEC_CMD,INTVEC_CMD,IDEAL_CMD};
1604  if (!iiCheckTypes(h,t,1)) return TRUE;
1605  if (((intvec*) h->Data())->length() != currRing->N ||
1606  ((intvec*) h->next->Data())->length() != currRing->N)
1607  {
1608  Werror("system(\"MwalkNextWeight\" ...) intvecs not of length %d\n",
1609  currRing->N);
1610  return TRUE;
1611  }
1612  intvec* arg1 = (intvec*) h->Data();
1613  intvec* arg2 = (intvec*) h->next->Data();
1614  ideal arg3 = (ideal) h->next->next->Data();
1615  intvec* result = (intvec*) MwalkNextWeight(arg1, arg2, arg3);
1616  res->rtyp = INTVEC_CMD;
1617  res->data = result;
1618  return FALSE;
1619  }
1620  else
1621  #endif //MWalkNextWeight
1622  #endif
1623  /*==================== Mivdp =================*/
1624  #ifdef HAVE_WALK
1625  if(strcmp(sys_cmd, "Mivdp") == 0)
1626  {
1627  if (h == NULL || h->Typ() != INT_CMD)
1628  {
1629  WerrorS("system(\"Mivdp\", int) expected");
1630  return TRUE;
1631  }
1632  if ((int) ((long)(h->Data())) != currRing->N)
1633  {
1634  Werror("system(\"Mivdp\" ...) intvecs not of length %d\n",
1635  currRing->N);
1636  return TRUE;
1637  }
1638  int arg1 = (int) ((long)(h->Data()));
1639  intvec* result = (intvec*) Mivdp(arg1);
1640  res->rtyp = INTVEC_CMD;
1641  res->data = result;
1642  return FALSE;
1643  }
1644  else
1645  #endif
1646  /*==================== Mivlp =================*/
1647  #ifdef HAVE_WALK
1648  if(strcmp(sys_cmd, "Mivlp") == 0)
1649  {
1650  if (h == NULL || h->Typ() != INT_CMD)
1651  {
1652  WerrorS("system(\"Mivlp\", int) expected");
1653  return TRUE;
1654  }
1655  if ((int) ((long)(h->Data())) != currRing->N)
1656  {
1657  Werror("system(\"Mivlp\" ...) intvecs not of length %d\n",
1658  currRing->N);
1659  return TRUE;
1660  }
1661  int arg1 = (int) ((long)(h->Data()));
1662  intvec* result = (intvec*) Mivlp(arg1);
1663  res->rtyp = INTVEC_CMD;
1664  res->data = result;
1665  return FALSE;
1666  }
1667  else
1668  #endif
1669  /*==================== MpDiv =================*/
1670  #ifdef HAVE_WALK
1671  #ifdef MpDiv
1672  if(strcmp(sys_cmd, "MpDiv") == 0)
1673  {
1674  const short t[]={2,POLY_CMD,POLY_CMD};
1675  if (!iiCheckTypes(h,t,1)) return TRUE;
1676  poly arg1 = (poly) h->Data();
1677  poly arg2 = (poly) h->next->Data();
1678  poly result = MpDiv(arg1, arg2);
1679  res->rtyp = POLY_CMD;
1680  res->data = result;
1681  return FALSE;
1682  }
1683  else
1684  #endif
1685  #endif
1686  /*==================== MpMult =================*/
1687  #ifdef HAVE_WALK
1688  #ifdef MpMult
1689  if(strcmp(sys_cmd, "MpMult") == 0)
1690  {
1691  const short t[]={2,POLY_CMD,POLY_CMD};
1692  if (!iiCheckTypes(h,t,1)) return TRUE;
1693  poly arg1 = (poly) h->Data();
1694  poly arg2 = (poly) h->next->Data();
1695  poly result = MpMult(arg1, arg2);
1696  res->rtyp = POLY_CMD;
1697  res->data = result;
1698  return FALSE;
1699  }
1700  else
1701  #endif
1702  #endif
1703  /*==================== MivSame =================*/
1704  #ifdef HAVE_WALK
1705  if (strcmp(sys_cmd, "MivSame") == 0)
1706  {
1707  const short t[]={2,INTVEC_CMD,INTVEC_CMD};
1708  if (!iiCheckTypes(h,t,1)) return TRUE;
1709  /*
1710  if (((intvec*) h->Data())->length() != currRing->N ||
1711  ((intvec*) h->next->Data())->length() != currRing->N)
1712  {
1713  Werror("system(\"MivSame\" ...) intvecs not of length %d\n",
1714  currRing->N);
1715  return TRUE;
1716  }
1717  */
1718  intvec* arg1 = (intvec*) h->Data();
1719  intvec* arg2 = (intvec*) h->next->Data();
1720  /*
1721  poly result = (poly) MivSame(arg1, arg2);
1722  res->rtyp = POLY_CMD;
1723  res->data = (poly) result;
1724  */
1725  res->rtyp = INT_CMD;
1726  res->data = (void*)(long) MivSame(arg1, arg2);
1727  return FALSE;
1728  }
1729  else
1730  #endif
1731  /*==================== M3ivSame =================*/
1732  #ifdef HAVE_WALK
1733  if (strcmp(sys_cmd, "M3ivSame") == 0)
1734  {
1735  const short t[]={3,INTVEC_CMD,INTVEC_CMD,INTVEC_CMD};
1736  if (!iiCheckTypes(h,t,1)) return TRUE;
1737  /*
1738  if (((intvec*) h->Data())->length() != currRing->N ||
1739  ((intvec*) h->next->Data())->length() != currRing->N ||
1740  ((intvec*) h->next->next->Data())->length() != currRing->N )
1741  {
1742  Werror("system(\"M3ivSame\" ...) intvecs not of length %d\n",
1743  currRing->N);
1744  return TRUE;
1745  }
1746  */
1747  intvec* arg1 = (intvec*) h->Data();
1748  intvec* arg2 = (intvec*) h->next->Data();
1749  intvec* arg3 = (intvec*) h->next->next->Data();
1750  /*
1751  poly result = (poly) M3ivSame(arg1, arg2, arg3);
1752  res->rtyp = POLY_CMD;
1753  res->data = (poly) result;
1754  */
1755  res->rtyp = INT_CMD;
1756  res->data = (void*)(long) M3ivSame(arg1, arg2, arg3);
1757  return FALSE;
1758  }
1759  else
1760  #endif
1761  /*==================== MwalkInitialForm =================*/
1762  #ifdef HAVE_WALK
1763  if(strcmp(sys_cmd, "MwalkInitialForm") == 0)
1764  {
1765  const short t[]={2,IDEAL_CMD,INTVEC_CMD};
1766  if (!iiCheckTypes(h,t,1)) return TRUE;
1767  if(((intvec*) h->next->Data())->length() != currRing->N)
1768  {
1769  Werror("system \"MwalkInitialForm\"...) intvec not of length %d\n",
1770  currRing->N);
1771  return TRUE;
1772  }
1773  ideal id = (ideal) h->Data();
1774  intvec* int_w = (intvec*) h->next->Data();
1775  ideal result = (ideal) MwalkInitialForm(id, int_w);
1776  res->rtyp = IDEAL_CMD;
1777  res->data = result;
1778  return FALSE;
1779  }
1780  else
1781  #endif
1782  /*==================== MivMatrixOrder =================*/
1783  #ifdef HAVE_WALK
1784  /************** Perturbation walk **********/
1785  if(strcmp(sys_cmd, "MivMatrixOrder") == 0)
1786  {
1787  if(h==NULL || h->Typ() != INTVEC_CMD)
1788  {
1789  WerrorS("system(\"MivMatrixOrder\",intvec) expected");
1790  return TRUE;
1791  }
1792  intvec* arg1 = (intvec*) h->Data();
1793  intvec* result = MivMatrixOrder(arg1);
1794  res->rtyp = INTVEC_CMD;
1795  res->data = result;
1796  return FALSE;
1797  }
1798  else
1799  #endif
1800  /*==================== MivMatrixOrderdp =================*/
1801  #ifdef HAVE_WALK
1802  if(strcmp(sys_cmd, "MivMatrixOrderdp") == 0)
1803  {
1804  if(h==NULL || h->Typ() != INT_CMD)
1805  {
1806  WerrorS("system(\"MivMatrixOrderdp\",intvec) expected");
1807  return TRUE;
1808  }
1809  int arg1 = (int) ((long)(h->Data()));
1810  intvec* result = (intvec*) MivMatrixOrderdp(arg1);
1811  res->rtyp = INTVEC_CMD;
1812  res->data = result;
1813  return FALSE;
1814  }
1815  else
1816  #endif
1817  /*==================== MPertVectors =================*/
1818  #ifdef HAVE_WALK
1819  if(strcmp(sys_cmd, "MPertVectors") == 0)
1820  {
1821  const short t[]={3,IDEAL_CMD,INTVEC_CMD,INT_CMD};
1822  if (!iiCheckTypes(h,t,1)) return TRUE;
1823  ideal arg1 = (ideal) h->Data();
1824  intvec* arg2 = (intvec*) h->next->Data();
1825  int arg3 = (int) ((long)(h->next->next->Data()));
1826  intvec* result = (intvec*) MPertVectors(arg1, arg2, arg3);
1827  res->rtyp = INTVEC_CMD;
1828  res->data = result;
1829  return FALSE;
1830  }
1831  else
1832  #endif
1833  /*==================== MPertVectorslp =================*/
1834  #ifdef HAVE_WALK
1835  if(strcmp(sys_cmd, "MPertVectorslp") == 0)
1836  {
1837  const short t[]={3,IDEAL_CMD,INTVEC_CMD,INT_CMD};
1838  if (!iiCheckTypes(h,t,1)) return TRUE;
1839  ideal arg1 = (ideal) h->Data();
1840  intvec* arg2 = (intvec*) h->next->Data();
1841  int arg3 = (int) ((long)(h->next->next->Data()));
1842  intvec* result = (intvec*) MPertVectorslp(arg1, arg2, arg3);
1843  res->rtyp = INTVEC_CMD;
1844  res->data = result;
1845  return FALSE;
1846  }
1847  else
1848  #endif
1849  /************** fractal walk **********/
1850  #ifdef HAVE_WALK
1851  if(strcmp(sys_cmd, "Mfpertvector") == 0)
1852  {
1853  const short t[]={2,IDEAL_CMD,INTVEC_CMD};
1854  if (!iiCheckTypes(h,t,1)) return TRUE;
1855  ideal arg1 = (ideal) h->Data();
1856  intvec* arg2 = (intvec*) h->next->Data();
1857  intvec* result = Mfpertvector(arg1, arg2);
1858  res->rtyp = INTVEC_CMD;
1859  res->data = result;
1860  return FALSE;
1861  }
1862  else
1863  #endif
1864  /*==================== MivUnit =================*/
1865  #ifdef HAVE_WALK
1866  if(strcmp(sys_cmd, "MivUnit") == 0)
1867  {
1868  const short t[]={1,INT_CMD};
1869  if (!iiCheckTypes(h,t,1)) return TRUE;
1870  int arg1 = (int) ((long)(h->Data()));
1871  intvec* result = (intvec*) MivUnit(arg1);
1872  res->rtyp = INTVEC_CMD;
1873  res->data = result;
1874  return FALSE;
1875  }
1876  else
1877  #endif
1878  /*==================== MivWeightOrderlp =================*/
1879  #ifdef HAVE_WALK
1880  if(strcmp(sys_cmd, "MivWeightOrderlp") == 0)
1881  {
1882  const short t[]={1,INTVEC_CMD};
1883  if (!iiCheckTypes(h,t,1)) return TRUE;
1884  intvec* arg1 = (intvec*) h->Data();
1885  intvec* result = MivWeightOrderlp(arg1);
1886  res->rtyp = INTVEC_CMD;
1887  res->data = result;
1888  return FALSE;
1889  }
1890  else
1891  #endif
1892  /*==================== MivWeightOrderdp =================*/
1893  #ifdef HAVE_WALK
1894  if(strcmp(sys_cmd, "MivWeightOrderdp") == 0)
1895  {
1896  if(h==NULL || h->Typ() != INTVEC_CMD)
1897  {
1898  WerrorS("system(\"MivWeightOrderdp\",intvec) expected");
1899  return TRUE;
1900  }
1901  intvec* arg1 = (intvec*) h->Data();
1902  //int arg2 = (int) h->next->Data();
1903  intvec* result = MivWeightOrderdp(arg1);
1904  res->rtyp = INTVEC_CMD;
1905  res->data = result;
1906  return FALSE;
1907  }
1908  else
1909  #endif
1910  /*==================== MivMatrixOrderlp =================*/
1911  #ifdef HAVE_WALK
1912  if(strcmp(sys_cmd, "MivMatrixOrderlp") == 0)
1913  {
1914  if(h==NULL || h->Typ() != INT_CMD)
1915  {
1916  WerrorS("system(\"MivMatrixOrderlp\",int) expected");
1917  return TRUE;
1918  }
1919  int arg1 = (int) ((long)(h->Data()));
1920  intvec* result = (intvec*) MivMatrixOrderlp(arg1);
1921  res->rtyp = INTVEC_CMD;
1922  res->data = result;
1923  return FALSE;
1924  }
1925  else
1926  #endif
1927  /*==================== MkInterRedNextWeight =================*/
1928  #ifdef HAVE_WALK
1929  if (strcmp(sys_cmd, "MkInterRedNextWeight") == 0)
1930  {
1931  const short t[]={3,INTVEC_CMD,INTVEC_CMD,IDEAL_CMD};
1932  if (!iiCheckTypes(h,t,1)) return TRUE;
1933  if (((intvec*) h->Data())->length() != currRing->N ||
1934  ((intvec*) h->next->Data())->length() != currRing->N)
1935  {
1936  Werror("system(\"MkInterRedNextWeight\" ...) intvecs not of length %d\n",
1937  currRing->N);
1938  return TRUE;
1939  }
1940  intvec* arg1 = (intvec*) h->Data();
1941  intvec* arg2 = (intvec*) h->next->Data();
1942  ideal arg3 = (ideal) h->next->next->Data();
1943  intvec* result = (intvec*) MkInterRedNextWeight(arg1, arg2, arg3);
1944  res->rtyp = INTVEC_CMD;
1945  res->data = result;
1946  return FALSE;
1947  }
1948  else
1949  #endif
1950  /*==================== MPertNextWeight =================*/
1951  #ifdef HAVE_WALK
1952  #ifdef MPertNextWeight
1953  if (strcmp(sys_cmd, "MPertNextWeight") == 0)
1954  {
1955  const short t[]={3,INTVEC_CMD,IDEAL_CMD,INT_CMD};
1956  if (!iiCheckTypes(h,t,1)) return TRUE;
1957  if (((intvec*) h->Data())->length() != currRing->N)
1958  {
1959  Werror("system(\"MPertNextWeight\" ...) intvecs not of length %d\n",
1960  currRing->N);
1961  return TRUE;
1962  }
1963  intvec* arg1 = (intvec*) h->Data();
1964  ideal arg2 = (ideal) h->next->Data();
1965  int arg3 = (int) h->next->next->Data();
1966  intvec* result = (intvec*) MPertNextWeight(arg1, arg2, arg3);
1967  res->rtyp = INTVEC_CMD;
1968  res->data = result;
1969  return FALSE;
1970  }
1971  else
1972  #endif //MPertNextWeight
1973  #endif
1974  /*==================== Mivperttarget =================*/
1975  #ifdef HAVE_WALK
1976  #ifdef Mivperttarget
1977  if (strcmp(sys_cmd, "Mivperttarget") == 0)
1978  {
1979  const short t[]={2,IDEAL_CMD,INT_CMD};
1980  if (!iiCheckTypes(h,t,1)) return TRUE;
1981  ideal arg1 = (ideal) h->Data();
1982  int arg2 = (int) h->next->Data();
1983  intvec* result = (intvec*) Mivperttarget(arg1, arg2);
1984  res->rtyp = INTVEC_CMD;
1985  res->data = result;
1986  return FALSE;
1987  }
1988  else
1989  #endif //Mivperttarget
1990  #endif
1991  /*==================== Mwalk =================*/
1992  #ifdef HAVE_WALK
1993  if (strcmp(sys_cmd, "Mwalk") == 0)
1994  {
1995  const short t[]={6,IDEAL_CMD,INTVEC_CMD,INTVEC_CMD,RING_CMD,INT_CMD,INT_CMD};
1996  if (!iiCheckTypes(h,t,1)) return TRUE;
1997  if (((intvec*) h->next->Data())->length() != currRing->N &&
1998  ((intvec*) h->next->next->Data())->length() != currRing->N )
1999  {
2000  Werror("system(\"Mwalk\" ...) intvecs not of length %d\n",
2001  currRing->N);
2002  return TRUE;
2003  }
2004  ideal arg1 = (ideal) h->CopyD();
2005  intvec* arg2 = (intvec*) h->next->Data();
2006  intvec* arg3 = (intvec*) h->next->next->Data();
2007  ring arg4 = (ring) h->next->next->next->Data();
2008  int arg5 = (int) (long) h->next->next->next->next->Data();
2009  int arg6 = (int) (long) h->next->next->next->next->next->Data();
2010  ideal result = (ideal) Mwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2011  res->rtyp = IDEAL_CMD;
2012  res->data = result;
2013  return FALSE;
2014  }
2015  else
2016  #endif
2017  /*==================== Mpwalk =================*/
2018  #ifdef HAVE_WALK
2019  #ifdef MPWALK_ORIG
2020  if (strcmp(sys_cmd, "Mwalk") == 0)
2021  {
2022  const short t[]={4,IDEAL_CMD,INTVEC_CMD,INTVEC_CMD,RING_CMD};
2023  if (!iiCheckTypes(h,t,1)) return TRUE;
2024  if ((((intvec*) h->next->Data())->length() != currRing->N &&
2025  ((intvec*) h->next->next->Data())->length() != currRing->N ) &&
2026  (((intvec*) h->next->Data())->length() != (currRing->N)*(currRing->N) &&
2027  ((intvec*) h->next->next->Data())->length() != (currRing->N)*(currRing->N)))
2028  {
2029  Werror("system(\"Mwalk\" ...) intvecs not of length %d or %d\n",
2030  currRing->N,(currRing->N)*(currRing->N));
2031  return TRUE;
2032  }
2033  ideal arg1 = (ideal) h->Data();
2034  intvec* arg2 = (intvec*) h->next->Data();
2035  intvec* arg3 = (intvec*) h->next->next->Data();
2036  ring arg4 = (ring) h->next->next->next->Data();
2037  ideal result = (ideal) Mwalk(arg1, arg2, arg3,arg4);
2038  res->rtyp = IDEAL_CMD;
2039  res->data = result;
2040  return FALSE;
2041  }
2042  else
2043  #else
2044  if (strcmp(sys_cmd, "Mpwalk") == 0)
2045  {
2047  if (!iiCheckTypes(h,t,1)) return TRUE;
2048  if(((intvec*) h->next->next->next->Data())->length() != currRing->N &&
2049  ((intvec*) h->next->next->next->next->Data())->length()!=currRing->N)
2050  {
2051  Werror("system(\"Mpwalk\" ...) intvecs not of length %d\n",currRing->N);
2052  return TRUE;
2053  }
2054  ideal arg1 = (ideal) h->Data();
2055  int arg2 = (int) (long) h->next->Data();
2056  int arg3 = (int) (long) h->next->next->Data();
2057  intvec* arg4 = (intvec*) h->next->next->next->Data();
2058  intvec* arg5 = (intvec*) h->next->next->next->next->Data();
2059  int arg6 = (int) (long) h->next->next->next->next->next->Data();
2060  int arg7 = (int) (long) h->next->next->next->next->next->next->Data();
2061  int arg8 = (int) (long) h->next->next->next->next->next->next->next->Data();
2062  ideal result = (ideal) Mpwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
2063  res->rtyp = IDEAL_CMD;
2064  res->data = result;
2065  return FALSE;
2066  }
2067  else
2068  #endif
2069  #endif
2070  /*==================== Mrwalk =================*/
2071  #ifdef HAVE_WALK
2072  if (strcmp(sys_cmd, "Mrwalk") == 0)
2073  {
2075  if (!iiCheckTypes(h,t,1)) return TRUE;
2076  if(((intvec*) h->next->Data())->length() != currRing->N &&
2077  ((intvec*) h->next->Data())->length() != (currRing->N)*(currRing->N) &&
2078  ((intvec*) h->next->next->Data())->length() != currRing->N &&
2079  ((intvec*) h->next->next->Data())->length() != (currRing->N)*(currRing->N) )
2080  {
2081  Werror("system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2082  currRing->N,(currRing->N)*(currRing->N));
2083  return TRUE;
2084  }
2085  ideal arg1 = (ideal) h->Data();
2086  intvec* arg2 = (intvec*) h->next->Data();
2087  intvec* arg3 = (intvec*) h->next->next->Data();
2088  int arg4 = (int)(long) h->next->next->next->Data();
2089  int arg5 = (int)(long) h->next->next->next->next->Data();
2090  int arg6 = (int)(long) h->next->next->next->next->next->Data();
2091  int arg7 = (int)(long) h->next->next->next->next->next->next->Data();
2092  ideal result = (ideal) Mrwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
2093  res->rtyp = IDEAL_CMD;
2094  res->data = result;
2095  return FALSE;
2096  }
2097  else
2098  #endif
2099  /*==================== MAltwalk1 =================*/
2100  #ifdef HAVE_WALK
2101  if (strcmp(sys_cmd, "MAltwalk1") == 0)
2102  {
2103  const short t[]={5,IDEAL_CMD,INT_CMD,INT_CMD,INTVEC_CMD,INTVEC_CMD};
2104  if (!iiCheckTypes(h,t,1)) return TRUE;
2105  if (((intvec*) h->next->next->next->Data())->length() != currRing->N &&
2106  ((intvec*) h->next->next->next->next->Data())->length()!=currRing->N)
2107  {
2108  Werror("system(\"MAltwalk1\" ...) intvecs not of length %d\n",
2109  currRing->N);
2110  return TRUE;
2111  }
2112  ideal arg1 = (ideal) h->Data();
2113  int arg2 = (int) ((long)(h->next->Data()));
2114  int arg3 = (int) ((long)(h->next->next->Data()));
2115  intvec* arg4 = (intvec*) h->next->next->next->Data();
2116  intvec* arg5 = (intvec*) h->next->next->next->next->Data();
2117  ideal result = (ideal) MAltwalk1(arg1, arg2, arg3, arg4, arg5);
2118  res->rtyp = IDEAL_CMD;
2119  res->data = result;
2120  return FALSE;
2121  }
2122  else
2123  #endif
2124  /*==================== MAltwalk1 =================*/
2125  #ifdef HAVE_WALK
2126  #ifdef MFWALK_ALT
2127  if (strcmp(sys_cmd, "Mfwalk_alt") == 0)
2128  {
2129  const short t[]={4,IDEAL_CMD,INTVEC_CMD,INTVEC_CMD,INT_CMD};
2130  if (!iiCheckTypes(h,t,1)) return TRUE;
2131  if (((intvec*) h->next->Data())->length() != currRing->N &&
2132  ((intvec*) h->next->next->Data())->length() != currRing->N )
2133  {
2134  Werror("system(\"Mfwalk\" ...) intvecs not of length %d\n",
2135  currRing->N);
2136  return TRUE;
2137  }
2138  ideal arg1 = (ideal) h->Data();
2139  intvec* arg2 = (intvec*) h->next->Data();
2140  intvec* arg3 = (intvec*) h->next->next->Data();
2141  int arg4 = (int) h->next->next->next->Data();
2142  ideal result = (ideal) Mfwalk_alt(arg1, arg2, arg3, arg4);
2143  res->rtyp = IDEAL_CMD;
2144  res->data = result;
2145  return FALSE;
2146  }
2147  else
2148  #endif
2149  #endif
2150  /*==================== Mfwalk =================*/
2151  #ifdef HAVE_WALK
2152  if (strcmp(sys_cmd, "Mfwalk") == 0)
2153  {
2154  const short t[]={5,IDEAL_CMD,INTVEC_CMD,INTVEC_CMD,INT_CMD,INT_CMD};
2155  if (!iiCheckTypes(h,t,1)) return TRUE;
2156  if (((intvec*) h->next->Data())->length() != currRing->N &&
2157  ((intvec*) h->next->next->Data())->length() != currRing->N )
2158  {
2159  Werror("system(\"Mfwalk\" ...) intvecs not of length %d\n",
2160  currRing->N);
2161  return TRUE;
2162  }
2163  ideal arg1 = (ideal) h->Data();
2164  intvec* arg2 = (intvec*) h->next->Data();
2165  intvec* arg3 = (intvec*) h->next->next->Data();
2166  int arg4 = (int)(long) h->next->next->next->Data();
2167  int arg5 = (int)(long) h->next->next->next->next->Data();
2168  ideal result = (ideal) Mfwalk(arg1, arg2, arg3, arg4, arg5);
2169  res->rtyp = IDEAL_CMD;
2170  res->data = result;
2171  return FALSE;
2172  }
2173  else
2174  #endif
2175  /*==================== Mfrwalk =================*/
2176  #ifdef HAVE_WALK
2177  if (strcmp(sys_cmd, "Mfrwalk") == 0)
2178  {
2179  const short t[]={6,IDEAL_CMD,INTVEC_CMD,INTVEC_CMD,INT_CMD,INT_CMD,INT_CMD};
2180  if (!iiCheckTypes(h,t,1)) return TRUE;
2181 /*
2182  if (((intvec*) h->next->Data())->length() != currRing->N &&
2183  ((intvec*) h->next->next->Data())->length() != currRing->N)
2184  {
2185  Werror("system(\"Mfrwalk\" ...) intvecs not of length %d\n",currRing->N);
2186  return TRUE;
2187  }
2188 */
2189  if((((intvec*) h->next->Data())->length() != currRing->N &&
2190  ((intvec*) h->next->next->Data())->length() != currRing->N ) &&
2191  (((intvec*) h->next->Data())->length() != (currRing->N)*(currRing->N) &&
2192  ((intvec*) h->next->next->Data())->length() != (currRing->N)*(currRing->N) ))
2193  {
2194  Werror("system(\"Mfrwalk\" ...) intvecs not of length %d or %d\n",
2195  currRing->N,(currRing->N)*(currRing->N));
2196  return TRUE;
2197  }
2198 
2199  ideal arg1 = (ideal) h->Data();
2200  intvec* arg2 = (intvec*) h->next->Data();
2201  intvec* arg3 = (intvec*) h->next->next->Data();
2202  int arg4 = (int)(long) h->next->next->next->Data();
2203  int arg5 = (int)(long) h->next->next->next->next->Data();
2204  int arg6 = (int)(long) h->next->next->next->next->next->Data();
2205  ideal result = (ideal) Mfrwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2206  res->rtyp = IDEAL_CMD;
2207  res->data = result;
2208  return FALSE;
2209  }
2210  else
2211  /*==================== Mprwalk =================*/
2212  if (strcmp(sys_cmd, "Mprwalk") == 0)
2213  {
2215  if (!iiCheckTypes(h,t,1)) return TRUE;
2216  if((((intvec*) h->next->Data())->length() != currRing->N &&
2217  ((intvec*) h->next->next->Data())->length() != currRing->N ) &&
2218  (((intvec*) h->next->Data())->length() != (currRing->N)*(currRing->N) &&
2219  ((intvec*) h->next->next->Data())->length() != (currRing->N)*(currRing->N) ))
2220  {
2221  Werror("system(\"Mrwalk\" ...) intvecs not of length %d or %d\n",
2222  currRing->N,(currRing->N)*(currRing->N));
2223  return TRUE;
2224  }
2225  ideal arg1 = (ideal) h->Data();
2226  intvec* arg2 = (intvec*) h->next->Data();
2227  intvec* arg3 = (intvec*) h->next->next->Data();
2228  int arg4 = (int)(long) h->next->next->next->Data();
2229  int arg5 = (int)(long) h->next->next->next->next->Data();
2230  int arg6 = (int)(long) h->next->next->next->next->next->Data();
2231  int arg7 = (int)(long) h->next->next->next->next->next->next->Data();
2232  int arg8 = (int)(long) h->next->next->next->next->next->next->next->Data();
2233  int arg9 = (int)(long) h->next->next->next->next->next->next->next->next->Data();
2234  ideal result = (ideal) Mprwalk(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
2235  res->rtyp = IDEAL_CMD;
2236  res->data = result;
2237  return FALSE;
2238  }
2239  else
2240  #endif
2241  /*==================== TranMImprovwalk =================*/
2242  #ifdef HAVE_WALK
2243  #ifdef TRAN_Orig
2244  if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2245  {
2246  const short t[]={3,IDEAL_CMD,INTVEC_CMD,INTVEC_CMD};
2247  if (!iiCheckTypes(h,t,1)) return TRUE;
2248  if (((intvec*) h->next->Data())->length() != currRing->N &&
2249  ((intvec*) h->next->next->Data())->length() != currRing->N )
2250  {
2251  Werror("system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2252  currRing->N);
2253  return TRUE;
2254  }
2255  ideal arg1 = (ideal) h->Data();
2256  intvec* arg2 = (intvec*) h->next->Data();
2257  intvec* arg3 = (intvec*) h->next->next->Data();
2258  ideal result = (ideal) TranMImprovwalk(arg1, arg2, arg3);
2259  res->rtyp = IDEAL_CMD;
2260  res->data = result;
2261  return FALSE;
2262  }
2263  else
2264  #endif
2265  #endif
2266  /*==================== MAltwalk2 =================*/
2267  #ifdef HAVE_WALK
2268  if (strcmp(sys_cmd, "MAltwalk2") == 0)
2269  {
2270  const short t[]={3,IDEAL_CMD,INTVEC_CMD,INTVEC_CMD};
2271  if (!iiCheckTypes(h,t,1)) return TRUE;
2272  if (((intvec*) h->next->Data())->length() != currRing->N &&
2273  ((intvec*) h->next->next->Data())->length() != currRing->N )
2274  {
2275  Werror("system(\"MAltwalk2\" ...) intvecs not of length %d\n",
2276  currRing->N);
2277  return TRUE;
2278  }
2279  ideal arg1 = (ideal) h->Data();
2280  intvec* arg2 = (intvec*) h->next->Data();
2281  intvec* arg3 = (intvec*) h->next->next->Data();
2282  ideal result = (ideal) MAltwalk2(arg1, arg2, arg3);
2283  res->rtyp = IDEAL_CMD;
2284  res->data = result;
2285  return FALSE;
2286  }
2287  else
2288  #endif
2289  /*==================== MAltwalk2 =================*/
2290  #ifdef HAVE_WALK
2291  if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
2292  {
2293  const short t[]={4,IDEAL_CMD,INTVEC_CMD,INTVEC_CMD,INT_CMD};
2294  if (!iiCheckTypes(h,t,1)) return TRUE;
2295  if (((intvec*) h->next->Data())->length() != currRing->N &&
2296  ((intvec*) h->next->next->Data())->length() != currRing->N )
2297  {
2298  Werror("system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
2299  currRing->N);
2300  return TRUE;
2301  }
2302  ideal arg1 = (ideal) h->Data();
2303  intvec* arg2 = (intvec*) h->next->Data();
2304  intvec* arg3 = (intvec*) h->next->next->Data();
2305  int arg4 = (int) ((long)(h->next->next->next->Data()));
2306  ideal result = (ideal) TranMImprovwalk(arg1, arg2, arg3, arg4);
2307  res->rtyp = IDEAL_CMD;
2308  res->data = result;
2309  return FALSE;
2310  }
2311  else
2312  #endif
2313  /*==================== TranMrImprovwalk =================*/
2314  #if 0
2315  #ifdef HAVE_WALK
2316  if (strcmp(sys_cmd, "TranMrImprovwalk") == 0)
2317  {
2318  if (h == NULL || h->Typ() != IDEAL_CMD ||
2319  h->next == NULL || h->next->Typ() != INTVEC_CMD ||
2320  h->next->next == NULL || h->next->next->Typ() != INTVEC_CMD ||
2321  h->next->next->next == NULL || h->next->next->next->Typ() != INT_CMD ||
2322  h->next->next->next == NULL || h->next->next->next->next->Typ() != INT_CMD ||
2323  h->next->next->next == NULL || h->next->next->next->next->next->Typ() != INT_CMD)
2324  {
2325  WerrorS("system(\"TranMrImprovwalk\", ideal, intvec, intvec) expected");
2326  return TRUE;
2327  }
2328  if (((intvec*) h->next->Data())->length() != currRing->N &&
2329  ((intvec*) h->next->next->Data())->length() != currRing->N )
2330  {
2331  Werror("system(\"TranMrImprovwalk\" ...) intvecs not of length %d\n", currRing->N);
2332  return TRUE;
2333  }
2334  ideal arg1 = (ideal) h->Data();
2335  intvec* arg2 = (intvec*) h->next->Data();
2336  intvec* arg3 = (intvec*) h->next->next->Data();
2337  int arg4 = (int)(long) h->next->next->next->Data();
2338  int arg5 = (int)(long) h->next->next->next->next->Data();
2339  int arg6 = (int)(long) h->next->next->next->next->next->Data();
2340  ideal result = (ideal) TranMrImprovwalk(arg1, arg2, arg3, arg4, arg5, arg6);
2341  res->rtyp = IDEAL_CMD;
2342  res->data = result;
2343  return FALSE;
2344  }
2345  else
2346  #endif
2347  #endif
2348  /*================= Extended system call ========================*/
2349  {
2350  #ifndef MAKE_DISTRIBUTION
2351  return(jjEXTENDED_SYSTEM(res, args));
2352  #else
2353  Werror( "system(\"%s\",...) %s", sys_cmd, feNotImplemented );
2354  #endif
2355  }
2356  } /* typ==string */
2357  return TRUE;
2358 }

◆ longCoeffsToSingularPoly()

poly longCoeffsToSingularPoly ( unsigned long *  polyCoeffs,
const int  degree 
)

Definition at line 205 of file extra.cc.

206 {
207  poly result = NULL;
208  for (int i = 0; i <= degree; i++)
209  {
210  if ((int)polyCoeffs[i] != 0)
211  {
212  poly term = p_ISet((int)polyCoeffs[i], currRing);
213  if (i > 0)
214  {
215  p_SetExp(term, 1, i, currRing);
216  p_Setm(term, currRing);
217  }
219  }
220  }
221  return result;
222 }

◆ singularMatrixToLongMatrix()

unsigned long** singularMatrixToLongMatrix ( matrix  singularMatrix)

Definition at line 173 of file extra.cc.

174 {
175  int n = singularMatrix->rows();
176  assume(n == singularMatrix->cols());
177  unsigned long **longMatrix = 0;
178  longMatrix = new unsigned long *[n] ;
179  for (int i = 0 ; i < n; i++)
180  longMatrix[i] = new unsigned long [n];
181  number entry;
182  for (int r = 0; r < n; r++)
183  for (int c = 0; c < n; c++)
184  {
185  poly p=MATELEM(singularMatrix, r + 1, c + 1);
186  int entryAsInt;
187  if (p!=NULL)
188  {
189  entry = p_GetCoeff(p, currRing);
190  entryAsInt = n_Int(entry, currRing->cf);
191  if (entryAsInt < 0) entryAsInt += n_GetChar(currRing->cf);
192  }
193  else
194  entryAsInt=0;
195  longMatrix[r][c] = (unsigned long)entryAsInt;
196  }
197  return longMatrix;
198 }
getCoeffType
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
dim
int dim(ideal I, ring r)
Definition: tropicalStrategy.cc:23
pDivisibleBy
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
Definition: polys.h:138
FALSE
#define FALSE
Definition: auxiliary.h:94
kFindZeroPoly
poly kFindZeroPoly(poly input_p, ring leadRing, ring tailRing)
Definition: kstd2.cc:324
ivTest
#define ivTest(v)
Definition: intvec.h:156
jjUNIQLIST
BOOLEAN jjUNIQLIST(leftv, leftv arg)
Definition: iparith.cc:9558
omPrintUsedTrackAddrs
void omPrintUsedTrackAddrs(FILE *fd, int max_frames)
Definition: omDebugCheck.c:576
pLmDeleteAndNext
#define pLmDeleteAndNext(p)
like pLmDelete, returns pNext(p)
Definition: polys.h:78
error
void error(const char *fmt,...)
Definition: emacs.cc:55
matrix
ip_smatrix * matrix
Definition: matpol.h:31
ncInitSpecialPairMultiplication
BOOLEAN ncInitSpecialPairMultiplication(ring r)
Definition: ncSAMult.cc:266
sleftv::Data
void * Data()
Definition: subexpr.cc:1182
countedref_shared_load
void countedref_shared_load()
Definition: countedref.cc:724
rField_is_long_R
static BOOLEAN rField_is_long_R(const ring r)
Definition: ring.h:533
GFInfo::GFChar
int GFChar
Definition: coeffs.h:94
twostd
ideal twostd(ideal I)
Compute two-sided GB:
Definition: nc.cc:18
fePrintOptValues
void fePrintOptValues()
Definition: feOpt.cc:316
getenv
char * getenv()
feReInitResources
void feReInitResources()
Definition: feResource.cc:207
p_GetCoeff
#define p_GetCoeff(p, r)
Definition: monomials.h:51
TranMImprovwalk
ideal TranMImprovwalk(ideal G, intvec *curr_weight, intvec *target_tmp, int nP)
Definition: walk.cc:8396
multifastmult
poly multifastmult(poly f, poly g, ring r)
Definition: fast_mult.cc:290
ip_smatrix
Definition: matpol.h:15
isOn
bool isOn(int sw)
switches
Definition: canonicalform.cc:1912
Mwalk
ideal Mwalk(ideal Go, intvec *orig_M, intvec *target_M, ring baseRing, int reduction, int printout)
Definition: walk.cc:5302
FLAG_TWOSTD
#define FLAG_TWOSTD
Definition: ipid.h:105
j
int j
Definition: facHensel.cc:105
versionString
char * versionString()
Definition: misc_ip.cc:789
f
FILE * f
Definition: checklibs.c:9
posInT17_c
int posInT17_c(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5754
spectrumfProc
BOOLEAN spectrumfProc(leftv result, leftv first)
Definition: ipshell.cc:4153
omFree
#define omFree(addr)
Definition: omAllocDecl.h:261
gmp_output_digits
size_t gmp_output_digits
Definition: mpr_complex.cc:43
k
int k
Definition: cfEzgcd.cc:92
CRING_CMD
@ CRING_CMD
Definition: tok.h:56
gmsNF
lists gmsNF(ideal p, ideal g, matrix B, int D, int K)
Definition: gms.cc:22
rDebugPrint
void rDebugPrint(const ring r)
Definition: ring.cc:4016
NUMBER_CMD
@ NUMBER_CMD
Definition: grammar.cc:288
procinfov
procinfo * procinfov
Definition: structs.h:63
MATELEM
#define MATELEM(mat, i, j)
Definition: matpol.h:30
bigintmat
Definition: bigintmat.h:52
fglmNewLinearCombination
poly fglmNewLinearCombination(ideal source, poly monset)
Definition: fglmcomb.cc:154
nc_rat_ReduceSpolyNew
poly nc_rat_ReduceSpolyNew(const poly p1, poly p2, int ishift, const ring r)
Definition: ratgring.cc:465
nc_p_Bracket_qq
poly nc_p_Bracket_qq(poly p, const poly q, const ring r)
returns [p,q], destroys p
Definition: old.gring.cc:2243
result
return result
Definition: facAbsBiFact.cc:76
n_GetChar
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
Definition: coeffs.h:444
GFInfo
Creation data needed for finite fields.
Definition: coeffs.h:93
p_DebugPrint
void p_DebugPrint(poly p, const ring r)
Definition: ring.cc:4221
BIGINT_CMD
@ BIGINT_CMD
Definition: tok.h:38
LIST_CMD
@ LIST_CMD
Definition: tok.h:118
pGetExp
#define pGetExp(p, i)
Exponent.
Definition: polys.h:41
evRowElim
matrix evRowElim(matrix M, int i, int j, int k)
Definition: eigenval.cc:47
posInT_EcartFDegpLength
int posInT_EcartFDegpLength(const TSet set, const int length, LObject &p)
Definition: kutil.cc:11494
Mivdp
intvec * Mivdp(int nR)
Definition: walk.cc:1007
ADDRESS
void * ADDRESS
Definition: auxiliary.h:133
posInT17
int posInT17(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5647
MODUL_CMD
@ MODUL_CMD
Definition: grammar.cc:287
MwalkNextWeight
intvec * MwalkNextWeight(intvec *curr_weight, intvec *target_weight, ideal G)
STRING_CMD
@ STRING_CMD
Definition: tok.h:183
feOptIndex
feOptIndex
Definition: feOptGen.h:15
redRat
int redRat(poly *h, poly *reducer, int *red_length, int rl, int ishift, ring r)
Definition: ratgring.cc:593
MPertVectorslp
intvec * MPertVectorslp(ideal G, intvec *ivtarget, int pdeg)
Definition: walk.cc:1299
ncRingType
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:159
M3ivSame
int M3ivSame(intvec *temp, intvec *u, intvec *v)
Definition: walk.cc:914
feGetOptIndex
feOptIndex feGetOptIndex(const char *name)
Definition: feOpt.cc:101
NONE
#define NONE
Definition: tok.h:219
irred
CFList int bool & irred
[in,out] Is A irreducible?
Definition: facFactorize.h:34
points
static coordinates * points
Definition: interpolation.cc:96
cf
CanonicalForm cf
Definition: cfModGcd.cc:4024
ppJetW
#define ppJetW(p, m, iv)
Definition: polys.h:363
freegb
ideal freegb(ideal I, int uptodeg, int lVblock)
Definition: kstd2.cc:4200
omError2String
const char * omError2String(omError_t error)
Definition: omError.c:52
IDDATA
#define IDDATA(a)
Definition: ipid.h:121
feOptUntyped
@ feOptUntyped
Definition: fegetopt.h:77
pFastPowerMC
poly pFastPowerMC(poly f, int n, ring r)
Definition: fast_mult.cc:588
posInT110
int posInT110(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5395
ip_smatrix::cols
int & cols()
Definition: matpol.h:26
iv2array
short * iv2array(intvec *iv, const ring R)
Definition: weight.cc:206
length
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
procinfo
Definition: subexpr.h:54
Mpwalk
ideal Mpwalk(ideal Go, int op_deg, int tp_deg, intvec *curr_weight, intvec *target_weight, int nP, int reduction, int printout)
Definition: walk.cc:5947
g
g
Definition: cfModGcd.cc:4031
MivUnit
intvec * MivUnit(int nV)
Definition: walk.cc:1496
omStrDup
#define omStrDup(s)
Definition: omAllocDecl.h:263
spmulProc
BOOLEAN spmulProc(leftv result, leftv first, leftv second)
Definition: ipshell.cc:4439
feSetOptValue
const char * feSetOptValue(feOptIndex opt, char *optarg)
Definition: feOpt.cc:150
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
DEF_CMD
@ DEF_CMD
Definition: tok.h:58
n_GF
@ n_GF
\GF{p^n < 2^16}
Definition: coeffs.h:33
nInitChar
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:350
omAllocBin
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
feStringAppendBrowsers
void feStringAppendBrowsers(int warn)
Definition: fehelp.cc:344
jjSORTLIST
BOOLEAN jjSORTLIST(leftv, leftv arg)
Definition: iparith.cc:9549
BIGINTMAT_CMD
@ BIGINTMAT_CMD
Definition: grammar.cc:278
semicProc3
BOOLEAN semicProc3(leftv res, leftv u, leftv v, leftv w)
Definition: ipshell.cc:4480
sdb_edit
void sdb_edit(procinfo *pi)
Definition: sdb.cc:110
pDelete
#define pDelete(p_ptr)
Definition: polys.h:181
getNCExtensions
int & getNCExtensions()
Definition: old.gring.cc:82
testHomog
@ testHomog
Definition: structs.h:41
StringEndS
char * StringEndS()
Definition: reporter.cc:151
pcvBasis
int pcvBasis(lists b, int i, poly m, int d, int n)
Definition: pcv.cc:430
printBlackboxTypes
void printBlackboxTypes()
list all defined type (for debugging)
Definition: blackbox.cc:209
setNCExtensions
int setNCExtensions(int iMask)
Definition: old.gring.cc:87
siRandomStart
int siRandomStart
Definition: cntrlc.cc:98
posInT_FDegpLength
int posInT_FDegpLength(const TSet set, const int length, LObject &p)
Definition: kutil.cc:11548
kNFBound
poly kNFBound(ideal F, ideal Q, poly p, int bound, int syzComp, int lazyReduce)
Definition: kstd1.cc:2868
sleftv
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
pMult
#define pMult(p, q)
Definition: polys.h:202
testGB
int testGB(ideal I, ideal GI)
Definition: ringgb.cc:227
w
const CanonicalForm & w
Definition: facAbsFact.cc:55
pcvMinDeg
int pcvMinDeg(poly p)
Definition: pcv.cc:135
RING_CMD
@ RING_CMD
Definition: grammar.cc:281
b
CanonicalForm b
Definition: cfModGcd.cc:4044
pFastPower
poly pFastPower(poly f, int n, ring r)
Definition: fast_mult.cc:342
n_InitMPZ
static FORCE_INLINE number n_InitMPZ(mpz_t n, const coeffs r)
conversion of a GMP integer to number
Definition: coeffs.h:542
currRingHdl
idhdl currRingHdl
Definition: ipid.cc:61
slists_bin
omBin slists_bin
Definition: lists.cc:23
evSwap
matrix evSwap(matrix M, int i, int j)
Definition: eigenval.cc:25
omPrintCurrentBackTrace
#define omPrintCurrentBackTrace(fd)
Definition: omRet2Info.h:39
pOppose
poly pOppose(ring Rop_src, poly p, const ring Rop_dst)
opposes a vector p from Rop to currRing (dst!)
Definition: old.gring.cc:3368
MATRIX_CMD
@ MATRIX_CMD
Definition: grammar.cc:286
testsvd
lists testsvd(matrix M)
Definition: calcSVD.cc:27
longCoeffsToSingularPoly
poly longCoeffsToSingularPoly(unsigned long *polyCoeffs, const int degree)
Definition: extra.cc:205
CanonicalForm
factory's main class
Definition: canonicalform.h:83
posInT19
int posInT19(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5881
factoryseed
void factoryseed(int s)
random seed initializer
Definition: cf_random.cc:176
term
Definition: int_poly.h:33
test_PosInL
int(* test_PosInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
Definition: kstd2.cc:81
p_SetExp
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
Definition: p_polys.h:489
rIsPluralRing
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:398
pLength
static unsigned pLength(poly a)
Definition: p_polys.h:193
HilbertSeries_OrbitData
void HilbertSeries_OrbitData(ideal S, int lV, bool IG_CASE, bool mgrad, bool odp, int trunDegHs)
Definition: hilb.cc:1969
SW_USE_EZGCD
static const int SW_USE_EZGCD
set to 1 to use EZGCD over Z
Definition: cf_defs.h:32
sca_Force
bool sca_Force(ring rGR, int b, int e)
Definition: sca.cc:1161
get_denom_list
lists get_denom_list()
Definition: denom_list.cc:8
currRing
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
MAltwalk2
ideal MAltwalk2(ideal Go, intvec *curr_weight, intvec *target_weight)
Definition: walk.cc:4280
om_InternalErrorStatus
omError_t om_InternalErrorStatus
Definition: omError.c:12
test_PosInT
int(* test_PosInT)(const TSet T, const int tl, LObject &h)
Definition: kstd2.cc:80
omError2Serror
const char * omError2Serror(omError_t error)
Definition: omError.c:63
TRUE
#define TRUE
Definition: auxiliary.h:98
i
int i
Definition: cfEzgcd.cc:125
rChar
int rChar(ring r)
Definition: ring.cc:686
ip_smatrix::rows
int & rows()
Definition: matpol.h:25
res
CanonicalForm res
Definition: facAbsFact.cc:64
INT_CMD
@ INT_CMD
Definition: tok.h:96
countedref_reference_load
void countedref_reference_load()
Initialize blackbox types 'reference' and 'shared', or both.
Definition: countedref.cc:700
Mprwalk
ideal Mprwalk(ideal Go, intvec *orig_M, intvec *target_M, int weight_rad, int op_deg, int tp_deg, int nP, int reduction, int printout)
Definition: walk.cc:6388
Sy_bit
#define Sy_bit(x)
Definition: options.h:32
M
#define M
Definition: sirandom.c:24
n_convFactoryNSingN
number n_convFactoryNSingN(const CanonicalForm n, const coeffs r)
Definition: numbers.cc:622
posInT2
int posInT2(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5212
PrintS
void PrintS(const char *s)
Definition: reporter.cc:284
pcvPMulL
lists pcvPMulL(poly p, lists l1)
Definition: pcv.cc:76
luSolveViaLDUDecomp
bool luSolveViaLDUDecomp(const matrix pMat, const matrix lMat, const matrix dMat, const matrix uMat, const poly l, const poly u, const poly lTimesU, const matrix bVec, matrix &xVec, matrix &H)
Solves the linear system A * x = b, where A is an (m x n)-matrix which is given by its LDU-decomposit...
Definition: linearAlgebra.cc:1461
omFreeSize
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
BOOLEAN
int BOOLEAN
Definition: auxiliary.h:85
Mivperttarget
intvec * Mivperttarget(ideal G, int ndeg)
lduDecomp
void lduDecomp(const matrix aMat, matrix &pMat, matrix &lMat, matrix &dMat, matrix &uMat, poly &l, poly &u, poly &lTimesU)
LU-decomposition of a given (m x n)-matrix with performing only those divisions that yield zero remai...
Definition: linearAlgebra.cc:1343
PROC_CMD
@ PROC_CMD
Definition: grammar.cc:280
MivSame
int MivSame(intvec *u, intvec *v)
Definition: walk.cc:893
createG0
ideal createG0()
Definition: kutil.cc:4405
om_ErrorStatus
omError_t om_ErrorStatus
Definition: omError.c:11
posInT_pLength
int posInT_pLength(const TSet set, const int length, LObject &p)
Definition: kutil.cc:11585
T
static jList * T
Definition: janet.cc:31
mp_Transp
matrix mp_Transp(matrix a, const ring R)
Definition: matpol.cc:257
Mfwalk
ideal Mfwalk(ideal G, intvec *ivstart, intvec *ivtarget, int reduction, int printout)
Definition: walk.cc:8031
scaFirstAltVar
static short scaFirstAltVar(ring r)
Definition: sca.h:18
rField_is_Ring
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:475
henselFactors
void henselFactors(const int xIndex, const int yIndex, const poly h, const poly f0, const poly g0, const int d, poly &f, poly &g)
Computes a factorization of a polynomial h(x, y) in K[[x]][y] up to a certain degree in x,...
Definition: linearAlgebra.cc:1219
rOpposite
ring rOpposite(ring src)
Definition: ring.cc:5194
nfMinPoly
static int nfMinPoly[16]
Definition: ffields.cc:549
IDEAL_CMD
@ IDEAL_CMD
Definition: grammar.cc:284
RightColonOperation
ideal RightColonOperation(ideal S, poly w, int lV)
Definition: hilb.cc:2309
pcvCV2P
poly pcvCV2P(poly cv, int d0, int d1)
Definition: pcv.cc:297
h
static Poly * h
Definition: janet.cc:972
semicProc
BOOLEAN semicProc(leftv res, leftv u, leftv v)
Definition: ipshell.cc:4520
GFInfo::GFDegree
int GFDegree
Definition: coeffs.h:95
sm_Flatten
ideal sm_Flatten(ideal a, const ring R)
Definition: matpol.cc:1929
setCharacteristic
void setCharacteristic(int c)
Definition: cf_char.cc:23
singular_homog_flag
int singular_homog_flag
Definition: cf_factor.cc:377
max
static int max(int a, int b)
Definition: fast_mult.cc:264
coeffs
pOne
#define pOne()
Definition: polys.h:309
MivMatrixOrderdp
intvec * MivMatrixOrderdp(int nV)
Definition: walk.cc:1417
intvec
Definition: intvec.h:21
blackboxIsCmd
int blackboxIsCmd(const char *n, int &tok)
used by scanner: returns ROOT_DECL for known types (and the type number in tok)
Definition: blackbox.cc:192
sleftv::data
void * data
Definition: subexpr.h:88
Mults
int Mults()
Definition: fast_mult.cc:14
pIter
#define pIter(p)
Definition: monomials.h:38
intvec::resize
void resize(int new_length)
Definition: intvec.cc:106
omAlloc
#define omAlloc(size)
Definition: omAllocDecl.h:210
spaddProc
BOOLEAN spaddProc(leftv result, leftv first, leftv second)
Definition: ipshell.cc:4397
singntl_HNF
matrix singntl_HNF(matrix m, const ring s)
Definition: clapsing.cc:1695
F5main
ideal F5main(ideal id, ring r, int opt, int plus, int termination)
Definition: f5gb.cc:1890
SW_USE_CHINREM_GCD
static const int SW_USE_CHINREM_GCD
set to 1 to use modular gcd over Z
Definition: cf_defs.h:38
n_Init
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:538
GFInfo::GFPar_name
const char * GFPar_name
Definition: coeffs.h:96
SINGULAR_VERSION
#define SINGULAR_VERSION
Definition: mod2.h:88
VECTOR_CMD
@ VECTOR_CMD
Definition: grammar.cc:292
myynest
int myynest
Definition: febase.cc:41
pp
CanonicalForm pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:248
singularMatrixToLongMatrix
unsigned long ** singularMatrixToLongMatrix(matrix singularMatrix)
Definition: extra.cc:173
slists::m
sleftv * m
Definition: lists.h:45
MivMatrixOrder
intvec * MivMatrixOrder(intvec *iv)
Definition: walk.cc:963
pPower
#define pPower(p, q)
Definition: polys.h:199
rBlocks
static int rBlocks(ring r)
Definition: ring.h:558
uni_subst_bits
poly uni_subst_bits(poly outer_uni, poly inner_multi, ring r)
Definition: digitech.cc:47
omFindExec
char * omFindExec(const char *name, char *exec)
Definition: omFindExec.c:252
MivWeightOrderdp
intvec * MivWeightOrderdp(intvec *ivstart)
Definition: walk.cc:1456
mpNew
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:37
n_convSingNFactoryN
CanonicalForm n_convSingNFactoryN(number n, BOOLEAN setChar, const coeffs r)
Definition: numbers.cc:627
ksOldSpolyRed
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
Definition: kInline.h:1049
pAdd
#define pAdd(p, q)
Definition: polys.h:198
pDivideM
#define pDivideM(a, b)
Definition: polys.h:288
MwalkInitialForm
ideal MwalkInitialForm(ideal G, intvec *ivw)
Definition: walk.cc:761
posInT13
int posInT13(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5484
n_transExt
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition: coeffs.h:39
IDRING
#define IDRING(a)
Definition: ipid.h:122
n_Print
void n_Print(number &a, const coeffs r)
print a number (BEWARE of string buffers!) mostly for debugging
Definition: numbers.cc:611
Off
void Off(int sw)
switches
Definition: canonicalform.cc:1905
MPertVectors
intvec * MPertVectors(ideal G, intvec *ivtarget, int pdeg)
Definition: walk.cc:1088
plain_spoly
poly plain_spoly(poly f, poly g)
Definition: ringgb.cc:169
convSingPFactoryP
CanonicalForm convSingPFactoryP(poly p, const ring r)
Definition: clapconv.cc:86
mp_InitI
matrix mp_InitI(int r, int c, int v, const ring R)
make it a v * unit matrix
Definition: matpol.cc:129
nc_rat_CreateSpoly
poly nc_rat_CreateSpoly(poly pp1, poly pp2, int ishift, const ring r)
Definition: ratgring.cc:340
slists
Definition: lists.h:23
feOptSpec
struct fe_option feOptSpec[]
INTVEC_CMD
@ INTVEC_CMD
Definition: tok.h:101
ringRedNF
poly ringRedNF(poly f, ideal G, ring r)
Definition: ringgb.cc:118
MAltwalk1
ideal MAltwalk1(ideal Go, int op_deg, int tp_deg, intvec *curr_weight, intvec *target_weight)
Definition: walk.cc:9671
MivMatrixOrderlp
intvec * MivMatrixOrderlp(int nV)
Definition: walk.cc:1401
INTMAT_CMD
@ INTMAT_CMD
Definition: grammar.cc:279
dynl_open
void * dynl_open(char *filename)
Definition: mod_raw.cc:153
IMATELEM
#define IMATELEM(M, I, J)
Definition: intvec.h:85
coeffs_BIGINT
coeffs coeffs_BIGINT
Definition: ipid.cc:52
idrec
Definition: idrec.h:35
feResource
static char * feResource(feResourceConfig config, int warn)
Definition: feResource.cc:258
Mivlp
intvec * Mivlp(int nR)
Definition: walk.cc:1022
rEnvelope
ring rEnvelope(ring R)
Definition: ring.cc:5524
p_Add_q
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:893
jjEXTENDED_SYSTEM
static BOOLEAN jjEXTENDED_SYSTEM(leftv res, leftv h)
Definition: extra.cc:2372
newstruct_set_proc
BOOLEAN newstruct_set_proc(const char *bbname, const char *func, int args, procinfov pr)
Definition: newstruct.cc:859
complexNearZero
bool complexNearZero(gmp_complex *c, int digits)
Definition: mpr_complex.cc:766
system
void system(sys)
MkInterRedNextWeight
intvec * MkInterRedNextWeight(intvec *iva, intvec *ivb, ideal G)
Definition: walk.cc:2570
HCord
int HCord
Definition: kutil.cc:235
ncInitSpecialPowersMultiplication
bool ncInitSpecialPowersMultiplication(ring r)
Definition: ncSAFormula.cc:50
pcvDim
int pcvDim(int d0, int d1)
Definition: pcv.cc:400
probIrredTest
int probIrredTest(const CanonicalForm &F, double error)
given some error probIrredTest detects irreducibility or reducibility of F with confidence level 1-er...
Definition: facIrredTest.cc:63
StringSetS
void StringSetS(const char *st)
Definition: reporter.cc:128
spectrumProc
BOOLEAN spectrumProc(leftv result, leftv first)
Definition: ipshell.cc:4102
pPrintDivisbleByStat
void pPrintDivisbleByStat()
Definition: pDebug.cc:413
Approx_Step
ideal Approx_Step(ideal L)
Ann: ???
Definition: nc.cc:250
SW_USE_EZGCD_P
static const int SW_USE_EZGCD_P
set to 1 to use EZGCD over F_q
Definition: cf_defs.h:34
bound
static CanonicalForm bound(const CFMatrix &M)
Definition: cf_linsys.cc:460
p_Shrink
poly p_Shrink(poly p, int lV, const ring r)
Definition: shiftgb.cc:370
computeMinimalPolynomial
unsigned long * computeMinimalPolynomial(unsigned long **matrix, unsigned n, unsigned long p)
Definition: minpoly.cc:428
Print
#define Print
Definition: emacs.cc:80
id_Vec2Ideal
ideal id_Vec2Ideal(poly vec, const ring R)
Definition: simpleideals.cc:1135
omMarkAsStaticAddr
void omMarkAsStaticAddr(void *addr)
pcvP2CV
poly pcvP2CV(poly p, int d0, int d1)
Definition: pcv.cc:280
om_Opts
omOpts_t om_Opts
Definition: omOpts.c:11
rSetSyzComp
void rSetSyzComp(int k, const ring r)
Definition: ring.cc:4991
Werror
void Werror(const char *fmt,...)
Definition: reporter.cc:189
idXXX
ideal idXXX(ideal h1, int k)
Definition: ideals.cc:878
pLastVblock
#define pLastVblock(p, lV)
Definition: shiftgb.h:30
scaLastAltVar
static short scaLastAltVar(ring r)
Definition: sca.h:25
pIsPurePower
#define pIsPurePower(p)
Definition: polys.h:243
FE_OPT_UNDEF
@ FE_OPT_UNDEF
Definition: feOptGen.h:15
assumeStdFlag
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1558
dynl_sym
void * dynl_sym(void *handle, const char *symbol)
Definition: mod_raw.cc:167
WerrorS
void WerrorS(const char *s)
Definition: feFopen.cc:24
ringorder_s
@ ringorder_s
s?
Definition: ring.h:77
sleftv::Typ
int Typ()
Definition: subexpr.cc:1039
m
int m
Definition: cfEzgcd.cc:121
singntl_LLL
matrix singntl_LLL(matrix m, const ring s)
Definition: clapsing.cc:1793
MATCOLS
#define MATCOLS(i)
Definition: matpol.h:29
TEST_FOR
#define TEST_FOR(A)
WarnS
#define WarnS
Definition: emacs.cc:78
sleftv::rtyp
int rtyp
Definition: subexpr.h:91
assume
#define assume(x)
Definition: mod2.h:390
NULL
#define NULL
Definition: omList.c:10
lists
slists * lists
Definition: mpr_numeric.h:146
posInT1
int posInT1(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5184
siSeed
int siSeed
Definition: sirandom.c:29
MPertNextWeight
intvec * MPertNextWeight(intvec *iva, ideal G, int deg)
simpleipc_cmd
int simpleipc_cmd(char *cmd, int id, int v)
Definition: semaphore.c:167
BIMATELEM
#define BIMATELEM(M, I, J)
Definition: bigintmat.h:134
MAXPATHLEN
#define MAXPATHLEN
Definition: omRet2Info.c:22
fe_option::value
void * value
Definition: fegetopt.h:93
pcvLAddL
lists pcvLAddL(lists l1, lists l2)
Definition: pcv.cc:31
evEigenvals
lists evEigenvals(matrix M)
Definition: eigenval_ip.cc:118
l
int l
Definition: cfEzgcd.cc:93
Mrwalk
ideal Mrwalk(ideal Go, intvec *orig_M, intvec *target_M, int weight_rad, int pert_deg, int reduction, int printout)
Definition: walk.cc:5603
feNotImplemented
const char feNotImplemented[]
Definition: reporter.cc:54
n_Int
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ....
Definition: coeffs.h:547
R
#define R
Definition: sirandom.c:26
intvec::rows
int rows() const
Definition: intvec.h:96
evHessenberg
matrix evHessenberg(matrix M)
Definition: eigenval.cc:100
p_Setm
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:234
Warn
#define Warn
Definition: emacs.cc:77
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
nc_PrintMat
matrix nc_PrintMat(int a, int b, ring r, int metric)
returns matrix with the info on noncomm multiplication
Definition: old.gring.cc:2394
slists::Init
INLINE_THIS void Init(int l=0)
p
int p
Definition: cfModGcd.cc:4019
setFlag
#define setFlag(A, F)
Definition: ipid.h:108
MivWeightOrderlp
intvec * MivWeightOrderlp(intvec *ivstart)
Definition: walk.cc:1436
s
const CanonicalForm int s
Definition: facAbsFact.cc:55
iiCheckTypes
BOOLEAN iiCheckTypes(leftv args, const short *type_list, int report)
check a list of arguemys against a given field of types return TRUE if the types match return FALSE (...
Definition: ipshell.cc:6546
Mfpertvector
intvec * Mfpertvector(ideal G, intvec *ivtarget)
Definition: walk.cc:1512
POLY_CMD
@ POLY_CMD
Definition: grammar.cc:289
feOptValue
static void * feOptValue(feOptIndex opt)
Definition: feOpt.h:40
pCopy
#define pCopy(p)
return a copy of the poly
Definition: polys.h:180
ringNF
poly ringNF(poly f, ideal G, ring r)
Definition: ringgb.cc:200
IDELEMS
#define IDELEMS(i)
Definition: simpleideals.h:26
SW_USE_QGCD
static const int SW_USE_QGCD
set to 1 to use Encarnacion GCD over Q(a)
Definition: cf_defs.h:40
posInT15
int posInT15(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5552
p_ISet
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition: p_polys.cc:1289
posInT0
int posInT0(const TSet, const int length, LObject &)
Definition: kutil.cc:5173
FLAG_STD
#define FLAG_STD
Definition: ipid.h:104
pHead
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
Definition: polys.h:67
fglmLinearCombination
poly fglmLinearCombination(ideal source, poly monset)
Definition: fglmcomb.cc:416
Mfrwalk
ideal Mfrwalk(ideal G, intvec *ivstart, intvec *ivtarget, int weight_rad, int reduction, int printout)
Definition: walk.cc:8212
fd
int status int fd
Definition: si_signals.h:59
PrintLn
void PrintLn()
Definition: reporter.cc:310
rIsSCA
static bool rIsSCA(const ring r)
Definition: nc.h:190
rField_is_long_C
static BOOLEAN rField_is_long_C(const ring r)
Definition: ring.h:536
MATROWS
#define MATROWS(i)
Definition: matpol.h:28
G
static TreeM * G
Definition: janet.cc:32
p_LPshift
poly p_LPshift(poly p, int sh, int uptodeg, int lV, const ring r)
Definition: shiftgb.cc:74
getBlackboxStuff
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition: blackbox.cc:16
omUpdateInfo
void omUpdateInfo()
Definition: omStats.c:24
n_SwitchChinRem
int n_SwitchChinRem
Definition: longrat.cc:2938
LINK_CMD
@ LINK_CMD
Definition: tok.h:117
CMATRIX_CMD
@ CMATRIX_CMD
Definition: tok.h:46
degree
int degree(const CanonicalForm &f)
Definition: canonicalform.h:309
omAlloc0
#define omAlloc0(size)
Definition: omAllocDecl.h:211
newstructShow
void newstructShow(newstruct_desc d)
Definition: newstruct.cc:839
singclap_absFactorize
ideal singclap_absFactorize(poly f, ideal &mipos, intvec **exps, int &numFactors, const ring r)
Definition: clapsing.cc:1849
On
void On(int sw)
switches
Definition: canonicalform.cc:1898
posInT11
int posInT11(const TSet set, const int length, LObject &p)
Definition: kutil.cc:5242
unifastmult
poly unifastmult(poly f, poly g, ring r)
Definition: fast_mult.cc:272
rSubring
ring rSubring(ring org_ring, sleftv *rv)
Definition: ipshell.cc:5957
sleftv::next
leftv next
Definition: subexpr.h:86
slicehilb
void slicehilb(ideal I)
Definition: hilb.cc:1131
sdb_flags
int sdb_flags
Definition: sdb.cc:32
si_opt_2
unsigned si_opt_2
Definition: options.c:6
gmp_complex
gmp_complex numbers based on
Definition: mpr_complex.h:179
BB_LIKE_LIST
#define BB_LIKE_LIST(B)
Definition: blackbox.h:54
singclap_neworder
char * singclap_neworder(ideal I, const ring r)
Definition: clapsing.cc:1542
SMATRIX_CMD
@ SMATRIX_CMD
Definition: grammar.cc:291
sm_UnFlatten
ideal sm_UnFlatten(ideal a, int col, const ring R)
Definition: matpol.cc:1949
feOptString
@ feOptString
Definition: fegetopt.h:77
id_TensorModuleMult
ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing)
Definition: simpleideals.cc:1717
rComplete
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
Definition: ring.cc:3369