mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
use HTML5 img tag to resize images
This commit is contained in:
parent
d0e0a07f16
commit
82a6ea06e6
@ -18,11 +18,14 @@
|
|||||||
* ```
|
* ```
|
||||||
* Sample implementation results to compute approximate roots of the equation
|
* Sample implementation results to compute approximate roots of the equation
|
||||||
* \f$x^4-1=0\f$:\n
|
* \f$x^4-1=0\f$:\n
|
||||||
* ![Error
|
* <img
|
||||||
* evolution](https://raw.githubusercontent.com/kvedala/C-Plus-Plus/docs/images/numerical_methods/durand_kerner_error.svg)
|
* src="https://raw.githubusercontent.com/kvedala/C-Plus-Plus/docs/images/numerical_methods/durand_kerner_error.svg"
|
||||||
*
|
* width="400" alt="Error evolution during root approximations computed every
|
||||||
* ![Roots
|
* iteration."/> <img
|
||||||
* evolution](https://raw.githubusercontent.com/kvedala/C-Plus-Plus/docs/images/numerical_methods/durand_kerner_roots.svg)
|
* src="https://raw.githubusercontent.com/kvedala/C-Plus-Plus/docs/images/numerical_methods/durand_kerner_roots.svg"
|
||||||
|
* width="400" alt="Roots evolution - shows the initial approximation of the
|
||||||
|
* roots and their convergence to a final approximation along with the iterative
|
||||||
|
* approximations" />
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -52,7 +55,7 @@ std::complex<double> poly_function(const std::valarray<double> &coeffs,
|
|||||||
int n;
|
int n;
|
||||||
|
|
||||||
// #ifdef _OPENMP
|
// #ifdef _OPENMP
|
||||||
// #pragma omp parallel for reduction(+ : real, imag)
|
// #pragma omp target teams distribute reduction(+ : real, imag)
|
||||||
// #endif
|
// #endif
|
||||||
for (n = 0; n < coeffs.size(); n++) {
|
for (n = 0; n < coeffs.size(); n++) {
|
||||||
std::complex<double> tmp =
|
std::complex<double> tmp =
|
||||||
@ -132,7 +135,6 @@ std::pair<uint32_t, double> durand_kerner_algo(
|
|||||||
bool break_loop = false;
|
bool break_loop = false;
|
||||||
while (!check_termination(tol_condition) && iter < INT16_MAX &&
|
while (!check_termination(tol_condition) && iter < INT16_MAX &&
|
||||||
!break_loop) {
|
!break_loop) {
|
||||||
std::complex<double> delta = 0;
|
|
||||||
tol_condition = 0;
|
tol_condition = 0;
|
||||||
iter++;
|
iter++;
|
||||||
break_loop = false;
|
break_loop = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user