Command: Apply

NEST HelpDesk Command Index NEST Quick Reference

Name:
 Apply - calls a function with the elements of an array as arguments
Synopsis:
 array proc Apply -> any
Description:
 Apply interprets the elements of the input array a as the list
 of arguments of the supplied function f,
   f(a(1),a(2), ...,a(n))

 This is to be distinguished from Map which individually applies
 the function to the elements of the array,
   [f(a(1),f(a(2), ...,f(a(n))] 

Parameters:
  array is an arbitrarily shaped heterogeneous array. 
  proc is any procedure object (pure function).

Examples:

  [1 2] {add} Apply --> 3
  [1 2] {dup mul} Map --> [1 4]
  [(hell world) 4 (o)] {insert} Apply --> (hello world)

Author:
 Diesmann
FirstVersion:
 unknown, documented 121124
Remarks:
 This function is an implementation of Mathematica's Apply function.
SeeAlso:Map MapAt MapThread
References:
 [1] The Mathematica Book V4.0 "Apply"
Source:
 /home/abuild/rpmbuild/BUILD/nest-2.4.1/lib/sli/mathematica.sli

NEST HelpDesk Command Index NEST Quick Reference

© 2000-2010 The NEST Initiative