/usr/share/axiom-20170501/src/algebra/CARTEN2.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | )abbrev package CARTEN2 CartesianTensorFunctions2
++ Author: Stephen M. Watt
++ Date Created: December 1986
++ Date Last Updated: May 30, 1991
++ Description:
++ This package provides functions to enable conversion of tensors
++ given conversion of the components.
CartesianTensorFunctions2(minix, dim, S, T) : SIG == CODE where
minix : Integer
dim : NonNegativeInteger
S : CommutativeRing
T : CommutativeRing
CS ==> CartesianTensor(minix, dim, S)
CT ==> CartesianTensor(minix, dim, T)
SIG ==> with
reshape : (List T, CS) -> CT
++ reshape(lt,ts) organizes the list of components lt into
++ a tensor with the same shape as ts.
map : (S->T, CS) -> CT
++ map(f,ts) does a componentwise conversion of the tensor ts
++ to a tensor with components of type T.
CODE ==> add
reshape(l, s) == unravel l
map(f, s) == unravel [f e for e in ravel s]
|