MyraMath
refine.h
Go to the documentation of this file.
1 // ========================================================================= //
2 // This file is part of MyraMath, copyright (c) 2014-2019 by Ryan A Chilton //
3 // and distributed by MyraCore, LLC. See LICENSE.txt for license terms. //
4 // ========================================================================= //
5 
6 #ifndef MYRAMATH_ITERATIVE_REFINE_H
7 #define MYRAMATH_ITERATIVE_REFINE_H
8 
15 #include <myramath/MYRAMATH_EXPORT.h>
16 
17 #include <vector>
18 
19 namespace myra {
20 
21 // Forward declarations.
22 template<class Number> class Action;
23 template<class Number> class MatrixRange;
24 template<class Number> class VectorRange;
25 
27 // Overwrites B with X. Returns residual history in relative frobenius norm, |A*X-B|/|B|.
28 // Can specify desired tolerance and maximum allowed iterations, both are defaulted.
29 MYRAMATH_EXPORT std::vector<float > refine(const Action<NumberS>& A, const Action<NumberS>& M, const MatrixRange<NumberS>& B, float tolerance = 1.0e-5 , int iterations = 20);
30 MYRAMATH_EXPORT std::vector<double> refine(const Action<NumberD>& A, const Action<NumberD>& M, const MatrixRange<NumberD>& B, double tolerance = 1.0e-12, int iterations = 20);
31 MYRAMATH_EXPORT std::vector<float > refine(const Action<NumberC>& A, const Action<NumberC>& M, const MatrixRange<NumberC>& B, float tolerance = 1.0e-5 , int iterations = 20);
32 MYRAMATH_EXPORT std::vector<double> refine(const Action<NumberZ>& A, const Action<NumberZ>& M, const MatrixRange<NumberZ>& B, double tolerance = 1.0e-12, int iterations = 20);
33 
35 // Overwrites b with x. Returns residual history in relative frobenius norm, |A*x-b|/|b|.
36 // Can specify desired tolerance and maximum allowed iterations, both are defaulted.
37 MYRAMATH_EXPORT std::vector<float > refine(const Action<NumberS>& A, const Action<NumberS>& M, const VectorRange<NumberS>& b, float tolerance = 1.0e-5 , int iterations = 20);
38 MYRAMATH_EXPORT std::vector<double> refine(const Action<NumberD>& A, const Action<NumberD>& M, const VectorRange<NumberD>& b, double tolerance = 1.0e-12, int iterations = 20);
39 MYRAMATH_EXPORT std::vector<float > refine(const Action<NumberC>& A, const Action<NumberC>& M, const VectorRange<NumberC>& b, float tolerance = 1.0e-5 , int iterations = 20);
40 MYRAMATH_EXPORT std::vector<double> refine(const Action<NumberZ>& A, const Action<NumberZ>& M, const VectorRange<NumberZ>& b, double tolerance = 1.0e-12, int iterations = 20);
41 
42 } // namespace myra
43 
44 #endif
Definition: syntax.dox:1
Various utility functions/classes related to scalar Number types.