Only in galib-2.4.5-al1/: AL1NOTES
diff -u -r oldgalib/galib245/examples/ex10.C galib-2.4.5-al1/examples/ex10.C
--- oldgalib/galib245/examples/ex10.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex10.C	2004-12-26 02:05:46.000000000 +0100
@@ -15,8 +15,8 @@
 ---------------------------------------------------------------------------- */
 #include <stdlib.h>
 #include <stdio.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <math.h>
 #include <ga/ga.h>
 
diff -u -r oldgalib/galib245/examples/ex11.C galib-2.4.5-al1/examples/ex11.C
--- oldgalib/galib245/examples/ex11.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex11.C	2004-12-26 02:05:46.000000000 +0100
@@ -8,8 +8,8 @@
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
 #include <stdlib.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <ga/ga.h>
 
 
diff -u -r oldgalib/galib245/examples/ex12.C galib-2.4.5-al1/examples/ex12.C
--- oldgalib/galib245/examples/ex12.C	1999-12-14 05:55:13.000000000 +0100
+++ galib-2.4.5-al1/examples/ex12.C	2004-12-26 02:05:46.000000000 +0100
@@ -8,8 +8,8 @@
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
 #include <stdlib.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <ga/ga.h>
 #include <ga/GAStringGenome.h>
 #include <ga/GAStringGenome.C>
diff -u -r oldgalib/galib245/examples/ex13.C galib-2.4.5-al1/examples/ex13.C
--- oldgalib/galib245/examples/ex13.C	1999-12-14 06:12:55.000000000 +0100
+++ galib-2.4.5-al1/examples/ex13.C	2004-12-26 02:40:03.000000000 +0100
@@ -16,8 +16,8 @@
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
 #include <stdlib.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <math.h>
 #include <ga/ga.h>
 
@@ -162,7 +162,7 @@
   cout << "\n"; cout.flush();
 
   numbers_genome = *data.numbers_genome;
