Changeset e2fb7a in git


Ignore:
Timestamp:
Feb 13, 2009, 4:17:40 PM (14 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
59f78ae5a870b7808ef48f59619f0aabf5305d9a
Parents:
761f29088f11fe57c7c1312cdf37ac4108f17307
Message:
More cddlib stuff. Expanded ineq matrix to have 0-th column store additive constants (which are zero)


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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    r761f29 re2fb7a  
    11/*
    22Compute the Groebner fan of an ideal
    3 Author: $Author: Singular $
    4 Date: $Date: 2009-02-12 08:35:05 $
    5 Header: $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.11 2009-02-12 08:35:05 Singular Exp $
    6 Id: $Id: gfan.cc,v 1.11 2009-02-12 08:35:05 Singular Exp $
     3Author: $Author: monerjan $
     4Date: $Date: 2009-02-13 15:17:40 $
     5Header: $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.12 2009-02-13 15:17:40 monerjan Exp $
     6Id: $Id: gfan.cc,v 1.12 2009-02-13 15:17:40 monerjan Exp $
    77*/
    88
    99#include "mod2.h"
     10
     11//A hack that hopefully will make compiler happy. Workaround only
     12//do the same in extra.cc and remove it befor committing!
     13//#ifndef HAVE_GFAN
     14//#define HAVE_GFAN
     15//#endif
    1016
    1117#ifdef HAVE_GFAN
     
    8086        ddcols=cols;
    8187        dd_MatrixPtr ddineq;            //Matrix to store the inequalities
    82         ddineq=dd_CreateMatrix(ddrows,ddcols);
     88        ddineq=dd_CreateMatrix(ddrows,ddcols+1); //The first col has to be 0 since cddlib checks for additive consts there
    8389
    8490        // We loop through each g\in GB and compute the resulting inequalities
     
    113119                                //printf("aktexpcomp=%i\n",aktexp[kk]);
    114120                                //ineq[aktmatrixrow][kk]=leadexp[kk]-aktexp[kk];        //dito
    115                                 dd_set_si(ddineq->matrix[(dd_rowrange)aktmatrixrow][kk],leadexp[kk]-aktexp[kk]);
     121                                dd_set_si(ddineq->matrix[(dd_rowrange)aktmatrixrow][kk+1],leadexp[kk]-aktexp[kk]); //because of the 1st col being const 0
    116122                        }
    117123                        aktmatrixrow=aktmatrixrow+1;
     
    119125
    120126        } //for
     127
     128        #ifdef gfan_DEBUG
     129        printf("The inequality matrix is:\n");
     130        dd_WriteMatrix(stdout, ddineq);
     131        #endif
    121132
    122133        // The inequalities are now stored in ddineq
     
    132143        }//if dd_Error
    133144
    134         #ifdef gfan_DEBUGs
    135         printf("Inequalitiy matrix\n");
    136         for (int i=0;i<rows;i++)
    137         {
    138                 for (int j=0;j<cols;j++)
    139                 {
    140                         printf("%i ",ineq[i][j]);
    141                 }
    142                 printf("\n");
    143         }
    144         #endif
     145        //Remove reduntant rows here!
     146
     147        ddineq->representation=dd_Inequality;           //We want our LP to be Ax>=0
     148
     149        //Clean up but don't delete the return value!
     150        dd_FreeMatrix(ddineq);
     151        //dd_clear(ddrows);
     152        //dd_clear(ddcols);
     153        //dd_clear(ddredrows);
     154        //dd_clear(ddnumb);
     155        //dd_clear(dderr);
     156        dd_free_global_constants();
     157
    145158        //res=(ideal)aktpoly;
    146159        //return res;
Note: See TracChangeset for help on using the changeset viewer.