Function Repository Resource:

RightComposeIndexed

Source Notebook

Get the final result of nested application of an indexed list of functions

Contributed by: Wolfram Staff

ResourceFunction["RightComposeIndexed"][{f1,f2,f3,},x,{i,j,k,}]

gives the last element of ResourceFunction["RightComposeIndexedList"][{f1,f2,f3,},x,{i,j,k,}].

Examples

Basic Examples (1) 

The final iterate from composing with a list of three functions:

In[1]:=
ResourceFunction[
 "RightComposeIndexed"][{f, g, h}, x, {1, 1, 2, 3, 1, 2}]
Out[1]=

Scope (1) 

Use a list of pure functions:

In[2]:=
ResourceFunction[
 "RightComposeIndexed"][{#^2 + 1 &, 1 - # &, Sqrt[#] &}, 2., {3, 2, 1,
   3, 2, 3}]
Out[2]=

Version History

  • 1.0.0 – 15 February 2023

Related Resources

License Information