Paraper
|
00001 #ifndef PARAPER_PARAPER_H 00002 #define PARAPER_PARAPER_H 00003 00004 #include <mpi.h> 00005 #include <cstdint> 00006 #include <vector> 00007 #include <boost/noncopyable.hpp> 00008 00009 namespace paraper 00010 { 00011 template <typename T = uintmax_t> 00012 class Paraper : boost::noncopyable 00013 { 00014 public: 00015 typedef T value_type; 00016 typedef std::vector<T> vector_type; 00017 00018 enum Distribution 00019 { 00020 SEPARATE, BULK, BULK_WITH_SHIFT 00021 }; 00022 00023 Paraper(); 00024 ~Paraper(); 00025 00026 void set_communicator(MPI_Comm comm); 00027 void free_communicator(); 00028 00029 void generate(T size, Distribution distribution = BULK_WITH_SHIFT); 00030 00031 const vector_type& elements() const; 00032 00033 T first() const; 00034 T count() const; 00035 00036 private: 00037 struct Impl; 00038 Impl* pimpl_; 00039 }; 00040 00041 } 00042 00043 #include "impl/Paraper.h" 00044 00045 #endif