MUDA
Loading...
Searching...
No Matches
linear_system_solve_tolerance.h
1#pragma once
2#include <numeric>
3
4namespace muda
5{
7{
8 double m_solve_sparse_error_threshold = -1.0;
9
10 public:
11 void solve_sparse_error_threshold(double threshold)
12 {
13 m_solve_sparse_error_threshold = threshold;
14 }
15
16 template <typename T>
17 T solve_sparse_error_threshold()
18 {
19 if(m_solve_sparse_error_threshold < 0.0)
20 {
21 constexpr auto eps = std::numeric_limits<T>::epsilon();
22 return eps;
23 }
24 else
25 {
26 return static_cast<T>(m_solve_sparse_error_threshold);
27 }
28 }
29};
30} // namespace muda
Definition linear_system_solve_tolerance.h:7