Reptorian's Combinatorics Library: Cartesian Product
Description
The set of all ordered items formed by combining elementsfrom multiple sets.
You can also view it as enumerating N-dimensional integer
coordinates within bounded ranges, represented as a
1-dimensional sequence.
$ +rep_cartesian_product 2,3,2 repeat w { e[0] {I[#-1,$>]} }
[gmic]./ Start G'MIC interpreter (v.3.7.3).
[gmic]./ 0,0,0
[gmic]./ 0,0,1
[gmic]./ 0,1,0
[gmic]./ 0,1,1
[gmic]./ 0,2,0
[gmic]./ 0,2,1
[gmic]./ 1,0,0
[gmic]./ 1,0,1
[gmic]./ 1,1,0
[gmic]./ 1,1,1
[gmic]./ 1,2,0
[gmic]./ 1,2,1
[gmic]./ Display image [0] = '[unnamed]'.
[0] = '[unnamed]':
size = (12,1,1,3) [144 b of float32].
data = (0,0,0,0,0,0,1,1,1,1,1,1^0,0,1,1,2,2,0,0,1,1,2,2^0,1,0,1,0,1,0,1,0,1,0,1).
min = 0, max = 2, mean = 0.666667, std = 0.666667, coords_min = (0,0,0,0), coords_max = (4,0,0,1).
[gmic]./ End G'MIC interpreter.
[gmic]./ Start G'MIC interpreter (v.3.7.3).
[gmic]./ 0,0,0
[gmic]./ 0,0,1
[gmic]./ 0,1,0
[gmic]./ 0,1,1
[gmic]./ 0,2,0
[gmic]./ 0,2,1
[gmic]./ 1,0,0
[gmic]./ 1,0,1
[gmic]./ 1,1,0
[gmic]./ 1,1,1
[gmic]./ 1,2,0
[gmic]./ 1,2,1
[gmic]./ Display image [0] = '[unnamed]'.
[0] = '[unnamed]':
size = (12,1,1,3) [144 b of float32].
data = (0,0,0,0,0,0,1,1,1,1,1,1^0,0,1,1,2,2,0,0,1,1,2,2^0,1,0,1,0,1,0,1,0,1,0,1).
min = 0, max = 2, mean = 0.666667, std = 0.666667, coords_min = (0,0,0,0), coords_max = (4,0,0,1).
[gmic]./ End G'MIC interpreter.
Commands
Cartesian Product:
| rep_cartesian_product | rep_cartesian_product_index2list | rep_cartesian_product_list2index |


Home
Download
News
Mastodon
Bluesky
X
Summary - 18 Years
Summary - 17 Years
Summary - 16 Years
Summary - 15 Years
Summary - 13 Years
Summary - 11 Years
Summary - 10 Years
Resources
Technical Reference
Scripting Tutorial
Video Tutorials
Wiki Pages
Image Gallery
Color Presets
Using libgmic
G'MIC Online
Community
Discussion Forum (Pixls.us)
GimpChat
IRC
Report Issue