Changeset 94d062 in git for Singular/fglm.cc


Ignore:
Timestamp:
Apr 14, 1998, 5:29:46 PM (26 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
8677912280afed4016cd16f860024d5d2390f1e7
Parents:
b1b0b32e97337832321183b3829223506e117514
Message:
* wichmann: Added error-Checks for findUniProc().


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

Legend:

Unmodified
Added
Removed
  • Singular/fglm.cc

    rb1b0b3 r94d062  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglm.cc,v 1.12 1998-01-23 14:20:38 obachman Exp $
     2// $Id: fglm.cc,v 1.13 1998-04-14 15:29:46 Singular Exp $
    33
    44/****************************************
     
    66****************************************/
    77/*
    8 * ABSTRACT - The FGLM-Algorithm
     8* ABSTRACT - The FGLM-Algorithm plus extension
    99*   Calculate a reduced groebner basis for one ordering, given a
    1010*   reduced groebner basis for another ordering.
     
    1313*   if the input is homogeneous ( then fglmhom.cc is used. Yet
    1414*   not implemented ).
     15*   The extension (finduni) finds minimal univariate Polynomials
     16*   lying in a 0-dimensional ideal.
    1517*/
    1618
     
    201203}
    202204
    203 //     Checks if the ideal "theIdeal" is zero-dimensional and minimal. It does
    204 //      not check, if it is reduced.
    205 //     returns FglmOk if we can use theIdeal for CalculateFunctionals (this
    206 //                     function reports an error if theIdeal is not reduced,
    207 //                     so this need not to be tested here)
    208 //             FglmNotReduced if theIdeal is not minimal
    209 //             FglmNotZeroDim if it is not zero-dimensional
    210 //             FglmHasOne if 1 belongs to theIdeal
     205// Checks if the ideal "theIdeal" is zero-dimensional and minimal. It does
     206//  not check, if it is reduced.
     207// returns FglmOk if we can use theIdeal for CalculateFunctionals (this
     208//                 function reports an error if theIdeal is not reduced,
     209//                 so this need not to be tested here)
     210//         FglmNotReduced if theIdeal is not minimal
     211//         FglmNotZeroDim if it is not zero-dimensional
     212//         FglmHasOne if 1 belongs to theIdeal
    211213FglmState
    212214fglmIdealcheck( const ideal theIdeal )
     
    239241}
    240242
    241 //     the main function for the fglm-Algorithm.
    242 //     Checks the input-data, calls CalculateFunctionals, handles change
    243 //     of ring-vars and finaly calls GroebnerViaFunctionals.
    244 //     returns the new groebnerbasis or 0 if an error occoured.
     243// The main function for the fglm-Algorithm.
     244// Checks the input-data, and calls fglmzero (see fglmzero.cc).
     245// Returns the new groebnerbasis or 0 if an error occoured.
    245246BOOLEAN
    246247fglmProc( leftv result, leftv first, leftv second )
     
    316317}
    317318
     319// The main function for finduni().
     320// Checks the input-data, and calls FindUnivariateWrapper (see fglmzero.cc).
     321// Returns an ideal containing the univariate Polynomials or 0 if an error
     322// has occoured.
    318323BOOLEAN
    319324findUniProc( leftv result, leftv first )
    320325{
    321326    ideal sourceIdeal;
    322     ideal destIdeal;
     327    ideal destIdeal = NULL;
     328    FglmState state;
    323329   
    324330    idhdl sourceIdealHdl = (idhdl)first->data;
    325331    sourceIdeal= IDIDEAL(sourceIdealHdl);
    326    
    327     destIdeal= FindUnivariateWrapper( sourceIdeal );
     332
     333    assumeStdFlag( first );
     334    state= fglmIdealcheck( sourceIdeal );
     335    if ( state == FglmOk ) {
     336        if ( FindUnivariateWrapper( sourceIdeal, destIdeal ) == FALSE )
     337            state = FglmNotReduced;
     338    }
     339    switch (state) {
     340        case FglmOk:
     341            break;
     342        case FglmHasOne:
     343            destIdeal= idInit(1,1);
     344            (destIdeal->m)[0]= pOne();
     345            state= FglmOk;
     346            break;
     347        case FglmNotZeroDim:
     348            Werror( "The ideal %s has to be 0-dimensional", first->Name() );
     349            destIdeal= idInit(0,0);
     350            break;
     351        case FglmNotReduced:
     352            Werror( "The ideal %s has to be reduced", first->Name() );
     353            destIdeal= idInit(0,0);
     354            break;
     355        default:
     356            destIdeal= idInit(1,1);
     357    }
    328358   
    329359    result->rtyp = IDEAL_CMD;
    330360    result->data= (void *)destIdeal;
    331361   
    332         return FALSE;
     362    return FALSE;
    333363}
    334364#endif
Note: See TracChangeset for help on using the changeset viewer.