VectorizeOptions ================ .. cpp:class:: numpy::VectorizeOptions numpy C++ class. Example ------- .. code-block:: cpp #include using namespace numpy; // Use VectorizeOptions VectorizeOptions obj; // ... operations ... Other Methods ------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``VectorizeOptions & withCache(boolenable_cache = true, size_tsize = 1000)`` - VectorizeOptions & - NP_VECTORIZE.H:48 - :ref:`View ` * - ``VectorizeOptions & withDoc(const std::string &documentation)`` - VectorizeOptions & - NP_VECTORIZE.H:54 - * - ``VectorizeOptions & withExcluded(const std::vector&excl)`` - VectorizeOptions & - NP_VECTORIZE.H:43 - :ref:`View ` * - ``VectorizeOptions & withSignature(const std::string &sig)`` - VectorizeOptions & - NP_VECTORIZE.H:38 - Code Examples ------------- The following examples are extracted from the test suite. .. _example-vectorizeoptions-withcache-0: .. dropdown:: withCache (np_test_1_all.cpp:15020) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 15010 :emphasize-lines: 11 } // Test 5: Custom vectorized function with options std::cout << "========= test_vectorize_with_options ======================="; auto custom_func = [](double x, double y, double scale) { return scale * (x + y); }; numpy::VectorizeOptions opts; opts.withExcluded({ 2 }).withCache(true, 500); auto vectorized_custom = numpy::vectorize(custom_func, opts); // Simplified test - just test with 2 array arguments for now numpy::NDArray x({ 2 }); x.setElementAt({ 0 }, 1.0); x.setElementAt({ 1 }, 2.0); numpy::NDArray y({ 2 }); y.setElementAt({ 0 }, 3.0); .. _example-vectorizeoptions-withexcluded-1: .. dropdown:: withExcluded (np_test_1_all.cpp:15020) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 15010 :emphasize-lines: 11 } // Test 5: Custom vectorized function with options std::cout << "========= test_vectorize_with_options ======================="; auto custom_func = [](double x, double y, double scale) { return scale * (x + y); }; numpy::VectorizeOptions opts; opts.withExcluded({ 2 }).withCache(true, 500); auto vectorized_custom = numpy::vectorize(custom_func, opts); // Simplified test - just test with 2 array arguments for now numpy::NDArray x({ 2 }); x.setElementAt({ 0 }, 1.0); x.setElementAt({ 1 }, 2.0); numpy::NDArray y({ 2 }); y.setElementAt({ 0 }, 3.0);