Initial revision
[LeanCalc.git] / help / reverse
1 NAME
2     reverse - reverse a copy of a list or matrix
3
4 SYNOPSIS
5     reverse(x)
6
7 TYPES
8     x           list or matrix
9
10     return      same type as x
11
12 DESCRIPTION
13     For a list or matrix x, reverse(x) returns a list or matrix in
14     which the order of the elements has been reversed.  The original
15     list or matrix x is unchanged.
16
17     In the case of matrix x, the returned value is a matrix with
18     the same dimension and index limits, but the reversing is performed
19     as if the matrix were a linear array.
20
21 EXAMPLE
22     > A = list(1, 7, 2, 4, 2)
23     > print reverse(A)
24
25     list (5 elements, 5 nonzero):
26           [[0]] = 2
27           [[1]] = 4
28           [[2]] = 2
29           [[3]] = 7
30           [[4]] = 1
31
32     > mat B[2,3] = {1,2,3,4,5,6}
33     > print reverse(B)
34
35     mat [2,3] (6 elements, 6 nonzero):
36       [0,0] = 6
37       [0,1] = 5
38       [0,2] = 4
39       [1,0] = 3
40       [1,1] = 2
41       [1,2] = 1
42
43 LIMITS
44     none
45
46 LINK LIBRARY
47     none
48
49 SEE ALSO
50     join, sort
51