Loading...
Searching...
No Matches
stats Module Reference

Definition

Provides methods to compute mean, standard deviation and variance of a given sample.

Examples

use benchmark_statistics
type(stats) :: s
integer :: i
real(r8) :: array(10)
do i = 1, 10
array(i) = real(i, r8)
end do
call s%compute(array)
write(*, '(A)') str(s%mean, '(f12.3)') // ' ms'//' +/- '//str(s%stddev, '(f12.3)') // ' ms'

Remarks

The statistics computed at the moment are limited to mean, min, max and standard deviations. The implementation is quite naive and serve only the purpose of the current library.

Constructors

Initializes a new instance of the stats class

stats(integer, real(r8), real(r8), real(r8))

type(stats) :: s 

Examples

use benchmark_statistics
type(stats) :: s

Remarks

Definition at line 48 of file Statistics.f90.


The documentation for this module was generated from the following file:

Variables

real(r8), public mean = 0.0_r8
 Mean value of the sample.
 
real(r8), public min = 0.0_r8
 Minimal value of the sample.
 
real(r8), public max = 0.0_r8
 Maximal value of the sample.
 
real(r8), public stddev = 0.0_r8
 Standard deviation of the sample.
 
real(r8), public variance = 0.0_r8
 Variance of the sample.
 

Methods

◆ compute()

procedure, pass(this) compute ( class(stats), intent(inout) this,
real(r8), dimension(:), intent(in) y )
Parameters
[in,out]thisbound argument
[in]ySample array

Examples

type(stats) :: s
integer :: i
real(r8) :: array(10)
call random_number(array)
call s%compute(array)

Remarks

Note
At the moment it only works for real(r8) arrays

Definition at line 60 of file Statistics.f90.