AutoTunedEigenSolver#

class numpy::AutoTunedEigenSolver#

numpy C++ class.

Example#

#include <numpy/np_ndarray.h>
using namespace numpy;

// Use AutoTunedEigenSolver
AutoTunedEigenSolver obj;
// ... operations ...

Constructors#

Signature

Location

Example

AutoTunedEigenSolver(typename real_type<T>::typetolerance = machine_epsilon<typename real_type<T>::type>(), boolenable_auto_tuning = true, size_tsample_rate = 10)

NP_LINALG_UTILS.H:2774

Linear Algebra#

Signature

Return Type

Location

Example

::numpy::linalg::EigenDecomposition<T> solve(const NDArray<T>&matrix, boolcompute_eigenvectors = true)

::numpy::linalg::EigenDecomposition<T>

NP_LINALG_UTILS.H:2782

View

Other Methods#

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<T>::typetol)

void

NP_LINALG_UTILS.H:2898

Code Examples#

The following examples are extracted from the test suite.

solve (np_test_2_all.cpp:5150)
5140     * Test linear system solving
5141     */
5142    void testMatrixSolvers() {
5143      std::cout << "========= testMatrixSolvers =======================";
5144
5145      // Test solve for simple 2x2 system
5146      numpy::Matrix<double> A("2 1; 1 1");
5147      numpy::Matrix<double> b("3; 2");
5148
5149      try {
5150        auto x = numpy::solve(A, b);
5151        assert_test(x.rows() == 2 && x.cols() == 1, "Solve result dimensions");
5152
5153        // Verify A * x = b
5154        auto Ax = A * x;
5155        assert_test(std::abs(Ax(0, 0) - b(0, 0)) < 1e-10, "Solve verification 0");
5156        assert_test(std::abs(Ax(1, 0) - b(1, 0)) < 1e-10, "Solve verification 1");
5157      }
5158      catch (...) {
5159        // std::cout << "Linear system solve test failed (expected for some systems)";
5160      }