From dc7ad4e3501556f55ef7a3a5508976e790c28bae Mon Sep 17 00:00:00 2001 From: Hans Olsson Date: Fri, 20 Mar 2020 09:38:46 +0100 Subject: [PATCH] Clarify symmetric, outerProduct, skew etc. (#2485) * Clarify symmetric, outerProduct, skew etc. Closes #2295 --- chapters/arrays.tex | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/chapters/arrays.tex b/chapters/arrays.tex index 4e4806123..b8c1f54fb 100644 --- a/chapters/arrays.tex +++ b/chapters/arrays.tex @@ -505,9 +505,10 @@ \subsubsection{Reduction Expressions}\doublelabel{reduction-expressions} \subsection{Matrix and Vector Algebra Functions}\doublelabel{matrix-and-vector-algebra-functions} The following set of built-in matrix and vector algebra functions are -available. The function transpose can be applied to any matrix. The -functions outerProduct, symmetric, cross and skew require Real/Integer -vector(s) or matrix as input(s) and returns a Real vector or matrix: +available. The function transpose and symmetric can be applied to any matrix. The +functions outerProduct, cross and skew require Real/Integer +vector(s) or matrix as input(s) and returns a Real/Integer vector or matrix (the result is only Integer +if the input/all inputs are Integer): \begin{longtable}[]{|p{3.5cm}|p{11.5cm}|} \caption{Matrix and vector algebra functions.}\\ @@ -521,10 +522,8 @@ \subsection{Matrix and Vector Algebra Functions}\doublelabel{matrix-and-vector-a & Returns the outer product of vectors v1 and v2 ( = matrix(v1)*transpose( matrix(v2) ) ).\\ \hline \lstinline!symmetric(A)! -& Returns a matrix where the diagonal elements and the elements above the -diagonal are identical to the corresponding elements of matrix A and -where the elements below the diagonal are set equal to the elements -above the diagonal of A, i.e., \lstinline!B := symmetric(A) ->! +& Returns a symmetric matrix which is identical to the square matrix \lstinline!A! +on and above the diagonal, i.e., \lstinline!B := symmetric(A) ->! \lstinline!B[i,j] := A[i,j], if i <= j, ! \lstinline! B[i,j] := A[j,i], if i > j!.\\ \hline \lstinline!cross(x,y)! & Returns the cross product of the 3-vectors x and y, i.e.