>>  <<  Usr  Pri  JfC  LJ  Phr  Dic  Voc  !:  Help  Dictionary

26. Obverse and Under

The result of f^:_1 is called the obverse of the function f ; if f=: g :. h, this obverse is h, and it is otherwise an inverse of f . Inverses are provided for over 25 primitives (including the case of the square root illustrated in Section 11), as well as many bonded dyads such as -&3 and 10&^. and 2&o. . Moreover, u@v^:_1 is given by (v^:_1)@(u^:_1) . For example:
   fFc=: (32&+)@(*&1.8)
   ]b=:fFc _40 0 100
_40 32 212

   cFf=: fFc^:_1
   cFf b
_40 0 100
The result of the phrase f &. g is the verb (g^:_1)@(f & g) . The function g can be viewed as preparation (which is done before and undone after) for the application of the “main” function f . For example:
   b=: 0 0 1 0 1 0 1 1 0 0 0
   sup=: </\                   Suppress ones after the first
   sup b
0 0 1 0 0 0 0 0 0 0 0

   |. sup |. b                 Suppress ones before the last
0 0 0 0 0 0 0 1 0 0 0

   sup&.|. b
0 0 0 0 0 0 0 1 0 0 0

   3 +&.^. 4                   Multiply by applying the exponential
12                             to the sum of logarithms

   (^.3)+(^.4)
2.48491

   ^ (^.3)+(^.4)
12

   ]c=: 1 2 3;4 5;6 7 8
+-----+---+-----+
|1 2 3|4 5|6 7 8|
+-----+---+-----+
          
   |.&.> c                     Open, reverse, and then box
+-----+---+-----+
|3 2 1|5 4|8 7 6|
+-----+---+-----+

Exercises

26.1   Use the following as exercises in reading and writing. Try using arguments such as a=: 2 3 5 7 and b=: 1 2 3 4 and c=: <@i."0 i. 3 4 :
f=: +&.^.                      Multiplication by addition of natural logs
g=: +&.(10&^.)                 Multiplication using base-10 logs
h=: *&.^                       Addition from multiplication
i=: |.&.>                      Reverse each box
j=: +/&.>                      Sum each box
k=: +/&>                       Sum each box and leave open



>>  <<  Usr  Pri  JfC  LJ  Phr  Dic  Voc  !:  Help  Dictionary