BroadcastWrapper ================ .. cpp:class:: numpy::BroadcastWrapper numpy C++ class. Example ------- .. code-block:: cpp #include using namespace numpy; // Use BroadcastWrapper BroadcastWrapper obj; // ... operations ... Constructors ------------ .. list-table:: :widths: 55 25 20 :header-rows: 1 * - Signature - Location - Example * - ``BroadcastWrapper(Arrays &...arrays)`` - NP_VECTORIZE_BROADCAST.H:260 - Other Methods ------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``auto begin()`` - auto - NP_VECTORIZE_BROADCAST.H:262 - :ref:`View ` * - ``auto end()`` - auto - NP_VECTORIZE_BROADCAST.H:266 - :ref:`View ` * - ``auto makeBroadcastIteratorImpl(std::index_sequence)`` - auto - NP_VECTORIZE_BROADCAST.H:271 - Code Examples ------------- The following examples are extracted from the test suite. .. _example-broadcastwrapper-begin-0: .. dropdown:: begin (np_test_1_all.cpp:6171) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 6161 :emphasize-lines: 11 // Test sorted data generation std::vector data = gen.generate(50, DataPattern::SORTED); if (!(data.size() == 50)) { std::string description = std::string("test_data_generator_sortedBenchmarkSorting():") + __FILE__ + ":" + std::to_string(__LINE__) + ": !(data.size() == 50)"; std::cout << std::string("[FAIL] ") + description << std::endl; throw std::runtime_error(description); } // Verify data is sorted if (!(std::is_sorted(data.begin(), data.end()))) { std::string description = std::string("test_data_generator_sortedBenchmarkSorting():") + __FILE__ + ":" + std::to_string(__LINE__) + ": !(std::is_sorted(data.begin(), data.end()))"; std::cout << std::string("[FAIL] ") + description << std::endl; throw std::runtime_error(description); } // std::cout << "Sorted data generation test passed" << std::endl; std::cout << " -> tests passed" << std::endl; } .. _example-broadcastwrapper-end-1: .. dropdown:: end (np_test_1_all.cpp:6171) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 6161 :emphasize-lines: 11 // Test sorted data generation std::vector data = gen.generate(50, DataPattern::SORTED); if (!(data.size() == 50)) { std::string description = std::string("test_data_generator_sortedBenchmarkSorting():") + __FILE__ + ":" + std::to_string(__LINE__) + ": !(data.size() == 50)"; std::cout << std::string("[FAIL] ") + description << std::endl; throw std::runtime_error(description); } // Verify data is sorted if (!(std::is_sorted(data.begin(), data.end()))) { std::string description = std::string("test_data_generator_sortedBenchmarkSorting():") + __FILE__ + ":" + std::to_string(__LINE__) + ": !(std::is_sorted(data.begin(), data.end()))"; std::cout << std::string("[FAIL] ") + description << std::endl; throw std::runtime_error(description); } // std::cout << "Sorted data generation test passed" << std::endl; std::cout << " -> tests passed" << std::endl; }