DFTDescriptor ============= .. cpp:class:: numpy::DFTDescriptor numpy C++ class. Example ------- .. code-block:: cpp #include using namespace numpy; // Use DFTDescriptor DFTDescriptor obj; // ... operations ... Constructors ------------ .. list-table:: :widths: 55 25 20 :header-rows: 1 * - Signature - Location - Example * - ``DFTDescriptor(const DFTDescriptor &)`` - NP_MKL_FFT.H:88 - * - ``noexcept DFTDescriptor(DFTDescriptor &&other)`` - NP_MKL_FFT.H:91 - Operators --------- .. list-table:: :widths: 40 25 15 20 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``DFTDescriptor & operator=(const DFTDescriptor &)`` - DFTDescriptor & - NP_MKL_FFT.H:89 - * - ``DFTDescriptor & noexcept operator=(DFTDescriptor &&other)`` - DFTDescriptor & noexcept - NP_MKL_FFT.H:95 - Construction ------------ .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``void create_1d(DFTI_CONFIG_VALUEprecision, DFTI_CONFIG_VALUEdomain, MKL_LONGlength)`` - void - NP_MKL_FFT.H:115 - * - ``void create_nd(DFTI_CONFIG_VALUEprecision, DFTI_CONFIG_VALUEdomain, const std::vector&dimensions)`` - void - NP_MKL_FFT.H:128 - Indexing / Selection -------------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``DFTI_DESCRIPTOR_HANDLE get()`` - DFTI_DESCRIPTOR_HANDLE - NP_MKL_FFT.H:227 - :ref:`View ` Type Checking ------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``bool is_valid()`` - bool - NP_MKL_FFT.H:222 - Other Methods ------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``void commit()`` - void - NP_MKL_FFT.H:157 - * - ``void compute_backward(void \*inout)`` - void - NP_MKL_FFT.H:190 - * - ``void compute_backward(void \*input, void \*output)`` - void - NP_MKL_FFT.H:201 - * - ``void compute_forward(void \*inout)`` - void - NP_MKL_FFT.H:168 - * - ``void compute_forward(void \*input, void \*output)`` - void - NP_MKL_FFT.H:179 - * - ``void reset()`` - void - NP_MKL_FFT.H:212 - :ref:`View ` * - ``void set_value(DFTI_CONFIG_PARAMparam, Tvalue)`` - void - NP_MKL_FFT.H:145 - Code Examples ------------- The following examples are extracted from the test suite. .. _example-dftdescriptor-get-0: .. dropdown:: get (np_test_1_all.cpp:28526) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 28516 :emphasize-lines: 11 std::cout << " -> tests passed" << std::endl; } void np_test_indexing_mask_indices() { std::cout << "========= mask_indices: triangular mask indices ======================="; // Get upper triangular indices for 3x3 matrix auto triu_idx = numpy::mask_indices(3, "triu", 0); // Should return tuple of 2 arrays bool passed = (std::get<0>(triu_idx).getSize() > 0); passed = passed && (std::get<1>(triu_idx).getSize() > 0); passed = passed && (std::get<0>(triu_idx).getSize() == std::get<1>(triu_idx).getSize()); // Get lower triangular indices auto tril_idx = numpy::mask_indices(3, "tril", 0); passed = passed && (std::get<0>(tril_idx).getSize() > 0); passed = passed && (std::get<1>(tril_idx).getSize() > 0); if (!passed) { std::cout << " [FAIL] : in np_test_indexing_mask_indices() : Mask indices incorrect"; .. _example-dftdescriptor-reset-1: .. dropdown:: reset (np_test_2_all.cpp:22610) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 22600 :emphasize-lines: 11 // Count iterations size_t outer_count = 0; size_t total_inner_count = 0; for (; !outer.is_finished(); ++outer) { size_t inner_count = 0; for (; !inner.is_finished(); ++inner) { inner_count++; total_inner_count++; } outer_count++; inner.reset(); } if (outer_count != 3 || total_inner_count != 12) { std::cout << " [FAIL] : Iteration counts incorrect"; throw std::runtime_error("np_test_nested_iters_basic failed"); } std::cout << " -> tests passed" << std::endl; }