Changeset 553daf in git


Ignore:
Timestamp:
Jul 1, 1997, 2:35:11 PM (27 years ago)
Author:
Jens Schmidt <schmidt@…>
Branches:
(u'spielwiese', '82fc009ea2b0098c1a4896c841bb70860976bdfc')
Children:
b05571db0515adc91bc85368f8dcce880183a651
Parents:
eb27afd664afaf2b0a54a0a8e2538973d26c20db
Message:
	* cf_random.cc (RandomGenerator): removed definitions of const
	  long int in class for mac.  Instead, they are initialized in
	  the constructor.


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

Legend:

Unmodified
Added
Removed
  • factory/cf_random.cc

    reb27af r553daf  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: cf_random.cc,v 1.3 1997-06-19 12:24:01 schmidt Exp $ */
     2/* $Id: cf_random.cc,v 1.4 1997-07-01 12:35:11 schmidt Exp $ */
    33
    44#include <config.h>
     
    1616class RandomGenerator {
    1717private:
     18#ifdef macintosh
     19    // mac does not like const long int in a class
     20    long int ia, im, iq, ir, deflt;
     21#else
    1822    const long int
    1923        ia = 16807,
     
    2226        ir = 2836,
    2327        deflt = 123459876;
     28#endif
    2429   
    2530    long s;
     
    2833    void seedInit( long ss ) { s = ((ss == 0) ? deflt : ss); }
    2934public:
     35#ifdef macintosh
     36    RandomGenerator();
     37    RandomGenerator( long ss );
     38#else
    3039    RandomGenerator() { seedInit( (long)time( 0 ) ); }
    3140    RandomGenerator( long ss ) { seedInit( ss ); }
     41#endif
    3242    ~RandomGenerator() {}
    3343    long generate();
    3444    void seed( long ss ) { seedInit( ss ); }
    3545};
     46
     47#ifdef macintosh
     48RandomGenerator::RandomGenerator()
     49{
     50  ia = 16807;
     51  im = 2147483647;
     52  iq = 127773;
     53  ir = 2836;
     54  deflt = 123459876;
     55  seedInit( (long)time( 0 ) );
     56}
     57
     58RandomGenerator::RandomGenerator( long ss )
     59{
     60  ia = 16807;
     61  im = 2147483647;
     62  iq = 127773;
     63  ir = 2836;
     64  deflt = 123459876;
     65  seedInit( ss );
     66}
     67#endif
    3668
    3769long
Note: See TracChangeset for help on using the changeset viewer.