From 790292f16bb6f9dac1be8bf54c44c4c3b2218e2d Mon Sep 17 00:00:00 2001
From: "Joseph F. Boudreau" <boudreau@pitt.edu>
Date: Wed, 10 Apr 2024 13:22:53 +0200
Subject: [PATCH] Modification of the way in which Transfunctions are
 persistified. Step 1: Genfunctions

Before:  Floating point data which is part of the description of
the stored functions is written into the string, the same string
used to define the function.

After:  Floating point data is stored in an auxilliary array that
must be used together with the string when the function is restored.
The array is implemented as an std::deque. It functions like a
FIFO.

Step 2: Transfunctions

(Not yet available at this stage)
---
 .../TFPersistification/ACosIO.h               |   2 +-
 .../TFPersistification/ASinIO.h               |   2 +-
 .../TFPersistification/ATanIO.h               |   2 +-
 .../TFPersistification/AbsIO.h                |   2 +-
 .../TFPersistification/ArrayFunctionIO.h      |   2 +-
 .../TFPersistification/CosIO.h                |   2 +-
 .../TFPersistification/FixedConstantIO.h      |   2 +-
 .../GenFunctionInterpreter.h                  |   7 +-
 .../GenFunctionPersistifier.h                 |  11 +-
 .../TFPersistification/GenFunctionReader.h    |   2 +-
 .../TFPersistification/GenfunIO.h             |  24 ++--
 .../TFPersistification/ModIO.h                |   2 +-
 .../TFPersistification/RectangularIO.h        |   2 +-
 .../TFPersistification/SinIO.h                |   2 +-
 .../TFPersistification/SqrtIO.h               |   2 +-
 .../TFPersistification/SquareIO.h             |   2 +-
 .../TFPersistification/TanIO.h                |   2 +-
 GeoModelIO/TFPersistification/src/ACosIO.cpp  |   2 +-
 GeoModelIO/TFPersistification/src/ASinIO.cpp  |   2 +-
 GeoModelIO/TFPersistification/src/ATanIO.cpp  |   2 +-
 GeoModelIO/TFPersistification/src/AbsIO.cpp   |   2 +-
 .../src/ArrayFunctionIO.cpp                   |  36 +++---
 GeoModelIO/TFPersistification/src/CosIO.cpp   |   2 +-
 .../src/FixedConstantIO.cpp                   |  14 +--
 .../src/GenFunctionInterpreter.cpp            |   7 +-
 .../src/GenFunctionPersistifier.cpp           |   5 +
 .../TFPersistification/src/GenfunIO.cpp       | 104 ++++++++++--------
 GeoModelIO/TFPersistification/src/ModIO.cpp   |  13 ++-
 .../TFPersistification/src/RectangularIO.cpp  |  46 +++-----
 GeoModelIO/TFPersistification/src/SinIO.cpp   |   2 +-
 GeoModelIO/TFPersistification/src/SqrtIO.cpp  |   2 +-
 .../TFPersistification/src/SquareIO.cpp       |   2 +-
 GeoModelIO/TFPersistification/src/TanIO.cpp   |   2 +-
 cmake/BuildType.cmake                         |   2 +-
 34 files changed, 163 insertions(+), 152 deletions(-)

diff --git a/GeoModelIO/TFPersistification/TFPersistification/ACosIO.h b/GeoModelIO/TFPersistification/TFPersistification/ACosIO.h
index 9c0c574c2..603bc762b 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/ACosIO.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/ACosIO.h
@@ -11,7 +11,7 @@ class ACosReader: public GenFunctionReader {
  public:
   
   ACosReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData=nullptr) const;
   
 };
 
diff --git a/GeoModelIO/TFPersistification/TFPersistification/ASinIO.h b/GeoModelIO/TFPersistification/TFPersistification/ASinIO.h
index dedc5ff8a..ea6204892 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/ASinIO.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/ASinIO.h
@@ -10,7 +10,7 @@ class ASinReader: public GenFunctionReader {
  public:
   
   ASinReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData=nullptr) const;
   
 };
 
diff --git a/GeoModelIO/TFPersistification/TFPersistification/ATanIO.h b/GeoModelIO/TFPersistification/TFPersistification/ATanIO.h
index 526d8b66f..094ecc691 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/ATanIO.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/ATanIO.h
@@ -10,7 +10,7 @@ class ATanReader: public GenFunctionReader {
  public:
   
   ATanReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> * fpData=nullptr) const;
   
 };
 
diff --git a/GeoModelIO/TFPersistification/TFPersistification/AbsIO.h b/GeoModelIO/TFPersistification/TFPersistification/AbsIO.h
index 09b351c5c..c8e71c3d0 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/AbsIO.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/AbsIO.h
@@ -10,7 +10,7 @@ class AbsReader: public GenFunctionReader {
  public:
   
   AbsReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *) const;
   
 };
 
diff --git a/GeoModelIO/TFPersistification/TFPersistification/ArrayFunctionIO.h b/GeoModelIO/TFPersistification/TFPersistification/ArrayFunctionIO.h
index f5ff56c25..5ebaf1d8e 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/ArrayFunctionIO.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/ArrayFunctionIO.h
@@ -10,7 +10,7 @@ class ArrayFunctionReader: public GenFunctionReader {
  public:
   
   ArrayFunctionReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> * fpData) const;
   
 };
 
diff --git a/GeoModelIO/TFPersistification/TFPersistification/CosIO.h b/GeoModelIO/TFPersistification/TFPersistification/CosIO.h
index b507f13e1..a91e3a865 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/CosIO.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/CosIO.h
@@ -11,7 +11,7 @@ class CosReader: public GenFunctionReader {
  public:
   
   CosReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData=nullptr) const;
   
 };
 
diff --git a/GeoModelIO/TFPersistification/TFPersistification/FixedConstantIO.h b/GeoModelIO/TFPersistification/TFPersistification/FixedConstantIO.h
index 84ecbe10e..1bed91638 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/FixedConstantIO.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/FixedConstantIO.h
@@ -10,7 +10,7 @@ class FixedConstantReader: public GenFunctionReader {
  public:
   
   FixedConstantReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData) const;
   
 };
 
