@stdlib/strided-base-unary
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published
About stdlib...

We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.

The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.

When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.

To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!

Unary

NPM version Build Status Coverage Status

Apply a unary callback to elements in a strided input array and assign results to elements in a strided output array.

Installation

npm install @stdlib/strided-base-unary

Usage

var unary = require( '@stdlib/strided-base-unary' );

unary( arrays, shape, strides, fcn )

Applies a unary callback to elements in a strided input array and assigns results to elements in a strided output array.

var Float64Array = require( '@stdlib/array-float64' );
var abs = require( '@stdlib/math-base-special-abs' );

var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );

// Compute the absolute values in-place:
unary( [ x, x ], [ x.length ], [ 1, 1 ], abs );
// x => <Float64Array>[ 2.0, 1.0, 3.0, 5.0, 4.0, 0.0, 1.0, 3.0 ]

The function accepts the following arguments:

  • arrays: array-like object containing one strided input array and one strided output array.
  • shape: array-like object containing a single element, the number of indexed elements.
  • strides: array-like object containing the stride lengths for the strided input and output arrays.
  • fcn: unary function to apply.

The shape and strides parameters determine which elements in the strided input and output arrays are accessed at runtime. For example, to index every other value in the strided input array and to index the first N elements of the strided output array in reverse order,

var Float64Array = require( '@stdlib/array-float64' );
var abs = require( '@stdlib/math-base-special-abs' );

var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] );
var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );

var N = 3;

unary( [ x, y ], [ N ], [ 2, -1 ], abs );
// y => <Float64Array>[ 5.0, 3.0, 1.0, 0.0, 0.0, 0.0 ]

Note that indexing is relative to the first index. To introduce an offset, use typed array views.

var Float64Array = require( '@stdlib/array-float64' );
var abs = require( '@stdlib/math-base-special-abs' );

// Initial arrays...
var x0 = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] );
var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );

// Create offset views...
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element

var N = 3;

unary( [ x1, y1 ], [ N ], [ -2, 1 ], abs );
// y0 => <Float64Array>[ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ]

unary.ndarray( arrays, shape, strides, offsets, fcn )

Applies a unary callback to elements in a strided input array and assigns results to elements in a strided output array using alternative indexing semantics.

var Float64Array = require( '@stdlib/array-float64' );
var abs = require( '@stdlib/math-base-special-abs' );

var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] );
var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] );

unary.ndarray( [ x, y ], [ x.length ], [ 1, 1 ], [ 0, 0 ], abs );
// y => <Float64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]

The function accepts the following additional arguments:

  • offsets: array-like object containing the starting indices (i.e., index offsets) for the strided input and output arrays.

While typed array views mandate a view offset based on the underlying buffer, the offsets parameter supports indexing semantics based on starting indices. For example, to index every other value in the strided input array starting from the second value and to index the last N elements in the strided output array,

var Float64Array = require( '@stdlib/array-float64' );
var abs = require( '@stdlib/math-base-special-abs' );

var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0, -6.0 ] );
var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );

var N = 3;

unary.ndarray( [ x, y ], [ N ], [ 2, -1 ], [ 1, y.length-1 ], abs );
// y => <Float64Array>[ 0.0, 0.0, 0.0, 6.0, 4.0, 2.0 ]

Examples

var discreteUniform = require( '@stdlib/random-base-discrete-uniform' ).factory;
var filledarray = require( '@stdlib/array-filled' );
var filledarrayBy = require( '@stdlib/array-filled-by' );
var unary = require( '@stdlib/strided-base-unary' );

function add10( x ) {
    return x + 10;
}

var N = 10;

var x = filledarrayBy( N, 'generic', discreteUniform( -100, 100 ) );
console.log( x );

var y = filledarray( 0.0, N, 'generic' );
console.log( y );

var shape = [ N ];
var strides = [ 1, -1 ];
var offsets = [ 0, N-1 ];

unary.ndarray( [ x, y ], shape, strides, offsets, add10 );
console.log( y );

C APIs

Character codes for data types:

  • c: complex64 (single-precision floating-point complex number).
  • z: complex128 (double-precision floating-point complex number).
  • f: float32 (single-precision floating-point number).
  • d: float64 (double-precision floating-point number).
  • k: int16 (signed 16-bit integer).
  • i: int32 (signed 32-bit integer).
  • s: int8 (signed 8-bit integer).
  • t: uint16 (unsigned 16-bit integer).
  • u: uint32 (unsigned 32-bit integer).
  • b: uint8 (unsigned 8-bit integer).

Function name suffix naming convention:

stdlib_strided_<input_data_type>_<output_data_type>[_as_<callback_arg_data_type>_<callback_return_data_type>]

For example,

void stdlib_strided_d_d(...) {...}

