minimum (Descriptive Statistics)


Import

#include <archr/stats/minimum.h>
#include <archr/stats/minimum.hpp>
import archr.stats
atomsLoads('archr')

Synopsis

 float archr_stats_minimum_f32(const float *first, size_t nbelem);
(1)
 double archr_stats_minimum_f64(const double *first, size_t nbelem);
(2)
 int8_t archr_stats_minimum_i8(const int8_t *first, size_t nbelem);
(3)
 int16_t archr_stats_minimum_i16(const int16_t *first, size_t nbelem);
(4)
 int32_t archr_stats_minimum_i32(const int32_t *first, size_t nbelem);
(5)
 int64_t archr_stats_minimum_i64(const int64_t *first, size_t nbelem);
(6)
 uint8_t archr_stats_minimum_u8(const uint8_t *first, size_t nbelem);
(7)
 uint16_t archr_stats_minimum_u16(const uint16_t *first, size_t nbelem);
(8)
 uint32_t archr_stats_minimum_u32(const uint32_t *first, size_t nbelem);
(9)
 uint64_t archr_stats_minimum_u64(const uint64_t *first, size_t nbelem);
(10)
 float minimum(const float *first, size_t nbelem);
(1)
 double minimum(const double *first, size_t nbelem);
(2)
 int8_t minimum(const int8_t *first, size_t nbelem);
(3)
 int16_t minimum(const int16_t *first, size_t nbelem);
(4)
 int32_t minimum(const int32_t *first, size_t nbelem);
(5)
 int64_t minimum(const int64_t *first, size_t nbelem);
(6)
 uint8_t minimum(const uint8_t *first, size_t nbelem);
(7)
 uint16_t minimum(const uint16_t *first, size_t nbelem);
(8)
 uint32_t minimum(const uint32_t *first, size_t nbelem);
(9)
 uint64_t minimum(const uint64_t *first, size_t nbelem);
(10)
 float minimum(const float *first, const float *last);
(11)
 double minimum(const double *first, const double *last);
(12)
 int8_t minimum(const int8_t *first, const int8_t *last);
(13)
 int16_t minimum(const int16_t *first, const int16_t *last);
(14)
 int32_t minimum(const int32_t *first, const int32_t *last);
(15)
 int64_t minimum(const int64_t *first, const int64_t *last);
(16)
 uint8_t minimum(const uint8_t *first, const uint8_t *last);
(17)
 uint16_t minimum(const uint16_t *first, const uint16_t *last);
(18)
 uint32_t minimum(const uint32_t *first, const uint32_t *last);
(19)
 uint64_t minimum(const uint64_t *first, const uint64_t *last);
(20)
template <typename Range> typename Range::value_type minimum(const Range& data);
(21)
subroutine archr_stats_minimum_f32(real(4) :: r, real(4), dimension(*), parameter :: first, integer(4) :: nbelem)
(1)
subroutine archr_stats_minimum_f64(real(8) :: r, real(8), dimension(*), parameter :: first, integer(4) :: nbelem)
(2)
subroutine archr_stats_minimum_i8(integer(1) :: r, integer(1), dimension(*), parameter :: first, integer(4) :: nbelem)
(3)
subroutine archr_stats_minimum_i16(integer(2) :: r, integer(2), dimension(*), parameter :: first, integer(4) :: nbelem)
(4)
subroutine archr_stats_minimum_i32(integer(4) :: r, integer(4), dimension(*), parameter :: first, integer(4) :: nbelem)
(5)
subroutine archr_stats_minimum_i64(integer(8) :: r, integer(8), dimension(*), parameter :: first, integer(4) :: nbelem)
(6)
subroutine archr_stats_minimum_u8(integer(1) :: r, integer(1), dimension(*), parameter :: first, integer(4) :: nbelem)
(7)
subroutine archr_stats_minimum_u16(integer(2) :: r, integer(2), dimension(*), parameter :: first, integer(4) :: nbelem)
(8)
subroutine archr_stats_minimum_u32(integer(4) :: r, integer(4), dimension(*), parameter :: first, integer(4) :: nbelem)
(9)
subroutine archr_stats_minimum_u64(integer(8) :: r, integer(8), dimension(*), parameter :: first, integer(4) :: nbelem)
(10)
def minimum(first):
    return r
(1)
function r = archr_stats_minimum(first)
(1)

Description

This function computes the minimum of the elements stored in:

Parameters

first

the beginning of the range of elements to process.

last

the end of the range of elements to process.

nbelem

the number of elements to process.

Return value

The minimum of the elements in the given range.

Example

#include <archr/stats/minimum.h>
#include <stdio.h>

int main()
{
 float v[] = {1,-2,3,-4,5,-6};

  printf("minimum(1,-2,3,-4,5,-6) = %f\n", archr_stats_minimum_f32(&v[0],6) );

  return 0;
}

Possible Output

minimum(1,-2,3,-4,5,-6) = -6.000000
minimum(1,-2,3,-4)      = -4.000000
#include <archr/stats/minimum.hpp>
#include <iostream>
#include <vector>

int main()
{
 std::vector<float> v{1,-2,3,-4,5,-6};

 std::cout << "minimum(1,-2,3,-4,5,-6) = " << archr::stats::minimum(v) << "\n";
 std::cout << "minimum(1,-2,3,-4,5)    = " << archr::stats::minimum(v.data(), 5) << "\n";
 std::cout << "minimum(1,-2,3)         = " << archr::stats::minimum(v.data(), v.data() + 3) << "\n";

  return 0;
}

Possible Output

minimum(1,-2,3,-4,5,-6) = -6
minimum(1,-2,3,-4,5)    = -4
minimum(1,-2,3)         = -2

Possible Output