maximum (Descriptive Statistics)


Import

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

Synopsis

 float archr_stats_maximum_f32(const float *first, size_t nbelem);
(1)
 double archr_stats_maximum_f64(const double *first, size_t nbelem);
(2)
 int8_t archr_stats_maximum_i8(const int8_t *first, size_t nbelem);
(3)
 int16_t archr_stats_maximum_i16(const int16_t *first, size_t nbelem);
(4)
 int32_t archr_stats_maximum_i32(const int32_t *first, size_t nbelem);
(5)
 int64_t archr_stats_maximum_i64(const int64_t *first, size_t nbelem);
(6)
 uint8_t archr_stats_maximum_u8(const uint8_t *first, size_t nbelem);
(7)
 uint16_t archr_stats_maximum_u16(const uint16_t *first, size_t nbelem);
(8)
 uint32_t archr_stats_maximum_u32(const uint32_t *first, size_t nbelem);
(9)
 uint64_t archr_stats_maximum_u64(const uint64_t *first, size_t nbelem);
(10)
 float maximum(const float *first, size_t nbelem);
(1)
 double maximum(const double *first, size_t nbelem);
(2)
 int8_t maximum(const int8_t *first, size_t nbelem);
(3)
 int16_t maximum(const int16_t *first, size_t nbelem);
(4)
 int32_t maximum(const int32_t *first, size_t nbelem);
(5)
 int64_t maximum(const int64_t *first, size_t nbelem);
(6)
 uint8_t maximum(const uint8_t *first, size_t nbelem);
(7)
 uint16_t maximum(const uint16_t *first, size_t nbelem);
(8)
 uint32_t maximum(const uint32_t *first, size_t nbelem);
(9)
 uint64_t maximum(const uint64_t *first, size_t nbelem);
(10)
 float maximum(const float *first, const float *last);
(11)
 double maximum(const double *first, const double *last);
(12)
 int8_t maximum(const int8_t *first, const int8_t *last);
(13)
 int16_t maximum(const int16_t *first, const int16_t *last);
(14)
 int32_t maximum(const int32_t *first, const int32_t *last);
(15)
 int64_t maximum(const int64_t *first, const int64_t *last);
(16)
 uint8_t maximum(const uint8_t *first, const uint8_t *last);
(17)
 uint16_t maximum(const uint16_t *first, const uint16_t *last);
(18)
 uint32_t maximum(const uint32_t *first, const uint32_t *last);
(19)
 uint64_t maximum(const uint64_t *first, const uint64_t *last);
(20)
template <typename Range> typename Range::value_type maximum(const Range& data);
(21)
subroutine archr_stats_maximum_f32(real(4) :: r, real(4), dimension(*), parameter :: first, integer(4) :: nbelem)
(1)
subroutine archr_stats_maximum_f64(real(8) :: r, real(8), dimension(*), parameter :: first, integer(4) :: nbelem)
(2)
subroutine archr_stats_maximum_i8(integer(1) :: r, integer(1), dimension(*), parameter :: first, integer(4) :: nbelem)
(3)
subroutine archr_stats_maximum_i16(integer(2) :: r, integer(2), dimension(*), parameter :: first, integer(4) :: nbelem)
(4)
subroutine archr_stats_maximum_i32(integer(4) :: r, integer(4), dimension(*), parameter :: first, integer(4) :: nbelem)
(5)
subroutine archr_stats_maximum_i64(integer(8) :: r, integer(8), dimension(*), parameter :: first, integer(4) :: nbelem)
(6)
subroutine archr_stats_maximum_u8(integer(1) :: r, integer(1), dimension(*), parameter :: first, integer(4) :: nbelem)
(7)
subroutine archr_stats_maximum_u16(integer(2) :: r, integer(2), dimension(*), parameter :: first, integer(4) :: nbelem)
(8)
subroutine archr_stats_maximum_u32(integer(4) :: r, integer(4), dimension(*), parameter :: first, integer(4) :: nbelem)
(9)
subroutine archr_stats_maximum_u64(integer(8) :: r, integer(8), dimension(*), parameter :: first, integer(4) :: nbelem)
(10)
def maximum(first):
    return r
(1)
function r = archr_stats_maximum(first)
(1)

Description

This function computes the maximum 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 maximum of the elements in the given range.

Example

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

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

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

  return 0;
}

Possible Output

maximum(1,-2,3,-4,5,-6) = 5.000000
maximum(1,-2,3,-4)      = 3.000000
#include <archr/stats/maximum.hpp>
#include <iostream>
#include <vector>

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

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

  return 0;
}

Possible Output

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

Possible Output