-  for(i=0; i<map.nPhenotypes(); i++){
+  for(unsigned int i=0; i<map.nPhenotypes(); i++){
     cout.width(10);
     cout << numbers_genome.phenotype(i) << " ";
   }
diff -u -r oldgalib/galib245/examples/ex14.C galib-2.4.5-al1/examples/ex14.C
--- oldgalib/galib245/examples/ex14.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex14.C	2004-12-26 02:05:46.000000000 +0100
@@ -11,8 +11,8 @@
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
 #include <stdlib.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <ga/ga.h>
 
 
diff -u -r oldgalib/galib245/examples/ex15.C galib-2.4.5-al1/examples/ex15.C
--- oldgalib/galib245/examples/ex15.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex15.C	2004-12-26 02:40:51.000000000 +0100
@@ -8,8 +8,8 @@
 stopping criterion for the GA rather than number-of-generations.
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <math.h>
 #include <ga/ga.h>
 
@@ -109,13 +109,13 @@
 
   genome.initialize();
   cout << "random values in the genome:\n";;
-  for(i=0; i<map.nPhenotypes(); i++){
+  for(unsigned int i=0; i<map.nPhenotypes(); i++){
     cout.width(10); cout << genome.phenotype(i) << " ";
   }
   cout << "\n";
   genome = ga.statistics().bestIndividual();
   cout << "the ga generated:\n";
-  for(i=0; i<map.nPhenotypes(); i++){
+  for(unsigned int i=0; i<map.nPhenotypes(); i++){
     cout.width(10); cout << genome.phenotype(i) << " ";
   }
   cout << "\n\n"; cout.flush();
diff -u -r oldgalib/galib245/examples/ex16.C galib-2.4.5-al1/examples/ex16.C
--- oldgalib/galib245/examples/ex16.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex16.C	2004-12-26 02:05:46.000000000 +0100
@@ -9,8 +9,8 @@
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
 #include <stdlib.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <ga/ga.h>
 
 
diff -u -r oldgalib/galib245/examples/ex17.C galib-2.4.5-al1/examples/ex17.C
--- oldgalib/galib245/examples/ex17.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex17.C	2004-12-26 02:05:46.000000000 +0100
@@ -10,8 +10,8 @@
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
 #include <stdlib.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <ga/ga.h>
 
 
diff -u -r oldgalib/galib245/examples/ex18.C galib-2.4.5-al1/examples/ex18.C
--- oldgalib/galib245/examples/ex18.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex18.C	2004-12-26 02:05:46.000000000 +0100
@@ -11,8 +11,8 @@
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
 #include <stdlib.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <ga/ga.h>
 
 float objective(GAGenome &);
diff -u -r oldgalib/galib245/examples/ex19.C galib-2.4.5-al1/examples/ex19.C
--- oldgalib/galib245/examples/ex19.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex19.C	2004-12-26 02:05:46.000000000 +0100
@@ -13,8 +13,8 @@
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
 #include <stdlib.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <math.h>
 #include <ga/ga.h>
 
diff -u -r oldgalib/galib245/examples/ex1.C galib-2.4.5-al1/examples/ex1.C
--- oldgalib/galib245/examples/ex1.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex1.C	2004-12-26 02:05:46.000000000 +0100
@@ -14,7 +14,7 @@
 function.  But it does work.
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
-#include <iostream.h>
+#include <iostream>
 
 #include <ga/GASimpleGA.h>	// we're going to use the simple GA
 #include <ga/GA2DBinStrGenome.h> // and the 2D binary string genome
diff -u -r oldgalib/galib245/examples/ex20.C galib-2.4.5-al1/examples/ex20.C
--- oldgalib/galib245/examples/ex20.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex20.C	2004-12-26 02:05:46.000000000 +0100
@@ -12,7 +12,7 @@
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
 #include <stdlib.h>
-#include <iostream.h>
+#include <iostream>
 #include <ga/ga.h>
 
 
diff -u -r oldgalib/galib245/examples/ex21.C galib-2.4.5-al1/examples/ex21.C
--- oldgalib/galib245/examples/ex21.C	1999-12-14 05:56:48.000000000 +0100
+++ galib-2.4.5-al1/examples/ex21.C	2004-12-26 02:45:02.695635408 +0100
@@ -12,7 +12,7 @@
 create the array determines which behaviour you'll get.
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
-#include <iostream.h>
+#include <iostream>
 #include <ga/ga.h>
 #include <ga/GARealGenome.h>
 #include <ga/GARealGenome.C>
@@ -69,7 +69,7 @@
 // the allele set explicitly (even though in this case 
 
   GARealAlleleSetArray alleles2a;
-  for(unsigned int kk=0; kk<length; kk++)
+  for(int kk=0; kk<length; kk++)
     alleles2a.add(0, 1, GAAllele::EXCLUSIVE, GAAllele::EXCLUSIVE);
   GARealGenome genome2a(alleles2a, Objective2);
 
diff -u -r oldgalib/galib245/examples/ex22.C galib-2.4.5-al1/examples/ex22.C
--- oldgalib/galib245/examples/ex22.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex22.C	2004-12-26 02:05:47.000000000 +0100
@@ -14,7 +14,7 @@
 child crossover" you could use your own crossover algorithm instead.
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
-#include <iostream.h>
+#include <iostream>
 #include <math.h>
 #include <ga/ga.h>
 
diff -u -r oldgalib/galib245/examples/ex23.C galib-2.4.5-al1/examples/ex23.C
--- oldgalib/galib245/examples/ex23.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex23.C	2004-12-26 02:05:47.000000000 +0100
@@ -8,8 +8,8 @@
 minimize your objective functions.
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <math.h>
 #include <ga/ga.h>
 #include <ga/GARealGenome.h>
diff -u -r oldgalib/galib245/examples/ex24.C galib-2.4.5-al1/examples/ex24.C
--- oldgalib/galib245/examples/ex24.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex24.C	2004-12-26 02:05:47.000000000 +0100
@@ -12,8 +12,8 @@
 example).
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <math.h>
 #include <ga/ga.h>
 #include <ga/GARealGenome.h>
diff -u -r oldgalib/galib245/examples/ex25.C galib-2.4.5-al1/examples/ex25.C
--- oldgalib/galib245/examples/ex25.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex25.C	2004-12-26 02:05:47.000000000 +0100
@@ -7,7 +7,7 @@
    This example shows how to do multiple populations on a single CPU.
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
-#include <iostream.h>
+#include <iostream>
 #include <ga/GA1DBinStrGenome.h>
 #include <ga/GADemeGA.h>
 
diff -u -r oldgalib/galib245/examples/ex2.C galib-2.4.5-al1/examples/ex2.C
--- oldgalib/galib245/examples/ex2.C	1999-12-14 05:53:25.000000000 +0100
+++ galib-2.4.5-al1/examples/ex2.C	2004-12-26 02:05:47.000000000 +0100
@@ -12,8 +12,8 @@
 objective function.
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <math.h>
 
 #include <ga/GASimpleGA.h>
diff -u -r oldgalib/galib245/examples/ex3.C galib-2.4.5-al1/examples/ex3.C
--- oldgalib/galib245/examples/ex3.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex3.C	2004-12-26 02:05:47.000000000 +0100
@@ -14,8 +14,8 @@
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
 #include <stdlib.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 
 #include <ga/GASimpleGA.h>	// the header for the GA we'll use
 #include <ga/GA2DBinStrGenome.h> // and the header for the genome we need
diff -u -r oldgalib/galib245/examples/ex4.C galib-2.4.5-al1/examples/ex4.C
--- oldgalib/galib245/examples/ex4.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex4.C	2004-12-26 02:05:47.000000000 +0100
@@ -16,7 +16,7 @@
 algorithm object.
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
-#include <iostream.h>
+#include <iostream>
 
 #include <ga/GASStateGA.h>	// include the steady-state GA header
 #include <ga/GA3DBinStrGenome.h> // and the header for the genome we'll use
diff -u -r oldgalib/galib245/examples/ex5.C galib-2.4.5-al1/examples/ex5.C
--- oldgalib/galib245/examples/ex5.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex5.C	2004-12-26 02:05:47.000000000 +0100
@@ -15,8 +15,8 @@
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
 #include <stdlib.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <math.h>
 #include <ga/GABin2DecGenome.h>
 #include <ga/GA2DBinStrGenome.h>
diff -u -r oldgalib/galib245/examples/ex6.C galib-2.4.5-al1/examples/ex6.C
--- oldgalib/galib245/examples/ex6.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex6.C	2004-12-26 02:05:47.000000000 +0100
@@ -15,8 +15,8 @@
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
 #include <stdlib.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <ga/ga.h>
 
 
diff -u -r oldgalib/galib245/examples/ex7.C galib-2.4.5-al1/examples/ex7.C
--- oldgalib/galib245/examples/ex7.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex7.C	2004-12-26 02:05:47.000000000 +0100
@@ -10,8 +10,8 @@
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
 #include <stdlib.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <ga/ga.h>
 
 float objective(GAGenome &);
diff -u -r oldgalib/galib245/examples/ex8.C galib-2.4.5-al1/examples/ex8.C
--- oldgalib/galib245/examples/ex8.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex8.C	2004-12-26 02:05:47.000000000 +0100
@@ -17,8 +17,8 @@
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
 #include <stdlib.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <ga/ga.h>
 
 
diff -u -r oldgalib/galib245/examples/ex9.C galib-2.4.5-al1/examples/ex9.C
--- oldgalib/galib245/examples/ex9.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/ex9.C	2004-12-26 02:05:47.000000000 +0100
@@ -9,8 +9,8 @@
 decimal genome.
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <ga/ga.h>
 
 float objective(GAGenome &);
diff -u -r oldgalib/galib245/examples/randtest.C galib-2.4.5-al1/examples/randtest.C
--- oldgalib/galib245/examples/randtest.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/randtest.C	2004-12-26 02:05:47.000000000 +0100
@@ -7,11 +7,13 @@
    Program to test the random number generator in GAlib.
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
-#include <iostream.h>
+#include <iostream>
 #include <string.h>
 #include <math.h>
 #include <ga/garandom.h>
 
+using namespace GARandom;
+
 static const int HIST_SIZE=501;
 static const int NFLIPS=10000;
 static const long int NUM_CHECKS=1000000L;
Only in galib-2.4.5-al1/examples: script.sh
diff -u -r oldgalib/galib245/examples/seed.C galib-2.4.5-al1/examples/seed.C
--- oldgalib/galib245/examples/seed.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/examples/seed.C	2004-12-26 02:05:47.000000000 +0100
@@ -4,8 +4,8 @@
 ---------------------------------------------------------------------------- */
 #include <stdio.h>
 #include <stdlib.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 
 #include <ga/ga.h>
 
diff -u -r oldgalib/galib245/ga/GA1DArrayGenome.C galib-2.4.5-al1/ga/GA1DArrayGenome.C
--- oldgalib/galib245/ga/GA1DArrayGenome.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GA1DArrayGenome.C	2004-12-26 02:39:07.618615320 +0100
@@ -18,6 +18,8 @@
 #include <ga/GA1DArrayGenome.h>
 #include <ga/GAMask.h>
 
+using namespace GARandom;
+
 template <class T> int 
 GA1DArrayIsHole(const GA1DArrayGenome<T>&, const GA1DArrayGenome<T>&,
 		int, int, int);
@@ -133,7 +135,7 @@
 
   nx = GAArray<T>::size(len);
   _evaluated = gaFalse;
-  return sz;
+  return GAArray<T>::sz;
 }
 
 
@@ -224,8 +226,8 @@
 
   initializer(DEFAULT_1DARRAY_ALLELE_INITIALIZER);
   mutator(DEFAULT_1DARRAY_ALLELE_MUTATOR);
-  comparator(DEFAULT_1DARRAY_ALLELE_COMPARATOR);
-  crossover(DEFAULT_1DARRAY_ALLELE_CROSSOVER);
+  comparator(GAArray<T>::DEFAULT_1DARRAY_ALLELE_COMPARATOR);
+  crossover(GAArray<T>::DEFAULT_1DARRAY_ALLELE_CROSSOVER);
 }
 
 template <class T> 
@@ -240,8 +242,8 @@
 
   initializer(DEFAULT_1DARRAY_ALLELE_INITIALIZER);
   mutator(DEFAULT_1DARRAY_ALLELE_MUTATOR);
-  comparator(DEFAULT_1DARRAY_ALLELE_COMPARATOR);
-  crossover(DEFAULT_1DARRAY_ALLELE_CROSSOVER);
+  comparator(GAArray<T>::DEFAULT_1DARRAY_ALLELE_COMPARATOR);
+  crossover(GAArray<T>::DEFAULT_1DARRAY_ALLELE_CROSSOVER);
 }
 
 
