// (1) # include # include # include // (2) # include namespace mpi = boost::mpi; // (3) #include #include typedef mpq_class val_t; // `mpq_class` is a GMP type typedef long coord_t; namespace rheinfall { template class Row { public: Row(const coord_t starting_column, const coord_t ending_column) : starting_column_(starting_column), ending_column_(ending_column) { }; virtual ~Row(); protected: coord_t starting_column_; coord_t ending_column_; // boost::serialization support friend class boost::serialization::access; template void serialize(Archive& ar, const unsigned int version); }; // class Row template class SparseRow : public Row { public: SparseRow(const coord_t starting_column, const coord_t ending_column) : Row(starting_column, ending_column) { }; protected: typedef Row Row_; std::vector < std::pair > storage; // boost::serialization support friend class boost::serialization::access; template void serialize(Archive& ar, const unsigned int version); }; // class SparseRow // inlines template template inline void Row::serialize(Archive& ar, const unsigned int version) { ar & starting_column_ & ending_column_; }; template template inline void SparseRow::serialize(Archive& ar, const unsigned int version) { ar & boost::serialization::base_object(*this) & storage; }; }; // namespace rheinfall