diff --git a/GeoModelIO/TFPersistification/TFPersistification/GenFunctionInterpreter.h b/GeoModelIO/TFPersistification/TFPersistification/GenFunctionInterpreter.h
index de3852862..356dcb969 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/GenFunctionInterpreter.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/GenFunctionInterpreter.h
@@ -5,7 +5,7 @@
 #include <typeinfo>
 #include <sstream>
 #include <memory>
-
+#include <deque>
 //
 // Forward definition of "Genfunction"
 //
@@ -35,8 +35,11 @@ class GenFunctionInterpreter {
 
   // Interprets a string.  
   GFPTR interpret(std::string::const_iterator begin,
-		  std::string::const_iterator end  ) const;
+		  std::string::const_iterator end,
+		  std::deque<double> *fpData=nullptr) const;
+
 
+  
  private:
 
   // Store the actual interpreters, map them into the type name
diff --git a/GeoModelIO/TFPersistification/TFPersistification/GenFunctionPersistifier.h b/GeoModelIO/TFPersistification/TFPersistification/GenFunctionPersistifier.h
index 0a6629c89..9a857c74a 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/GenFunctionPersistifier.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/GenFunctionPersistifier.h
@@ -4,7 +4,7 @@
 #include <string>
 #include <typeinfo>
 #include <sstream>
-
+#include <deque>
 //
 // Forward declaration of GeoGenfun::AbsFunction
 //
@@ -40,14 +40,19 @@ class GenFunctionPersistifier {
   // Retrieves the stream used to build the expression:
   std::ostringstream & getStream() const;
 
- private:
+  // Retreive floating point data
+  std::deque<double> & getFloatingPointData() const;
+
+private:
 
   // Store the actual recorders, map them into the type name
   std::map<std::string, const GenFunctionRecorder *> recorderMap;
 
   // Here is the result:
-  mutable std::string codedString;
+  mutable std::string         codedString;
+  mutable std::deque<double>  floatingPointData;
 
+  
   // An ostringstream is used to build the coded string:
   mutable std::ostringstream *stream;
 
diff --git a/GeoModelIO/TFPersistification/TFPersistification/GenFunctionReader.h b/GeoModelIO/TFPersistification/TFPersistification/GenFunctionReader.h
index 18183d62a..a1fdb2f89 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/GenFunctionReader.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/GenFunctionReader.h
@@ -26,7 +26,7 @@ class GenFunctionReader {
   virtual ~GenFunctionReader();
 
   // Execute
-  virtual GFPTR execute(std::string::const_iterator , std::string::const_iterator) const=0;
+  virtual GFPTR execute(std::string::const_iterator , std::string::const_iterator, std::deque<double> *fpData=nullptr) const=0;
 
   // Access to the interpreter:
   const GenFunctionInterpreter *getInterpreter() const;
diff --git a/GeoModelIO/TFPersistification/TFPersistification/GenfunIO.h b/GeoModelIO/TFPersistification/TFPersistification/GenfunIO.h
index 05f8e41f5..fae8b60b2 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/GenfunIO.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/GenfunIO.h
@@ -10,7 +10,7 @@ class ConstTimesFunctionReader: public GenFunctionReader {
  public:
   
   ConstTimesFunctionReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData=nullptr ) const;
   
 };
 
@@ -29,7 +29,7 @@ class ConstPlusFunctionReader: public GenFunctionReader {
  public:
   
   ConstPlusFunctionReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData=nullptr ) const;
   
 };
 
@@ -48,7 +48,7 @@ class ConstMinusFunctionReader: public GenFunctionReader {
  public:
   
   ConstMinusFunctionReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData=nullptr ) const;
   
 };
 
@@ -67,7 +67,7 @@ class ConstOverFunctionReader: public GenFunctionReader {
  public:
   
   ConstOverFunctionReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData=nullptr ) const;
   
 };
 
@@ -87,7 +87,7 @@ class FunctionCompositionReader: public GenFunctionReader {
  public:
   
   FunctionCompositionReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData ) const;
   
 };
 
@@ -107,7 +107,7 @@ class FunctionNegationReader: public GenFunctionReader {
  public:
   
   FunctionNegationReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData ) const;
   
 };
 
@@ -126,7 +126,7 @@ class FunctionNoopReader: public GenFunctionReader {
  public:
   
   FunctionNoopReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData ) const;
   
 };
 
@@ -145,7 +145,7 @@ class FunctionProductReader: public GenFunctionReader {
  public:
   
   FunctionProductReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData ) const;
   
 };
 
@@ -164,7 +164,7 @@ class FunctionQuotientReader: public GenFunctionReader {
  public:
   
   FunctionQuotientReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData ) const;
   
 };
 
@@ -184,7 +184,7 @@ class FunctionSumReader: public GenFunctionReader {
  public:
   
   FunctionSumReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData ) const;
   
 };
 
@@ -203,7 +203,7 @@ class FunctionDifferenceReader: public GenFunctionReader {
  public:
   
   FunctionDifferenceReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData ) const;
   
 };
 
@@ -223,7 +223,7 @@ class VariableReader: public GenFunctionReader {
  public:
   
   VariableReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData=nullptr) const;
   
 };
 
diff --git a/GeoModelIO/TFPersistification/TFPersistification/ModIO.h b/GeoModelIO/TFPersistification/TFPersistification/ModIO.h
index cec3e1057..bb30523f4 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/ModIO.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/ModIO.h
@@ -11,7 +11,7 @@ class ModReader: public GenFunctionReader {
  public:
   
   ModReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> * fpData) const;
   
 };
 
diff --git a/GeoModelIO/TFPersistification/TFPersistification/RectangularIO.h b/GeoModelIO/TFPersistification/TFPersistification/RectangularIO.h
index dd6843056..3d9beef9a 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/RectangularIO.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/RectangularIO.h
@@ -11,7 +11,7 @@ class RectangularReader: public GenFunctionReader {
  public:
   
   RectangularReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData) const;
   
 };
 
diff --git a/GeoModelIO/TFPersistification/TFPersistification/SinIO.h b/GeoModelIO/TFPersistification/TFPersistification/SinIO.h
index 02990ca51..ffaed09d7 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/SinIO.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/SinIO.h
@@ -12,7 +12,7 @@ class SinReader: public GenFunctionReader {
  public:
   
   SinReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData=nullptr) const;
   
 };
 