@@ -295,11 +297,11 @@
 // value (ie one of our alleles).
 template <class T> int
 GA1DArrayAlleleGenome<T>::resize(int len){
-  unsigned int oldx = nx;
+  unsigned int oldx = GA1DArrayAlleleGenome<T>::nx;
   GA1DArrayGenome<T>::resize(len);
-  if(nx > oldx){
-    for(unsigned int i=oldx; i<nx; i++)
-      a[i] = aset[i % naset].allele();
+  if(GA1DArrayGenome<T>::nx > oldx){
+    for(unsigned int i=oldx; i<GA1DArrayGenome<T>::nx; i++)
+      GAArray<T>::a[i] = aset[i % naset].allele();
   }
   return len;
 }
diff -u -r oldgalib/galib245/ga/GA1DArrayGenome.h galib-2.4.5-al1/ga/GA1DArrayGenome.h
--- oldgalib/galib245/ga/GA1DArrayGenome.h	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GA1DArrayGenome.h	2004-12-26 00:26:21.000000000 +0100
@@ -63,7 +63,7 @@
   GA1DArrayGenome<T>& operator=(const GAGenome& orig)
     {copy(orig); return *this;}
   GA1DArrayGenome<T>& operator=(const T array []) // no err checks!
-    {for(unsigned int i=0; i<sz; i++) gene(i, *(array+i)); return *this;}
+    {for(unsigned int i=0; i<GAArray<T>::sz; i++) gene(i, *(array+i)); return *this;}
   virtual ~GA1DArrayGenome();
   virtual GAGenome *clone(GAGenome::CloneMethod flag=CONTENTS) const;
   virtual void copy(const GAGenome &);
@@ -75,10 +75,10 @@
 
   virtual int equal(const GAGenome & c) const ;
 
-  const T & gene(unsigned int x=0) const {return a[x];}
+  const T & gene(unsigned int x=0) const {return GAArray<T>::a[x];}
   T & gene(unsigned int x, const T & value){
-    if(a[x] != value){ a[x] = value; _evaluated = gaFalse;}
-    return a[x];
+    if(GAArray<T>::a[x] != value){ GAArray<T>::a[x] = value; _evaluated = gaFalse;}
+    return GAArray<T>::a[x];
   }
   int length() const {return nx;}
   int length(int x){resize(x); return nx;}
@@ -152,7 +152,7 @@
   GA1DArrayAlleleGenome<T>& operator=(const T array []) // no err checks!
     {GA1DArrayGenome<T>::operator=(array); return *this;}
   virtual ~GA1DArrayAlleleGenome();
-  virtual GAGenome *clone(GAGenome::CloneMethod flag=CONTENTS) const;
+  virtual GAGenome *clone(GAGenome::CloneMethod flag=GAArray<T>::CONTENTS) const;
   virtual void copy(const GAGenome &);
 
 #ifndef NO_STREAMS
diff -u -r oldgalib/galib245/ga/GA2DArrayGenome.C galib-2.4.5-al1/ga/GA2DArrayGenome.C
--- oldgalib/galib245/ga/GA2DArrayGenome.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GA2DArrayGenome.C	2004-12-26 02:42:31.840568864 +0100
@@ -18,6 +18,7 @@
 #include <ga/GA2DArrayGenome.h>
 #include <ga/GAMask.h>
 
+using namespace GARandom;
 
 /* ----------------------------------------------------------------------------
 2DArrayGenome
@@ -86,7 +87,7 @@
 
 template <class T> int
 GA2DArrayGenome<T>::resize(int w, int h){
-  if(w == STA_CAST(int,nx) && h == STA_CAST(int,ny)) return sz;
+  if(w == STA_CAST(int,nx) && h == STA_CAST(int,ny)) return GA2DArrayGenome<T>::sz;
 
   if(w == GAGenome::ANY_SIZE)
     w = GARandomInt(minX, maxX);
@@ -113,7 +114,7 @@
   if(w < STA_CAST(int,nx)){
     int y=GAMin(STA_CAST(int,ny),h);
     for(int j=0; j<y; j++)
-      move(j*w,j*nx,w);
+      GAArray<T>::move(j*w,j*nx,w);
   }
   GAArray<T>::size(w*h);
   if(w > STA_CAST(int,nx)){		// adjust the existing chunks of bits
@@ -124,7 +125,7 @@
 
   nx = w; ny = h;
   _evaluated = gaFalse;
-  return sz;
+  return GA2DArrayGenome<T>::sz;
 }
 
 
@@ -271,8 +272,8 @@
 
   initializer(DEFAULT_2DARRAY_ALLELE_INITIALIZER);
   mutator(DEFAULT_2DARRAY_ALLELE_MUTATOR);
-  comparator(DEFAULT_2DARRAY_ALLELE_COMPARATOR);
-  crossover(DEFAULT_2DARRAY_ALLELE_CROSSOVER);
+  comparator(GA2DArrayGenome<T>::DEFAULT_2DARRAY_ALLELE_COMPARATOR);
+  crossover(GA2DArrayGenome<T>::DEFAULT_2DARRAY_ALLELE_CROSSOVER);
 }
 
 template <class T> 
@@ -288,8 +289,8 @@
 
   initializer(DEFAULT_2DARRAY_ALLELE_INITIALIZER);
   mutator(DEFAULT_2DARRAY_ALLELE_MUTATOR);
-  comparator(DEFAULT_2DARRAY_ALLELE_COMPARATOR);
-  crossover(DEFAULT_2DARRAY_ALLELE_CROSSOVER);
+  comparator(GA2DArrayGenome<T>::DEFAULT_2DARRAY_ALLELE_COMPARATOR);
+  crossover(GA2DArrayGenome<T>::DEFAULT_2DARRAY_ALLELE_CROSSOVER);
 }
 
 
@@ -335,23 +336,23 @@
 
 template <class T> int
 GA2DArrayAlleleGenome<T>::resize(int x, int y){
-  unsigned int oldx = nx;
-  unsigned int oldy = ny;
+  unsigned int oldx = GA2DArrayGenome<T>::nx;
+  unsigned int oldy = GA2DArrayGenome<T>::ny;
   GA2DArrayGenome<T>::resize(x,y);
 
-  if(nx > oldx){		// adjust the existing chunks of bits
-    int y=GAMin(oldy,ny);
+  if(GA2DArrayGenome<T>::nx > oldx){		// adjust the existing chunks of bits
+    int y=GAMin(oldy,GA2DArrayGenome<T>::ny);
     for(int j=y-1; j>=0; j--){
-      for(unsigned int i=oldx; i<nx; i++)
-	a[j*nx+i] = aset[(j*nx+i) % naset].allele();
+      for(unsigned int i=oldx; i<GA2DArrayGenome<T>::nx; i++)
+	GA2DArrayGenome<T>::a[j*GA2DArrayGenome<T>::nx+i] = aset[(j*GA2DArrayGenome<T>::nx+i) % naset].allele();
     }
   }
-  if(ny > oldy){		// change in height is always new bits
-    for(unsigned int i=nx*oldy; i<nx*ny; i++)
-      a[i] = aset[i % naset].allele();
+  if(GA2DArrayGenome<T>::ny > oldy){		// change in height is always new bits
+    for(unsigned int i=GA2DArrayGenome<T>::nx*oldy; i<GA2DArrayGenome<T>::nx*GA2DArrayGenome<T>::ny; i++)
+      GA2DArrayGenome<T>::a[i] = aset[i % naset].allele();
   }
 
-  return sz;
+  return GA2DArrayGenome<T>::sz;
 }
 
 
diff -u -r oldgalib/galib245/ga/GA2DArrayGenome.h galib-2.4.5-al1/ga/GA2DArrayGenome.h
--- oldgalib/galib245/ga/GA2DArrayGenome.h	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GA2DArrayGenome.h	2004-12-26 00:27:26.000000000 +0100
@@ -57,10 +57,10 @@
 
   virtual int equal(const GAGenome & c) const;
 
-  const T & gene(unsigned int x, unsigned int y) const {return a[y*nx+x]; }
+  const T & gene(unsigned int x, unsigned int y) const {return GAArray<T>::a[y*nx+x]; }
   T & gene(unsigned int x, unsigned int y, const T & value) {
-    if(a[y*nx+x] != value){a[y*nx+x] = value; _evaluated = gaFalse;}
-    return a[y*nx+x];
+    if(GAArray<T>::a[y*nx+x] != value){GAArray<T>::a[y*nx+x] = value; _evaluated = gaFalse;}
+    return GAArray<T>::a[y*nx+x];
   }
   int width() const {return nx;}
   int width(int w){resize(w, ny); return nx;}
@@ -121,7 +121,7 @@
   GA2DArrayAlleleGenome<T>& operator=(const T array [])
     { GA2DArrayGenome<T>::operator=(array); return *this; }
   virtual ~GA2DArrayAlleleGenome();
-  virtual GAGenome * clone(GAGenome::CloneMethod flag=CONTENTS) const;
+  virtual GAGenome * clone(GAGenome::CloneMethod flag=GAArray<T>::CONTENTS) const;
   virtual void copy(const GAGenome &);
 
 #ifndef NO_STREAMS
diff -u -r oldgalib/galib245/ga/GA3DArrayGenome.C galib-2.4.5-al1/ga/GA3DArrayGenome.C
--- oldgalib/galib245/ga/GA3DArrayGenome.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GA3DArrayGenome.C	2004-12-26 02:44:27.292017576 +0100
@@ -18,6 +18,7 @@
 #include <ga/GA3DArrayGenome.h>
 #include <ga/GAMask.h>
 
+using namespace GARandom;
 
 /* ----------------------------------------------------------------------------
 3DArrayGenome
@@ -89,7 +90,7 @@
 GA3DArrayGenome<T>::resize(int w, int h, int d)
 {
   if(w == STA_CAST(int,nx) && h == STA_CAST(int,ny) && d == STA_CAST(int,nz))
-    return sz;
+    return GA3DArrayGenome<T>::sz;
 
   if(w == GAGenome::ANY_SIZE)
     w = GARandomInt(minX, maxX);
@@ -166,7 +167,7 @@
 
   nx = w; ny = h; nz = d;
   _evaluated = gaFalse;
-  return sz;
+  return GA3DArrayGenome<T>::sz;
 }
 
 
@@ -324,8 +325,8 @@
 
   initializer(DEFAULT_3DARRAY_ALLELE_INITIALIZER);
   mutator(DEFAULT_3DARRAY_ALLELE_MUTATOR);
-  comparator(DEFAULT_3DARRAY_ALLELE_COMPARATOR);
-  crossover(DEFAULT_3DARRAY_ALLELE_CROSSOVER);
+  comparator(GA3DArrayGenome<T>::DEFAULT_3DARRAY_ALLELE_COMPARATOR);
+  crossover(GA3DArrayGenome<T>::DEFAULT_3DARRAY_ALLELE_CROSSOVER);
 }
 
 template <class T> 
@@ -341,8 +342,8 @@
 
   initializer(DEFAULT_3DARRAY_ALLELE_INITIALIZER);
   mutator(DEFAULT_3DARRAY_ALLELE_MUTATOR);
-  comparator(DEFAULT_3DARRAY_ALLELE_COMPARATOR);
-  crossover(DEFAULT_3DARRAY_ALLELE_CROSSOVER);
+  comparator(GA3DArrayGenome<T>::DEFAULT_3DARRAY_ALLELE_COMPARATOR);
+  crossover(GA3DArrayGenome<T>::DEFAULT_3DARRAY_ALLELE_CROSSOVER);
 }
 
 
@@ -388,45 +389,45 @@
 
 template <class T> int
 GA3DArrayAlleleGenome<T>::resize(int w, int h, int d){
-  unsigned int oldx = nx;
-  unsigned int oldy = ny;
-  unsigned int oldz = nz;
+  unsigned int oldx = GA3DArrayGenome<T>::nx;
+  unsigned int oldy = GA3DArrayGenome<T>::ny;
+  unsigned int oldz = GA3DArrayGenome<T>::nz;
   GA3DArrayGenome<T>::resize(w,h,d);
 
 // set new elements to proper randomly selected values
 
-  if(nx > oldx && ny > oldy){
-    int z=GAMin(oldz,nz);
+  if(GA3DArrayGenome<T>::nx > oldx && GA3DArrayGenome<T>::ny > oldy){
+    int z=GAMin(oldz,GA3DArrayGenome<T>::nz);
     for(int k=z-1; k>=0; k--){
       int j;
       for(j=oldy-1; j>=0; j--)
-	for(unsigned int i=oldx; i<nx; i++)
-	  a[k*ny*nx+j*nx+i] = aset[(k*ny*nx+j*nx+i) % naset].allele();
-      for(j=oldy; j<STA_CAST(int,ny); j++)
-	for(unsigned int i=0; i<nx; i++)
-	  a[k*ny*nx+j*nx+i] = aset[(k*ny*nx+j*nx+i) % naset].allele();
+	for(unsigned int i=oldx; i<GA3DArrayGenome<T>::nx; i++)
+	  GA3DArrayGenome<T>::a[k*GA3DArrayGenome<T>::ny*GA3DArrayGenome<T>::nx+j*GA3DArrayGenome<T>::nx+i] = aset[(k*GA3DArrayGenome<T>::ny*GA3DArrayGenome<T>::nx+j*GA3DArrayGenome<T>::nx+i) % naset].allele();
+      for(j=oldy; j<STA_CAST(int,GA3DArrayGenome<T>::ny); j++)
+	for(unsigned int i=0; i<GA3DArrayGenome<T>::nx; i++)
+	  GA3DArrayGenome<T>::a[k*GA3DArrayGenome<T>::ny*GA3DArrayGenome<T>::nx+j*GA3DArrayGenome<T>::nx+i] = aset[(k*GA3DArrayGenome<T>::ny*GA3DArrayGenome<T>::nx+j*GA3DArrayGenome<T>::nx+i) % naset].allele();
     }
   }
-  else if(nx > oldx){
-    int z=GAMin(oldz,nz);
+  else if(GA3DArrayGenome<T>::nx > oldx){
+    int z=GAMin(oldz,GA3DArrayGenome<T>::nz);
     for(int k=z-1; k>=0; k--)
-      for(int j=ny-1; j>=0; j--)
-	for(unsigned int i=oldx; i<nx; i++)
-	  a[k*ny*nx+j*nx+i] = aset[(k*ny*nx+j*nx+i) % naset].allele();
+      for(int j=GA3DArrayGenome<T>::ny-1; j>=0; j--)
+	for(unsigned int i=oldx; i<GA3DArrayGenome<T>::nx; i++)
+	  GA3DArrayGenome<T>::a[k*GA3DArrayGenome<T>::ny*GA3DArrayGenome<T>::nx+j*GA3DArrayGenome<T>::nx+i] = aset[(k*GA3DArrayGenome<T>::ny*GA3DArrayGenome<T>::nx+j*GA3DArrayGenome<T>::nx+i) % naset].allele();
   }
-  else if(ny > oldy){
-    int z=GAMin(oldz,nz);
+  else if(GA3DArrayGenome<T>::ny > oldy){
+    int z=GAMin(oldz,GA3DArrayGenome<T>::nz);
     for(int k=z-1; k>=0; k--)
-      for(unsigned int j=oldy; j<ny; j++)
-	for(unsigned int i=0; i<nx; i++)
-	  a[k*ny*nx+j*nx+i] = aset[(k*ny*nx+j*nx+i) % naset].allele();
+      for(unsigned int j=oldy; j<GA3DArrayGenome<T>::ny; j++)
+	for(unsigned int i=0; i<GA3DArrayGenome<T>::nx; i++)
+	  GA3DArrayGenome<T>::a[k*GA3DArrayGenome<T>::ny*GA3DArrayGenome<T>::nx+j*GA3DArrayGenome<T>::nx+i] = aset[(k*GA3DArrayGenome<T>::ny*GA3DArrayGenome<T>::nx+j*GA3DArrayGenome<T>::nx+i) % naset].allele();
   }
-  if(nz > oldz){		// change in depth is always new elements
-    for(unsigned int i=nx*ny*oldz; i<nx*ny*nz; i++)
-      a[i] = aset[i % naset].allele();
+  if(GA3DArrayGenome<T>::nz > oldz){		// change in depth is always new elements
+    for(unsigned int i=GA3DArrayGenome<T>::nx*GA3DArrayGenome<T>::ny*oldz; i<GA3DArrayGenome<T>::nx*GA3DArrayGenome<T>::ny*GA3DArrayGenome<T>::nz; i++)
+      GA3DArrayGenome<T>::a[i] = aset[i % naset].allele();
   }
 
-  return sz;
+  return GA3DArrayGenome<T>::sz;
 }
 
 
diff -u -r oldgalib/galib245/ga/GA3DArrayGenome.h galib-2.4.5-al1/ga/GA3DArrayGenome.h
--- oldgalib/galib245/ga/GA3DArrayGenome.h	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GA3DArrayGenome.h	2004-12-26 00:34:05.000000000 +0100
@@ -60,14 +60,14 @@
   virtual int equal(const GAGenome & c) const;
 
   const T & gene(unsigned int x, unsigned int y, unsigned int z) const {
-    return a[z*ny*nx + y*nx + x];
+    return GAArray<T>::a[z*ny*nx + y*nx + x];
   }
   T & gene(unsigned int x, unsigned int y, unsigned int z, const T & value){
-    if(a[z*ny*nx + y*nx + x] != value){ 
+    if(GAArray<T>::a[z*ny*nx + y*nx + x] != value){ 
       _evaluated = gaFalse;
-      a[z*ny*nx + y*nx + x] = value;
+      GAArray<T>::a[z*ny*nx + y*nx + x] = value;
     }
-    return a[z*ny*nx + y*nx + x];
+    return GAArray<T>::a[z*ny*nx + y*nx + x];
   }
   int width() const {return nx;}
   int width(int w){resize(w, ny, nz); return nx;}
@@ -136,7 +136,7 @@
   GA3DArrayAlleleGenome<T>& operator=(const T array [])
     {GA3DArrayGenome<T>::operator=(array); return *this;}
   virtual ~GA3DArrayAlleleGenome();
-  virtual GAGenome * clone(GAGenome::CloneMethod flag=CONTENTS) const;
+  virtual GAGenome * clone(GAGenome::CloneMethod flag=GAArray<T>::CONTENTS) const;
   virtual void copy(const GAGenome &);
 
 #ifndef NO_STREAMS
diff -u -r oldgalib/galib245/ga/GAAllele.h galib-2.4.5-al1/ga/GAAllele.h
--- oldgalib/galib245/ga/GAAllele.h	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GAAllele.h	2004-12-26 02:36:47.349939400 +0100
@@ -86,7 +86,7 @@
 
 
 // mods for symantec C++ on macOS.  thanks to RJG 15jul96
-#if defined(THINK_C) || __powerc
+#if defined(THINK_C) || __powerc || defined(__GNUG__)
 template <class T> int operator==(const T &, const T &);
 template <class T> int operator!=(const T &, const T &);
 #endif
@@ -144,8 +144,8 @@
   friend operator==(const GAAlleleSet<T> &, const GAAlleleSet<T> &);
   friend operator!=(const GAAlleleSet<T> &, const GAAlleleSet<T> &);
 #elif defined(__GNUG__)
-  friend int operator==<T>(const GAAlleleSet<T> &, const GAAlleleSet<T> &);
-  friend int operator!=<T>(const GAAlleleSet<T> &, const GAAlleleSet<T> &);
+  friend int operator==<>(const GAAlleleSet<T> &, const GAAlleleSet<T> &);
+  friend int operator!=<>(const GAAlleleSet<T> &, const GAAlleleSet<T> &);
 #else
   friend int operator==(const GAAlleleSet<T> &, const GAAlleleSet<T> &);
   friend int operator!=(const GAAlleleSet<T> &, const GAAlleleSet<T> &);
diff -u -r oldgalib/galib245/ga/GABinStr.C galib-2.4.5-al1/ga/GABinStr.C
--- oldgalib/galib245/ga/GABinStr.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GABinStr.C	2004-12-26 01:05:58.000000000 +0100
@@ -13,6 +13,7 @@
 #include <ga/gaerror.h>
 #include <ga/GABinStr.h>
 
+using namespace GARandom;
 
 /* ----------------------------------------------------------------------------
 BinaryStringGenome
diff -u -r oldgalib/galib245/ga/GABinStr.h galib-2.4.5-al1/ga/GABinStr.h
--- oldgalib/galib245/ga/GABinStr.h	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GABinStr.h	2004-12-26 01:06:58.000000000 +0100
@@ -21,6 +21,8 @@
 #include <ga/gatypes.h>
 #include <ga/garandom.h>
 
+using namespace GARandom;
+
 #define GA_BINSTR_CHUNKSIZE 32	  // size of the chunks of bits we allocate
 
 
diff -u -r oldgalib/galib245/ga/gaconfig.h galib-2.4.5-al1/ga/gaconfig.h
--- oldgalib/galib245/ga/gaconfig.h	2000-02-03 21:00:45.000000000 +0100
+++ galib-2.4.5-al1/ga/gaconfig.h	2004-12-26 02:46:46.859800048 +0100
@@ -82,18 +82,6 @@
    
    
              
-   
-   USE_RAN1           These specify which random number function to use.  Only
-   USE_RAN2           one of these may be specified.  You may have to tweak 
-   USE_RAN3           random.h a bit as well (these functions are not defined 
-   USE_RAND 	      the same way on each platform).  For best results, use
-   USE_RANDOM	      ran2 or ran3 (performance is slightly slower than most
-   USE_RAND48	      system RNGs, but you'll get better results).
-
-                      If you want to use another random number generator you
-                      must hack random.h directly (see the comments in that
-                      file).
-
    BITBASE            The built-in type to use for bit conversions.  This 
                       should be set to the type of the largest integer that
                       your system supports.  If you have long long int then
@@ -148,26 +136,6 @@
 
 
 // ----------------------------------------------------------------------------
-// borland c++ compiler
-//
-// You may or may not need the BORLAND_INST flag defined when you use a borland
-// compiler.  I did not need it when I compiled using version 4.0, but I did
-// need it when I compiled with an earlier version (I think it was 3.x but I
-// do not remember for certain).
-//   Note that the default random number generator when using a borland (or
-// any PC compiler, for that matter) is the basic system's RNG.
-// I did this because of the hassles of 16- vs 32-bit DOS/Windows rubbish.  If
-// you want a better RNG, you can use the others in GAlib, but you'll have to
-// do a bit of checking to make sure it works with your DOS/Windows config.
-// All of the RNGs work fine under all of the 32-bit OSes I've tried, but they
-// don't do so well in a 16-bit OS.
-//  Use the randtest example to check GAlib's RNG after you compile everything.
-#elif defined(__BORLANDC__)
-#define USE_RAND		// comment this if you're using a 32-bit OS
-//#define USE_BORLAND_INST
-
-
-// ----------------------------------------------------------------------------
 // MicroSoft's Visual C++ programming environment.
 #elif defined(_MSC_VER)
 #if defined(_CPPRTTI)
@@ -254,13 +222,6 @@
 #endif
 
 
-// If no RNG has been selected, use the ran2 generator by default
-#if !defined(USE_RAND) && !defined(USE_RANDOM) && \
-    !defined(USE_RAND48) && !defined(USE_RAN2) && !defined(USE_RAN3)
-#define USE_RAN2
-#endif
-
-
 // This defines how many bits are in a single word on your system.  Most 
 // systems have a word length of 8 bits.
 #ifndef BITS_IN_WORD
diff -u -r oldgalib/galib245/ga/GADCrowdingGA.C galib-2.4.5-al1/ga/GADCrowdingGA.C
--- oldgalib/galib245/ga/GADCrowdingGA.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GADCrowdingGA.C	2004-12-26 01:04:28.000000000 +0100
@@ -8,6 +8,8 @@
 #include "GAList.h"
 #include "garandom.h"
 
+using namespace GARandom;
+
 // this assumes that all of the genomes in the population are the same class
 void
 GADCrowdingGA::initialize(unsigned int seed)
diff -u -r oldgalib/galib245/ga/GADemeGA.C galib-2.4.5-al1/ga/GADemeGA.C
--- oldgalib/galib245/ga/GADemeGA.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GADemeGA.C	2004-12-26 01:03:54.000000000 +0100
@@ -9,6 +9,7 @@
 #include <ga/garandom.h>
 #include <ga/GADemeGA.h>
 
+using namespace GARandom;
 
 GAParameterList&
 GADemeGA::registerDefaultParameters(GAParameterList& p) {
diff -u -r oldgalib/galib245/ga/GAIncGA.C galib-2.4.5-al1/ga/GAIncGA.C
--- oldgalib/galib245/ga/GAIncGA.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GAIncGA.C	2004-12-26 01:03:35.000000000 +0100
@@ -10,6 +10,7 @@
 #include <ga/GAIncGA.h>
 #include <ga/garandom.h>
 
+using namespace GARandom;
 
 GAParameterList&
 GAIncrementalGA::registerDefaultParameters(GAParameterList& p) {
diff -u -r oldgalib/galib245/ga/GAListGenome.C galib-2.4.5-al1/ga/GAListGenome.C
--- oldgalib/galib245/ga/GAListGenome.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GAListGenome.C	2004-12-26 02:11:04.847435424 +0100
@@ -16,6 +16,9 @@
 #include <ga/GAListGenome.h>
 #include <ga/GAMask.h>
 
+#include <ga/garandom.h>
+using namespace GARandom;
+
 template <class T> int 
 GAListIsHole(const GAListGenome<T>&, const GAListGenome<T>&, int, int, int);
 
@@ -81,13 +84,13 @@
 GAListGenome<T>::write(ostream & os) const 
 {
   os << "node       next       prev       contents\n";
-  if(!hd) return 0;;
-  os.width(10); os << hd << " ";
-  os.width(10); os << hd->next << " ";
-  os.width(10); os << hd->prev << " ";
-  os.width(10); os << &(DYN_CAST(GANode<T>*, hd)->contents) << "\n";
+  if(!GAList<T>::hd) return 0;;
+  os.width(10); os << GAList<T>::hd << " ";
+  os.width(10); os << GAList<T>::hd->next << " ";
+  os.width(10); os << GAList<T>::hd->prev << " ";
+  os.width(10); os << &(DYN_CAST(GANode<T>*, GAList<T>::hd)->contents) << "\n";
 
-  for(GANodeBASE * tmp=hd->next; tmp && tmp != hd; tmp=tmp->next){
+  for(GANodeBASE * tmp=GAList<T>::hd->next; tmp && tmp != GAList<T>::hd; tmp=tmp->next){
     os.width(10); os << tmp << " ";
     os.width(10); os << tmp->next << " ";
     os.width(10); os << tmp->prev << " ";
@@ -109,7 +112,7 @@
 {
   if(this == &c) return 1;
   const GAListGenome<T> & b = DYN_CAST(const GAListGenome<T>&, c);
-  if(size() != b.size()) return 0;
+  if(GAList<T>::size() != b.size()) return 0;
 
   GAListIter<T> iterA(*this), iterB(b);
   T *tmpA = iterA.head(), *tmpB = iterB.head();
diff -u -r oldgalib/galib245/ga/GAPopulation.C galib-2.4.5-al1/ga/GAPopulation.C
--- oldgalib/galib245/ga/GAPopulation.C	1999-12-15 18:39:10.000000000 +0100
+++ galib-2.4.5-al1/ga/GAPopulation.C	2004-12-26 01:05:20.000000000 +0100
@@ -12,6 +12,8 @@
 #include <ga/garandom.h>
 #include <ga/GABaseGA.h>		// for the sake of flaky g++ compiler
 
+using namespace GARandom;
+
 #define NOMINMAX		// for the sake of window, thanks nick wienholt
 
 // This is the default population initializer.  It simply calls the initializer
diff -u -r oldgalib/galib245/ga/garandom.C galib-2.4.5-al1/ga/garandom.C
--- oldgalib/galib245/ga/garandom.C	1999-12-15 18:39:11.000000000 +0100
+++ galib-2.4.5-al1/ga/garandom.C	2004-12-26 02:47:34.000000000 +0100
@@ -13,7 +13,44 @@
 #include <math.h>
 #include <string.h>
 
-static void bitseed(unsigned int seed=1);
+using namespace GARandom;
+
+namespace GARandom { 
+
+// This is the random bit generator Method II from numerical recipes in C.  The
+// seed determines where in the cycle of numbers the generator will start, so
+// we don't need full 'long' precision in the argument to the seed function.
+
+#define IB1 1
+#define IB2 2
+#define IB5 16
+#define IB18 131072L
+#define MASK (IB1+IB2+IB5)
+
+static unsigned long iseed;
+
+void 
+bitseed(unsigned int seed) {
+  iseed = seed;
+}
+
+int 
+GARandomBit() {
+  if (iseed & IB18) {
+    iseed=((iseed ^ MASK) << 1) | IB1;
+    return 1;
+  } else {
+    iseed <<= 1;
+    return 0;
+  }
+}
+
+#undef MASK
+#undef IB18
+#undef IB5
+#undef IB2
+#undef IB1
+
 
 // If the machine has multiple processes, use the PID to help make the random
 // number generator seed more random.
@@ -28,21 +65,7 @@
 // the library.
 const char*
 GAGetRNG() {
-#if defined(USE_RAN1)
-  return "RAN1";
-#elif defined(USE_RAN2)
   return "RAN2";
-#elif defined(USE_RAN3)
-  return "RAN3";
-#elif defined(USE_RAND)
-  return "RAND";
-#elif defined(USE_RANDOM)
-  return "RANDOM";
-#elif defined(USE_RAND48)
-  return "RAND48";
-#else
-  return "UNKNOWN";
-#endif
 }
 
 // Seed the random number generator with an appropriate value.  We seed both 
@@ -70,12 +93,12 @@
       for(unsigned int i=0; i<BITS_IN_WORD*sizeof(unsigned int); i++)
 	seed += (tmp & (1 << i));
     }
-    _GA_RND_SEED (seed); 
+    sran (seed); 
     bitseed(seed);
   }
   else if(s != 0 && seed != s) {
     seed = s;
-    _GA_RND_SEED (seed); 
+    sran (seed); 
     bitseed(seed);
   }
 }
@@ -86,7 +109,7 @@
 GAResetRNG(unsigned int s) {
   if(s != 0) {
     seed = s;
-    _GA_RND_SEED (seed); 
+    sran (seed); 
     bitseed(seed);
   }
 }
@@ -138,40 +161,6 @@
 
 
 
-// This is the random bit generator Method II from numerical recipes in C.  The
-// seed determines where in the cycle of numbers the generator will start, so
-// we don't need full 'long' precision in the argument to the seed function.
-
-#define IB1 1
-#define IB2 2
-#define IB5 16
-#define IB18 131072L
-#define MASK (IB1+IB2+IB5)
-
-static unsigned long iseed;
-
-void 
-bitseed(unsigned int seed) {
-  iseed = seed;
-}
-
-int 
-GARandomBit() {
-  if (iseed & IB18) {
-    iseed=((iseed ^ MASK) << 1) | IB1;
-    return 1;
-  } else {
-    iseed <<= 1;
-    return 0;
-  }
-}
-
-#undef MASK
-#undef IB18
-#undef IB5
-#undef IB2
-#undef IB1
-
 
 
 
@@ -187,77 +176,6 @@
 // you don't call it more than about 10^8 times, so for any long GA runs you'd
 // better use something with a longer period.
 
-#if defined(USE_RAN1)
-
-#define IA 16807L
-#define IM 2147483647L
-#define AM (1.0/IM)
-#define IQ 127773L
-#define IR 2836L
-#define NTAB 32
-#define NDIV (1+(IM-1)/NTAB)
-#define EPS 1.2e-7
-#define RNMX (1.0-EPS)
-
-static long iy=0;
-static long iv[NTAB];
-static long idum=0;
-
-void
-sran1(unsigned int seed) {
-  int j;
-  long k;
-
-  idum = seed;
-  if (idum == 0) idum=1;
-  if (idum < 0) idum = -idum;
-  for (j=NTAB+7;j>=0;j--) {
-    k=(idum)/IQ;
-    idum=IA*(idum-k*IQ)-IR*k;
-    if (idum < 0) idum += IM;
-    if (j < NTAB) iv[j] = idum;
-  }
-  iy=iv[0];
-}
-
-float ran1() {
-  int j;
-  long k;
-  float temp;
-
-  k=(idum)/IQ;
-  idum=IA*(idum-k*IQ)-IR*k;
-  if (idum < 0) idum += IM;
-  j=iy/NDIV;
-  iy=iv[j];
-  iv[j] = idum;
-  if ((temp=AM*iy) > RNMX) return RNMX;
-  else return temp;
-}
-
-#undef IA
-#undef IM
-#undef AM
-#undef IQ
-#undef IR
-#undef NTAB
-#undef NDIV
-#undef EPS
-#undef RNMX
-
-#endif
-
-
-
-
-// The ran2 pseudo-random number generator.  It has a period of 2 * 10^18 and
-// returns a uniform random deviate on the interval (0.0, 1.0) excluding the
-// end values.  idum initializes the sequence, so we create a separate seeding
-// function to set the seed.  If you reset the seed then you re-initialize the
-// sequence.
-
-#if defined(USE_RAN2)
-
 #define IM1 2147483563L
 #define IM2 2147483399L
 #define AM (1.0/IM1)
@@ -279,7 +197,7 @@
 static long idum=0;
 
 void 
-sran2(unsigned int seed) {
+GARandom::sran(unsigned int seed) {
   int j;
   long k;
 
@@ -297,7 +215,7 @@
 }
 
 float
-ran2() {
+GARandom::ran() {
   int j;
   long k;
   float temp;
@@ -331,63 +249,4 @@
 #undef EPS
 #undef RNMX
 
-#endif
-
-
-#if defined(USE_RAN3)
-
-// The ran3 pseudo-random number generator.  It is *not* linear congruential.
-
-#define MBIG 1000000000
-#define MSEED 161803398
-#define MZ 0
-#define FAC (1.0/MBIG)
-
-static int inext,inextp;
-static long ma[56];
-
-void 
-sran3(unsigned int seed) {
-  long idum = seed;
-  long mj,mk;
-  int i,ii,k;
-
-  mj=labs(MSEED-labs(idum));
-  mj %= MBIG;
-  ma[55]=mj;
-  mk=1;
-  for (i=1;i<=54;i++) {
-    ii=(21*i) % 55;
-    ma[ii]=mk;
-    mk=mj-mk;
-    if (mk < MZ) mk += MBIG;
-    mj=ma[ii];
-  }
-  for (k=1;k<=4;k++)
-    for (i=1;i<=55;i++) {
-      ma[i] -= ma[1+(i+30) % 55];
-      if (ma[i] < MZ) ma[i] += MBIG;
-    }
-  inext=0;
-  inextp=31;
-}
-
-float 
-ran3() {
-  long mj;
-  int i,ii,k;
-  
-  if (++inext == 56) inext=1;
-  if (++inextp == 56) inextp=1;
-  mj=ma[inext]-ma[inextp];
-  if (mj < MZ) mj += MBIG;
-  ma[inext]=mj;
-  return mj*FAC;
-}
-
-#undef MBIG
-#undef MSEED
-#undef MZ
-#undef FAC
-
-#endif
+} // end of namespace GARandom
diff -u -r oldgalib/galib245/ga/garandom.h galib-2.4.5-al1/ga/garandom.h
--- oldgalib/galib245/ga/garandom.h	1999-12-15 18:39:11.000000000 +0100
+++ galib-2.4.5-al1/ga/garandom.h	2004-12-26 02:02:56.660651096 +0100
@@ -64,103 +64,27 @@
 // genetic algorithms the random number generator is the bottleneck, so this
 // isn't totally useless musing...
 
-#if defined(USE_RAN1) || defined(USE_RAN2) || defined(USE_RAN3)
+namespace GARandom {
+	void sran(unsigned int seed=1);
+	float ran();
 
-#if defined(USE_RAN1)
-
-#define _GA_RND             ran1
-#define _GA_RND_SEED        sran1
-void sran1(unsigned int seed=1);
-float ran1();
-
-#elif defined(USE_RAN2)
-
-#define _GA_RND             ran2
-#define _GA_RND_SEED        sran2
-void sran2(unsigned int seed=1);
-float ran2();
-
-#elif defined(USE_RAN3)
-
-#define _GA_RND             ran3
-#define _GA_RND_SEED        sran3
-void sran3(unsigned int seed=1);
-float ran3();
-
-#endif
-
-inline int GARandomInt(){ return _GA_RND() > 0.5 ? 1 : 0; }
+inline int GARandomInt(){ return ran() > 0.5 ? 1 : 0; }
 inline int GARandomInt(int low, int high){ 
   float val=STA_CAST(float,high)-STA_CAST(float,low)+(float)1; 
-  val*=_GA_RND(); 
+  val*=ran(); 
   return (STA_CAST(int,val)+low);
 }
 
-inline double GARandomDouble(){ return _GA_RND(); }
-inline double GARandomDouble(double low, double high){
-  double val=high-low; val*=_GA_RND(); return val+low;
-}
-
-inline float GARandomFloat(){ return _GA_RND(); }
-inline float GARandomFloat(float low, float high){
-  float val=high-low; val*=_GA_RND(); return val+low;
-}
-
-#elif defined(USE_RAND) || defined(USE_RANDOM) || defined(USE_RAND48)
-
-#error  It is usually a bad idea to use the system randum number generator!
-#error  Be sure that your system generator works properly, then comment
-#error  these lines to go ahead and do your compilation.
-
-#include <math.h>
-#include <limits.h>
-
-#if defined(USE_RANDOM) 
-
-#define _GA_RND             random
-#define _GA_RND_SEED        srandom
-#define _GA_RND_MAX         LONG_MAX
-
-#elif defined(USE_RAND48)
-
-#define _GA_RND             lrand48
-#define _GA_RND_SEED        srand48
-#define _GA_RND_MAX         LONG_MAX
-
-#else
-
-#define _GA_RND             rand
-#define _GA_RND_SEED        srand
-#define _GA_RND_MAX         RAND_MAX
-
-#endif
-
-inline int GARandomInt(){ return _GA_RND() > _GA_RND_MAX/2 ? 1 : 0; }
-inline int GARandomInt(int low, int high){ 
-  return low + _GA_RND() % (high-low+1);
-}
-
-inline double GARandomDouble(){ 
-  double val=_GA_RND(); val/=_GA_RND_MAX; return val;
-}
-inline double GARandomDouble(double low, double high){
-  double val=high-low; val*=_GA_RND(); val/=_GA_RND_MAX; val+=low; return val;
+inline double GARandom::GARandomDouble(){ return ran(); }
+inline double GARandom::GARandomDouble(double low, double high){
+  double val=high-low; val*=ran(); return val+low;
 }
 
-inline float GARandomFloat(){
-  float val=_GA_RND(); val/=_GA_RND_MAX; return val;
-}
+inline float GARandomFloat(){ return ran(); }
 inline float GARandomFloat(float low, float high){
-  float val=high-low; val*=_GA_RND(); val/=_GA_RND_MAX; val+=low; return val;
+  float val=high-low; val*=ran(); return val+low;
 }
 
-#endif
-
-
-
-
-
-
 unsigned int GAGetRandomSeed();
 void GARandomSeed(unsigned int seed=0);
 void GAResetRNG(unsigned int seed);
@@ -177,4 +101,6 @@
 
 const char* GAGetRNG();
 
+}
+
 #endif
diff -u -r oldgalib/galib245/ga/GASelector.C galib-2.4.5-al1/ga/GASelector.C
--- oldgalib/galib245/ga/GASelector.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GASelector.C	2004-12-26 01:04:53.000000000 +0100
@@ -15,6 +15,8 @@
 #include <ga/garandom.h>
 #include <ga/gaerror.h>
 
+using namespace GARandom;
+
 #if USE_DS_SELECTOR == 1
 static void GAQuickSort(unsigned int *, float *, int, int);
 #endif
diff -u -r oldgalib/galib245/ga/GASimpleGA.C galib-2.4.5-al1/ga/GASimpleGA.C
--- oldgalib/galib245/ga/GASimpleGA.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GASimpleGA.C	2004-12-26 01:03:12.000000000 +0100
@@ -10,6 +10,7 @@
 #include <ga/GASimpleGA.h>
 #include <ga/garandom.h>
 
+using namespace GARandom;
 
 GAParameterList&
 GASimpleGA::registerDefaultParameters(GAParameterList& p) {
diff -u -r oldgalib/galib245/ga/GASStateGA.C galib-2.4.5-al1/ga/GASStateGA.C
--- oldgalib/galib245/ga/GASStateGA.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GASStateGA.C	2004-12-26 01:02:48.000000000 +0100
@@ -10,6 +10,8 @@
 #include <ga/GASStateGA.h>
 #include <ga/garandom.h>
 
+using namespace GARandom;
+
 //#define GA_DEBUG
 
 #define USE_PREPL 0
diff -u -r oldgalib/galib245/ga/GATreeGenome.C galib-2.4.5-al1/ga/GATreeGenome.C
--- oldgalib/galib245/ga/GATreeGenome.C	1999-11-11 19:56:03.000000000 +0100
+++ galib-2.4.5-al1/ga/GATreeGenome.C	2004-12-26 02:12:29.243605256 +0100
@@ -15,6 +15,8 @@
 #include <stdlib.h>
 #include <ga/GATreeGenome.h>
 
+#include <ga/garandom.h>
+using namespace GARandom;
 
 extern int _GATreeCompare(GANodeBASE * anode, GANodeBASE * bnode);
 
@@ -104,7 +106,7 @@
 GATreeGenome<T>::write(ostream & os) const 
 {
   os << "node       parent     child      next       prev       contents\n";
-  _tt(os, (GANode<T> *)rt);
+  _tt(os, (GANode<T> *)GATreeGenome<T>::rt);
   return 0;
 }
 #endif
@@ -115,7 +117,7 @@
 {
   if(this == &c) return 1;
   const GATreeGenome<T>& b = DYN_CAST(const GATreeGenome<T>&, c);
-  return _GATreeCompare(rt, b.rt) ? 0 : 1;
+  return _GATreeCompare(GATreeGenome<T>::rt, b.GATreeGenome<T>::rt) ? 0 : 1;
 }
 
 
@@ -232,9 +234,9 @@
   }
   else{				// only nuke the number of nodes we need to
     for(i=0; i<nMut; i++){
-      a = GARandomInt(0,n-1);
-      b = GARandomInt(0,n-1);
-      if(!child.ancestral(a,b)) child.swaptree(a,b);
+      a = GARandomInt(0,n-1); b =
+      GARandomInt(0,n-1); if(!child.ancestral(a,b))
+      child.swaptree(a,b);
     }
   }
   child.root();		// set iterator to root node
diff -u -r oldgalib/galib245/ga/gaversion.h galib-2.4.5-al1/ga/gaversion.h
--- oldgalib/galib245/ga/gaversion.h	2000-02-03 21:04:48.000000000 +0100
+++ galib-2.4.5-al1/ga/gaversion.h	2004-12-26 01:17:54.000000000 +0100
@@ -9,6 +9,6 @@
 #ifndef _ga_version_h_
 #define _ga_version_h_
 
-static char *rcsid = "$Date: 2000/02/03 15:04:48 $ $Revision: 2.4.5 $";
+static char *rcsid = "$Date: 2000/02/03 15:04:48 $ $Revision: 2.4.5-al1 $";
 
 #endif
