Miscellaneous | 128!: |
128!:0 y |
QR. Produces the QR decomposition of a complex matrix y
(in the domain of matrix inverse %.),
an Hermitian matrix and a square upper triangular matrix,
individually boxed.
mp=: +/ . * NB. Matrix product A=: j./?. 2 7 4$10 NB. A random complex matrix $A 7 4 'Q R'=: 128!:0 A $Q 7 4 $R 4 4 >./|,(=i.4) - (+|:Q) mp Q NB. Q is Hermitian 2.70972e_16 0~:R NB. R is upper triangular 1 1 1 1 0 1 1 1 0 0 1 1 0 0 0 1 A -: Q mp R 1 |
128!:1 y | R Inv. Invert square upper triangular matrix. |
x 128!:2 y | Apply. x 128!:2 y applies the verb in
string x to y .
For example:
'+/' 128!:2 i.2 5 5 7 9 11 13 '+/' 128!:2"1 i.2 5 10 35 '+/"1' 128!:2 i.2 5 10 35 ('+/';'|.';'|."1') 128!:2&.><i.2 5 +-----------+---------+---------+ |5 7 9 11 13|5 6 7 8 9|4 3 2 1 0| | |0 1 2 3 4|9 8 7 6 5| +-----------+---------+---------+ '2 3' 128!:2 i.2 5 |syntax error | '2 3' 128!:2 i.2 5 '@' 128!:2 i.2 5 |syntax error | '@' 128!:2 i.2 5The ranks of 128!:2 are 1 _ , that is, apply the lists in the left argument to the right argument in toto. |
[x] 128!:3 y | CRC. A CRC polynomial is a boolean list or an integer. The following CRC polynomials p and q are equivalent: p=: 1 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 q=: _306674912 _8]\p 1 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 q -: (_2 _2,30$2) #. p 1 p -: (32$2) #: q 1 x 128!:3 y computes the CRC encoding of string y according to x , which may be p or p;i , where p is a CRC polynomial and i is the initial CRC value. If i is elided then _1 is used. 128!:3 y is equivalent to _306674912 (128!:3) y . The monad x&(128!:3) is supported by special code which pre-computes a look-up table of CRC values for each byte. Examples: f=: 128!:3 f '123456789' _873187034 f 'assiduously avoid any and all asinine alliterations' 1439575093 |
128!:4 y | RNG Raw. See Roll/Deal (?).
|
128!:5 y | Is NaN. If z=: 128!:5 y , then z has the same shape as y and an atom of z is 1 if and only if the corresponding atom of y is _. (NaN) or contains _. . Examples: (128!:5) 3.45 6 _. 7 0 0 1 0 (128!:5) t=. 2 2$1 2;3 4 5;(<<_. 7);_. 0 0 1 1 (128!:5) < t 1 (128!:5) ;:'Cogito, ergo sum. _.' 0 0 0 0 0 |
[x] 128!:6 y | SHA. The Secure Hash Algorithms are a family of cryptographic hash functions.
x 128!:6 y computes the SHA of string y according to x, results are hexadecimal strings. 1 SHA1 2 SHA224 3 SHA256 4 SHA384 5 SHA512 6 SHA3_224 7 SHA3_256 8 SHA3_384 9 SHA3_512 _1 to _9 are the same as 1 to 9 but with results in binary strings.
Examples: 128!:6 'abc' a9993e364706816aba3e25717850c26c9cd0d89d 1 (128!:6) 'abc' a9993e364706816aba3e25717850c26c9cd0d89d a. i. _1 (128!:6) 'abc' 169 153 62 54 71 6 129 106 186 62 37 113 120 80 194 108 156 208 216 157 |