Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Class cartesian_topology

boost::mpi::cartesian_topology — Describe the topology of a cartesian grid.

Synopsis

// In header: <boost/mpi/cartesian_communicator.hpp>


class cartesian_topology : private std::vector< cartesian_dimension > {
public:

  // public member functions
  cartesian_topology() = delete;
  cartesian_topology(cartesian_topology const &) = default;
  cartesian_topology & operator=(cartesian_topology const &) = default;
  cartesian_topology(cartesian_topology &&);
  cartesian_topology & operator=(cartesian_topology &&);
  ~cartesian_topology() = default;
  cartesian_topology(int);
  cartesian_topology(std::vector< cartesian_dimension > const &);
  template<typename InitArr> explicit cartesian_topology(InitArr);
  explicit cartesian_topology(std::initializer_list< cartesian_dimension >);
  template<int NDIM> explicit cartesian_topology(cartesian_dimension(&));
  template<typename DimRg, typename PerRg> 
    cartesian_topology(DimRg const &, PerRg const &);
  template<typename DimIter, typename PerIter> 
    cartesian_topology(DimIter, PerIter, int);
  std::vector< cartesian_dimension > & stl();
  std::vector< cartesian_dimension > const & stl() const;
  void split(std::vector< int > &, std::vector< bool > &) const;
};

Description

Behave mostly like a sequence of cartesian_dimension with the notable exception that its size is fixed. This is a lightweight object, so that any constructor that could be considered missing could be replaced with a function (move constructor provided when supported).

cartesian_topology public member functions

  1. cartesian_topology() = delete;
  2. cartesian_topology(cartesian_topology const &) = default;
  3. cartesian_topology & operator=(cartesian_topology const &) = default;
  4. cartesian_topology(cartesian_topology && other);
  5. cartesian_topology & operator=(cartesian_topology && other);
  6. ~cartesian_topology() = default;
  7. cartesian_topology(int ndim);
    Create a N dimension space. Each dimension is initialized as non periodic of size 0.
  8. cartesian_topology(std::vector< cartesian_dimension > const & dims);
    Use the provided dimensions specification as initial values.
  9. template<typename InitArr> explicit cartesian_topology(InitArr dims);
    Use dimensions specification provided in the sequence container as initial values. #param dims must be a sequence container.
  10. explicit cartesian_topology(std::initializer_list< cartesian_dimension > dims);
    Use dimensions specification provided in the initialization list as initial values. #param dims can be of the form { dim_1, false}, .... {dim_n, true}.
  11. template<int NDIM> explicit cartesian_topology(cartesian_dimension(&) dims);
    Use dimensions specification provided in the array. #param dims can be of the form { dim_1, false}, .... {dim_n, true}.
  12. template<typename DimRg, typename PerRg> 
      cartesian_topology(DimRg const & dim_rg, PerRg const & period_rg);
    Use dimensions specification provided in the input ranges The ranges do not need to be the same size. If the sizes are different, the missing values will be complete with zeros of the dim and assumed non periodic.

    Parameters:

    dim_rg

    the dimensions, values must convert to integers.

    period_rg

    the periodicities, values must convert to booleans. #param dims can be of the form { dim_1, false}, .... {dim_n, true}

  13. template<typename DimIter, typename PerIter> 
      cartesian_topology(DimIter dit, PerIter pit, int n);
    Iterator based initializer. Will use the first n iterated values. Both iterators can be single pass.

    Parameters:

    dit

    dimension iterator, value must convert to integer type.

    pit

    periodicity iterator, value must convert to booleans..

  14. std::vector< cartesian_dimension > & stl();

    Export as an stl sequence.

  15. std::vector< cartesian_dimension > const & stl() const;

    Export as an stl sequence.

  16. void split(std::vector< int > & dims, std::vector< bool > & periodics) const;

    Split the topology in two sequences of sizes and periodicities.


PrevUpHomeNext