AutoTunedEigenSolver ==================== .. cpp:class:: numpy::AutoTunedEigenSolver numpy C++ class. Example ------- .. code-block:: cpp #include using namespace numpy; // Use AutoTunedEigenSolver AutoTunedEigenSolver obj; // ... operations ... Constructors ------------ .. list-table:: :widths: 55 25 20 :header-rows: 1 * - Signature - Location - Example * - ``AutoTunedEigenSolver(typename real_type::typetolerance = machine_epsilon::type>(), boolenable_auto_tuning = true, size_tsample_rate = 10)`` - NP_LINALG_UTILS.H:2774 - Linear Algebra -------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``::numpy::linalg::EigenDecomposition solve(const NDArray&matrix, boolcompute_eigenvectors = true)`` - ::numpy::linalg::EigenDecomposition - NP_LINALG_UTILS.H:2782 - :ref:`View ` Other Methods ------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``void clearPerformanceHistory()`` - void - NP_LINALG_UTILS.H:2908 - * - ``void setAutoTuning(boolenable)`` - void - NP_LINALG_UTILS.H:2903 - * - ``void setTolerance(typename real_type::typetol)`` - void - NP_LINALG_UTILS.H:2898 - Code Examples ------------- The following examples are extracted from the test suite. .. _example-autotunedeigensolver-solve-0: .. dropdown:: solve (np_test_2_all.cpp:5150) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 5140 :emphasize-lines: 11 * Test linear system solving */ void testMatrixSolvers() { std::cout << "========= testMatrixSolvers ======================="; // Test solve for simple 2x2 system numpy::Matrix A("2 1; 1 1"); numpy::Matrix b("3; 2"); try { auto x = numpy::solve(A, b); assert_test(x.rows() == 2 && x.cols() == 1, "Solve result dimensions"); // Verify A * x = b auto Ax = A * x; assert_test(std::abs(Ax(0, 0) - b(0, 0)) < 1e-10, "Solve verification 0"); assert_test(std::abs(Ax(1, 0) - b(1, 0)) < 1e-10, "Solve verification 1"); } catch (...) { // std::cout << "Linear system solve test failed (expected for some systems)"; }