VectorizeInfo ============= .. cpp:class:: numpy::VectorizeInfo numpy C++ class. Example ------- .. code-block:: cpp #include using namespace numpy; // Use VectorizeInfo VectorizeInfo obj; // ... operations ... Other Methods ------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``std::string describe(const VectorizedFunc &vf)`` - std::string - NP_VECTORIZE.H:574 - :ref:`View ` Code Examples ------------- The following examples are extracted from the test suite. .. _example-vectorizeinfo-describe-0: .. dropdown:: describe (np_test_1_all.cpp:11448) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 11438 :emphasize-lines: 11 auto moment2_result = moment(normal_data, 2); // std::cout << "2nd moment: " << moment2_result.getElementAt({ 0 }) << std::endl; if (!(moment2_result.getElementAt({ 0 }) > 0)) { std::string description = std::string("testDistributionShapeMeasures():") + __FILE__ + ":" + std::to_string(__LINE__) + ": !(moment2_result.getElementAt({ 0 }) > 0)"; std::cout << std::string("[FAIL] ") + description << std::endl; throw std::runtime_error(description); } // std::cout << "[OK] Moment calculation\n"; // Test describe auto desc_result = describe(normal_data); // std::cout << "Describe result:" << std::endl; // std::cout << " nobs: " << desc_result.nobs << std::endl; // std::cout << " min: " << desc_result.minmax.first << ", max: " << desc_result.minmax.second << std::endl; // std::cout << " mean: " << desc_result.mean << std::endl; // std::cout << " variance: " << desc_result.variance << std::endl; if (!(desc_result.nobs == 5)) { std::string description = std::string("testDistributionShapeMeasures():") + __FILE__ + ":" + std::to_string(__LINE__) + ": !(desc_result.nobs == 5)"; std::cout << std::string("[FAIL] ") + description << std::endl; throw std::runtime_error(description); }