is a function which accepts one double-precision floating-point strided input array and one double-precision floating-point strided output array. In other words, the suffix encodes the function type signature.

To support callbacks whose input arguments and/or return values are of a different data type than the strided input and/or output array data types, the naming convention supports appending an as suffix. For example,

void stdlib_strided_f_f_as_d_d(...) {...}

is a function which accepts one single-precision floating-point strided input array and one single-precision floating-point strided output array. However, the callback accepts and returns double-precision floating-point numbers. Accordingly, the input and output values need to be cast using the following conversion sequence

// Convert each input array element to double-precision:
double in1 = (double)x[ i ];

// Evaluate the callback:
double out = f( in1 );

// Convert the callback return value to single-precision:
y[ i ] = (float)out;

When the strided input array and the callback (i.e., the input argument and return value) share the same data type, the as suffix can be omitted. For example,

void stdlib_strided_f_d(...) {...}

is a function which accepts one single-precision floating-point strided input array and one double-precision floating-point strided output array. The callback is assumed to accept and return single-precision floating-point numbers. Accordingly, the input and output values are cast according to the following conversion sequence

// Retrieve each input array element as single-precision:
float in1 = (float)x[ i ];

// Evaluate the callback:
float out = f( in1 );

// Convert the callback return value to double-precision:
y[ i ] = (double)out;

Usage

#include "stdlib/strided/base/unary.h"

