Skip to main content

tensors.tppl

type TensorRecord​

type TensorRecord = TensorRecord {
magic: Matrix[Real],
mul: Matrix[Real],
pow: Matrix[Real],
sclrMul: Matrix[Real],
transpose: Matrix[Real],
exponential: Matrix[Real]
}

function tensors​

Model function tensors Parameters: magic: the Int[] sequences of the Melancolia 4x4 magic square Returns: a tensor Side-effect: prints things This function illustrates how to create tensors and manipulate them. Tensors can be over elementary types: Matrix[Real], Matrix[Int], Matrix[Bool], but for linear algebra (matrix algebra) we use real tensors.

model function tensors(magic: Int[]) => TensorRecord