FLINT 0.9.9
Fortran Library for numerical INTegration of differential equations
Loading...
Searching...
No Matches
flintutils Module Reference

FLINTUtils Module. More...

Data Types

interface  func
 Interface of the function whose root needs to be computed. More...
 

Functions/Subroutines

subroutine root (a, b, ya, yb, tol, f, x, fx, niter, error)
 Subroutine for computing the root using Brent algorithm.
 
pure integer function, dimension(size(sortedx)) binarysearch (sortedx, sorteddataarray)
 Performs binary search on a provided sorted array.
 

Variables

integer, parameter, public flint_sp = real32
 By default, use 64-bit double precision (IEEE-754)
 
integer, parameter, public single
 
integer, parameter, public parameter
 
integer, parameter, public flint_dp = real64
 
integer, parameter, public double
 
integer, parameter, public flint_qp = real128
 
integer, parameter, public quadruple
 
integer, parameter, public flint_wp = FLINT_DP
 
real(wp), parameter, public flint_eps = epsilon(1.0_WP)
 Smallest positive real satisfying 1.0_WP + eps > 1.0_WP.
 
integer, parameter flint_rootfind_maxitr = 50
 Max iterations for the root-finding.
 

Detailed Description

FLINTUtils Module.

This module provides common utility functions.

Author
Bharat Mahajan
Date
Created: 04/25/2019
Module containing all the utility functions

Function/Subroutine Documentation

◆ binarysearch()

pure integer function, dimension(size(sortedx)) flintutils::binarysearch ( real(wp), dimension(1:), intent(in) sortedx,
real(wp), dimension(:), intent(in) sorteddataarray )

Performs binary search on a provided sorted array.

TBD

Parameters
[in]sortedxElement to find
[in]sorteddataarrayAscending-order sorted vector

Definition at line 214 of file FLINTUtils.F90.

References binarysearch().

Referenced by binarysearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ root()

subroutine flintutils::root ( real(wp), intent(in) a,
real(wp), intent(in) b,
real(wp), intent(in) ya,
real(wp), intent(in) yb,
real(wp), intent(in) tol,
procedure(func) f,
real(wp), intent(out) x,
real(wp), intent(out) fx,
integer, intent(out) niter,
integer, intent(out) error )

Subroutine for computing the root using Brent algorithm.

For details on the algorithm, see Numerical receipes in C book at https://www2.units.it/ipl/students_area/imm2/files/Numerical_Recipes.pdf

Parameters
[in]aLower bound on the root
[in]bUpper bound on the root
[in]yaf(a)
[in]ybf(b)
[in]toltolerance
ffunction
[out]xroot
[out]fxvalue at root
[out]niterno. of iterations
[out]errorerror status

Definition at line 69 of file FLINTUtils.F90.

References flint_eps, and flint_rootfind_maxitr.

Variable Documentation

◆ double

integer, parameter, public flintutils::double

Definition at line 33 of file FLINTUtils.F90.

◆ flint_dp

integer, parameter, public flintutils::flint_dp = real64

Definition at line 33 of file FLINTUtils.F90.

◆ flint_eps

real(wp), parameter, public flintutils::flint_eps = epsilon(1.0_WP)

Smallest positive real satisfying 1.0_WP + eps > 1.0_WP.

Definition at line 49 of file FLINTUtils.F90.

Referenced by root().

◆ flint_qp

integer, parameter, public flintutils::flint_qp = real128

Definition at line 34 of file FLINTUtils.F90.

◆ flint_rootfind_maxitr

integer, parameter flintutils::flint_rootfind_maxitr = 50

Max iterations for the root-finding.

Definition at line 52 of file FLINTUtils.F90.

Referenced by root().

◆ flint_sp

integer, parameter, public flintutils::flint_sp = real32

By default, use 64-bit double precision (IEEE-754)

Definition at line 32 of file FLINTUtils.F90.

◆ flint_wp

integer, parameter, public flintutils::flint_wp = FLINT_DP

Definition at line 42 of file FLINTUtils.F90.

◆ parameter

integer parameter public flintutils::parameter

Definition at line 32 of file FLINTUtils.F90.

◆ quadruple

integer, parameter, public flintutils::quadruple

Definition at line 34 of file FLINTUtils.F90.

◆ single

integer, parameter, public flintutils::single

Definition at line 32 of file FLINTUtils.F90.