Changeset c5d8dd in git


Ignore:
Timestamp:
Feb 11, 2009, 3:57:55 PM (14 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', 'f6c3dc58b0df4bd712574325fe76d0626174ad97')
Children:
87beab79ada79bca10d045490906c1eb82902d37
Parents:
8fc55e2c9b6b4b308c8d558497c631cf418a0d0f
Message:
Added cddlib
made gfan optional via HAVE_GFAN


git-svn-id: file:///usr/local/Singular/svn/trunk@11369 2c84dea3-7e68-4137-9b89-c4e89433aadc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/extra.cc

    r8fc55e2 rc5d8dd  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: extra.cc,v 1.291 2009-02-06 15:16:16 monerjan Exp $ */
     4/* $Id: extra.cc,v 1.292 2009-02-11 14:57:54 monerjan Exp $ */
    55/*
    66* ABSTRACT: general interface to internals of Singular ("system" command)
     
    5858#ifdef HAVE_RINGS
    5959#include "ringgb.h"
     60#endif
     61
     62#ifdef HAVE_GFAN
    6063#include "gfan.h"
    6164#endif
    62 
    6365
    6466#ifdef HAVE_F5
     
    30653067#endif
    30663068
     3069#ifdef HAVE_GFAN
    30673070/*======== GFAN ==============*/
    30683071if (strcmp(sys_cmd,"gfan")==0)
     
    30803083}
    30813084else
    3082 
     3085#endif
    30833086
    30843087/*==================== Error =================*/
  • kernel/gfan.cc

    r8fc55e2 rc5d8dd  
    22Compute the Groebner fan of an ideal
    33Author: $Author: monerjan $
    4 Date: $Date: 2009-02-10 17:04:17 $
    5 Header: $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.9 2009-02-10 17:04:17 monerjan Exp $
    6 Id: $Id: gfan.cc,v 1.9 2009-02-10 17:04:17 monerjan Exp $
     4Date: $Date: 2009-02-11 14:57:55 $
     5Header: $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.10 2009-02-11 14:57:55 monerjan Exp $
     6Id: $Id: gfan.cc,v 1.10 2009-02-11 14:57:55 monerjan Exp $
    77*/
    88
     
    1313#include "ideals.h"
    1414#include "kmatrix.h"
     15#include "/users/urmel/alggeom/monerjan/cddlib/include/setoper.h" //Support for cddlib. Dirty hack
     16#include "/users/urmel/alggeom/monerjan/cddlib/include/cdd.h"
    1517
    1618#ifndef gfan_DEBUG
     
    4143        #endif
    4244
    43         //All variables go here - except ineq matrix
     45        //All variables go here - except ineq matrix and *v, see below
    4446        int lengthGB=IDELEMS(I);        // # of polys in the groebner basis
    4547        int pCompCount;                 // # of terms in a poly
     
    4850        int leadexp[numvar];            // dirty hack of exp.vects
    4951        int aktexp[numvar];
    50         int cols,rows;                  // will contain the dimensions of the ineq matrix
     52        int cols,rows;                  // will contain the dimensions of the ineq matrix - deprecated by
     53        dd_rowrange ddrows;
     54        dd_colrange ddcols;
     55        dd_rowset ddredrows;            // # of redundant rows in ddineq
     56        dd_NumberType ddnumb=dd_Real;   //Number type
     57        dd_ErrorType dderr=dd_NoError;  //
    5158        // End of var declaration
    5259
     
    6471        printf("rows=%i\n",rows);
    6572        printf("Will create a %i x %i - matrix to store inequalities\n",rows,cols);
    66         int ineq[rows][cols];   // array of int vs matrix vs KMatrix ??? What's to use?
    67         int aktmatrixrow=0;     // needed to store the diffs of the expvects in the rows of ineq
    6873
    69         // We loop through each g\in GB
     74        dd_rowrange aktmatrixrow=0;     // needed to store the diffs of the expvects in the rows of ddineq
     75        dd_set_global_constants();
     76        ddrows=rows;
     77        ddcols=cols;
     78        dd_MatrixPtr ddineq;            //Matrix to store the inequalities
     79        ddineq=dd_CreateMatrix(ddrows,ddcols);
     80
     81        // We loop through each g\in GB and compute the resulting inequalities
    7082        for (int i=0; i<IDELEMS(I); i++)
    7183        {
     
    8193                {
    8294                        leadexp[kk]=v[kk+1];
    83                         printf("Leadexpcomp=%i\n",leadexp[kk]);
     95                        //printf("Leadexpcomp=%i\n",leadexp[kk]);
    8496                        //Since we need to know the difference of leadexp with the other expvects we do nothing here
    8597                        //but compute the diff below
     
    96108//The ordering somehow gets lost here but this is acceptable, since we are only interested in the inequalities
    97109                                aktexp[kk]=v[kk+1];
    98                                 printf("aktexpcomp=%i\n",aktexp[kk]);
    99                                 ineq[aktmatrixrow][kk]=leadexp[kk]-aktexp[kk];  //dito
     110                                //printf("aktexpcomp=%i\n",aktexp[kk]);
     111                                //ineq[aktmatrixrow][kk]=leadexp[kk]-aktexp[kk];        //dito
     112                                dd_set_si(ddineq->matrix[(dd_rowrange)aktmatrixrow][kk],leadexp[kk]-aktexp[kk]);
    100113                        }
    101114                        aktmatrixrow=aktmatrixrow+1;
    102115                }//while
     116
    103117        } //for
    104         #ifdef gfan_DEBUG
     118
     119        // The inequalities are now stored in ddineq
     120        // Next we check for superflous rows
     121        ddredrows = dd_RedundantRows(ddineq, &dderr);
     122        if (dderr!=dd_NoError)                  // did an error occur?
     123        {
     124                 dd_WriteErrorMessages(stderr,dderr);   //if so tell us
     125        } else
     126        {
     127                printf("Redundant rows: ");
     128                set_fwrite(stdout, ddredrows);          //otherwise print the redundant rows
     129        }//if dd_Error
     130
     131        #ifdef gfan_DEBUGs
    105132        printf("Inequalitiy matrix\n");
    106133        for (int i=0;i<rows;i++)
Note: See TracChangeset for help on using the changeset viewer.