Boost C++ 库

...这是世界上最受推崇、设计最精良的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu, C++ Coding Standards

类 cartesian_topology - Boost C++ 函数库
PrevUpHomeNext

类 cartesian_topology

boost::mpi::cartesian_topology — 描述笛卡尔网格的拓扑。

提要

// 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;
};

描述

行为与一系列 cartesian_dimension 基本相同,但有一个显著的区别是其大小是固定的。这是一个轻量级对象,因此任何可能被认为是缺失的构造函数都可以被一个函数替换(如果支持,会提供移动构造函数)。

cartesian_topology 公共成员函数

  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);
    创建一个 N 维空间。每个维度都初始化为非周期性,大小为 0。
  8. cartesian_topology(std::vector< cartesian_dimension > const & dims);
    使用提供的维度规范作为初始值。
  9. template<typename InitArr> explicit cartesian_topology(InitArr dims);
    使用序列容器中提供的维度规范作为初始值。#param dims 必须是一个序列容器。
  10. explicit cartesian_topology(std::initializer_list< cartesian_dimension > dims);
    使用初始化列表中提供的维度规范作为初始值。#param dims 的形式可以是 { dim_1, false}, .... {dim_n, true}。
  11. template<int NDIM> explicit cartesian_topology(cartesian_dimension(&) dims);
    使用数组中提供的维度规范作为初始值。#param dims 的形式可以是 { dim_1, false}, .... {dim_n, true}。
  12. template<typename DimRg, typename PerRg> 
      cartesian_topology(DimRg const & dim_rg, PerRg const & period_rg);
    使用输入范围中提供的维度规范。范围不需要大小相同。如果大小不同,缺失的值将用维度(dim)的零值填充,并假定为非周期性。

    参数

    dim_rg

    维度,值必须可转换为整数。

    period_rg

    周期性,值必须可转换为布尔值。#param dims 的形式可以是 { dim_1, false}, .... {dim_n, true}

  13. template<typename DimIter, typename PerIter> 
      cartesian_topology(DimIter dit, PerIter pit, int n);
    基于迭代器的初始化器。将使用前 n 个迭代值。两个迭代器都可以是单次遍历。

    参数

    dit

    维度迭代器,值必须可转换为整数类型。

    pit

    周期性迭代器,值必须可转换为布尔值。

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

    导出为 stl 序列。

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

    导出为 stl 序列。

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

    将拓扑分割成两个大小和周期性的序列。


PrevUpHomeNext