Changeset 9f9b142 in git


Ignore:
Timestamp:
Mar 25, 2009, 8:55:50 PM (15 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
54248e343a5d77bfd7f19c65855707d3950619e8
Parents:
66a5f833d02d3288ce452e48c6ece435a1f9ebd0
Message:
More work on facets. Started with rings


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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    r66a5f8 r9f9b142  
    22Compute the Groebner fan of an ideal
    33$Author: monerjan $
    4 $Date: 2009-03-24 21:31:49 $
    5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.20 2009-03-24 21:31:49 monerjan Exp $
    6 $Id: gfan.cc,v 1.20 2009-03-24 21:31:49 monerjan Exp $
     4$Date: 2009-03-25 19:55:50 $
     5$Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.21 2009-03-25 19:55:50 monerjan Exp $
     6$Id: gfan.cc,v 1.21 2009-03-25 19:55:50 monerjan Exp $
    77*/
    88
     
    3939#define gfan_DEBUG
    4040#endif
     41
     42//#include gcone.h
     43
    4144/**
    4245*\brief Class facet
     
    125128/*RETURN_TYPE: pointer to first facet           */
    126129/************************************************/
    127 facet getConeNormals(ideal I)
     130facet *getConeNormals(ideal I)
    128131{
    129132        #ifdef gfan_DEBUG
     
    255258        /*The pointer *fRoot should be the return value of this function*/
    256259        facet *fRoot = new facet();             //instantiate new facet with intvec with numvar rows, one column and initial values all 0
    257         //facet *fRoot;
    258260        facet *fAct;                    //instantiate pointer to active facet
    259         fAct = (facet*)&fRoot; 
     261        fAct = fRoot;           //This does not seem to do the trick. fRoot and fAct have to point to the same adress!
     262        std::cout << "fRoot = " << fRoot << ", fAct = " << fAct << endl;
    260263        //fAct = fRoot;                 //Let fAct point to fRoot
    261264        for (int kk = 0; kk<ddrows; kk++)
     
    267270                        foo = (double*)ddineq->matrix[kk][jj];  //get entry from actual position
    268271#ifdef gfan_DEBUG
    269                         std::cout << "fAct is " << *foo << " at " << fAct << endl;
     272                        std::cout << "fAct is " << *foo << " at " << fAct << std::endl;
    270273#endif
    271274                        /*next two lines commented out. How to store values into intvec? */
    272275                        //load[jj] = (int)*foo;                 //store typecasted entry at pos jj of load
    273276                        //fAct->setFacetNormal(load);
     277                        //check for flipability here
    274278                        if (jj<ddcols)                          //Is this facet NOT the last facet? Writing while instead of if is a really bad idea :)
    275279                        {
     
    280284        }
    281285        /*
    282         Now we should have a concatenated list containing the facet normals which we can adress via *f
     286        Now we should have a concatenated list containing the facet normals of those facets that are
     287                -irredundant
     288                -flipable
     289        Adressing is done via *fRoot
     290        But since we did this in a function probably most if not all is lost after the return. So implement this as a method of gcone
    283291        */
    284292       
     
    286294        //Clean up but don't delete the return value! (Whatever it will turn out to be)
    287295        dd_FreeMatrix(ddineq);
    288         //set_free(ddrows);
    289         //set_free(ddcols);
    290296        set_free(ddredrows);
    291         //set_free(ddnumb);
    292         //set_free(dderr);
    293297        free(ddnewpos);
    294         //set_free(ddlinset);
     298        set_free(ddlinset);
    295299        dd_free_global_constants();
    296300
    297 
    298         return *fRoot;
     301        return fRoot;
    299302}
    300303
     
    304307        cout << "Now in subroutine gfan" << endl;
    305308        #endif
     309        ring rootRing;  // The ring associated to the target ordering
    306310        ideal res;
    307311        matrix ineq; //Matrix containing the boundary inequalities
     312        facet *fRoot;
     313       
     314       
     315        rootRing=rCopy0(currRing);
     316        rComplete(rootRing);
     317        rChangeCurrRing(rootRing);
     318        cout << "The current ring is " << endl;
     319        rWrite(rootRing);
     320       
     321        gcone *gcRoot = new gcone();    //Instantiate the sink
     322        gcone *gcAct;
     323        gcAct = gcRoot;
     324
     325       
    308326        /*
    309         1. Select target order
     327        1. Select target order, say dp.
    310328        2. Compute GB of inputIdeal wrt target order -> newRing, setCurrRing etc...
    311329        3. getConeNormals
    312330        */
    313331        res=getGB(inputIdeal);
    314         getConeNormals(res);
     332        fRoot=getConeNormals(res);
     333        cout << fRoot << endl;
    315334        return res;
    316335}
    317 #endif
     336/*
     337Since gfan.cc is #included from extra.cc there must not be a int main(){} here
     338*/
     339#endif
Note: See TracChangeset for help on using the changeset viewer.