Changeset dff969 in git


Ignore:
Timestamp:
Oct 9, 1997, 4:39:02 PM (26 years ago)
Author:
Jens Schmidt <schmidt@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
5cf721fd6f055b1dafc770f3b5de911f53ce5fb9
Parents:
dbf92f4b21fb5e2527dd8e6e58d284a85b3281b5
Message:
	* cf_algorithm.cc (divides): moved from canonicalform.cc to
	  cf_algorithm.cc.  Declaration moved, too.  In all files which
 	  refer to this function #include of cf_algorithm.h added.


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

Legend:

Unmodified
Added
Removed
  • factory/cf_algorithm.cc

    rdbf92f rdff969  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: cf_algorithm.cc,v 1.2 1997-09-08 16:02:02 schmidt Exp $ */
     2/* $Id: cf_algorithm.cc,v 1.3 1997-10-09 14:39:02 schmidt Exp $ */
    33
    44//{{{ docu
     
    163163}
    164164//}}}
     165
     166//{{{ bool divides ( const CanonicalForm & f, const CanonicalForm & g )
     167//{{{ docu
     168//
     169// divides() - check whether f divides g.
     170//
     171// Uses some extra checks to avoid polynomial division.
     172//
     173//}}}
     174bool
     175divides ( const CanonicalForm & f, const CanonicalForm & g )
     176{
     177    if ( g.level() > 0 && g.level() == f.level() )
     178        if ( divides( f.tailcoeff(), g.tailcoeff() ) && divides( f.LC(), g.LC() ) ) {
     179            CanonicalForm q, r;
     180            bool ok = divremt( g, f, q, r );
     181            return ok && r == 0;
     182        }
     183        else
     184            return false;
     185    else {
     186        CanonicalForm q, r;
     187        bool ok = divremt( g, f, q, r );
     188        return ok && r == 0;
     189    }
     190}
Note: See TracChangeset for help on using the changeset viewer.