diff --git a/GeoModelIO/TFPersistification/TFPersistification/SqrtIO.h b/GeoModelIO/TFPersistification/TFPersistification/SqrtIO.h
index 7c7f9ecc0..a30e3bed9 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/SqrtIO.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/SqrtIO.h
@@ -11,7 +11,7 @@ class SqrtReader: public GenFunctionReader {
  public:
   
   SqrtReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData=nullptr) const;
   
 };
 
diff --git a/GeoModelIO/TFPersistification/TFPersistification/SquareIO.h b/GeoModelIO/TFPersistification/TFPersistification/SquareIO.h
index 082a62c3e..35471b681 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/SquareIO.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/SquareIO.h
@@ -11,7 +11,7 @@ class SquareReader: public GenFunctionReader {
  public:
   
   SquareReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> * fpData=nullptr) const;
   
 };
 
diff --git a/GeoModelIO/TFPersistification/TFPersistification/TanIO.h b/GeoModelIO/TFPersistification/TFPersistification/TanIO.h
index 5d1dcf596..7d65621da 100644
--- a/GeoModelIO/TFPersistification/TFPersistification/TanIO.h
+++ b/GeoModelIO/TFPersistification/TFPersistification/TanIO.h
@@ -11,7 +11,7 @@ class TanReader: public GenFunctionReader {
  public:
   
   TanReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
+  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData=nullptr) const;
   
 };
 
diff --git a/GeoModelIO/TFPersistification/src/ACosIO.cpp b/GeoModelIO/TFPersistification/src/ACosIO.cpp
index 667993030..74b487fdc 100644
--- a/GeoModelIO/TFPersistification/src/ACosIO.cpp
+++ b/GeoModelIO/TFPersistification/src/ACosIO.cpp
@@ -7,7 +7,7 @@
 ACosReader::ACosReader(GenFunctionInterpreter *interpreter):GenFunctionReader("ACos", interpreter) {}
 
 
