Generalize transpose to all arrays
This commit is contained in:
parent
ea824a901b
commit
92fc8f00c9
2 changed files with 9 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue