Generalize transpose to all arrays

This commit is contained in:
Kiana Sheibani 2022-08-31 16:01:21 -04:00
parent ea824a901b
commit 92fc8f00c9
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
2 changed files with 9 additions and 10 deletions

View file

@ -141,16 +141,6 @@ hstack : {m : _} -> Vect n (Vector m a) -> Matrix m n a
hstack = stack 1
export
transpose : Matrix m n a -> Matrix n m a
transpose mat with (viewShape mat)
_ | Shape [m,n] = fromFunctionNB [n,m] (\[i,j] => mat!#[j,i])
export
(.T) : Matrix m n a -> Matrix n m a
(.T) = transpose
||| Calculate the outer product of two vectors as a matrix.
export
outer : Num a => Vector m a -> Vector n a -> Matrix m n a