Changeset 84bac9 in git


Ignore:
Timestamp:
Jun 5, 2018, 12:20:40 PM (6 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
d16f9cafaea19a094331583401a2c636168f5157
Parents:
480978c837b761f00f135f8c3c49ffbccb5ff8fb
Message:
opt: conversion to factory
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_factory.cc

    r480978c r84bac9  
    3030CFFactory::basic ( long value )
    3131{
    32     if ( currenttype == IntegerDomain )
     32  switch(currenttype)
     33  {
     34    case IntegerDomain:
    3335        if (LIKELY( value >= MINIMMEDIATE && value <= MAXIMMEDIATE ))
    3436            return int2imm( value );
     
    4042//         else
    4143//             return new InternalRational( value );
    42     else  if ( currenttype == FiniteFieldDomain )
     44    case FiniteFieldDomain:
    4345        return int2imm_p( ff_norm( value ) );
    44     else  if ( currenttype == GaloisFieldDomain )
     46    case GaloisFieldDomain:
    4547        return int2imm_gf( gf_int2gf( value ) );
    46     else {
    47         ASSERT( 0, "illegal basic domain!" );
    48         return 0;
    49     }
     48    default: {
     49        ASSERT( 0, "illegal basic domain!" );
     50        return 0;
     51    }
     52  }
    5053}
    5154
  • factory/int_poly.cc

    r480978c r84bac9  
    3030#include "variable.h"
    3131#include "imm.h"
     32
     33#ifdef __GNUC__
     34#define LIKELY(X)   (__builtin_expect(!!(X), 1))
     35#define UNLIKELY(X) (__builtin_expect(!!(X), 0))
     36#else
     37#define LIKELY(X)   (X)
     38#define UNLIKELY(X) (X)
     39#endif
    3240
    3341#ifdef HAVE_OMALLOC
     
    21552163        {
    21562164            theCursor->coeff += aCursor->coeff * coeff;
    2157             if ( theCursor->coeff.isZero() )
     2165            if(UNLIKELY(( theCursor->coeff.isZero() )))
    21582166            {
    21592167                if ( predCursor )
  • libpolys/coeffs/modulop.cc

    r480978c r84bac9  
    344344{
    345345  if (setChar) setCharacteristic( r->ch );
    346   CanonicalForm term(npInt( n,r ));
    347   return term;
     346  return CanonicalForm(npInt( n,r ));
    348347}
    349348
  • libpolys/polys/clapconv.cc

    r480978c r84bac9  
    9494  while ( p!=NULL )
    9595  {
    96     CanonicalForm term;
    97     term=r->cf->convSingNFactoryN(pGetCoeff( p ),setChar, r->cf);
     96    CanonicalForm term=r->cf->convSingNFactoryN(pGetCoeff( p ),setChar, r->cf);
    9897    if (errorreported) break;
    9998    setChar=FALSE;
     
    101100    {
    102101      if ( (e = p_GetExp( p, i, r)) != 0 )
    103         term *= power( Variable( i ), e );
     102        term *= CanonicalForm( Variable( i ), e );
    104103    }
    105104    result += term;
Note: See TracChangeset for help on using the changeset viewer.