Difference between revisions of "Array.$()"
Jump to navigation
Jump to search
(Created page with "Array.$(Function|Array of Functions[,param1,param2,...]) This returns the result of each element of the Array being operated on by the function or array of functions passed....") |
|||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | Array.$(Function|Array of Functions[,param1,param2,...]) | + | *[[ Z3 | << Z3 Home ]] |
+ | *[[ Z%5E3_Language_Documentation | Z3 Language Documentation]] | ||
+ | *[[ Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member Functions]] | ||
+ | |||
+ | |||
+ | ==Array.$(Function|Array of Functions[,param1,param2,...]) == | ||
This returns the result of each element of the Array being operated on by the function or array of functions passed. The parameters provided following the function/function array is passed to the function with each element as the first parameter. | This returns the result of each element of the Array being operated on by the function or array of functions passed. The parameters provided following the function/function array is passed to the function with each element as the first parameter. | ||
Line 52: | Line 57: | ||
| 0.07523524614651178 | | 0.07523524614651178 | ||
|} | |} | ||
+ | |||
+ | |||
+ | Below is an example of taking a 4x5 array, filling it with 1 to 10, followed by exploding each of the elements using a lambda function created using the z3 notation to declare a simple function (a:=[x].explode()) | ||
+ | |||
+ | |4,5,1..10|.$(a:=[x].explode()) | ||
+ | |||
+ | {| class="wikitable"|- | ||
+ | | | ||
+ | {| class="wikitable"|- | ||
+ | | 0 | ||
+ | |} | ||
+ | || | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 | ||
+ | |} | ||
+ | || | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 || 2 | ||
+ | |} | ||
+ | || | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 || 2 || 3 | ||
+ | |} | ||
+ | || | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 || 2 || 3 || 4 | ||
+ | |} | ||
+ | |||
+ | |- | ||
+ | | | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 || 2 || 3 || 4 || 5 | ||
+ | |} | ||
+ | || | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 || 2 || 3 || 4 || 5 || 6 | ||
+ | |} | ||
+ | || | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 | ||
+ | |} | ||
+ | || | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 | ||
+ | |} | ||
+ | || | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 | ||
+ | |} | ||
+ | |||
+ | |- | ||
+ | | | ||
+ | {| class="wikitable"|- | ||
+ | | 0 | ||
+ | |} | ||
+ | || | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 | ||
+ | |} | ||
+ | || | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 || 2 | ||
+ | |} | ||
+ | || | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 || 2 || 3 | ||
+ | |} | ||
+ | || | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 || 2 || 3 || 4 | ||
+ | |} | ||
+ | |||
+ | |- | ||
+ | | | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 || 2 || 3 || 4 || 5 | ||
+ | |} | ||
+ | || | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 || 2 || 3 || 4 || 5 || 6 | ||
+ | |} | ||
+ | || | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 | ||
+ | |} | ||
+ | || | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 | ||
+ | |} | ||
+ | || | ||
+ | {| class="wikitable"|- | ||
+ | | 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 | ||
+ | |} | ||
+ | |||
+ | |} | ||
+ | |||
+ | |||
+ | ==See Also== | ||
+ | [[Array.$$() | $$]] | ||
+ | |||
+ | [[Array.mapper() |Mapper]] | ||
+ | |||
+ | [[Array.maprow() | Maprow]] |
Latest revision as of 07:12, 17 April 2020
Array.$(Function|Array of Functions[,param1,param2,...])
This returns the result of each element of the Array being operated on by the function or array of functions passed. The parameters provided following the function/function array is passed to the function with each element as the first parameter.
For example, 1..10.$(SIN)
0.8414709848078965 |
0.9092974268256817 |
0.1411200080598672 |
-0.7568024953079282 |
-0.9589242746631385 |
-0.27941549819892586 |
0.6569865987187891 |
0.9893582466233818 |
0.4121184852417566 |
-0.5440211108893698 |
1..10.$(CHIDIST,5)
0.9625657732472964 |
0.8491450360846097 |
0.6999858358786275 |
0.5494159513527801 |
0.4158801869955078 |
0.30621891841327864 |
0.22064030793671074 |
0.15623562757772202 |
0.10906415794977253 |
0.07523524614651178 |
Below is an example of taking a 4x5 array, filling it with 1 to 10, followed by exploding each of the elements using a lambda function created using the z3 notation to declare a simple function (a:=[x].explode())
|4,5,1..10|.$(a:=[x].explode())
|
|
|
|
| ||||||||||||||||||||||||||||||||||||||||
|
|
|
|
| ||||||||||||||||||||||||||||||||||||||||
|
|
|
|
| ||||||||||||||||||||||||||||||||||||||||
|
|
|
|
|