NumCpp  2.14.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lstsq.hpp
Go to the documentation of this file.
1
28#pragma once
29
32#include "NumCpp/NdArray.hpp"
33
34namespace nc::linalg
35{
36 //============================================================================
37 // Method Description:
56 template<typename dtype>
58 {
60
61 SVD svdSolver(inA.template astype<double>());
62 const double threshold = inTolerance * svdSolver.s().front();
63
64 return svdSolver.solve(inB.template astype<double>(), threshold);
65 }
66} // namespace nc::linalg
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition StaticAsserts.hpp:39
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:139
Definition SVDClass.hpp:47
Definition cholesky.hpp:41
NdArray< double > lstsq(const NdArray< dtype > &inA, const NdArray< dtype > &inB, double inTolerance=1e-12)
Definition lstsq.hpp:57
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition arange.hpp:59