Index: LinearAlgebra/configure.ac
===================================================================
--- LinearAlgebra/configure.ac	(revision 29cbe9eb5045c2dc5460417786abf8dd54510240)
+++ LinearAlgebra/configure.ac	(revision c2e56705b36163307f5a111381f66c386e164bad)
@@ -104,6 +104,6 @@
 AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found]))
 
-# CodePatterns library (needs operator<<(.., range<>) ) 
-AM_PATH_CODEPATTERNS([1.0.13], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])])
+# CodePatterns library (serialization header before MemDebug.hpp ) 
+AM_PATH_CODEPATTERNS([1.1.5], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])])
 
 # boost
Index: LinearAlgebra/src/LinearAlgebra/RealSpaceMatrix.hpp
===================================================================
--- LinearAlgebra/src/LinearAlgebra/RealSpaceMatrix.hpp	(revision 29cbe9eb5045c2dc5460417786abf8dd54510240)
+++ LinearAlgebra/src/LinearAlgebra/RealSpaceMatrix.hpp	(revision c2e56705b36163307f5a111381f66c386e164bad)
@@ -14,4 +14,7 @@
 #endif
 
+#include "boost/serialization/access.hpp"
+#include <boost/serialization/split_member.hpp>
+//#include "boost/serialization/export.hpp"
 
 #include <iosfwd>
@@ -156,7 +159,28 @@
   bool operator==(const RealSpaceMatrix&) const;
 
+  bool operator!=(const RealSpaceMatrix &other) const {
+    return !(*this == other);
+  }
+
+private:
+  friend class boost::serialization::access;
+  // serialization
+  template<class Archive>
+  void save(Archive & ar, const unsigned int version) const
+  {
+    ar & content;
+  }
+  template<class Archive>
+  void load(Archive & ar, const unsigned int version)
+  {
+    ar & content;
+    createViews();
+  }
+  BOOST_SERIALIZATION_SPLIT_MEMBER()
+
 private:
   RealSpaceMatrix(MatrixContent*);
   void createViews();
+
   MatrixContent *content;
   // we keep around some Vector views of the matrix, to return references
@@ -165,4 +189,5 @@
   Vector* diagonal_ptr;
 };
+//BOOST_CLASS_EXPORT_GUID(RealSpaceMatrix, "RealSpaceMatrix")
 
 const RealSpaceMatrix operator*(const double,const RealSpaceMatrix&);
Index: LinearAlgebra/src/unittests/Makefile.am
===================================================================
--- LinearAlgebra/src/unittests/Makefile.am	(revision 29cbe9eb5045c2dc5460417786abf8dd54510240)
+++ LinearAlgebra/src/unittests/Makefile.am	(revision c2e56705b36163307f5a111381f66c386e164bad)
@@ -74,5 +74,6 @@
 	RealSpaceMatrixUnitTest.cpp \
 	RealSpaceMatrixUnitTest.hpp
-RealSpaceMatrixUnitTest_LDADD = ${GSLLIBS}
+RealSpaceMatrixUnitTest_LDADD = ${GSLLIBS} \
+	$(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS)
 
 VectorContentUnitTest_SOURCES = UnitTestMain.cpp \
Index: LinearAlgebra/src/unittests/RealSpaceMatrixUnitTest.cpp
===================================================================
--- LinearAlgebra/src/unittests/RealSpaceMatrixUnitTest.cpp	(revision 29cbe9eb5045c2dc5460417786abf8dd54510240)
+++ LinearAlgebra/src/unittests/RealSpaceMatrixUnitTest.cpp	(revision c2e56705b36163307f5a111381f66c386e164bad)
@@ -27,6 +27,11 @@
 #include "RealSpaceMatrixUnitTest.hpp"
 
+// include headers that implement a archive in simple text format
+#include <boost/archive/text_oarchive.hpp>
+#include <boost/archive/text_iarchive.hpp>
+
 #include "defs.hpp"
 #include "Exceptions.hpp"
+#include "MatrixContent.hpp"
 #include "RealSpaceMatrix.hpp"
 #include "Vector.hpp"
@@ -366,2 +371,21 @@
   CPPUNIT_ASSERT_EQUAL((*perm5)*t,Vector(2,3,1));
 }
+
+void RealSpaceMatrixTest::SerializationTest()
+{
+  // write element to stream
+  std::stringstream stream;
+  boost::archive::text_oarchive oa(stream);
+  oa << diagonal;
+
+  //std::cout << "Contents of archive is " << stream.str() << std::endl;
+
+  // create and open an archive for input
+  boost::archive::text_iarchive ia(stream);
+  // read class state from archive
+  RealSpaceMatrix *newm;
+
+  ia >> newm;
+
+  CPPUNIT_ASSERT (*diagonal == *newm);
+}
Index: LinearAlgebra/src/unittests/RealSpaceMatrixUnitTest.hpp
===================================================================
--- LinearAlgebra/src/unittests/RealSpaceMatrixUnitTest.hpp	(revision 29cbe9eb5045c2dc5460417786abf8dd54510240)
+++ LinearAlgebra/src/unittests/RealSpaceMatrixUnitTest.hpp	(revision c2e56705b36163307f5a111381f66c386e164bad)
@@ -30,4 +30,5 @@
   CPPUNIT_TEST ( DeterminantTest );
   CPPUNIT_TEST ( VecMultTest );
+  CPPUNIT_TEST ( SerializationTest );
   CPPUNIT_TEST_SUITE_END();
 
@@ -44,4 +45,5 @@
   void DeterminantTest();
   void VecMultTest();
+  void SerializationTest();
 
   RealSpaceMatrix *zero;
