Changeset 67294f1 in git


Ignore:
Timestamp:
May 13, 2014, 3:53:03 PM (10 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
35f5d9ad091c8da876ba995bb16cca8524433938
Parents:
0ac77c459123ddecaf705f0a8aead6339faa5279
git-author:
Martin Lee <martinlee84@web.de>2014-05-13 15:53:03+02:00
git-committer:
Martin Lee <martinlee84@web.de>2014-05-21 15:06:54+02:00
Message:
chg: move IntGenerator from facAlgFuncUtil to cf_generator
Location:
factory
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_generator.cc

    r0ac77c4 r67294f1  
    1212#include "gfops.h"
    1313#include "ffops.h"
     14
     15bool IntGenerator::hasItems() const
     16{
     17    return 1;
     18}
     19
     20CanonicalForm IntGenerator::item() const
     21{
     22  return mapinto (CanonicalForm (current));
     23}
     24
     25void IntGenerator::next()
     26{
     27    current++;
     28}
     29
     30CFGenerator * IntGenerator::clone () const
     31{
     32    return new IntGenerator();
     33}
    1434
    1535bool FFGenerator::hasItems() const
     
    201221CFGenerator * CFGenFactory::generate()
    202222{
    203     ASSERT( getCharacteristic() > 0, "not a finite field" );
    204     if ( getGFDegree() > 1 )
     223    if (getCharacteristic() == 0)
     224        return new IntGenerator();
     225    else if ( getGFDegree() > 1 )
    205226        return new GFGenerator();
    206227    else
  • factory/cf_generator.h

    r0ac77c4 r67294f1  
    2020    virtual void next() {};
    2121    virtual CFGenerator * clone() const { return new CFGenerator();}
     22};
     23
     24class IntGenerator : public CFGenerator
     25{
     26private:
     27    int current;
     28public:
     29    IntGenerator() : current(0) {}
     30    ~IntGenerator() {}
     31    bool hasItems() const;
     32    void reset() { current = 0; }
     33    CanonicalForm item() const;
     34    void next();
     35    void operator++ () { next(); }
     36    void operator++ ( int ) { next(); }
     37    CFGenerator * clone() const;
    2238};
    2339
  • factory/facAlgFunc.cc

    r0ac77c4 r67294f1  
    493493  CFGenerator * Gen;
    494494  if (getCharacteristic() == 0)
    495     Gen= new IntGenerator();
     495    Gen= CFGenFactory::generate();
    496496  else if (degree (vminpoly) > 0)
    497497    Gen= AlgExtGenerator (vminpoly).clone();
    498498  else
    499     Gen= new FFGenerator();
     499    Gen= CFGenFactory::generate();
    500500
    501501  CFFList LL= CFFList (CFFactor (f, 1));
  • factory/facAlgFuncUtil.cc

    r0ac77c4 r67294f1  
    2020#include "cf_assert.h"
    2121
     22#include "canonicalform.h"
    2223#include "facAlgFuncUtil.h"
    2324#include "cfCharSetsUtil.h"
     
    9192  FFRandom gen;
    9293  return find_irreducible (degOfExt, gen, Variable (1));
    93 }
    94 
    95 // // missing class: IntGenerator:
    96 bool IntGenerator::hasItems() const
    97 {
    98     return 1;
    99 }
    100 
    101 CanonicalForm IntGenerator::item() const
    102 //int IntGenerator::item() const
    103 {
    104   //return current; //CanonicalForm( current );
    105   return mapinto (CanonicalForm (current));
    106 }
    107 
    108 void IntGenerator::next()
    109 {
    110     current++;
    11194}
    11295
  • factory/facAlgFuncUtil.h

    r0ac77c4 r67294f1  
    1818#ifndef FAC_ALG_FUNC_UTIL_H
    1919#define FAC_ALG_FUNC_UTIL_H
    20 
    21 #include "cf_generator.h"
    22 
    23 
    24 // missing class: IntGenerator:
    25 class IntGenerator : public CFGenerator
    26 {
    27 private:
    28     int current;
    29 public:
    30     IntGenerator() : current(0) {}
    31     ~IntGenerator() {}
    32     bool hasItems() const;
    33     void reset() { current = 0; }
    34     CanonicalForm item() const;
    35     void next();
    36     void operator++ () { next(); }
    37     void operator++ ( int ) { next(); }
    38 };
    3920
    4021CFFList
Note: See TracChangeset for help on using the changeset viewer.