Changeset f1295f in git


Ignore:
Timestamp:
Jun 26, 1998, 6:16:40 PM (26 years ago)
Author:
Jens Schmidt <schmidt@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
511e63efe177f34a743560226ca4267eb8929c64
Parents:
6dd2895cf5762cfd623523c3f1f6d624f28aa874
Message:
	* int_rat.cc, int_int.cc, int_rat.h, int_int.h, int_poly.h
	  (isZero, isOne): methods removed.  Declarations adapted.

	* int_int.cc (neg): doc fixes.  Slightly speeded up.


git-svn-id: file:///usr/local/Singular/svn/trunk@2241 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
factory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • factory/int_int.cc

    r6dd289 rf1295f  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: int_int.cc,v 1.13 1998-06-12 14:33:50 schmidt Exp $ */
     2/* $Id: int_int.cc,v 1.14 1998-06-26 16:16:33 schmidt Exp $ */
    33
    44#include <config.h>
     
    5656#endif /* NOSTREAMIO */
    5757
    58 bool InternalInteger::isZero() const
    59 {
    60     return mpz_cmp_si( &thempi, 0 ) == 0;
    61 }
    62 
    63 bool InternalInteger::isOne() const
    64 {
    65     return mpz_cmp_si( &thempi, 1 ) == 0;
    66 }
    67 
    6858bool InternalInteger::is_imm() const
    6959{
     
    8777}
    8878
    89 InternalCF* InternalInteger::neg()
    90 {
    91     if ( getRefCount() > 1 ) {
    92         decRefCount();
    93         MP_INT dummy;
    94         mpz_init( &dummy );
    95         mpz_neg( &dummy, &thempi );
     79//{{{ InternalCF * InternalInteger::neg ()
     80// docu: see CanonicalForm::operator -()
     81InternalCF *
     82InternalInteger::neg ()
     83{
     84    if ( getRefCount() > 1 ) {
     85        decRefCount();
     86        MP_INT dummy;
     87        mpz_init_set( &dummy, &thempi );
     88        mpz_neg( &dummy, &dummy );
    9689        return new InternalInteger( dummy );
    97     }
    98     else {
     90    } else {
    9991        mpz_neg( &thempi, &thempi );
    10092        return this;
    10193    }
    10294}
     95//}}}
    10396
    10497
  • factory/int_int.h

    r6dd289 rf1295f  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: int_int.h,v 1.8 1998-03-17 15:56:18 schmidt Exp $ */
     2/* $Id: int_int.h,v 1.9 1998-06-26 16:16:40 schmidt Exp $ */
    33
    44#ifndef INCL_INT_INT_H
     
    4646    void print( ostream&, char* );
    4747#endif /* NOSTREAMIO */
    48     bool isZero() const;
    49     bool isOne() const;
    5048    InternalCF* genZero();
    5149    InternalCF* genOne();
Note: See TracChangeset for help on using the changeset viewer.