Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface describing the main export.

Hierarchy

  • Routine

Callable

  • Applies a function to elements in a five-dimensional nested input array and assigns results to elements in a new five-dimensional nested output array.

    Type parameters

    • T

    • U

    • V

    Parameters

    • x: Array5D<T>

      input nested array

    • shape: Shape5D

      array shape

    • fcn: Callback<T, U, V>

      function to apply

    • Optional thisArg: ThisParameterType<Callback<T, U, V>>

      function execution context

    Returns Array5D < U >

    Example

    var ones5d = require( '@stdlib/array/base/ones5d' );
    
    function scale( x ) {
        return x * 10.0;
    }
    
    var shape = [ 1, 1, 1, 2, 2 ];
    
    var x = ones5d( shape );
    var y = map5d( x, shape, scale );
    // returns [ [ [ [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ] ] ] ]

Index

Methods

Methods

assign

  • Applies a function to elements in a five-dimensional nested input array and assigns results to elements in a five-dimensional nested output array.

    Type parameters

    • T

    • U

    • V

    Parameters

    • x: Array5D<T>

      input nested array

    • y: Array5D<U>

      output nested array

    • shape: Shape5D

      array shape

    • fcn: Callback<T, U, V>

      function to apply

    • Optional thisArg: ThisParameterType<Callback<T, U, V>>

      function execution context

    Returns Array5D < U >

    Example

    var ones5d = require( '@stdlib/array/base/ones5d' );
    var zeros5d = require( '@stdlib/array/base/zeros5d' );
    
    function scale( x ) {
        return x * 10.0;
    }
    
    var shape = [ 1, 1, 1, 2, 2 ];
    
    var x = ones5d( shape );
    var y = zeros5d( shape );
    
    var out = map5d.assign( x, y, shape, scale );
    // returns [ [ [ [ [ 10.0, 10.0 ], [ 10.0, 10.0 ] ] ] ] ]
    
    var bool = ( out === y );
    // returns true