Changeset 78e2fd in git for factory/canonicalform.cc


Ignore:
Timestamp:
Jul 14, 1997, 2:45:07 PM (27 years ago)
Author:
Jens Schmidt <schmidt@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
e1a0bd7739355c4d2a5c76f07eae73d641b31c3c
Parents:
9ea9c61e58613776c6f87c9b161c4ba78f200283
Message:
	* canonicalform.cc (initCanonicalForm): initialization of
	  SW_USE_SPARSEMOD added

	* canonicalform.cc (CanonicalForm::degree( Variable )): doc fix

	* canonicalform.cc (CanonicalForm::degree): doc fix


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

Legend:

Unmodified
Added
Removed
  • factory/canonicalform.cc

    r9ea9c6 r78e2fd  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: canonicalform.cc,v 1.8 1997-07-01 12:48:00 schmidt Exp $ */
     2/* $Id: canonicalform.cc,v 1.9 1997-07-14 12:45:07 schmidt Exp $ */
    33
    44#include <config.h>
     
    227227}
    228228
     229//{{{ int CanonicalForm::degree() const
     230//{{{ docu
     231//
     232// degree() - return degree in main variable.
     233//
     234// Returns -1 for the zero polynomial.
     235//
     236//}}}
    229237int
    230238CanonicalForm::degree() const
     
    237245        return value->degree();
    238246}
    239 
     247//}}}
     248
     249//{{{ int CanonicalForm::degree( const Variable & v ) const
     250//{{{ docu
     251//
     252// degree() - return degree in variable v.
     253//
     254// Returns -1 for the zero polynomial.
     255//
     256// Note: If v is less than the main variable of CO we have to swap
     257// variables which may be quite expensive.  Calculating the degree in
     258// respect to an algebraic variable may fail.
     259//
     260//}}}
    240261int
    241262CanonicalForm::degree( const Variable & v ) const
     
    250271        return value->degree();
    251272    else  if ( v > mvar() )
     273        // relatively to v, f is in a coefficient ring
    252274        return 0;
    253275    else {
     276        // v < mvar(), make v main variable
    254277        CanonicalForm f = swapvar( *this, v, mvar() );
    255         if ( f.mvar() == mvar() )
    256             return f.value->degree();
    257         else
     278        if ( f.mvar() == mvar() )
     279            return f.value->degree();
     280        else
     281            // in this case, we lost our main variable because
     282            // v did not occur in CO
    258283            return 0;
    259284    }
    260285}
     286//}}}
    261287
    262288int
     
    11371163        Off( SW_FAC_QUADRATICLIFT );
    11381164        Off( SW_USE_EZGCD );
     1165        Off( SW_USE_SPARSEMOD );
    11391166
    11401167        (void)initializeCharacteristic();
Note: See TracChangeset for help on using the changeset viewer.