sciada_0.1.0_29e19539/src/sci-statistics.ads

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
-- --------------------------------------------------------------------
--  sci-statistics -- computation arround statistics
--  Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--  SPDX-License-Identifier: Apache-2.0
-----------------------------------------------------------------------
with Ada.Numerics.Generic_Elementary_Functions;

--  = Statistics =
--  To use the `Statistics` package, it is first necessary to instantiate
--  the `SCI.Statistics` package with a `Float_Type` used for the internal
--  computation.  This floating point type must have enough digits and allow
--  enough value ranges for proper statistics calculations.
--
--     package Double_Statistics is new SCI.Statistics (Double);
--
--  The `SCI.Statistics.Descriptive` package provides operations used by
--  descriptive statistics: min, max, mean, sum, deviation.  It must be
--  instantiated with the target floating point type that describe values,
--  an index type and an array type that describe the array of values.
--  For example:
--
--     type MyFloat is new Float range 0.0 .. 1_000.0;
--     type MyFloat_Array is array (Positive range <>) of MyFloat;
--     package MyFloat_Statistics is
--        new Double_Statistics.Descriptive (Value_Type => MyFloat,
--                                           Index_Type => Positive,
--                                           Array_Type => MyFloat_Array);
--
generic
   type Float_Type is digits <>;
package SCI.Statistics with Pure is

   package Functions is
      new Ada.Numerics.Generic_Elementary_Functions (Float_Type);

end SCI.Statistics;