test_get_standard_deviation Subroutine

public subroutine test_get_standard_deviation()

Arguments

None

Calls

proc~~test_get_standard_deviation~~CallsGraph proc~test_get_standard_deviation test_get_standard_deviation assertequal assertequal proc~test_get_standard_deviation->assertequal none~add_cycle~2 AdvancedMeter%add_cycle proc~test_get_standard_deviation->none~add_cycle~2 none~get_standard_deviation AdvancedMeter%get_standard_deviation proc~test_get_standard_deviation->none~get_standard_deviation none~reset~30 AdvancedMeter%reset proc~test_get_standard_deviation->none~reset~30 none~get_mean_cycle AdvancedMeter%get_mean_cycle none~add_cycle~2->none~get_mean_cycle none~get_num_cycles AdvancedMeter%get_num_cycles none~get_mean_cycle->none~get_num_cycles

Source Code

   subroutine test_get_standard_deviation()
      type (AdvancedMeter) :: t

      t = AdvancedMeter(MpiTimerGauge())
      call t%add_cycle(increment=1._REAL64)
      call t%add_cycle(increment=3._REAL64)
      @assertEqual(1., t%get_standard_deviation())

      call t%reset()
      call t%add_cycle(increment=1._REAL64)
      call t%add_cycle(increment=3._REAL64)
      @assertEqual(1., t%get_standard_deviation())

      call t%reset()
      call t%add_cycle(increment=7._REAL64 - 2)
      call t%add_cycle(increment=7._REAL64 - 1)
      call t%add_cycle(increment=7._REAL64 + 3)

      @assertEqual(sqrt(14._REAL64/3), t%get_standard_deviation())
      
   end subroutine test_get_standard_deviation