slatec-sys 0.1.0

Unsafe, provider-neutral Rust declarations for the reviewed SLATEC raw API
Documentation
# Purpose

This random number generator is portable among a wide variety of computers. It generates a random number between 0.0 and 1.0 accord- ing to the algorithm presented by Bays and Durham (TOMS, 2, 59, 1976). The motivation for using this scheme, which resembles the Maclaren-Marsaglia method, is to greatly increase the period of the random sequence. If the period of the basic generator (RAND) is P, then the expected mean period of the sequence generated by RUNIF is given by new mean P = SQRT (PI*FACTORIAL(N)/(8*P)), where FACTORIAL(N) must be much greater than P in this asymptotic formula. Generally, N should be around 32 if P=4.E6 as for RAND. Input Argument --

# Description

This canonical unsafe binding exposes original SLATEC routine `RUNIF`. Its documented behavior is taken from the selected, source-hash-verified provider prologue; the exact implementation source is [RUNIF](https://www.netlib.org/slatec/fnlib/runif.f).

# Arguments

## `T`

**Direction:** `input`. **Fortran type:** `REAL`. **Rust ABI type:** `*mut f32`. **Shape:** rank 1; dimensions (*).

an array of ABS(N)+1 random numbers from a previous invocation of RUNIF. Whenever N is positive and differs from the old N, the table is initialized. The first ABS(N) numbers are the table discussed in the reference, and the N+1 -st value is Y. This array may be saved in order to restart a sequence. Output Value -- RUNIF a random number between 0. 0 and 1.

## `N`

**Direction:** `input`. **Fortran type:** `INTEGER`. **Rust ABI type:** `*mut crate::FortranInteger`. **Shape:** scalar.

ABS(N) is the number of random numbers in an auxiliary table. Note though that ABS(N)+1 is the number of items in array T. If N is positive and differs from its value in the previous invocation, then the table is initialized for the new value of If N is negative, ABS(N) is the number of items in an auxiliary table, but the tables are now assumed already to be initialized. This option enables the user to save the table T at the end of a long computer run and to restart with the same sequence. Normally, RUNIF would be called at most once with negative N. Subsequent invocations would have N positive and of the correct magnitude.

# Return value

This Fortran function returns its scalar result using the compiler-validated ABI fingerprint `function:f32(mut_f32_ptr_rank1,mut_i32)`. It has no separate Rust `Result` status channel.

# Workspace and array requirements

- `T`: not a workspace argument

# ABI notes

- Canonical Rust path: `slatec_sys::statistics::runif`
- Original SLATEC routine: `RUNIF`
- Native symbol: `runif_`
- ABI fingerprint: `function:f32(mut_f32_ptr_rank1,mut_i32)`
- Exact Netlib source file: [RUNIF](https://www.netlib.org/slatec/fnlib/runif.f)

# Safety

Every raw pointer must be non-null unless this argument contract expressly permits null, correctly aligned, and valid for its documented readable or writable extent. Preserve Fortran column-major layout, length, leading-dimension, workspace, callback-lifetime, aliasing, and provider-runtime requirements. The native routine does not retain ordinary argument pointers beyond this call.