stdlib_strided_b_b( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 1 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint8_t fcn( uint8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_b( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint8_t (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_b( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_b_as_u_u( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 1 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint32_t fcn( uint32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_b_as_u_u( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint32_t (*f)(uint32_t) function to apply provided as a void pointer.
void stdlib_strided_b_b_as_u_u( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_c( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint8_t fcn( uint8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_c( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint8_t (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_c( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_c_as_b_c( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float32.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex64_t fcn( uint8_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_b_c_as_b_c( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex64_t (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_c_as_b_c( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_c_as_c_c( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float32.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex64_t fcn( stdlib_complex64_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_b_c_as_c_c( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex64_t (*f)(stdlib_complex64_t) function to apply provided as a void pointer.
void stdlib_strided_b_c_as_c_c( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_c_as_z_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_b_c_as_z_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_b_c_as_z_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint8_t fcn( uint8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint8_t (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_d_as_b_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( uint8_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_b_d_as_b_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_d_as_b_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_d_as_d_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( double x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_d_as_d_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(double) function to apply provided as a void pointer.
void stdlib_strided_b_d_as_d_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_f( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint8_t fcn( uint8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_f( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint8_t (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_f( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_f_as_b_f( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static float fcn( uint8_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_b_f_as_b_f( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a float (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_f_as_b_f( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_f_as_d_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( double x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_f_as_d_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(double) function to apply provided as a void pointer.
void stdlib_strided_b_f_as_d_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_f_as_f_f( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static float fcn( float x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_f_as_f_f( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a float (*f)(float) function to apply provided as a void pointer.
void stdlib_strided_b_f_as_f_f( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint8_t fcn( uint8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint8_t (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_i_as_b_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( uint8_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_b_i_as_b_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_i_as_b_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_i_as_i_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_i_as_i_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_b_i_as_i_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_k( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint8_t fcn( uint8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_k( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint8_t (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_k( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_k_as_b_k( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int16_t fcn( uint8_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_b_k_as_b_k( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int16_t (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_k_as_b_k( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_k_as_i_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_k_as_i_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_b_k_as_i_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_k_as_k_k( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int16_t fcn( int16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_k_as_k_k( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int16_t (*f)(int16_t) function to apply provided as a void pointer.
void stdlib_strided_b_k_as_k_k( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_t( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint8_t fcn( uint8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_t( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint8_t (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_t( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_t_as_b_t( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint16_t fcn( uint8_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_b_t_as_b_t( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint16_t (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_t_as_b_t( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_t_as_t_t( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint16_t fcn( uint16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_t_as_t_t( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint16_t (*f)(uint16_t) function to apply provided as a void pointer.
void stdlib_strided_b_t_as_t_t( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_t_as_u_u( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint32_t fcn( uint32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_t_as_u_u( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint32_t (*f)(uint32_t) function to apply provided as a void pointer.
void stdlib_strided_b_t_as_u_u( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_u( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint8_t fcn( uint8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_u( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint8_t (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_u( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_u_as_b_u( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint32_t fcn( uint8_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_b_u_as_b_u( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint32_t (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_u_as_b_u( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_u_as_u_u( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint32_t fcn( uint32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_u_as_u_u( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint32_t (*f)(uint32_t) function to apply provided as a void pointer.
void stdlib_strided_b_u_as_u_u( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint8_t fcn( uint8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_b_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint8_t (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_z_as_b_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( uint8_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_b_z_as_b_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(uint8_t) function to apply provided as a void pointer.
void stdlib_strided_b_z_as_b_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_b_z_as_z_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_b_z_as_z_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_b_z_as_z_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_c_c( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float32.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 8, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex64_t fcn( stdlib_complex64_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_c_c( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex64_t (*f)(stdlib_complex64_t) function to apply provided as a void pointer.
void stdlib_strided_c_c( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_c_c_as_z_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 8, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_c_c_as_z_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_c_c_as_z_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_c_f_as_c_f( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float32.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 8, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static float fcn( stdlib_complex64_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_c_f_as_c_f( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a float (*f)(stdlib_complex64_t) function to apply provided as a void pointer.
void stdlib_strided_c_f_as_c_f( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_c_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float32.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 8, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex64_t fcn( stdlib_complex64_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_c_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex64_t (*f)(stdlib_complex64_t) function to apply provided as a void pointer.
void stdlib_strided_c_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_c_z_as_c_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float32.h"
#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 8, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex64_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_c_z_as_c_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex64_t) function to apply provided as a void pointer.
void stdlib_strided_c_z_as_c_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_c_z_as_z_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 8, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_c_z_as_z_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_c_z_as_z_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_d_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 8, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( double x ) {
    return x;
}

// Apply the callback:
stdlib_strided_d_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(double) function to apply provided as a void pointer.
void stdlib_strided_d_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_d_i_as_d_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 8, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( double x ) {
    // ...
}

// Apply the callback:
stdlib_strided_d_i_as_d_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(double) function to apply provided as a void pointer.
void stdlib_strided_d_i_as_d_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_d_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 8, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( double x ) {
    return x;
}

// Apply the callback:
stdlib_strided_d_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(double) function to apply provided as a void pointer.
void stdlib_strided_d_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_d_z_as_d_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 8, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( double x ) {
    // ...
}

// Apply the callback:
stdlib_strided_d_z_as_d_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(double) function to apply provided as a void pointer.
void stdlib_strided_d_z_as_d_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_d_z_as_z_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 8, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_d_z_as_z_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_d_z_as_z_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_f_c( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static float fcn( float x ) {
    return x;
}

// Apply the callback:
stdlib_strided_f_c( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a float (*f)(float) function to apply provided as a void pointer.
void stdlib_strided_f_c( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_f_c_as_c_c( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float32.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex64_t fcn( stdlib_complex64_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_f_c_as_c_c( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex64_t (*f)(stdlib_complex64_t) function to apply provided as a void pointer.
void stdlib_strided_f_c_as_c_c( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_f_c_as_f_c( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float32.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex64_t fcn( float x ) {
    // ...
}

// Apply the callback:
stdlib_strided_f_c_as_f_c( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex64_t (*f)(float) function to apply provided as a void pointer.
void stdlib_strided_f_c_as_f_c( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_f_c_as_z_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_f_c_as_z_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_f_c_as_z_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_f_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static float fcn( float x ) {
    return x;
}

// Apply the callback:
stdlib_strided_f_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a float (*f)(float) function to apply provided as a void pointer.
void stdlib_strided_f_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_f_d_as_d_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( double x ) {
    return x;
}

// Apply the callback:
stdlib_strided_f_d_as_d_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(double) function to apply provided as a void pointer.
void stdlib_strided_f_d_as_d_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_f_d_as_f_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( float x ) {
    // ...
}

// Apply the callback:
stdlib_strided_f_d_as_f_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(float) function to apply provided as a void pointer.
void stdlib_strided_f_d_as_f_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_f_f( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static float fcn( float x ) {
    return x;
}

// Apply the callback:
stdlib_strided_f_f( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a float (*f)(float) function to apply provided as a void pointer.
void stdlib_strided_f_f( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_f_f_as_d_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( double x ) {
    return x;
}

// Apply the callback:
stdlib_strided_f_f_as_d_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(double) function to apply provided as a void pointer.
void stdlib_strided_f_f_as_d_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_f_i_as_f_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( float x ) {
    // ...
}

// Apply the callback:
stdlib_strided_f_i_as_f_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(float) function to apply provided as a void pointer.
void stdlib_strided_f_i_as_f_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_f_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static float fcn( float x ) {
    return x;
}

// Apply the callback:
stdlib_strided_f_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a float (*f)(float) function to apply provided as a void pointer.
void stdlib_strided_f_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_f_z_as_f_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( float x ) {
    // ...
}

// Apply the callback:
stdlib_strided_f_z_as_f_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(float) function to apply provided as a void pointer.
void stdlib_strided_f_z_as_f_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_f_z_as_z_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_f_z_as_z_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_f_z_as_z_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_i_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_i_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_i_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_i_d_as_d_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( double x ) {
    return x;
}

// Apply the callback:
stdlib_strided_i_d_as_d_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(double) function to apply provided as a void pointer.
void stdlib_strided_i_d_as_d_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_i_d_as_i_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( int32_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_i_d_as_i_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_i_d_as_i_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_i_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_i_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_i_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_i_u( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_i_u( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_i_u( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_i_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_i_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_i_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_i_z_as_i_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( int32_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_i_z_as_i_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_i_z_as_i_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_i_z_as_z_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_i_z_as_z_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_i_z_as_z_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_c( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int16_t fcn( int16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_k_c( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int16_t (*f)(int16_t) function to apply provided as a void pointer.
void stdlib_strided_k_c( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_c_as_c_c( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float32.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex64_t fcn( stdlib_complex64_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_k_c_as_c_c( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex64_t (*f)(stdlib_complex64_t) function to apply provided as a void pointer.
void stdlib_strided_k_c_as_c_c( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_c_as_k_c( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float32.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex64_t fcn( int16_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_k_c_as_k_c( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex64_t (*f)(int16_t) function to apply provided as a void pointer.
void stdlib_strided_k_c_as_k_c( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_c_as_z_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_k_c_as_z_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_k_c_as_z_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int16_t fcn( int16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_k_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int16_t (*f)(int16_t) function to apply provided as a void pointer.
void stdlib_strided_k_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_d_as_d_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( double x ) {
    return x;
}

// Apply the callback:
stdlib_strided_k_d_as_d_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(double) function to apply provided as a void pointer.
void stdlib_strided_k_d_as_d_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_d_as_k_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( int16_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_k_d_as_k_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(int16_t) function to apply provided as a void pointer.
void stdlib_strided_k_d_as_k_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_f( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int16_t fcn( int16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_k_f( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int16_t (*f)(int16_t) function to apply provided as a void pointer.
void stdlib_strided_k_f( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_f_as_d_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( double x ) {
    return x;
}

// Apply the callback:
stdlib_strided_k_f_as_d_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(double) function to apply provided as a void pointer.
void stdlib_strided_k_f_as_d_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_f_as_f_f( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static float fcn( float x ) {
    return x;
}

// Apply the callback:
stdlib_strided_k_f_as_f_f( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a float (*f)(float) function to apply provided as a void pointer.
void stdlib_strided_k_f_as_f_f( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_f_as_k_f( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static float fcn( int16_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_k_f_as_k_f( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a float (*f)(int16_t) function to apply provided as a void pointer.
void stdlib_strided_k_f_as_k_f( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int16_t fcn( int16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_k_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int16_t (*f)(int16_t) function to apply provided as a void pointer.
void stdlib_strided_k_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_i_as_i_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_k_i_as_i_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_k_i_as_i_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_i_as_k_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int16_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_k_i_as_k_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int16_t) function to apply provided as a void pointer.
void stdlib_strided_k_i_as_k_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_k( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int16_t fcn( int16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_k_k( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int16_t (*f)(int16_t) function to apply provided as a void pointer.
void stdlib_strided_k_k( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_k_as_i_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_k_k_as_i_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_k_k_as_i_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_t( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int16_t fcn( int16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_k_t( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int16_t (*f)(int16_t) function to apply provided as a void pointer.
void stdlib_strided_k_t( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_t_as_i_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_k_t_as_i_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_k_t_as_i_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_u( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int16_t fcn( int16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_k_u( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int16_t (*f)(int16_t) function to apply provided as a void pointer.
void stdlib_strided_k_u( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_u_as_i_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_k_u_as_i_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_k_u_as_i_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int16_t fcn( int16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_k_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int16_t (*f)(int16_t) function to apply provided as a void pointer.
void stdlib_strided_k_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_z_as_k_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( int16_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_k_z_as_k_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(int16_t) function to apply provided as a void pointer.
void stdlib_strided_k_z_as_k_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_k_z_as_z_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_k_z_as_z_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_k_z_as_z_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_b( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 1 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int8_t fcn( int8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_b( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int8_t (*f)(int8_t) function to apply provided as a void pointer.
void stdlib_strided_s_b( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_c( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int8_t fcn( int8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_c( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int8_t (*f)(int8_t) function to apply provided as a void pointer.
void stdlib_strided_s_c( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_c_as_c_c( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float32.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex64_t fcn( stdlib_complex64_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_s_c_as_c_c( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex64_t (*f)(stdlib_complex64_t) function to apply provided as a void pointer.
void stdlib_strided_s_c_as_c_c( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_c_as_s_c( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float32.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex64_t fcn( int8_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_s_c_as_s_c( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex64_t (*f)(int8_t) function to apply provided as a void pointer.
void stdlib_strided_s_c_as_s_c( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_c_as_z_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_s_c_as_z_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_s_c_as_z_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int8_t fcn( int8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int8_t (*f)(int8_t) function to apply provided as a void pointer.
void stdlib_strided_s_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_d_as_d_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( double x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_d_as_d_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(double) function to apply provided as a void pointer.
void stdlib_strided_s_d_as_d_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_d_as_s_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( int8_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_s_d_as_s_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(int8_t) function to apply provided as a void pointer.
void stdlib_strided_s_d_as_s_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_f( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int8_t fcn( int8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_f( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int8_t (*f)(int8_t) function to apply provided as a void pointer.
void stdlib_strided_s_f( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_f_as_d_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( double x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_f_as_d_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(double) function to apply provided as a void pointer.
void stdlib_strided_s_f_as_d_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_f_as_f_f( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static float fcn( float x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_f_as_f_f( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a float (*f)(float) function to apply provided as a void pointer.
void stdlib_strided_s_f_as_f_f( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_f_as_s_f( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static float fcn( int8_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_s_f_as_s_f( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a float (*f)(int8_t) function to apply provided as a void pointer.
void stdlib_strided_s_f_as_s_f( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int8_t fcn( int8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int8_t (*f)(int8_t) function to apply provided as a void pointer.
void stdlib_strided_s_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_i_as_i_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_i_as_i_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_s_i_as_i_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_i_as_s_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int8_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_s_i_as_s_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int8_t) function to apply provided as a void pointer.
void stdlib_strided_s_i_as_s_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_k( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int8_t fcn( int8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_k( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int8_t (*f)(int8_t) function to apply provided as a void pointer.
void stdlib_strided_s_k( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_k_as_i_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_k_as_i_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_s_k_as_i_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_k_as_k_k( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int16_t fcn( int16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_k_as_k_k( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int16_t (*f)(int16_t) function to apply provided as a void pointer.
void stdlib_strided_s_k_as_k_k( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_k_as_s_k( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int16_t fcn( int8_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_s_k_as_s_k( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int16_t (*f)(int8_t) function to apply provided as a void pointer.
void stdlib_strided_s_k_as_s_k( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_s( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 1 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int8_t fcn( int8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_s( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int8_t (*f)(int8_t) function to apply provided as a void pointer.
void stdlib_strided_s_s( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_s_as_i_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 1 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_s_as_i_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_s_s_as_i_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_t( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int8_t fcn( int8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_t( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int8_t (*f)(int8_t) function to apply provided as a void pointer.
void stdlib_strided_s_t( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_t_as_i_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_t_as_i_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_s_t_as_i_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_u( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int8_t fcn( int8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_u( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int8_t (*f)(int8_t) function to apply provided as a void pointer.
void stdlib_strided_s_u( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_u_as_i_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_u_as_i_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_s_u_as_i_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int8_t fcn( int8_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_s_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int8_t (*f)(int8_t) function to apply provided as a void pointer.
void stdlib_strided_s_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_z_as_s_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( int8_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_s_z_as_s_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(int8_t) function to apply provided as a void pointer.
void stdlib_strided_s_z_as_s_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_s_z_as_z_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 1, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_s_z_as_z_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_s_z_as_z_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_c( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint16_t fcn( uint16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_t_c( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint16_t (*f)(uint16_t) function to apply provided as a void pointer.
void stdlib_strided_t_c( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_c_as_c_c( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float32.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex64_t fcn( stdlib_complex64_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_t_c_as_c_c( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex64_t (*f)(stdlib_complex64_t) function to apply provided as a void pointer.
void stdlib_strided_t_c_as_c_c( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_c_as_t_c( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float32.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex64_t fcn( uint16_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_t_c_as_t_c( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex64_t (*f)(uint16_t) function to apply provided as a void pointer.
void stdlib_strided_t_c_as_t_c( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_c_as_z_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_t_c_as_z_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_t_c_as_z_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint16_t fcn( uint16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_t_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint16_t (*f)(uint16_t) function to apply provided as a void pointer.
void stdlib_strided_t_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_d_as_d_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( double x ) {
    return x;
}

// Apply the callback:
stdlib_strided_t_d_as_d_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(double) function to apply provided as a void pointer.
void stdlib_strided_t_d_as_d_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_d_as_t_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( uint16_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_t_d_as_t_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(uint16_t) function to apply provided as a void pointer.
void stdlib_strided_t_d_as_t_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_f( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint16_t fcn( uint16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_t_f( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint16_t (*f)(uint16_t) function to apply provided as a void pointer.
void stdlib_strided_t_f( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_f_as_d_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( double x ) {
    return x;
}

// Apply the callback:
stdlib_strided_t_f_as_d_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(double) function to apply provided as a void pointer.
void stdlib_strided_t_f_as_d_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_f_as_f_f( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static float fcn( float x ) {
    return x;
}

// Apply the callback:
stdlib_strided_t_f_as_f_f( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a float (*f)(float) function to apply provided as a void pointer.
void stdlib_strided_t_f_as_f_f( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_f_as_t_f( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static float fcn( uint16_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_t_f_as_t_f( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a float (*f)(uint16_t) function to apply provided as a void pointer.
void stdlib_strided_t_f_as_t_f( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint16_t fcn( uint16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_t_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint16_t (*f)(uint16_t) function to apply provided as a void pointer.
void stdlib_strided_t_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_i_as_i_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( int32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_t_i_as_i_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(int32_t) function to apply provided as a void pointer.
void stdlib_strided_t_i_as_i_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_i_as_t_i( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static int32_t fcn( uint16_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_t_i_as_t_i( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a int32_t (*f)(uint16_t) function to apply provided as a void pointer.
void stdlib_strided_t_i_as_t_i( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_t( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint16_t fcn( uint16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_t_t( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint16_t (*f)(uint16_t) function to apply provided as a void pointer.
void stdlib_strided_t_t( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_t_as_u_u( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 2 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint32_t fcn( uint32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_t_t_as_u_u( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint32_t (*f)(uint32_t) function to apply provided as a void pointer.
void stdlib_strided_t_t_as_u_u( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_u( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint16_t fcn( uint16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_t_u( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint16_t (*f)(uint16_t) function to apply provided as a void pointer.
void stdlib_strided_t_u( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_u_as_t_u( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint32_t fcn( uint16_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_t_u_as_t_u( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint32_t (*f)(uint16_t) function to apply provided as a void pointer.
void stdlib_strided_t_u_as_t_u( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_u_as_u_u( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint32_t fcn( uint32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_t_u_as_u_u( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint32_t (*f)(uint32_t) function to apply provided as a void pointer.
void stdlib_strided_t_u_as_u_u( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint16_t fcn( uint16_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_t_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint16_t (*f)(uint16_t) function to apply provided as a void pointer.
void stdlib_strided_t_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_z_as_t_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( uint16_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_t_z_as_t_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(uint16_t) function to apply provided as a void pointer.
void stdlib_strided_t_z_as_t_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_t_z_as_z_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 2, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_t_z_as_z_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_t_z_as_z_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_u_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint32_t fcn( uint32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_u_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint32_t (*f)(uint32_t) function to apply provided as a void pointer.
void stdlib_strided_u_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_u_d_as_d_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( double x ) {
    return x;
}

// Apply the callback:
stdlib_strided_u_d_as_d_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(double) function to apply provided as a void pointer.
void stdlib_strided_u_d_as_d_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_u_d_as_u_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( uint32_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_u_d_as_u_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(uint32_t) function to apply provided as a void pointer.
void stdlib_strided_u_d_as_u_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_u_u( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 4 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint32_t fcn( uint32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_u_u( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint32_t (*f)(uint32_t) function to apply provided as a void pointer.
void stdlib_strided_u_u( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_u_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static uint32_t fcn( uint32_t x ) {
    return x;
}

// Apply the callback:
stdlib_strided_u_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a uint32_t (*f)(uint32_t) function to apply provided as a void pointer.
void stdlib_strided_u_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_u_z_as_u_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( uint32_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_u_z_as_u_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(uint32_t) function to apply provided as a void pointer.
void stdlib_strided_u_z_as_u_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_u_z_as_z_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 4, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_u_z_as_z_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_u_z_as_z_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_z_d_as_z_d( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 16, 8 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static double fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_z_d_as_z_d( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a double (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_z_d_as_z_d( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

stdlib_strided_z_z( *arrays[], *shape, *strides, *fcn )

Applies a unary callback to strided input array elements and assigns results to elements in a strided output array.

#include "stdlib/complex/float64.h"
#include <stdint.h>

// Create underlying byte arrays:
uint8_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

// Define a pointer to an array containing pointers to strided arrays:
uint8_t *arrays[] = { x, out };

// Define the strides:
int64_t strides[] = { 16, 16 };

// Define the number of elements over which to iterate:
int64_t shape[] = { 3 };

// Define a callback:
static stdlib_complex128_t fcn( stdlib_complex128_t x ) {
    // ...
}

// Apply the callback:
stdlib_strided_z_z( arrays, shape, strides, (void *)fcn );

The function accepts the following arguments:

  • arrays: [inout] uint8_t** array whose first element is a pointer to a strided input array and whose second element is a pointer to a strided output array.
  • shape: [in] int64_t* array whose only element is the number of elements over which to iterate.
  • strides: [in] int64_t* array containing strides (in bytes) for each strided array.
  • fcn: [in] void* a stdlib_complex128_t (*f)(stdlib_complex128_t) function to apply provided as a void pointer.
void stdlib_strided_z_z( uint8_t *arrays[], const int64_t *shape, const int64_t *strides, void *fcn );

STDLIB_STRIDED_UNARY_LOOP_PREAMBLE

Macro containing the preamble for a loop which operates on strided array elements.

STDLIB_STRIDED_UNARY_LOOP_PREMABLE {
    // Loop body...
}

The macro expects the following variables to be defined:

  • arrays: uint8_t** array whose first element is a pointer to a strided input array and whose last element is a pointer to a strided output array.
  • shape: int64_t* array whose only element is the number of elements over which to iterate.
  • strides: int64_t* array containing strides (in bytes) for each strided array.

The macro defines the following variables:

  • ip1: uint8_t* pointer to the first indexed element of the input strided array.
  • op1: uint8_t* pointer to the first indexed element of the output strided array.
  • is1: int64_t index increment for the input strided array.
  • os1: int64_t index increment for the output strided array.
  • n: int64_t number of indexed elements.
  • i: int64_t loop counter.
#define STDLIB_STRIDED_UNARY_LOOP_PREAMBLE                 \
    uint8_t *ip1 = arrays[ 0 ];                            \
    uint8_t *op1 = arrays[ 1 ];                            \
    int64_t is1 = strides[ 0 ];                            \
    int64_t os1 = strides[ 1 ];                            \
    int64_t n = shape[ 0 ];                                \
    int64_t i;                                             \
    if ( n <= 0 ) {                                        \
        return;                                            \
    }                                                      \
    if ( is1 < 0 ) {                                       \
        ip1 += (1-n) * is1;                                \
    }                                                      \
    if ( os1 < 0 ) {                                       \
        op1 += (1-n) * os1;                                \
    }                                                      \
    for ( i = 0; i < n; i++, ip1 += is1, op1 += os1 )

STDLIB_STRIDED_UNARY_LOOP_TWO_OUT_PREAMBLE

Macro containing the preamble for a loop which operates on strided array elements and updates two strided output arrays.

STDLIB_STRIDED_UNARY_LOOP_TWO_OUT_PREAMBLE {
    // Loop body...
}

The macro expects the following variables to be defined:

  • arrays: uint8_t** array whose first element is a pointer to a strided input array and whose last two elements are pointers to strided output arrays.
  • shape: int64_t* array whose only element is the number of elements over which to iterate.
  • strides: int64_t* array containing strides (in bytes) for each strided array.

The macro defines the following variables:

  • ip1: uint8_t* pointer to the first indexed element of the input strided array.
  • op1: uint8_t* pointer to the first indexed element of the first output strided array.
  • op2: uint8_t* pointer to the first indexed element of the second output strided array.
  • is1: int64_t index increment for the input strided array.
  • os1: int64_t index increment for the first output strided array.
  • os2: int64_t index increment for the second output strided array.
  • n: int64_t number of indexed elements.
  • i: int64_t loop counter.
#define STDLIB_STRIDED_UNARY_LOOP_TWO_OUT_PREAMBLE         \
    uint8_t *ip1 = arrays[ 0 ];                            \
    uint8_t *op1 = arrays[ 1 ];                            \
    uint8_t *op2 = arrays[ 2 ];                            \
    int64_t is1 = strides[ 0 ];                            \
    int64_t os1 = strides[ 1 ];                            \
    int64_t os2 = strides[ 2 ];                            \
    int64_t n = shape[ 0 ];                                \
    int64_t i;                                             \
    if ( n <= 0 ) {                                        \
        return;                                            \
    }                                                      \
    if ( is1 < 0 ) {                                       \
        ip1 += (1-n) * is1;                                \
    }                                                      \
    if ( os1 < 0 ) {                                       \
        op1 += (1-n) * os1;                                \
    }                                                      \
    if ( os2 < 0 ) {                                       \
        op2 += (1-n) * os2;                                \
    }                                                      \
    for ( i = 0; i < n; i++, ip1 += os1, op1 += os1, op2 += os2 )

STDLIB_STRIDED_UNARY_LOOP_INLINE( tin, tout, expr )

Macro for a unary loop which inlines an expression.

STDLIB_STRIDED_UNARY_LOOP_INLINE( double, double, *out = in1 * in1 )

The macro expects the following arguments:

  • tin: input strided array element type.
  • tout: output strided array element type.
  • expr: expression to inline.

In addition to the variables defined by the STDLIB_STRIDED_UNARY_LOOP_PREAMBLE macro, the macro defines the following variables:

  • in1: <tin> input strided array element.
  • out: <tout>* pointer to an output strided array element.

The macro expects a provided expression to operate on in1 and to store the result via *out.

#define STDLIB_STRIDED_UNARY_LOOP_INLINE( tin, tout, expr )        \
    STDLIB_STRIDED_UNARY_LOOP_PREAMBLE {                           \
        const tin in1 = *(tin *)ip1;                               \
        tout *out = (tout *)op1;                                   \
        expr;                                                      \
    }

STDLIB_STRIDED_UNARY_LOOP_CLBK( tin, tout )

Macro for a unary loop which invokes a callback.

STDLIB_STRIDED_UNARY_LOOP_CLBK( double, double )

The macro expects the following arguments:

  • tin: input strided array element data type.
  • tout: output strided array element data type.

In addition to the variables expected by STDLIB_STRIDED_UNARY_LOOP_PREAMBLE, the macro expects the following variables to be defined:

  • f: unary callback.

In addition to the variables defined by the STDLIB_STRIDED_UNARY_LOOP_PREAMBLE, the macro defines the following variables:

  • x: <tin> input strided array element.
#define STDLIB_STRIDED_UNARY_LOOP_CLBK( tin, tout )        \
    STDLIB_STRIDED_UNARY_LOOP_PREAMBLE {                   \
        const tin x = *(tin *)ip1;                         \
        *(tout *)op1 = (tout)f( x );                       \
    }

STDLIB_STRIDED_UNARY_LOOP_CLBK_ARG_CAST( tin, tout, fin )

Macro for a unary loop which invokes a callback requiring arguments be explicitly cast to a different type.

STDLIB_STRIDED_UNARY_LOOP_CLBK_ARG_CAST( float, float, double )

The macro expects the following arguments:

  • tin: input strided array element data type.
  • tout: output strided array element data type.
  • fin: callback argument data type.

In addition to the variables expected by STDLIB_STRIDED_UNARY_LOOP_PREAMBLE, the macro expects the following variables to be defined:

  • f: unary callback.

In addition to the variables defined by the STDLIB_STRIDED_UNARY_LOOP_PREAMBLE, the macro defines the following variables:

  • x: <tin> input strided array element.
#define STDLIB_STRIDED_UNARY_LOOP_CLBK_ARG_CAST( tin, tout, fin )  \
    STDLIB_STRIDED_UNARY_LOOP_PREAMBLE {                           \
        const tin x = *(tin *)ip1;                                 \
        *(tout *)op1 = (tout)f( (fin)x );                          \
    }

Examples

#include "stdlib/strided/base/unary.h"
#include <stdint.h>
#include <stdio.h>
#include <inttypes.h>

// Define a callback:
static double scale( const double x ) {
    return x * 10.0;
}

int main( void ) {
    // Create underlying byte arrays:
    uint8_t x[] = { 1, 4, 7 };
    uint8_t out[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

    // Define a pointer to an array containing pointers to strided arrays:
    uint8_t *arrays[] = { x, out };

    // Define the strides:
    int64_t strides[] = { 1, 8 }; // 1 byte per uint8, 8 bytes per double

    // Define the number of elements over which to iterate:
    int64_t shape[] = { 3 };

    // Apply the callback:
    stdlib_strided_b_d_as_d_d( arrays, shape, strides, (void *)scale );

    // Print the contents of the output array:
    uint8_t *op1 = out;
    for ( int64_t i = 0; i < shape[0]; i++, op1 += strides[1] ) {
        const double v = *(double *)op1;
        printf( "out[ %"PRId64" ] = %lf\n", i, v );
    }
}

See Also

  • @stdlib/strided-base/unary: apply a unary callback to elements in a strided input array and assign results to elements in a strided output array.
  • @stdlib/strided-base/dmap: apply a unary function to a double-precision floating-point strided input array and assign results to a double-precision floating-point strided output array.
  • @stdlib/strided-base/nullary: apply a nullary callback and assign results to elements in a strided output array.
  • @stdlib/strided-base/quaternary: apply a quaternary callback to strided input array elements and assign results to elements in a strided output array.
  • @stdlib/strided-base/quinary: apply a quinary callback to strided input array elements and assign results to elements in a strided output array.
  • @stdlib/strided-base/smap: apply a unary function to a single-precision floating-point strided input array and assign results to a single-precision floating-point strided output array.
  • @stdlib/strided-base/ternary: apply a ternary callback to strided input array elements and assign results to elements in a strided output array.

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2024. The Stdlib Authors.

Package Sidebar

Install

npm i @stdlib/strided-base-unary

Homepage

stdlib.io

Weekly Downloads

258

Version

0.2.1

License

Apache-2.0

Unpacked Size

826 kB

Total Files

309

Last publish

Collaborators

  • stdlib-bot
  • kgryte
  • planeshifter
  • rreusser