-GFPTR  ACosReader::execute(std::string::const_iterator, std::string::const_iterator ) const {
+GFPTR  ACosReader::execute(std::string::const_iterator, std::string::const_iterator, std::deque<double> * ) const {
   return GFPTR(new GeoGenfun::ACos());
 }
 
diff --git a/GeoModelIO/TFPersistification/src/ASinIO.cpp b/GeoModelIO/TFPersistification/src/ASinIO.cpp
index c4a2e0c14..d67ccd613 100644
--- a/GeoModelIO/TFPersistification/src/ASinIO.cpp
+++ b/GeoModelIO/TFPersistification/src/ASinIO.cpp
@@ -7,7 +7,7 @@
 ASinReader::ASinReader(GenFunctionInterpreter *interpreter):GenFunctionReader("ASin", interpreter) {}
 
 
-GFPTR  ASinReader::execute(std::string::const_iterator, std::string::const_iterator ) const {
+GFPTR  ASinReader::execute(std::string::const_iterator, std::string::const_iterator, std::deque<double> * ) const {
   return GFPTR(new GeoGenfun::ASin());
 }
 
diff --git a/GeoModelIO/TFPersistification/src/ATanIO.cpp b/GeoModelIO/TFPersistification/src/ATanIO.cpp
index 33df878f4..fcd94ee13 100644
--- a/GeoModelIO/TFPersistification/src/ATanIO.cpp
+++ b/GeoModelIO/TFPersistification/src/ATanIO.cpp
@@ -7,7 +7,7 @@
 ATanReader::ATanReader(GenFunctionInterpreter *interpreter):GenFunctionReader("ATan", interpreter) {}
 
 
-GFPTR  ATanReader::execute(std::string::const_iterator, std::string::const_iterator ) const {
+GFPTR  ATanReader::execute(std::string::const_iterator, std::string::const_iterator, std::deque<double> * ) const {
   return GFPTR(new GeoGenfun::ATan());
 }
 
diff --git a/GeoModelIO/TFPersistification/src/AbsIO.cpp b/GeoModelIO/TFPersistification/src/AbsIO.cpp
index cb8039fca..50e2dd488 100644
--- a/GeoModelIO/TFPersistification/src/AbsIO.cpp
+++ b/GeoModelIO/TFPersistification/src/AbsIO.cpp
@@ -7,7 +7,7 @@
 AbsReader::AbsReader(GenFunctionInterpreter *interpreter):GenFunctionReader("Abs", interpreter) {}
 
 
-GFPTR  AbsReader::execute(std::string::const_iterator, std::string::const_iterator) const {
+GFPTR  AbsReader::execute(std::string::const_iterator, std::string::const_iterator, std::deque<double> *fpData=nullptr) const {
   return GFPTR(new GeoGenfun::Abs());
 }
 
diff --git a/GeoModelIO/TFPersistification/src/ArrayFunctionIO.cpp b/GeoModelIO/TFPersistification/src/ArrayFunctionIO.cpp
index de725f013..78de2456c 100644
--- a/GeoModelIO/TFPersistification/src/ArrayFunctionIO.cpp
+++ b/GeoModelIO/TFPersistification/src/ArrayFunctionIO.cpp
@@ -2,27 +2,23 @@
 #include "TFPersistification/GenFunctionPersistifier.h"
 #include "TFPersistification/GenFunctionInterpreter.h"
 #include "TFPersistification/ArrayFunctionIO.h"
+#include <algorithm> 
 ArrayFunctionReader::ArrayFunctionReader(GenFunctionInterpreter *interpreter):GenFunctionReader("ArrayFunction", interpreter) {}
 
 
-GFPTR  ArrayFunctionReader::execute(std::string::const_iterator cStart, std::string::const_iterator cEnd) const {
+GFPTR  ArrayFunctionReader::execute(std::string::const_iterator cStart, std::string::const_iterator cEnd, std::deque<double> *fpData) const {
+  std::string aNumberStr(cStart,cEnd);
+  std::istringstream stream(aNumberStr);
+  std::string real;
+  unsigned int len;
+  stream >> real >> len;
+  if (real != "REAL" || !stream) {
+    throw std::runtime_error ("Parse error in ArrayFunctionReader");
+  }
   std::vector<double> elements;
-  auto cNext=std::find(cStart, cEnd,',');
-  while (cNext!=cEnd) {
-    std::string aNumberStr(cStart,cNext);
-    std::istringstream stream(aNumberStr);
-    double d;
-    stream >> d;
-    elements.push_back(d);
-    cStart=cNext+1;
-    cNext=std::find(cStart, cEnd,',');
+  for (int i=0;i<len;i++) {
+    elements.push_back(fpData->back()); fpData->pop_back();
   }
-
-  std::string aNumberStr(cStart,cNext);
-  std::istringstream stream(aNumberStr);
-  double d;
-  stream >> d;
-  elements.push_back(d);
   
   return GFPTR(new GeoGenfun::ArrayFunction(&elements.front(), &elements.back() + 1));
 }
@@ -36,10 +32,8 @@ void ArrayFunctionRecorder::execute(const GeoGenfun::AbsFunction & F) const {
   if (!ptr) throw std::runtime_error("Error in ArrayFunctionRecorder:: wrong function type");
   std::ostringstream & stream = getPersistifier()->getStream();
   stream << "ArrayFunction";
-  stream << "(";
-  for (size_t i=0;i<ptr->values().size();i++){
-    stream<<ptr->values()[i];
-    if (i!=ptr->values().size()-1) stream << ",";
-  }
+  stream << "(REAL ";
+  stream << ptr->values().size();
   stream << ")";
+  std::copy(ptr->values().begin(), ptr->values().end(), std::front_inserter(getPersistifier()->getFloatingPointData()));
 }
diff --git a/GeoModelIO/TFPersistification/src/CosIO.cpp b/GeoModelIO/TFPersistification/src/CosIO.cpp
index 15c055a89..cec81c4ea 100644
--- a/GeoModelIO/TFPersistification/src/CosIO.cpp
+++ b/GeoModelIO/TFPersistification/src/CosIO.cpp
@@ -7,7 +7,7 @@
 CosReader::CosReader(GenFunctionInterpreter *interpreter):GenFunctionReader("Cos",interpreter) {}
 
 
-GFPTR  CosReader::execute(std::string::const_iterator, std::string::const_iterator ) const {
+GFPTR  CosReader::execute(std::string::const_iterator, std::string::const_iterator, std::deque<double> * ) const {
   return GFPTR(new GeoGenfun::Cos());
 }
 
diff --git a/GeoModelIO/TFPersistification/src/FixedConstantIO.cpp b/GeoModelIO/TFPersistification/src/FixedConstantIO.cpp
index 22d547499..a366719c0 100644
--- a/GeoModelIO/TFPersistification/src/FixedConstantIO.cpp
+++ b/GeoModelIO/TFPersistification/src/FixedConstantIO.cpp
@@ -5,11 +5,12 @@
 FixedConstantReader::FixedConstantReader(GenFunctionInterpreter *interpreter):GenFunctionReader("FixedConstant", interpreter) {}
 
 
-GFPTR  FixedConstantReader::execute(std::string::const_iterator begin, std::string::const_iterator end) const {
-  double v;
+GFPTR  FixedConstantReader::execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData) const {
   std::string aNumberStr(begin,end);
-  std::istringstream stream(aNumberStr);
-  stream >> v;
+  if (aNumberStr!="REAL") {
+    throw std::runtime_error ("Parse error in FixedConstantReader");
+  }
+  double v=fpData->back();fpData->pop_back();
   return GFPTR(new GeoGenfun::FixedConstant(v));
 }
 
@@ -21,8 +22,7 @@ void FixedConstantRecorder::execute(const GeoGenfun::AbsFunction & F) const {
   const GeoGenfun::FixedConstant * ptr = dynamic_cast<const GeoGenfun::FixedConstant *> (&F);
   if (!ptr) throw std::runtime_error("Error in FixedConstantRecorder:: wrong function type");
   std::ostringstream & stream = getPersistifier()->getStream();
+  getPersistifier()->getFloatingPointData().push_front((*ptr)(0));
   stream << "FixedConstant";
-  stream << "(";
-  stream<< (*ptr) (0);
-  stream << ")";
+  stream << "(REAL)";
 }
diff --git a/GeoModelIO/TFPersistification/src/GenFunctionInterpreter.cpp b/GeoModelIO/TFPersistification/src/GenFunctionInterpreter.cpp
index f0d16e766..2468ebb8b 100644
--- a/GeoModelIO/TFPersistification/src/GenFunctionInterpreter.cpp
+++ b/GeoModelIO/TFPersistification/src/GenFunctionInterpreter.cpp
@@ -59,7 +59,8 @@ void GenFunctionInterpreter::add(const std::string & str, const GenFunctionReade
 }
 
 
-GFPTR GenFunctionInterpreter::interpret(std::string::const_iterator sBegin, std::string::const_iterator sEnd) const {
+GFPTR GenFunctionInterpreter::interpret(std::string::const_iterator sBegin, std::string::const_iterator sEnd,
+					std::deque<double> * fpData) const {
 
   auto begin=std::find(sBegin, sEnd, '(');
   std::reverse_iterator<std::string::const_iterator> rBegin(sEnd);
@@ -77,7 +78,7 @@ GFPTR GenFunctionInterpreter::interpret(std::string::const_iterator sBegin, std:
       throw std::runtime_error (stream.str());
     }
     const GenFunctionReader *reader = (*rIter).second;
-    return reader->execute(begin,begin);//exec w/null expression
+    return reader->execute(begin,begin,fpData);//exec w/null expression
   }
   std::string op(sBegin,begin);
   auto argBegin=begin+1, argEnd=end-1;
@@ -88,5 +89,5 @@ GFPTR GenFunctionInterpreter::interpret(std::string::const_iterator sBegin, std:
     throw std::runtime_error (stream.str());
   }
   const GenFunctionReader *reader = (*rIter).second;
-  return reader->execute(argBegin,argEnd);
+  return reader->execute(argBegin,argEnd,fpData);
 }
diff --git a/GeoModelIO/TFPersistification/src/GenFunctionPersistifier.cpp b/GeoModelIO/TFPersistification/src/GenFunctionPersistifier.cpp
index a08537248..20077bd4d 100644
--- a/GeoModelIO/TFPersistification/src/GenFunctionPersistifier.cpp
+++ b/GeoModelIO/TFPersistification/src/GenFunctionPersistifier.cpp
@@ -20,6 +20,7 @@
 
 #include <sstream>
 #include <iomanip>
+
 const std::string & GenFunctionPersistifier::getCodedString() const {
   codedString=getStream().str();
   delete stream;
@@ -27,6 +28,10 @@ const std::string & GenFunctionPersistifier::getCodedString() const {
   return codedString;
 }
 
+std::deque<double> & GenFunctionPersistifier::getFloatingPointData() const {
+  return floatingPointData;
+}
+
 
 GenFunctionPersistifier::~GenFunctionPersistifier() {
   delete stream;
diff --git a/GeoModelIO/TFPersistification/src/GenfunIO.cpp b/GeoModelIO/TFPersistification/src/GenfunIO.cpp
index 748c88c63..1a4a129dd 100644
--- a/GeoModelIO/TFPersistification/src/GenfunIO.cpp
+++ b/GeoModelIO/TFPersistification/src/GenfunIO.cpp
@@ -2,27 +2,20 @@
 #include "TFPersistification/GenFunctionInterpreter.h"
 #include "TFPersistification/GenFunctionPersistifier.h"
 #include "TFPersistification/GenfunIO.h"
-
 #include "GeoGenericFunctions/Variable.h"
-
+#include <stdexcept>
 #include <sstream>
 
 ConstTimesFunctionReader::ConstTimesFunctionReader(GenFunctionInterpreter *interpreter):GenFunctionReader("ConstTimesFunction", interpreter) {}
 
-inline double atof(std::string::const_iterator begin, std::string::const_iterator end) {
-
-  std::string atom(begin,end);
-  std::istringstream stream(atom);
-  double x=0;
-  stream >> x;
-  return x;
+GFPTR  ConstTimesFunctionReader::execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> * fpData) const {
+  std::string::const_iterator sep=split(begin,end);
+  double c=fpData->back(); fpData->pop_back(); //Was: atof(begin,sep);
+  if (std::string(begin,sep)!="REAL") {
+    throw std::runtime_error ("Parse error in ConstTimesFunctionReader");
+  }
   
-}
-
-GFPTR  ConstTimesFunctionReader::execute(std::string::const_iterator begin, std::string::const_iterator end) const {
-  auto sep=split(begin,end);
-  double c=atof(begin,sep);
-  return GFPTR(new GeoGenfun::ConstTimesFunction(c,getInterpreter()->interpret(sep+1,end).get()));
+  return GFPTR(new GeoGenfun::ConstTimesFunction(c,getInterpreter()->interpret(sep+1,end,fpData).get()));
 }
 
 
@@ -34,8 +27,9 @@ void ConstTimesFunctionRecorder::execute(const GeoGenfun::AbsFunction & F) const
   if (!ptr) throw std::runtime_error("Error in ConstTimesFunctionRecorder:: wrong function type");
   std::ostringstream & stream = getPersistifier()->getStream();
   double c1=ptr->_constant;
+  getPersistifier()->getFloatingPointData().push_front(c1);
   stream << "ConstTimesFunction" << "(";
-  stream << c1;
+  stream << "REAL";
   stream << ",";
   getPersistifier()->persistify(*ptr->_arg);
   stream << ")";
@@ -44,10 +38,13 @@ void ConstTimesFunctionRecorder::execute(const GeoGenfun::AbsFunction & F) const
 ConstPlusFunctionReader::ConstPlusFunctionReader(GenFunctionInterpreter *interpreter):GenFunctionReader("ConstPlusFunction", interpreter) {}
 
 
-GFPTR  ConstPlusFunctionReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
+GFPTR  ConstPlusFunctionReader::execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> * fpData ) const {
   auto sep=split(begin, end);
-  double c=atof(begin,sep);
-  return GFPTR(new GeoGenfun::ConstPlusFunction(c,getInterpreter()->interpret(sep+1,end).get()));
+  double c=fpData->back(); fpData->pop_back(); //Was: atof(begin,sep);
+  if (std::string(begin,sep)!="REAL") {
+    throw std::runtime_error ("Parse error in ConstPlusFunctionReader");
+  }
+  return GFPTR(new GeoGenfun::ConstPlusFunction(c,getInterpreter()->interpret(sep+1,end,fpData).get()));
 }
 
 ConstPlusFunctionRecorder::ConstPlusFunctionRecorder(GenFunctionPersistifier *persistifier):
@@ -58,8 +55,9 @@ void ConstPlusFunctionRecorder::execute(const GeoGenfun::AbsFunction & F) const
   if (!ptr) throw std::runtime_error("Error in ConstPlusFunctionRecorder:: wrong function type");
   std::ostringstream & stream = getPersistifier()->getStream();
   double c1=ptr->_constant;
+  getPersistifier()->getFloatingPointData().push_front(c1);
   stream << "ConstPlusFunction" << "(";
-  stream << c1;
+  stream << "REAL";
   stream << ",";
   getPersistifier()->persistify(*ptr->_arg);
   stream << ")";
@@ -68,10 +66,13 @@ void ConstPlusFunctionRecorder::execute(const GeoGenfun::AbsFunction & F) const
 ConstMinusFunctionReader::ConstMinusFunctionReader(GenFunctionInterpreter *interpreter):GenFunctionReader("ConstMinusFunction", interpreter) {}
 
 
-GFPTR  ConstMinusFunctionReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
+GFPTR  ConstMinusFunctionReader::execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> * fpData ) const {
   auto sep=split(begin,end);
-  double c=atof(begin,sep);
-  return GFPTR(new GeoGenfun::ConstMinusFunction(c,getInterpreter()->interpret(sep+1,end).get()));
+  double c=fpData->back(); fpData->pop_back(); //Was: atof(begin,sep);
+  if (std::string(begin,sep)!="REAL") {
+    throw std::runtime_error ("Parse error in ConstMinusFunctionReader");
+  }
+  return GFPTR(new GeoGenfun::ConstMinusFunction(c,getInterpreter()->interpret(sep+1,end,fpData).get()));
 }
 
 ConstMinusFunctionRecorder::ConstMinusFunctionRecorder(GenFunctionPersistifier *persistifier):
@@ -82,8 +83,9 @@ void ConstMinusFunctionRecorder::execute(const GeoGenfun::AbsFunction & F) const
   if (!ptr) throw std::runtime_error("Error in ConstMinusFunctionRecorder:: wrong function type");
   std::ostringstream & stream = getPersistifier()->getStream();
   double c1=ptr->_constant;
+  getPersistifier()->getFloatingPointData().push_front(c1);
   stream << "ConstMinusFunction" << "(";
-  stream << c1;
+  stream << "REAL";
   stream << ",";
   getPersistifier()->persistify(*ptr->_arg);
   stream << ")";
@@ -92,10 +94,13 @@ void ConstMinusFunctionRecorder::execute(const GeoGenfun::AbsFunction & F) const
 ConstOverFunctionReader::ConstOverFunctionReader(GenFunctionInterpreter *interpreter):GenFunctionReader("ConstOverFunction", interpreter) {}
 
 
-GFPTR  ConstOverFunctionReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
+GFPTR  ConstOverFunctionReader::execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> * fpData ) const {
   auto sep=split(begin,end);
-  double c=atof(begin,sep);
-  return GFPTR(new GeoGenfun::ConstOverFunction(c,getInterpreter()->interpret(sep+1,end).get()));
+  double c=fpData->back(); fpData->pop_back(); //Was: atof(begin,sep);
+  if (std::string(begin,sep)!="REAL") {
+    throw std::runtime_error ("Parse error in ConstOverFunctionReader");
+  }
+  return GFPTR(new GeoGenfun::ConstOverFunction(c,getInterpreter()->interpret(sep+1,end,fpData).get()));
 }
 
 ConstOverFunctionRecorder::ConstOverFunctionRecorder(GenFunctionPersistifier *persistifier):
@@ -106,8 +111,9 @@ void ConstOverFunctionRecorder::execute(const GeoGenfun::AbsFunction & F) const
   if (!ptr) throw std::runtime_error("Error in ConstOverFunctionRecorder:: wrong function type");
   std::ostringstream & stream = getPersistifier()->getStream();
   double c1=ptr->_constant;
+  getPersistifier()->getFloatingPointData().push_front(c1);
   stream << "ConstOverFunction" << "(";
-  stream << c1;
+  stream << "REAL";
   stream << ",";
   getPersistifier()->persistify(*ptr->_arg);
   stream << ")";
@@ -116,9 +122,12 @@ void ConstOverFunctionRecorder::execute(const GeoGenfun::AbsFunction & F) const
 FunctionCompositionReader::FunctionCompositionReader(GenFunctionInterpreter *interpreter):GenFunctionReader("FunctionComposition", interpreter) {}
 
 
-GFPTR  FunctionCompositionReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
+GFPTR  FunctionCompositionReader::execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> * fpData ) const {
   auto sep=split(begin,end);
-  return GFPTR(new GeoGenfun::FunctionComposition(getInterpreter()->interpret(begin,sep).get(),getInterpreter()->interpret(sep+1,end).get()));
+  GFPTR  f1=getInterpreter()->interpret(begin,sep,fpData);
+  GFPTR  f2=getInterpreter()->interpret(sep+1,end,fpData);
+	     
+  return GFPTR(new GeoGenfun::FunctionComposition(f1.get(),f2.get()));
 }
 
 FunctionCompositionRecorder::FunctionCompositionRecorder(GenFunctionPersistifier *persistifier):
@@ -138,8 +147,8 @@ void FunctionCompositionRecorder::execute(const GeoGenfun::AbsFunction & F) cons
 FunctionNegationReader::FunctionNegationReader(GenFunctionInterpreter *interpreter):GenFunctionReader("FunctionNegation",interpreter) {}
 
 
-GFPTR  FunctionNegationReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
-  return GFPTR(new GeoGenfun::FunctionNegation(getInterpreter()->interpret(begin,end).get()));
+GFPTR  FunctionNegationReader::execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> * fpData ) const {
+  return GFPTR(new GeoGenfun::FunctionNegation(getInterpreter()->interpret(begin,end,fpData).get()));
 }
 
 FunctionNegationRecorder::FunctionNegationRecorder(GenFunctionPersistifier *persistifier):
@@ -157,8 +166,8 @@ void FunctionNegationRecorder::execute(const GeoGenfun::AbsFunction & F) const {
 FunctionNoopReader::FunctionNoopReader(GenFunctionInterpreter *interpreter):GenFunctionReader("FunctionNoop",interpreter) {}
 
 
-GFPTR  FunctionNoopReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
-  return GFPTR(new GeoGenfun::FunctionNoop(getInterpreter()->interpret(begin,end).get()));
+GFPTR  FunctionNoopReader::execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> * fpData ) const {
+  return GFPTR(new GeoGenfun::FunctionNoop(getInterpreter()->interpret(begin,end,fpData).get()));
 }
 
 FunctionNoopRecorder::FunctionNoopRecorder(GenFunctionPersistifier *persistifier):
@@ -176,9 +185,11 @@ void FunctionNoopRecorder::execute(const GeoGenfun::AbsFunction & F) const {
 FunctionProductReader::FunctionProductReader(GenFunctionInterpreter *interpreter):GenFunctionReader("FunctionProduct",interpreter) {}
 
 
-GFPTR  FunctionProductReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
+GFPTR  FunctionProductReader::execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> * fpData ) const {
   auto sep=split(begin,end);
-  return GFPTR(new GeoGenfun::FunctionProduct(getInterpreter()->interpret(begin,sep).get(),getInterpreter()->interpret(sep+1,end).get()));
+  GFPTR  f1=getInterpreter()->interpret(begin,sep,fpData);
+  GFPTR  f2=getInterpreter()->interpret(sep+1,end,fpData);
+  return GFPTR(new GeoGenfun::FunctionProduct(f1.get(),f2.get()));
 }
 
 FunctionProductRecorder::FunctionProductRecorder(GenFunctionPersistifier *persistifier):
@@ -198,9 +209,11 @@ void FunctionProductRecorder::execute(const GeoGenfun::AbsFunction & F) const {
 FunctionSumReader::FunctionSumReader(GenFunctionInterpreter *interpreter):GenFunctionReader("FunctionSum",interpreter) {}
 
 
-GFPTR  FunctionSumReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
+GFPTR  FunctionSumReader::execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> * fpData ) const {
   auto sep=split(begin,end);
-  return GFPTR(new GeoGenfun::FunctionSum(getInterpreter()->interpret(begin,sep).get(),getInterpreter()->interpret(sep+1,end).get()));
+  GFPTR  f1=getInterpreter()->interpret(begin,sep,fpData);
+  GFPTR  f2=getInterpreter()->interpret(sep+1,end,fpData);
+  return GFPTR(new GeoGenfun::FunctionSum(f1.get(),f2.get()));
 }
 
 FunctionSumRecorder::FunctionSumRecorder(GenFunctionPersistifier *persistifier):
@@ -225,9 +238,11 @@ void FunctionSumRecorder::execute(const GeoGenfun::AbsFunction & F) const {
 FunctionQuotientReader::FunctionQuotientReader(GenFunctionInterpreter *interpreter):GenFunctionReader("FunctionQuotient",interpreter) {}
 
 
-GFPTR  FunctionQuotientReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
+GFPTR  FunctionQuotientReader::execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> * fpData ) const {
   auto sep=split(begin,end);
-  return GFPTR(new GeoGenfun::FunctionQuotient(getInterpreter()->interpret(begin,sep).get(),getInterpreter()->interpret(sep+1,end).get()));
+  GFPTR  f1=getInterpreter()->interpret(begin,sep,fpData);
+  GFPTR  f2=getInterpreter()->interpret(sep+1,end,fpData);
+  return GFPTR(new GeoGenfun::FunctionQuotient(f1.get(),f2.get()));
 }
 
 FunctionQuotientRecorder::FunctionQuotientRecorder(GenFunctionPersistifier *persistifier):
@@ -247,9 +262,12 @@ void FunctionQuotientRecorder::execute(const GeoGenfun::AbsFunction & F) const {
 FunctionDifferenceReader::FunctionDifferenceReader(GenFunctionInterpreter *interpreter):GenFunctionReader("FunctionDifference",interpreter) {}
 
 
-GFPTR  FunctionDifferenceReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
+GFPTR  FunctionDifferenceReader::execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> * fpData ) const {
   auto sep=split(begin,end);
-  return GFPTR(new GeoGenfun::FunctionDifference(getInterpreter()->interpret(begin,sep).get(),getInterpreter()->interpret(sep+1,end).get()));
+
+  GFPTR  f1=getInterpreter()->interpret(begin,sep,fpData);
+  GFPTR  f2=getInterpreter()->interpret(sep+1,end,fpData);
+  return GFPTR(new GeoGenfun::FunctionDifference(f1.get(),f2.get()));
 }
 
 FunctionDifferenceRecorder::FunctionDifferenceRecorder(GenFunctionPersistifier *persistifier):
@@ -273,7 +291,7 @@ void FunctionDifferenceRecorder::execute(const GeoGenfun::AbsFunction & F) const
 VariableReader::VariableReader(GenFunctionInterpreter *interpreter):GenFunctionReader("X",interpreter) {}
 
 
-GFPTR  VariableReader::execute(std::string::const_iterator, std::string::const_iterator) const {
+GFPTR  VariableReader::execute(std::string::const_iterator, std::string::const_iterator, std::deque<double> *) const {
   return GFPTR(new GeoGenfun::Variable());
 }
 
diff --git a/GeoModelIO/TFPersistification/src/ModIO.cpp b/GeoModelIO/TFPersistification/src/ModIO.cpp
index 99df3526d..e4f63678b 100644
--- a/GeoModelIO/TFPersistification/src/ModIO.cpp
+++ b/GeoModelIO/TFPersistification/src/ModIO.cpp
@@ -6,11 +6,13 @@
 ModReader::ModReader(GenFunctionInterpreter *interpreter):GenFunctionReader("Mod", interpreter) {}
 
 
-GFPTR  ModReader::execute(std::string::const_iterator begin, std::string::const_iterator end) const {
-  double y;
+GFPTR  ModReader::execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData) const {
+
   std::string aNumberStr(begin,end);
-  std::istringstream stream(aNumberStr);
-  stream >> y;
+  if (aNumberStr!="REAL") {
+    throw std::runtime_error ("Parse error in ModReader");
+  }
+  double y=fpData->back();fpData->pop_back();
   return GFPTR(new GeoGenfun::Mod(y));
 }
 
@@ -22,8 +24,9 @@ void ModRecorder::execute(const GeoGenfun::AbsFunction & F) const {
   const GeoGenfun::Mod * ptr = dynamic_cast<const GeoGenfun::Mod *> (&F);
   if (!ptr) throw std::runtime_error("Error in ModRecorder:: wrong function type");
   std::ostringstream & stream = getPersistifier()->getStream();
+  getPersistifier()->getFloatingPointData().push_front(ptr->modulus());
   stream << "Mod";
   stream << "(";
-  stream<<ptr->modulus();
+  stream<<"REAL";
   stream << ")";
 }
diff --git a/GeoModelIO/TFPersistification/src/RectangularIO.cpp b/GeoModelIO/TFPersistification/src/RectangularIO.cpp
index eb521dad9..e841fa6d0 100644
--- a/GeoModelIO/TFPersistification/src/RectangularIO.cpp
+++ b/GeoModelIO/TFPersistification/src/RectangularIO.cpp
@@ -6,31 +6,16 @@
 RectangularReader::RectangularReader(GenFunctionInterpreter *interpreter):GenFunctionReader("Rectangular", interpreter) {}
 
 
-GFPTR  RectangularReader::execute(std::string::const_iterator begin, std::string::const_iterator end) const {
-  std::vector<double> elements;
-  auto cStart=begin;
-  auto cNext=std::find(cStart, end,',');
-  while (cNext!=end) {
-    std::string aNumberStr(cStart,cNext);
-    std::istringstream stream(aNumberStr);
-    double d;
-    stream >> d;
-    elements.push_back(d);
-    cStart=cNext+1;
-    cNext=std::find(cStart, end,',');
+GFPTR  RectangularReader::execute(std::string::const_iterator begin, std::string::const_iterator end, std::deque<double> *fpData) const {
+  std::string aNumberStr(begin,end);
+  if (aNumberStr!=("REAL,REAL,REAL,REAL")) {
+    throw std::runtime_error("Parse error in RectangularReader");
   }
-  std::string aNumberStr(cStart,cNext);
-  std::istringstream stream(aNumberStr);
-  double d;
-  stream >> d;
-  elements.push_back(d);
-  if (elements.size()!=4) throw std::runtime_error("Error in Rectangular: illegal value list");
-  
   GeoGenfun::Rectangular *ptr=new GeoGenfun::Rectangular();
-  ptr->x0().setValue(elements[0]);
-  ptr->x1().setValue(elements[1]);
-  ptr->baseline().setValue(elements[2]);
-  ptr->height().setValue(elements[3]);
+  ptr->x0().setValue(fpData->back());       fpData->pop_back();
+  ptr->x1().setValue(fpData->back());       fpData->pop_back();
+  ptr->baseline().setValue(fpData->back()); fpData->pop_back();
+  ptr->height().setValue(fpData->back());   fpData->pop_back();
   return GFPTR(ptr);
 }
 
@@ -42,14 +27,11 @@ void RectangularRecorder::execute(const GeoGenfun::AbsFunction & F) const {
   const GeoGenfun::Rectangular * ptr = dynamic_cast<const GeoGenfun::Rectangular *> (&F);
   if (!ptr) throw std::runtime_error("Error in RectangularRecorder:: wrong function type");
   std::ostringstream & stream = getPersistifier()->getStream();
+  getPersistifier()->getFloatingPointData().push_front(ptr->x0().getValue());
+  getPersistifier()->getFloatingPointData().push_front(ptr->x1().getValue());
+  getPersistifier()->getFloatingPointData().push_front(ptr->baseline().getValue());
+  getPersistifier()->getFloatingPointData().push_front(ptr->height().getValue());
   stream << "Rectangular";
-  stream << "(";
-  stream << ptr->x0().getValue();
-  stream << ",";
-  stream << ptr->x1().getValue();
-  stream << ",";
-  stream << ptr->baseline().getValue();
-  stream << ",";
-  stream << ptr->height().getValue();
-  stream << ")";
+  stream << "(REAL,REAL,REAL,REAL)";
+  
 }
diff --git a/GeoModelIO/TFPersistification/src/SinIO.cpp b/GeoModelIO/TFPersistification/src/SinIO.cpp
index 4a450d3af..e30116ae9 100644
--- a/GeoModelIO/TFPersistification/src/SinIO.cpp
+++ b/GeoModelIO/TFPersistification/src/SinIO.cpp
@@ -7,7 +7,7 @@
 SinReader::SinReader(GenFunctionInterpreter *interpreter):GenFunctionReader("Sin", interpreter) {}
 
 
-GFPTR  SinReader::execute(std::string::const_iterator, std::string::const_iterator ) const {
+GFPTR  SinReader::execute(std::string::const_iterator, std::string::const_iterator, std::deque<double> * ) const {
   return GFPTR(new GeoGenfun::Sin());
 }
 
diff --git a/GeoModelIO/TFPersistification/src/SqrtIO.cpp b/GeoModelIO/TFPersistification/src/SqrtIO.cpp
index a06a58e10..e0c21fd91 100644
--- a/GeoModelIO/TFPersistification/src/SqrtIO.cpp
+++ b/GeoModelIO/TFPersistification/src/SqrtIO.cpp
@@ -7,7 +7,7 @@
 SqrtReader::SqrtReader(GenFunctionInterpreter *interpreter):GenFunctionReader("Sqrt", interpreter) {}
 
 
-GFPTR  SqrtReader::execute(std::string::const_iterator, std::string::const_iterator ) const {
+GFPTR  SqrtReader::execute(std::string::const_iterator, std::string::const_iterator, std::deque<double> * ) const {
   return GFPTR(new GeoGenfun::Sqrt());
 }
 
diff --git a/GeoModelIO/TFPersistification/src/SquareIO.cpp b/GeoModelIO/TFPersistification/src/SquareIO.cpp
index 1f70c16e0..9c0607dcd 100644
--- a/GeoModelIO/TFPersistification/src/SquareIO.cpp
+++ b/GeoModelIO/TFPersistification/src/SquareIO.cpp
@@ -7,7 +7,7 @@
 SquareReader::SquareReader(GenFunctionInterpreter *interpreter):GenFunctionReader("Square", interpreter) {}
 
 
-GFPTR  SquareReader::execute(std::string::const_iterator, std::string::const_iterator ) const {
+GFPTR  SquareReader::execute(std::string::const_iterator, std::string::const_iterator, std::deque<double> * ) const {
   return GFPTR(new GeoGenfun::Square());
 }
 
diff --git a/GeoModelIO/TFPersistification/src/TanIO.cpp b/GeoModelIO/TFPersistification/src/TanIO.cpp
index ad57db23d..3c0fb7a32 100644
--- a/GeoModelIO/TFPersistification/src/TanIO.cpp
+++ b/GeoModelIO/TFPersistification/src/TanIO.cpp
@@ -7,7 +7,7 @@
 TanReader::TanReader(GenFunctionInterpreter *interpreter):GenFunctionReader("Tan", interpreter) {}
 
 
-GFPTR  TanReader::execute(std::string::const_iterator, std::string::const_iterator) const {
+GFPTR  TanReader::execute(std::string::const_iterator, std::string::const_iterator, std::deque<double> *) const {
   return GFPTR(new GeoGenfun::Tan());
 }
 
diff --git a/cmake/BuildType.cmake b/cmake/BuildType.cmake
index ac66a37a7..c4f91dede 100644
--- a/cmake/BuildType.cmake
+++ b/cmake/BuildType.cmake
@@ -3,7 +3,7 @@
 # Source: https://blog.kitware.com/cmake-and-the-default-build-type/
 
 # Set a default build type if none was specified
-set(default_build_type "Release")
+set(default_build_type "Debug")
 
 # TODO: at the moment, we want to build in Release mode by default,
 # even if we build from a Git clone, because that is the default mode
-- 
GitLab