DeclException1 (ExcIndexNotPresent, int,
<< "The global index " << arg1
<< " is not an element of this set.");
+
+ /**
+ * Write or read the data of this object to or
+ * from a stream for the purpose of serialization
+ */
+ template <class Archive>
+ void serialize (Archive & ar, const unsigned int version);
private:
/**
{
return sizeof(Range);
}
+
+ /**
+ * Write or read the data of this object to or
+ * from a stream for the purpose of serialization
+ */
+ template <class Archive>
+ void serialize (Archive & ar, const unsigned int version);
};
out << "}" << std::endl;
}
+template <class Archive>
+inline
+void
+IndexSet::Range::serialize (Archive & ar, const unsigned int)
+{
+ ar & begin & end & nth_index_in_set;
+}
+
+template <class Archive>
+inline
+void
+IndexSet::serialize (Archive & ar, const unsigned int)
+{
+ ar & ranges & is_compressed & index_space_size;
+}
DEAL_II_NAMESPACE_CLOSE
#include <base/std_cxx1x/shared_ptr.h>
#include <boost/property_tree/ptree_fwd.hpp>
+#include <boost/serialization/split_member.hpp>
#include <map>
#include <vector>
*/
unsigned int memory_consumption () const;
+ /**
+ * Write the data of this object to
+ * a stream for the purpose of serialization.
+ */
+ template <class Archive>
+ void save (Archive & ar, const unsigned int version) const;
+
+ /**
+ * Read the data of this object
+ * from a stream for the purpose of serialization.
+ */
+ template <class Archive>
+ void load (Archive & ar, const unsigned int version);
+
+ BOOST_SERIALIZATION_SPLIT_MEMBER()
+
+ /**
+ * Test for equality.
+ */
+ bool operator == (const ParameterHandler & prm2) const;
+
/** @addtogroup Exceptions
* @{ */
};
+template <class Archive>
+inline
+void
+ParameterHandler::save (Archive & ar, const unsigned int) const
+{
+ // Forward to serialization
+ // function in the base class.
+ ar & static_cast<const Subscriptor &>(*this);
+
+ ar & *entries.get();
+
+ std::vector<std::string> descriptions;
+
+ for (unsigned int j=0; j<patterns.size(); ++j)
+ descriptions.push_back (patterns[j]->description());
+
+ ar & descriptions;
+}
+
+
+template <class Archive>
+inline
+void
+ParameterHandler::load (Archive & ar, const unsigned int)
+{
+ // Forward to serialization
+ // function in the base class.
+ ar & static_cast<Subscriptor &>(*this);
+
+ ar & *entries.get();
+
+ std::vector<std::string> descriptions;
+ ar & descriptions;
+
+ patterns.clear ();
+ for (unsigned int j=0; j<descriptions.size(); ++j)
+ patterns.push_back (std_cxx1x::shared_ptr<Patterns::PatternBase>(Patterns::pattern_factory(descriptions[j])));
+}
+
+inline
+bool
+ParameterHandler::operator == (const ParameterHandler & prm2) const
+{
+ if(patterns.size() != prm2.patterns.size())
+ return false;
+
+ for(unsigned int j=0; j<patterns.size(); ++j)
+ if (patterns[j]->description() != prm2.patterns[j]->description())
+ return false;
+
+ // return !(*entries != *(prm2.entries));
+ return true;
+ // TODO: Fix
+}
+
DEAL_II_NAMESPACE_CLOSE
#endif
*/
Polynomial<number>& operator -= (const Polynomial<number>& p);
+ /**
+ * Test for equality of two polynomials.
+ */
+ bool operator == (const Polynomial<number> & p) const;
+
/**
* Print coefficients.
*/
void print(std::ostream& out) const;
+
+ /**
+ * Write or read the data of this object to or
+ * from a stream for the purpose of serialization.
+ */
+ template <class Archive>
+ void serialize (Archive & ar, const unsigned int version);
protected:
return value;
}
+
+
+
+ template <typename number>
+ template <class Archive>
+ inline
+ void
+ Polynomial<number>::serialize (Archive & ar, const unsigned int)
+ {
+ // forward to serialization
+ // function in the base class.
+ ar & static_cast<Subscriptor &>(*this);
+ ar & coefficients;
+ }
+
}
DEAL_II_NAMESPACE_CLOSE
* size.
*/
Quadrature& operator = (const Quadrature<dim>&);
+
+ /**
+ * Test for equality of two quadratures.
+ */
+ bool operator == (const Quadrature<dim> & p) const;
/**
* Set the quadrature points and
*/
unsigned int memory_consumption () const;
+ /**
+ * Write or read the data of this object to or
+ * from a stream for the purpose of serialization.
+ */
+ template <class Archive>
+ void serialize (Archive & ar, const unsigned int version);
+
protected:
/**
* List of quadrature points. To
+template <int dim>
+template <class Archive>
+inline
+void
+Quadrature<dim>::serialize (Archive & ar, const unsigned int)
+{
+ // forward to serialization
+ // function in the base class.
+ ar & static_cast<Subscriptor &>(*this);
+
+ ar & quadrature_points & weights;
+}
+
+
/* -------------- declaration of explicit specializations ------------- */
<< "\" did subscribe to this object of class " << arg1);
//@}
+ /**
+ * Read or write the data of this object to or
+ * from a stream for the purpose of serialization
+ */
+ template <class Archive>
+ void serialize(Archive & ar, const unsigned int version);
+
private:
/**
* Register a subscriber for
//---------------------------------------------------------------------------
+template <class Archive>
+inline
+void
+Subscriptor::serialize(Archive & ar, const unsigned int)
+{
+ ar & (unsigned int&)counter ;//& counter_map;
+ // TODO: Serialize counter_map
+}
+
// If we are in optimized mode, the subscription checking is turned
// off. Therefore, we provide inline definitions of subscribe and
// unsubscribe here. The definitions for debug mode are in
*/
template<typename T2>
TableBase<N,T>& operator = (const TableBase<N,T2> &src);
+
+ /**
+ * Test for equality of two tables.
+ */
+ bool operator == (const TableBase<N,T> & T2) const;
/**
* Set all entries to their
*/
unsigned int memory_consumption () const;
+ /**
+ * Write or read the data of this object to or
+ * from a stream for the purpose of serialization.
+ */
+ template <class Archive>
+ void serialize (Archive & ar, const unsigned int version);
+
protected:
/**
* Return the position of the
+template <int N, typename T>
+template <class Archive>
+inline
+void
+TableBase<N,T>::serialize (Archive & ar, const unsigned int)
+{
+ ar & static_cast<Subscriptor &>(*this);
+
+ ar & values & table_size;
+}
+
+
+
namespace internal
{
namespace TableBaseAccessors
}
+template <int N, typename T>
+inline
+bool
+TableBase<N,T>::operator == (const TableBase<N,T> & T2) const
+{
+ return (values == T2.values);
+}
+
+
template <int N, typename T>
inline
-
template <typename T>
inline
Table<5,T>::Table ()
*/
void sort ();
+ /**
+ * Write or read the data of this object to or
+ * from a stream for the purpose of serialization.
+ */
+ template <class Archive>
+ void serialize (Archive & ar, const unsigned int version);
+
protected:
/**
* Store the indices in an array.
+template <int N>
+template <class Archive>
+inline
+void
+TableIndicesBase<N>::serialize (Archive & ar, const unsigned int)
+{
+ ar & indices;
+}
+
+
+
template <>
inline
void
}
+
inline
TableIndices<4>::TableIndices ()
{
}
+
/**
* Output operator for indices; reports them in a list like this:
* <code>[i1,i2,...]</code>.
#include <base/config.h>
#include <base/exceptions.h>
#include <base/subscriptor.h>
+#include <boost/serialization/array.hpp>
+#include <boost/serialization/split_member.hpp>
#include <vector>
#include <iostream>
* objects.
*/
SparsityPattern & operator = (const SparsityPattern &);
+
+ /**
+ * Test for equality of two SparsityPatterns.
+ */
+ bool operator == (const SparsityPattern &) const;
/**
* Reallocate memory and set up data
* information!
*/
inline const unsigned int * get_column_numbers () const;
+
+ /**
+ * Write the data of this object to
+ * a stream for the purpose of serialization
+ */
+ template <class Archive>
+ void save (Archive & ar, const unsigned int version) const;
+
+ /**
+ * Read the data of this object
+ * from a stream for the purpose of serialization
+ */
+ template <class Archive>
+ void load (Archive & ar, const unsigned int version);
+
+ BOOST_SERIALIZATION_SPLIT_MEMBER()
/** @addtogroup Exceptions
* @{ */
+template <class Archive>
+inline
+void
+SparsityPattern::save (Archive & ar, const unsigned int) const
+{
+ // forward to serialization
+ // function in the base class.
+ ar & static_cast<const Subscriptor &>(*this);
+
+ ar & max_dim & rows & cols & max_vec_len & max_row_length & compressed & diagonal_optimized;
+
+ ar & boost::serialization::make_array(rowstart, max_dim + 1);
+ ar & boost::serialization::make_array(colnums, max_vec_len);
+}
+
+
+
+template <class Archive>
+inline
+void
+SparsityPattern::load (Archive & ar, const unsigned int)
+{
+ // forward to serialization
+ // function in the base class.
+ ar & static_cast<Subscriptor &>(*this);
+
+ ar & max_dim & rows & cols & max_vec_len & max_row_length & compressed & diagonal_optimized;
+
+ rowstart = new std::size_t [max_dim + 1];
+ colnums = new unsigned int [max_vec_len];
+
+ ar & boost::serialization::make_array(rowstart, max_dim + 1);
+ ar & boost::serialization::make_array(colnums, max_vec_len);
+}
+
+
+
+inline
+bool
+SparsityPattern::operator == (const SparsityPattern& sp2) const
+{
+ if (max_dim != sp2.max_dim || rows != sp2.rows || cols != sp2.cols ||
+ max_vec_len != sp2.max_vec_len || max_row_length != sp2.max_row_length ||
+ compressed != sp2.compressed || diagonal_optimized != sp2.diagonal_optimized)
+ return false;
+
+ for (unsigned int i = 0; i < max_dim+1; ++i)
+ if (rowstart[i] != sp2.rowstart[i])
+ return false;
+
+ for (unsigned int i = 0; i < max_vec_len; ++i)
+ if (colnums[i] != sp2.colnums[i])
+ return false;
+
+ return true;
+}
+
+
+
namespace internal
{
namespace SparsityPatternTools
#include <base/parallel.h>
#include <base/subscriptor.h>
#include <boost/lambda/lambda.hpp>
+#include <boost/serialization/array.hpp>
+#include <boost/serialization/split_member.hpp>
#include <cstdio>
#include <iostream>
*/
unsigned int memory_consumption () const;
//@}
+
+ /**
+ * Write the data of this object to
+ * a stream for the purpose of serialization.
+ */
+ template <class Archive>
+ void save (Archive & ar, const unsigned int version) const;
+
+ /**
+ * Read the data of this object
+ * from a stream for the purpose of serialization.
+ */
+ template <class Archive>
+ void load (Archive & ar, const unsigned int version);
+
+ BOOST_SERIALIZATION_SPLIT_MEMBER()
protected:
}
+
+template <typename Number>
+template <class Archive>
+inline
+void
+Vector<Number>::save (Archive & ar, const unsigned int) const
+{
+ // forward to serialization
+ // function in the base class.
+ ar & static_cast<const Subscriptor &>(*this);
+
+ ar & vec_size & max_vec_size ;
+ ar & boost::serialization::make_array(val, max_vec_size);
+}
+
+
+
+template <typename Number>
+template <class Archive>
+inline
+void
+Vector<Number>::load (Archive & ar, const unsigned int)
+{
+ // forward to serialization
+ // function in the base class.
+ ar & static_cast<Subscriptor &>(*this);
+
+ ar & vec_size & max_vec_size ;
+
+ val = new Number[max_vec_size];
+ ar & boost::serialization::make_array(val, max_vec_size);
+}
+
+
#endif
return os;
}
+
/*@}*/
DEAL_II_NAMESPACE_CLOSE
return *this;
}
+ template <typename number >
+ bool
+ Polynomial<number>::operator == (const Polynomial<number> & p) const
+ {
+ return (p.coefficients == coefficients);
+ }
+
template <typename number>
template <typename number2>
+template <int dim>
+bool
+Quadrature<dim>::operator == (const Quadrature<dim> & q) const
+{
+ return ((quadrature_points == q.quadrature_points)
+ &&
+ (weights == q.weights));
+}
+
+
+
template <int dim>
Quadrature<dim>::~Quadrature ()
{}