This repository has been archived on 2024-06-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
coffee.pygments/tests/examplefiles/apl/test.apl
Oleh Prypin 6f43092173
Also add auto-updatable output-based tests to examplefiles (#1689)
Co-authored-by: Georg Brandl <georg@python.org>
2021-01-20 10:48:45 +01:00

26 lines
587 B
APL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

RM COMBIN N;D;E;F;G;P
⍝ Returns a matrix of every possible
⍝ combination of M elements from the
⍝ vector N. That is, returns a
⍝ matrix with M!N rows and N columns.
E(PN-RM-1)-⎕IO
DR+P
R(P,1)D
PP1
L1:(⎕IO>1DD-1)0
P+\P
G+\¯10,FP
EF/E-G
R(F/D),R[E+E;]
EG
L1
RM QUICKEXP N
⍝ Matrix exponentiation
B 1 + 2 N
V (B 2) N
L M
R +.× / V / L { L ( A +.× A L) , L }¨ B-1