APL Symbol Reference
- {drop}
A{drop}B returns a copy of vector B without the first A (if A>0) or last A (if A<0) elements. If B is a matrix, A is must be two numbers, with A[1] giving the number of rows and A[2] giving the number of columns to drop. - {take}
A{take}B returns the first A (if A>0) or last A (if A<0) elements of a vector B. If B is a matrix, A is must be two numbers, with A[1] giving the number of rows and A[2] giving the number of columns to return. - {epsilon} {enlist} {membership}
A{membership}B returns a Boolean array having the same shape as A. Ones in the result mark elements of A that occur in B; zeros mark elements that don't occur in B. The monadic form, {enlist}B, flattens and ravels a nested array. It returns a simple (non-nested) vector containing all the elements in B. - {gradeup}
{gradeup}B returns a permutation vector that describes how to arrange the elements of a numeric vector B in ascending order. The expression B[{gradeup}B] can be used to obtain a sorted copy of B. The dyadic form, A{gradeup}B, is used for character data. The left argument (A) specifies the collating sequence. If B is a matrix, the result describes how to arrange the rows in alphabetic order. B[{gradeup}B;] returns a sorted copy of B. - {transpose}
{transpose}B returns the transpose of a matrix B. (It flips the matrix across the main diagonal, so the first row becomes the first column.) More generally, transpose reverses the order of the dimensions in B. Consequently, it has no effect on vectors or scalars. The dyadic form, A{transpose}B, reorders the dimensions of B according to A. If A is a permutation vector (i.e., if it has no duplicate elements), the shape of the result Z is related to the shape of B by the identity ({shape}Z)[A] <--> {shape}B. If A has duplicate elements, transpose takes a diagonal slice along the dimensions corresponding to the duplicated elements. The most common case of this form is 1 1{transpose}B, which returns the main diagonal of a matrix B. - {quotequad}
{quotequad} is used for character input and output. Assigning a value to {quotequad}, as in {quotequad}{<-}B, causes the value of B to be displayed (without a carriage return being appended at the end). Referencing {quotequad}, as in Z{<-}{quotequad}, causes a line of character input to be read from the user. - {ln} {log}
{ln}B returns the natural log of B. A{log}B returns the base-A log of B. - {floor} {minimum}
{floor}B returns the largest integer that is less than or equal to B. (For positive numbers, this is usually the integer part of B.) The dyadic form, A{minimum}B, returns the lesser of A and B. To find the smallest element in a vector, {minimum} is used with the reduce operator, as in {minimum}/B. - {ceiling} {maximum}
{ceiling}B returns the smallest integer that is greater than or equal to B. (For positive numbers, this rounds B up to the next higher integer.) The dyadic form, A{maximum}B, returns the greater of A and B. To find the largest element in a vector, {maximum} is used with the reduce operator, as in {maximum}/B. To be continued...
JimW's Home Page |