!y      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(c) Alberto Ruiz 2007-15BSD3 Alberto Ruiz provisionalNone =>F;0hmatrixspecialized fromIntegral hmatrixspecialized fromIntegralhmatrixNumber of elementshmatrixcreates a Vector from a list: +> fromList [2,3,5,7] 4 |> [2.0,3.0,5.0,7.0] hmatrixCreate a vector from a list of elements and explicit dimension. The input list is truncated if it is too long, so it may safely be used, for instance, with infinite lists. 5 |> [1..][1.0,2.0,3.0,4.0,5.0]>it :: (Enum a, Num a, Foreign.Storable.Storable a) => Vector a hmatrixECreate a vector of indexes, useful for matrix extraction using '(??)'hmatrix4takes a number of consecutive elements from a Vector subVector 2 3 (fromList [1..10]) [3.0,4.0,5.0]>it :: (Enum t, Num t, Foreign.Storable.Storable t) => Vector thmatrixReads a vector position:fromList [0..9] @> 77.0hmatrix0access to Vector elements without range checkinghmatrixconcatenate a list of vectors*vjoin [fromList [1..5::Double], konst 1 3]![1.0,2.0,3.0,4.0,5.0,1.0,1.0,1.0]it :: Vector Doublehmatrix2Extract consecutive subvectors of the given sizes.)takesV [3,4] (linspace 10 (1,10::Double))![[1.0,2.0,3.0],[4.0,5.0,6.0,7.0]]it :: [Vector Double]hmatrixXtransforms a complex vector into a real vector with alternating real and imaginary partshmatrixXtransforms a real vector into a complex vector with alternating real and imaginary partshmatrixmap on VectorshmatrixzipWith for VectorshmatrixunzipWith for Vectorshmatrix'monadic map over Vectors the monad m must be stricthmatrixmonadic map over Vectorshmatrixbmonadic map over Vectors with the zero-indexed index passed to the mapping function the monad m must be stricthmatrixSmonadic map over Vectors with the zero-indexed index passed to the mapping functionhmatrixycreates a Vector of the specified length using the supplied function to to map the index to the value at that index. 3> buildVector 4 fromIntegral 4 |> [0.0,1.0,2.0,3.0]hmatrixzip for Vectors hmatrixunzip for Vectorshmatrixindex of the starting elementhmatrixnumber of elements to extracthmatrixsourcehmatrixresult*     9 9 (c) Alberto Ruiz 2007-15BSD3 Alberto Ruiz provisionalNone HUVA4hmatrix clear the fpu&hmatrixpostfix function application (flip ($))hmatrix@error codes for the auxiliary functions required by the wrappers'hmatrixcheck the error code(hmatrixpostfix error code checkhmatrix%Error capture and conversion to Maybe!%$#"     &'($1%15 5 5&0(0(c) Alberto Ruiz 2007-15BSD3 Alberto Ruiz provisionalNone HUV`$*hmatrixuniform distribution in [0,1)+hmatrix=normal distribution with mean zero and standard deviation onehmatrixsum of elementshmatrixsum of elementshmatrixsum of elementshmatrixsum of elementshmatrixproduct of elementshmatrixproduct of elementshmatrixproduct of elementshmatrixproduct of elementshmatrixUobtains different functions of a vector: norm1, norm2, max, min, posmax, posmin, etc.hmatrixUobtains different functions of a vector: norm1, norm2, max, min, posmax, posmin, etc.hmatrix:obtains different functions of a vector: only norm1, norm2hmatrix:obtains different functions of a vector: only norm1, norm2hmatrixUobtains different functions of a vector: norm1, norm2, max, min, posmax, posmin, etc.hmatrixUobtains different functions of a vector: norm1, norm2, max, min, posmax, posmin, etc.hmatrix'map of real vectors with given functionhmatrix*map of complex vectors with given function hmatrix'map of real vectors with given function!hmatrix'map of real vectors with given function"hmatrix'map of real vectors with given function#hmatrix'map of real vectors with given function$hmatrix'map of real vectors with given function%hmatrix*map of complex vectors with given function&hmatrix'map of real vectors with given function'hmatrix*map of complex vectors with given function(hmatrix'map of real vectors with given function)hmatrix'map of real vectors with given function*hmatrix%elementwise operation on real vectors+hmatrix(elementwise operation on complex vectors,hmatrix%elementwise operation on real vectors-hmatrix(elementwise operation on complex vectors.hmatrix%elementwise operation on CInt vectors/hmatrix%elementwise operation on CInt vectors-hmatrixNObtains a vector of pseudorandom elements (use randomIO to get a random seed)./hmatrixrange 5 [0,1,2,3,4]it :: Vector I-hmatrix distributionhmatrix vector size0)+*,123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./-./1 (c) Alberto Ruiz 2007-15BSD3 Alberto Ruiz provisionalNone  %7=>?@HUV0hmatrixSupported matrix elements.1hmatrix<Matrix representation suitable for BLAS/LAPACK computations.hmatrixMatrix transpose.;hmatrixmCreates a vector by concatenation of rows. If the matrix is ColumnMajor, this operation requires a transpose.flatten (ident 3)%[1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0]$it :: (Num t, Element t) => Vector t<hmatrixthe inverse of  hmatrixcommon value with "adaptable" 1=hmatrixCreate a matrix from a list of vectors. All vectors must have the same dimension, or dimension 1, which is are automatically expanded.>hmatrix2extracts the rows of a matrix as a list of vectors?hmatrix3Creates a matrix from a list of vectors, as columns@hmatrix6Creates a list of vectors from the columns of a matrixhmatrixReads a matrix position.DhmatrixCreates a matrix from a vector by grouping the elements in rows with the desired number of columns. (GNU-Octave groups by columns. To do it you can define reshapeF r = tr' . reshape r( where r is the desired number of rows.)reshape 4 (fromList [1..12])(3><4) [ 1.0, 2.0, 3.0, 4.0 , 5.0, 6.0, 7.0, 8.0 , 9.0, 10.0, 11.0, 12.0 ]EhmatrixAapplication of a vector function on the flattened matrix elementsFhmatrixCapplication of a vector function on the flattened matrices elementsGhmatrix;reference to a rectangular slice of a matrix (no data copy)Hhmatrix#Transpose an array with dimensions dims by making a copy using strides/. For example, for an array with 3 indices, (reorderVector strides dims v) ! ((i * dims ! 1 + j) * dims ! 2 + k) == v ! (i * strides ! 0 + j * strides ! 1 + k * strides ! 2)H This function is intended to be used internally by tensor libraries.Ihmatrix!save a matrix as a 2D ASCII tableGhmatrix(r0,c0) starting positionhmatrix(rt,ct) dimensions of submatrixhmatrix input matrixhmatrixresultHhmatrixstrides: array strideshmatrixdims : array dimensions of new array vhmatrixv: flattened input arrayhmatrixv': flattened output arrayIhmatrix)"printf" format (e.g. "%.2f", "%g", etc.)01243     56789:;<=>?@ABCDEFG !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIHI19 (c) Alberto Ruiz 2008BSD3 Alberto Ruiz provisionalNone %SX/Jhmatrixr0 c0 height width3JKJKLMNOPRQSTUWVXYZ[\]^_`abcdefghijklmnopqrstuvwxyz (c) Alberto Ruiz 2010BSD3 Alberto Ruiz provisionalNone LhmatrixFormatting tool{hmatrixCreates a string from a matrix given a separator and a function to show each entry. Using this function the user can easily define any desired display function: import Text.Printf(printf) +disp = putStr . format " " (printf "%.2f")|hmatrixFShow a matrix with "autoscaling" and a given number of decimal places.%putStr . disps 2 $ 120 * (3><4) [1..]3x4 E3 0.12 0.24 0.36 0.48 0.60 0.72 0.84 0.96 1.08 1.20 1.32 1.44}hmatrix4Show a matrix with a given number of decimal places.dispf 2 (1/3 + ident 3)="3x3\n1.33 0.33 0.33\n0.33 1.33 0.33\n0.33 0.33 1.33\n""putStr . dispf 2 $ (3><4)[1,1.5..]3x41.00 1.50 2.00 2.503.00 3.50 4.00 4.505.00 5.50 6.00 6.50EputStr . unlines . tail . lines . dispf 2 . asRow $ linspace 10 (0,1):0.00 0.11 0.22 0.33 0.44 0.56 0.67 0.78 0.89 1.00Mhmatrix4Show a vector using a function for showing matrices..putStr . vecdisp (dispf 2) $ linspace 10 (0,1)@10 |> 0.00 0.11 0.22 0.33 0.44 0.56 0.67 0.78 0.89 1.00~hmatrix+Tool to display matrices with latex syntax.)latexFormat "bmatrix" (dispf 2 $ ident 2):"\\begin{bmatrix}\n1 & 0\n\\\\\n0 & 1\n\\end{bmatrix}"Nhmatrix<Pretty print a complex number with at most n decimal digits.hmatrix<Pretty print a complex matrix with at most n decimal digits.hmatrix9load a matrix from an ASCII file formatted as a 2D table.~hmatrix4type of braces: "matrix", "bmatrix", "pmatrix", etc.hmatrix@Formatted matrix, with elements separated by spaces and newlines I{|}M~(c) Alberto Ruiz 2007-10BSD3 Alberto Ruiz provisionalNone  =>?@AHVhmatrix*Specification of indexes for the operator .hmatrixGeneral matrix slicing.m(4><5) [ 0, 1, 2, 3, 4 , 5, 6, 7, 8, 9 , 10, 11, 12, 13, 14 , 15, 16, 17, 18, 19 ]m ?? (Take 3, DropLast 2)(3><3) [ 0, 1, 2 , 5, 6, 7 , 10, 11, 12 ]m ?? (Pos (idxs[2,1]), All)(2><5) [ 10, 11, 12, 13, 14 , 5, 6, 7, 8, 9 ]+m ?? (PosCyc (idxs[-7,80]), Range 4 (-2) 0)(2><3) [ 9, 7, 5 , 4, 2, 0 ]Ohmatrix0obtains the common value of a property of a listPhmatrix1creates a matrix from a vertical list of matricesQhmatrix3creates a matrix from a horizontal list of matriceshmatrixACreate a matrix from blocks given as a list of lists of matrices.iSingle row-column components are automatically expanded to match the corresponding common row and column: disp = putStr . dispf 2 Bdisp $ fromBlocks [[ident 5, 7, row[10,20]], [3, diagl[1,2,3], 0]] 8x101 0 0 0 0 7 7 7 10 200 1 0 0 0 7 7 7 10 200 0 1 0 0 7 7 7 10 200 0 0 1 0 7 7 7 10 200 0 0 0 1 7 7 7 10 203 3 3 3 3 1 0 0 0 03 3 3 3 3 0 2 0 0 03 3 3 3 3 0 0 3 0 0hmatrixcreate a block diagonal matrix<disp 2 $ diagBlock [konst 1 (2,2), konst 2 (3,5), col [5,7]]7x81 1 0 0 0 0 0 01 1 0 0 0 0 0 00 0 2 2 2 2 2 00 0 2 2 2 2 2 00 0 2 2 2 2 2 00 0 0 0 0 0 0 50 0 0 0 0 0 0 75diagBlock [(0><4)[], konst 2 (2,3)] :: Matrix Double(2><7)$ [ 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0& , 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ]hmatrix Reverse rowshmatrixReverse columnshmatrix&creates a rectangular diagonal matrix:5diagRect 7 (fromList [10,20,30]) 4 5 :: Matrix Double(4><5) [ 10.0, 7.0, 7.0, 7.0, 7.0 , 7.0, 20.0, 7.0, 7.0, 7.0 , 7.0, 7.0, 30.0, 7.0, 7.0 , 7.0, 7.0, 7.0, 7.0, 7.0 ]hmatrix/extracts the diagonal from a rectangular matrixhmatrix'Create a matrix from a list of elements"(2><3) [2, 4, 7+2*iC, -3, 11, 0](2><3), [ 2.0 :+ 0.0, 4.0 :+ 0.0, 7.0 :+ 2.0. , (-3.0) :+ (-0.0), 11.0 :+ 0.0, 0.0 :+ 0.0 ]yThe input list is explicitly truncated, so that it can safely be used with lists that are too long (like infinite lists). (2><3)[1..](2><3) [ 1.0, 2.0, 3.0 , 4.0, 5.0, 6.0 ]bThis is the format produced by the instances of Show (Matrix a), which can also be used for input.Rhmatrix7Creates a matrix with the last n rows of another matrixShmatrix2Creates a copy of a matrix without the last n rowsThmatrix:Creates a matrix with the last n columns of another matrixUhmatrix5Creates a copy of a matrix without the last n columnshmatrix Creates a 1+ from a list of lists (considered as rows).fromLists [[1,2],[3,4],[5,6]](3><2) [ 1.0, 2.0 , 3.0, 4.0 , 5.0, 6.0 ]hmatrix$creates a 1-row matrix from a vectorasRow (fromList [1..5]) (1><5) [ 1.0, 2.0, 3.0, 4.0, 5.0 ]hmatrix'creates a 1-column matrix from a vectorasColumn (fromList [1..5])(5><1) [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 ]Vhmatrixcreates a Matrix of the specified size using the supplied function to to map the row/column position to the value at that row/column position. > buildMatrix 3 4 (\(r,c) -> fromIntegral r * fromIntegral c) (3><4) [ 0.0, 0.0, 0.0, 0.0, 0.0 , 0.0, 1.0, 2.0, 3.0, 4.0 , 0.0, 2.0, 4.0, 6.0, 8.0]Hilbert matrix of order N: Ihilb n = buildMatrix n n (\(i,j)->1/(fromIntegral i + fromIntegral j +1))WhmatrixSrearranges the rows of a matrix according to the order given in a list of integers.XhmatrixSrearranges the rows of a matrix according to the order given in a list of integers.hmatrixKcreates matrix by repetition of a matrix a given number of rows and columnsrepmat (ident 2) 2 3(4><6) [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 , 0.0, 1.0, 0.0, 1.0, 0.0, 1.0 , 1.0, 0.0, 1.0, 0.0, 1.0, 0.0! , 0.0, 1.0, 0.0, 1.0, 0.0, 1.0 ]hmatrix A version of Fl which automatically adapt matrices with a single row or column to match the dimensions of the other matrix.hmatrixyPartition a matrix into blocks with the given numbers of rows and columns. The remaining rows and columns are discarded.hmatrixFully partition a matrix into blocks of the same size. If the dimensions are not a multiple of the given size the last blocks will be smaller.hmatrixcmapMatrixWithIndexM_ (\(i,j) v -> printf "m[%d,%d] = %.f\n" i j v :: IO()) ((2><3)[1 :: Double ..]) m[0,0] = 1 m[0,1] = 2 m[0,2] = 3 m[1,0] = 4 m[1,1] = 5 m[1,2] = 6hmatrixmmapMatrixWithIndexM (\(i,j) v -> Just $ 100*v + 10*fromIntegral i + fromIntegral j) (ident 3:: Matrix Double) Just (3><3) [ 100.0, 1.0, 2.0 , 10.0, 111.0, 12.0 , 20.0, 21.0, 122.0 ]hmatrixemapMatrixWithIndex (\(i,j) v -> 100*v + 10*fromIntegral i + fromIntegral j) (ident 3:: Matrix Double)(3><3) [ 100.0, 1.0, 2.0 , 10.0, 111.0, 12.0 , 20.0, 21.0, 122.0 ]:YZ[\]^_`OPQabRSTUVWXcdefgh9 (c) Alberto Ruiz 2010BSD3 Alberto Ruiz provisionalNone  =>?@ACHVhmatrix+Structures that may contain complex numbershmatrixSupported real typesihmatrix,Supported single-double precision type pairsjhmatrixCcreates a complex vector from vectors with real and imaginary partskhmatrixthe inverse of  toComplexlmnopqrstuvwxyz(c) Alberto Ruiz 2006-14BSD3 Alberto Ruiz provisionalNone %UVir?{hmatrixMatrix product based on BLAS's dgemm.|hmatrixMatrix product based on BLAS's zgemm.}hmatrixMatrix product based on BLAS's sgemm.~hmatrixMatrix product based on BLAS's cgemm.hmatrix)Full SVD of a real matrix using LAPACK's dgesvd.hmatrix)Full SVD of a real matrix using LAPACK's dgesdd.hmatrix,Full SVD of a complex matrix using LAPACK's zgesvd.hmatrix,Full SVD of a complex matrix using LAPACK's zgesdd.hmatrix*Thin SVD of a real matrix, using LAPACK's dgesvd with jobu == jobvt == 'S'.hmatrix-Thin SVD of a complex matrix, using LAPACK's zgesvd with jobu == jobvt == 'S'.hmatrix*Thin SVD of a real matrix, using LAPACK's dgesdd with jobz == 'S'.hmatrix-Thin SVD of a complex matrix, using LAPACK's zgesdd with jobz == 'S'.hmatrix1Singular values of a real matrix, using LAPACK's dgesvd with jobu == jobvt == 'N'.hmatrix4Singular values of a complex matrix, using LAPACK's zgesvd with jobu == jobvt == 'N'.hmatrix1Singular values of a real matrix, using LAPACK's dgesdd with jobz == 'N'.hmatrix4Singular values of a complex matrix, using LAPACK's zgesdd with jobz == 'N'.hmatrixPSingular values and all right singular vectors of a real matrix, using LAPACK's dgesvd# with jobu == 'N' and jobvt == 'A'.hmatrixSSingular values and all right singular vectors of a complex matrix, using LAPACK's zgesvd# with jobu == 'N' and jobvt == 'A'.hmatrixOSingular values and all left singular vectors of a real matrix, using LAPACK's dgesvd$ with jobu == 'A' and jobvt == 'N'.hmatrixRSingular values and all left singular vectors of a complex matrix, using LAPACK's zgesvd# with jobu == 'A' and jobvt == 'N'.hmatrixOEigenvalues and right eigenvectors of a general complex matrix, using LAPACK's zgeevI. The eigenvectors are the columns of v. The eigenvalues are not sorted.hmatrix8Eigenvalues of a general complex matrix, using LAPACK's zgeev3 with jobz == 'N'. The eigenvalues are not sorted.hmatrixLEigenvalues and right eigenvectors of a general real matrix, using LAPACK's dgeevI. The eigenvectors are the columns of v. The eigenvalues are not sorted.hmatrix5Eigenvalues of a general real matrix, using LAPACK's dgeev3 with jobz == 'N'. The eigenvalues are not sorted.hmatrixZGeneralized eigenvalues and right eigenvectors of a pair of real matrices, using LAPACK's dggevk. The eigenvectors are the columns of v. The eigenvalues are represented as alphas / betas and not sorted.hmatrix]Generalized eigenvalues and right eigenvectors of a pair of complex matrices, using LAPACK's zggevk. The eigenvectors are the columns of v. The eigenvalues are represented as alphas / betas and not sorted.hmatrixNEigenvalues and right eigenvectors of a symmetric real matrix, using LAPACK's dsyev_. The eigenvectors are the columns of v. The eigenvalues are sorted in descending order (use  for ascending order).hmatrix in ascending orderhmatrixQEigenvalues and right eigenvectors of a hermitian complex matrix, using LAPACK's zheev_. The eigenvectors are the columns of v. The eigenvalues are sorted in descending order (use  for ascending order).hmatrix in ascending orderhmatrix7Eigenvalues of a symmetric real matrix, using LAPACK's dsyevC with jobz == 'N'. The eigenvalues are sorted in descending order.hmatrix:Eigenvalues of a hermitian complex matrix, using LAPACK's zheevC with jobz == 'N'. The eigenvalues are sorted in descending order.hmatrixSolve a real linear system (for square coefficient matrix and several right-hand sides) using the LU decomposition, based on LAPACK's dgesv6. For underconstrained or overconstrained systems use  or  . See also .hmatrixSolve a complex linear system (for square coefficient matrix and several right-hand sides) using the LU decomposition, based on LAPACK's zgesv6. For underconstrained or overconstrained systems use  or  . See also .hmatrixwSolves a symmetric positive definite system of linear equations using a precomputed Cholesky factorization obtained by .hmatrixwSolves a Hermitian positive definite system of linear equations using a precomputed Cholesky factorization obtained by .hmatrix/Solves a triangular system of linear equations.hmatrix/Solves a triangular system of linear equations.hmatrix0Solves a tridiagonal system of linear equations.hmatrixLeast squared error solution of an overconstrained real linear system, or the minimum norm solution of an underconstrained system, using LAPACK's dgels!. For rank-deficient systems use .hmatrixLeast squared error solution of an overconstrained complex linear system, or the minimum norm solution of an underconstrained system, using LAPACK's zgels!. For rank-deficient systems use .hmatrixkMinimum norm solution of a general real linear least squares problem Ax=B using the SVD, based on LAPACK's dgelss6. Admits rank-deficient systems but it is slower than . The effective rank of A is determined by treating as zero those singular valures which are less than rcond times the largest singular value. If rcond == Nothing machine precision is used.hmatrixnMinimum norm solution of a general complex linear least squares problem Ax=B using the SVD, based on LAPACK's zgelss6. Admits rank-deficient systems but it is slower than . The effective rank of A is determined by treating as zero those singular valures which are less than rcond times the largest singular value. If rcond == Nothing machine precision is used.hmatrixWCholesky factorization of a complex Hermitian positive definite matrix, using LAPACK's zpotrf.hmatrixTCholesky factorization of a real symmetric positive definite matrix, using LAPACK's dpotrf.hmatrixWCholesky factorization of a complex Hermitian positive definite matrix, using LAPACK's zpotrf ( version).hmatrixTCholesky factorization of a real symmetric positive definite matrix, using LAPACK's dpotrf ( version).hmatrix2QR factorization of a real matrix, using LAPACK's dgeqr2.hmatrix5QR factorization of a complex matrix, using LAPACK's zgeqr2.hmatrixbuild rotation from reflectorshmatrixbuild rotation from reflectorshmatrixAHessenberg factorization of a square real matrix, using LAPACK's dgehrd.hmatrixDHessenberg factorization of a square complex matrix, using LAPACK's zgehrd.hmatrix<Schur factorization of a square real matrix, using LAPACK's dgees.hmatrix?Schur factorization of a square complex matrix, using LAPACK's zgees.hmatrix:LU factorization of a general real matrix, using LAPACK's dgetrf.hmatrix=LU factorization of a general complex matrix, using LAPACK's zgetrf.hmatrix@Solve a real linear system from a precomputed LU decomposition (), using LAPACK's dgetrs.hmatrixCSolve a complex linear system from a precomputed LU decomposition (), using LAPACK's zgetrs.hmatrix=LDL factorization of a symmetric real matrix, using LAPACK's dsytrf.hmatrix@LDL factorization of a hermitian complex matrix, using LAPACK's zhetrf.hmatrixASolve a real linear system from a precomputed LDL decomposition (), using LAPACK's dsytrs.hmatrixDSolve a complex linear system from a precomputed LDL decomposition (), using LAPACK's zsytrs.hmatrixrcondhmatrixcoefficient matrixhmatrixright hand sides (as columns)hmatrixsolution vectors (as columns)hmatrixrcondhmatrixcoefficient matrixhmatrixright hand sides (as columns)hmatrixsolution vectors (as columns){|}~     1(c) Alberto Ruiz 2010-14BSD3 Alberto Ruiz provisionalNone  =>?@ACHV#hmatrixconjugate transposehmatrix transposehmatrix$Matrix product and related functionshmatrixmatrix producthmatrix@sum of absolute value of elements (differs in complex case from norm1)hmatrix!sum of absolute value of elementshmatrixeuclidean normhmatrixelement of maximum magnitudehmatrixkonst 7 3 :: Vector FloatfromList [7.0,7.0,7.0]konst i (3::Int,4::Int)(3><4)1 [ 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.01 , 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.03 , 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.0 ]hmatrix9Basic element-by-element functions for numeric containershmatrix!element by element multiplicationhmatrix6scale the element by element reciprocal of the object: @scaleRecip 2 (fromList [5,i]) == 2 |> [0.4 :+ 0.0,0.0 :+ (-2.0)]hmatrixelement by element divisionhmatrix(create a structure with a single elementlet v = fromList [1..3::Double]v / scalar (norm2 v)CfromList [0.2672612419124244,0.5345224838248488,0.8017837257372732]hmatrixcomplex conjugatehmatrix  for integer arrayscmod 3 (range 5)fromList [0,1,2,0,1]hmatrix2fromInt ((2><2) [0..3]) :: Matrix (Complex Double)(2><2)[ 0.0 :+ 0.0, 1.0 :+ 0.0, 2.0 :+ 0.0, 3.0 :+ 0.0 ]hmatrixlike !H (cannot implement instance Functor because of Element class constraint)hmatrixgeneric indexing functionvector [1,2,3] `atIndex` 12.0matrix 3 [0..8] `atIndex` (2,0)6.0hmatrixindex of minimum elementhmatrixindex of maximum elementhmatrixvalue of minimum elementhmatrixvalue of maximum elementhmatrixthe sum of elementshmatrixthe product of elementshmatrix#A more efficient implementation of !cmap (\x -> if x>0 then 1 else 0) step $ linspace 5 (-1,1::Double)5 |> [0.0,0.0,0.0,1.0,1.0]hmatrixElement by element version of /case compare a b of {LT -> l; EQ -> e; GT -> g}.<Arguments with any dimension = 1 are automatically expanded:Econd ((1><4)[1..]) ((3><1)[1..]) 0 100 ((3><4)[1..]) :: Matrix Double(3><4)[ 100.0, 2.0, 3.0, 4.0, 0.0, 100.0, 7.0, 8.0, 0.0, 0.0, 100.0, 12.0 ]$let chop x = cond (abs x) 1E-6 0 0 xhmatrix0Find index of elements which satisfy a predicate$find (>0) (ident 3 :: Matrix Double)[(0,0),(1,1),(2,2)]hmatrix+Create a structure from an association list(assoc 5 0 [(3,7),(1,4)] :: Vector DoublefromList [0.0,4.0,0.0,7.0,0.0]Bassoc (2,3) 0 [((0,2),7),((1,0),2*i-3)] :: Matrix (Complex Double)(2><3)( [ 0.0 :+ 0.0, 0.0 :+ 0.0, 7.0 :+ 0.0* , (-3.0) :+ 2.0, 0.0 :+ 0.0, 0.0 :+ 0.0 ]hmatrix+Modify a structure using an update function:accum (ident 5) (+) [((1,1),5),((0,3),3)] :: Matrix Double(5><5) [ 1.0, 0.0, 0.0, 3.0, 0.0 , 0.0, 6.0, 0.0, 0.0, 0.0 , 0.0, 0.0, 1.0, 0.0, 0.0 , 0.0, 0.0, 0.0, 1.0, 0.0 , 0.0, 0.0, 0.0, 0.0, 1.0 ]computation of histogram:Iaccum (konst 0 7) (+) (map (flip (,) 1) [4,5,4,1,5,2,5]) :: Vector Double&fromList [0.0,1.0,1.0,0.0,2.0,3.0,0.0]hmatrixunconjugated dot producthmatrixOuter product of two vectors.)fromList [1,2,3] `outer` fromList [5,2,3](3><3) [ 5.0, 2.0, 3.0 , 10.0, 4.0, 6.0 , 15.0, 6.0, 9.0 ]hmatrix"Kronecker product of two matrices. m1=(2><3) [ 1.0, 2.0, 0.0 , 0.0, -1.0, 3.0 ] m2=(4><3) [ 1.0, 2.0, 3.0 , 4.0, 5.0, 6.0 , 7.0, 8.0, 9.0 , 10.0, 11.0, 12.0 ]kronecker m1 m2 (8><9): [ 1.0, 2.0, 3.0, 2.0, 4.0, 6.0, 0.0, 0.0, 0.0: , 4.0, 5.0, 6.0, 8.0, 10.0, 12.0, 0.0, 0.0, 0.0: , 7.0, 8.0, 9.0, 14.0, 16.0, 18.0, 0.0, 0.0, 0.0: , 10.0, 11.0, 12.0, 20.0, 22.0, 24.0, 0.0, 0.0, 0.0: , 0.0, 0.0, 0.0, -1.0, -2.0, -3.0, 3.0, 6.0, 9.0: , 0.0, 0.0, 0.0, -4.0, -5.0, -6.0, 12.0, 15.0, 18.0: , 0.0, 0.0, 0.0, -7.0, -8.0, -9.0, 21.0, 24.0, 27.0< , 0.0, 0.0, 0.0, -10.0, -11.0, -12.0, 30.0, 33.0, 36.0 ]hmatrix.Creates a square matrix with a given diagonal.hmatrix.creates the identity matrix of given dimension"hmatrixsizehmatrix default valuehmatrixassociation listhmatrixresult#hmatrixinitial structurehmatrixupdate functionhmatrixassociation listhmatrixresulthmatrixahmatrixbhmatrixlhmatrixehmatrixghmatrixresulthmatrixsizehmatrix default valuehmatrixassociation listhmatrixresulthmatrixinitial structurehmatrixupdate functionhmatrixassociation listhmatrixresultr$%&'()*+,#"-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVNone "#=?@AbhmatrixyGeneral matrix with specialized internal representations for dense, sparse, diagonal, banded, and constant elements./let m = mkSparse [((0,999),1.0),((1,1999),2.0)]m3SparseR {gmCSR = CSR {csrVals = fromList [1.0,2.0],5 csrCols = fromList [1000,2000],1 csrRows = fromList [1,2,3],# csrNRows = 2,' csrNCols = 2000}, nRows = 2,# nCols = 2000}let m = mkDense (mat 2 [1..4])mDense {gmDense = (2><2) [ 1.0, 2.0$ , 3.0, 4.0 ], nRows = 2, nCols = 2}hmatrixgeneral matrix - vector product/let m = mkSparse [((0,999),1.0),((1,1999),2.0)] m :: GMatrixm !#> vector [1..2000][1000.0,4000.0]it :: Vector DoubleWX08(c) Vivian McPhail 2010BSD36Vivian McPhail <haskell.vivian.mcphail <at> gmail.com> provisionalportableNone >kYhmatrixlProvide optimal association order for a chain of matrix multiplications and apply the multiplications.xThe algorithm is the well-known O(n^3) dynamic programming algorithm that builds a pyramid of optimal associations. mm1, m2, m3, m4 :: Matrix Double m1 = (10><15) [1..] m2 = (15><20) [1..] m3 = (20><5) [1..] m4 = (5><10) [1..] >>> optimiseMult [m1,m2,m3,m4] will perform ((m1  (m2  m3))  m4)2The naive left-to-right multiplication would take 4500? scalar multiplications whereas the optimised version performs 2750 scalar multiplications. The complexity in this case is 32 (= 4^3/2) * (2 comparisons, 3 scalar multiplications, 3 scalar additions, 5 lookups, 2 updates) + a constant (= three table allocations)Y(c) Alberto Ruiz 2006-14BSD3 Alberto Ruiz provisionalNone  =>?@AHVHhmatrixVA matrix that, by construction, it is known to be complex Hermitian or real symmetric.It can be created using 7, 8, or 9(, and the matrix can be extracted using 6.hmatrix_QR decomposition of a matrix in compact form. (The orthogonal matrix is not explicitly formed.)hmatrixVLDL decomposition of a complex Hermitian or real symmetric matrix in a compact format.hmatrix1LU decomposition of a matrix in a compact format.hmatrixPGeneric linear algebra functions for double precision real and complex matrices..(Single precision data can be converted using  and ).hmatrix"Full singular value decomposition. a = (5><3) [ 1.0, 2.0, 3.0 , 4.0, 5.0, 6.0 , 7.0, 8.0, 9.0 , 10.0, 11.0, 12.0 , 13.0, 14.0, 15.0 ] :: Matrix Double let (u,s,v) = svd adisp 3 u5x5&-0.101 0.768 0.614 0.028 -0.149&-0.249 0.488 -0.503 0.172 0.646&-0.396 0.208 -0.405 -0.660 -0.449&-0.543 -0.072 -0.140 0.693 -0.447&-0.690 -0.352 0.433 -0.233 0.398s<[35.18264833189422,1.4769076999800903,1.089145439970417e-15]it :: Vector Doubledisp 3 v3x3-0.519 -0.751 0.408-0.576 -0.046 -0.816-0.632 0.659 0.408let d = diagRect 0 s 5 3disp 3 d5x335.183 0.000 0.000 0.000 1.477 0.000 0.000 0.000 0.000 0.000 0.000 0.000disp 3 $ u <> d <> tr v5x3 1.000 2.000 3.000 4.000 5.000 6.000 7.000 8.000 9.00010.000 11.000 12.00013.000 14.000 15.000hmatrix A version of  which returns only the min (rows m) (cols m) singular vectors of m.If (u,s,v) = thinSVD m then m == u <> diag s <> tr v. a = (5><3) [ 1.0, 2.0, 3.0 , 4.0, 5.0, 6.0 , 7.0, 8.0, 9.0 , 10.0, 11.0, 12.0 , 13.0, 14.0, 15.0 ] :: Matrix Double let (u,s,v) = thinSVD adisp 3 u5x3-0.101 0.768 0.614-0.249 0.488 -0.503-0.396 0.208 -0.405-0.543 -0.072 -0.140-0.690 -0.352 0.433s<[35.18264833189422,1.4769076999800903,1.089145439970417e-15]it :: Vector Doubledisp 3 v3x3-0.519 -0.751 0.408-0.576 -0.046 -0.816-0.632 0.659 0.408disp 3 $ u <> diag s <> tr v5x3 1.000 2.000 3.000 4.000 5.000 6.000 7.000 8.000 9.00010.000 11.000 12.00013.000 14.000 15.000hmatrixSingular values only.Zhmatrix A version of G which returns an appropriate diagonal matrix with the singular values.If (u,d,v) = fullSVD m then m == u <> d <> tr v.hmatrix Similar to T, returning only the nonzero singular values and the corresponding singular vectors. a = (5><3) [ 1.0, 2.0, 3.0 , 4.0, 5.0, 6.0 , 7.0, 8.0, 9.0 , 10.0, 11.0, 12.0 , 13.0, 14.0, 15.0 ] :: Matrix Double let (u,s,v) = compactSVD adisp 3 u5x2-0.101 0.768-0.249 0.488-0.396 0.208-0.543 -0.072-0.690 -0.352s%[35.18264833189422,1.476907699980091]it :: Vector Doubledisp 3 u5x2-0.101 0.768-0.249 0.488-0.396 0.208-0.543 -0.072-0.690 -0.352disp 3 $ u <> diag s <> tr v5x3 1.000 2.000 3.000 4.000 5.000 6.000 7.000 8.000 9.00010.000 11.000 12.00013.000 14.000 15.000hmatrixcompactSVDTol r is similar to  (for which r=1), but uses tolerance tol=r*g*eps*(max rows cols)/ to distinguish nonzero singular values, where g$ is the greatest singular value. If g<r*eps+, then only one singular value is returned.hmatrix<Singular values and all right singular vectors (as columns).hmatrix;Singular values and all left singular vectors (as columns).hmatrixRObtains the LU decomposition of a matrix in a compact data structure suitable for .hmatrixmSolution of a linear system (for several right hand sides) from the precomputed LU factorization obtained by .[hmatrixSolve a linear system (for square coefficient matrix and several right-hand sides) using the LU decomposition. For underconstrained or overconstrained systems use   or  . It is similar to  . , but  linearSolve0 raises an error if called on a singular system.\hmatrixSolve a linear system (for square coefficient matrix and several right-hand sides) using the LU decomposition, returning Nothing for a singular system. For underconstrained or overconstrained systems use   or  .hmatrixvSolve a symmetric or Hermitian positive definite linear system using a precomputed Cholesky decomposition obtained by  .hmatrix%Solve a triangular linear system. If D is specified then all elements below the diagonal are ignored; if @ is specified then all elements above the diagonal are ignored. hmatrix=Solve a tridiagonal linear system. Suppose you wish to solve Ax = b where A = \begin{bmatrix} 1.0 & 4.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ 3.0 & 1.0 & 4.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 3.0 & 1.0 & 4.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 3.0 & 1.0 & 4.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 3.0 & 1.0 & 4.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 3.0 & 1.0 & 4.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 3.0 & 1.0 & 4.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 3.0 & 1.0 & 4.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 3.0 & 1.0 \end{bmatrix} \quad b = \begin{bmatrix} 1.0 & 1.0 & 1.0 \\ 1.0 & -1.0 & 2.0 \\ 1.0 & 1.0 & 3.0 \\ 1.0 & -1.0 & 4.0 \\ 1.0 & 1.0 & 5.0 \\ 1.0 & -1.0 & 6.0 \\ 1.0 & 1.0 & 7.0 \\ 1.0 & -1.0 & 8.0 \\ 1.0 & 1.0 & 9.0 \end{bmatrix} then dL = fromList [3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0] d = fromList [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] dU = fromList [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0] b = (9><3) [ 1.0, 1.0, 1.0, 1.0, -1.0, 2.0, 1.0, 1.0, 3.0, 1.0, -1.0, 4.0, 1.0, 1.0, 5.0, 1.0, -1.0, 6.0, 1.0, 1.0, 7.0, 1.0, -1.0, 8.0, 1.0, 1.0, 9.0 ] x = triDiagSolve dL d dU b  hmatrixMinimum norm solution of a general linear least squares problem Ax=B using the SVD. Admits rank-deficient systems but it is slower than  g. The effective rank of A is determined by treating as zero those singular valures which are less than ]" times the largest singular value. hmatrixLeast squared error solution of an overconstrained linear system, or the minimum norm solution of an underconstrained system. For rank-deficient systems use  .^hmatrix Similar to  l, without checking that the input matrix is hermitian or symmetric. It works with the lower triangular part. hmatrixSObtains the LDL decomposition of a matrix in a compact data structure suitable for  . hmatrixlSolution of a linear system (for several right hand sides) from a precomputed LDL factorization obtained by  .ONote: this can be slower than the general solver based on the LU decomposition.hmatrixSEigenvalues (not ordered) and eigenvectors (as columns) of a general square matrix.If  (s,v) = eig m then m <> v == v <> diag s Ba = (3><3) [ 3, 0, -2 , 4, 5, -1 , 3, 1, 0 ] :: Matrix Double let (l, v) = eig aputStr . dispcf 3 . asRow $ l1x3!1.925+1.523i 1.925-1.523i 4.151putStr . dispcf 3 $ v3x3$-0.455+0.365i -0.455-0.365i 0.181$ 0.603 0.603 -0.978$ 0.033+0.543i 0.033-0.543i -0.104"putStr . dispcf 3 $ complex a <> v3x3$-1.432+0.010i -1.432-0.010i 0.753$ 1.160+0.918i 1.160-0.918i -4.059$-0.763+1.096i -0.763-1.096i -0.433putStr . dispcf 3 $ v <> diag l3x3$-1.432+0.010i -1.432-0.010i 0.753$ 1.160+0.918i 1.160-0.918i -4.059$-0.763+1.096i -0.763-1.096i -0.433hmatrix Generalized eigenvalues (not ordered) and eigenvectors (as columns) of a pair of nonsymmetric matrices. Eigenvalues are represented as pairs of alpha, beta, where eigenvalue = alpha / beta. Alpha is always complex, but betas has the same type as the input matrix.If (alphas, betas, v) = geig a b, then )a <> v == b <> v <> diag (alphas / betas)?Note that beta can be 0 and that has reasonable interpretation.hmatrix5Eigenvalues (not ordered) of a general square matrix.hmatrix|Generalized eigenvalues of a pair of matrices. Represented as pairs of alpha, beta, where eigenvalue is alpha / beta as in .hmatrix Similar to k without checking that the input matrix is hermitian or symmetric. It works with the upper triangular part.hmatrix Similar to k without checking that the input matrix is hermitian or symmetric. It works with the upper triangular part.hmatrixoEigenvalues and eigenvectors (as columns) of a complex hermitian or real symmetric matrix, in descending order.If (s,v) = eigSH m then m == v <> diag s <> tr v @a = (3><3) [ 1.0, 2.0, 3.0 , 2.0, 4.0, 5.0 , 3.0, 5.0, 6.0 ] let (l, v) = eigSH al<[11.344814282762075,0.17091518882717918,-0.5157294715892575]disp 3 $ v <> diag l <> tr v3x31.000 2.000 3.0002.000 4.000 5.0003.000 5.000 6.000hmatrixREigenvalues (in descending order) of a complex hermitian or real symmetric matrix.hmatrixQR factorization.If  (q,r) = qr m then  m == q <> rs, where q is unitary and r is upper triangular. Note: the current implementation is very slow for large matrices.  is much faster.hmatrix A version of  which returns only the min (rows m) (cols m) columns of q and rows of r.hmatrix9Compute the QR decomposition of a matrix in compact form.hmatrixZgenerate a matrix with k orthogonal columns from the compact QR decomposition obtained by .hmatrixRQ factorization.If  (r,q) = rq m then  m == r <> qs, where q is unitary and r is upper triangular. Note: the current implementation is very slow for large matrices.  is much faster.hmatrix A version of  which returns only the min (rows m) (cols m) columns of r and rows of q.hmatrixHessenberg factorization.If (p,h) = hess m then m == p <> h <> tr pj, where p is unitary and h is in upper Hessenberg form (it has zero entries below the first subdiagonal).hmatrixSchur factorization.If (u,s) = schur m then m == u <> s <> tr u, where u is unitary and s is a Shur matrix. A complex Schur matrix is upper triangular. A real Schur matrix is upper triangular in 2x2 blocks.c"Anything that the Jordan decomposition can do, the Schur decomposition can do better!" (Van Loan)hmatrix Similar to V, but instead of an error (e.g., caused by a matrix not positive definite) it returns _.hmatrix Similar to  l, without checking that the input matrix is hermitian or symmetric. It works with the upper triangular part. hmatrixLCholesky factorization of a positive definite hermitian or symmetric matrix.If  c = chol m then c is upper triangular and m == tr c <> c.!hmatrix Similar to  V, but instead of an error (e.g., caused by a matrix not positive definite) it returns _."hmatrixMJoint computation of inverse and logarithm of determinant of a square matrix.#hmatrixLDeterminant of a square matrix. To avoid possible overflow or underflow use ".$hmatrix.Explicit LU factorization of a general matrix.If (l,u,p,s) = lu m then m == p <> l <> u{, where l is lower triangular, u is upper triangular, p is a permutation matrix and s is the signature of the permutation.%hmatrix%Inverse of a square matrix. See also ".&hmatrix:Pseudoinverse of a general matrix with default tolerance (' 1, similar to GNU-Octave).'hmatrix pinvTol r7 computes the pseudoinverse of a matrix with tolerance tol=r*g*eps*(max rows cols)), where g is the greatest singular value. [m = (3><3) [ 1, 0, 0 , 0, 1, 0 , 0, 0, 1e-10] :: Matrix Double pinv m1. 0. 0.0. 1. 0.0. 0. 10000000000. pinvTol 1E8 m1. 0. 0.0. 1. 0.0. 0. 1.`hmatrix4Numeric rank of a matrix from the SVD decomposition.(hmatrix2Numeric rank of a matrix from its singular values.]hmatrix#The machine precision of a Double: eps = 2.22044604925031e-16 (the value used by GNU-Octave).)hmatrix%1 + 0.5*peps == 1, 1 + 0.6*peps /= 1*hmatrixAThe nullspace of a matrix from its precomputed SVD decomposition.ahmatrix$The nullspace of a matrix. See also *.bhmatrixQThe nullspace of a matrix, assumed to be one-dimensional, with machine precision.+hmatrix@The range space a matrix from its precomputed SVD decomposition.chmatrix:Return an orthonormal basis of the range space of a matrix-hmatrixYReciprocal of the 2-norm condition number of a matrix, computed from the singular values..hmatrix9Number of linearly independent rows or columns. See also (/hmatrixCGeneric matrix functions for diagonalizable matrices. For instance: logm = matFunc log0hmatrixMatrix exponential. It uses a direct translation of Algorithm 11.3.1 in Golub & Van Loan, based on a scaled Pade approximation.1hmatrixMatrix square root. Currently it uses a simple iterative algorithm described in Wikipedia. It only works with invertible matrices that have a real solution. 1m = (2><2) [4,9 ,0,4] :: Matrix Doublesqrtm m(2><2) [ 2.0, 2.25 , 0.0, 2.0 ](For diagonalizable matrices you can try / sqrt: matFunc sqrt ((2><2) [1,0,0,-1])(2><2) [ 1.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 1.0 ]2hmatrixGCompute the explicit LU decomposition from the compact one obtained by .dhmatrix;Approximate number of common digits in the maximum element.4hmatrixjGeneralized symmetric positive definite eigensystem Av = lBv, for A and B symmetric, B positive definite.6hmatrix"Extract the general matrix from a ; structure, forgetting its symmetric or Hermitian property.7hmatrixICompute the complex Hermitian or real symmetric part of a square matrix ( (x + tr x)/2).8hmatrixCompute the contraction  tr x <> x of a general matrix.9hmatrix_At your own risk, declare that a matrix is complex Hermitian or real symmetric for usage in  , 9, etc. Only a triangular part of the matrix will be used. hmatrix0Cholesky decomposition of the coefficient matrixhmatrixright hand sideshmatrixsolutionhmatrix or hmatrixcoefficient matrixhmatrixright hand sideshmatrixsolution hmatrixlower diagonal: n - 1 elementshmatrix diagonal: n elementshmatrixupper diagonal: n - 1 elementshmatrixright hand sideshmatrixsolution"hmatrix.(inverse, (log abs det, sign or phase of det))`hmatrixnumeric zero (e.g. 1*])hmatrixinput matrix mhmatrixsv of mhmatrix rank of m(hmatrixnumeric zero (e.g. 1*])hmatrixmaximum dimension of the matrixhmatrixsingular valueshmatrix rank of m*hmatrixLeft "numeric" zero (eg. 1*])), or Right "theoretical" matrix rank.hmatrixinput matrix mhmatrix of mhmatrix nullspaceahmatrixrelative tolerance in ] units (e.g., use 3 to get 3*])hmatrix input matrixhmatrix.list of unitary vectors spanning the nullspace+hmatrixLeft "numeric" zero (eg. 1*])), or Right "theoretical" matrix rank.hmatrixinput matrix mhmatrix of mhmatrixorth4hmatrixAhmatrixB5hmatrixAhmatrixBefghijklmnopqrstuvwxyz{|}~Z[\   ^   !"#$%&'`(])*ab+c,-./012d3456789(c) Alberto Ruiz 2009-14BSD3 Alberto Ruiz provisionalNone i:hmatrix`Obtains a matrix whose rows are pseudorandom samples from a multivariate Gaussian distribution.;hmatrix_Obtains a matrix whose rows are pseudorandom samples from a multivariate uniform distribution.hmatrix9pseudorandom matrix with uniform elements between 0 and 1<hmatrix9pseudorandom matrix with uniform elements between 0 and 1=hmatrix(pseudorandom matrix with normal elementsdisp 3 =<< randn 3 53x5%0.386 -1.141 0.491 -0.510 1.512%0.069 -0.919 1.022 -0.181 0.745%0.313 -0.670 -0.097 -1.575 -0.583:hmatrixnumber of rowshmatrix mean vectorhmatrixcovariance matrixhmatrixresult;hmatrixnumber of rowshmatrixranges for each columnhmatrixresulthmatrixrowshmatrixcolumns )*+,-:;<=(c) Alberto Ruiz 2010-14BSD3 Alberto Ruiz provisionalNone  =>?@AC! ?hmatrixbuild 5 (**2) :: Vector Double[0.0,1.0,4.0,9.0,16.0]it :: Vector DoubleHilbert matrix of order N:=let hilb n = build (n,n) (\i j -> 1/(i+j+1)) :: Matrix DoubleputStr . dispf 2 $ hilb 33x31.00 0.50 0.330.50 0.33 0.250.33 0.25 0.20hmatrix9Matrix-matrix, matrix-vector, and vector-matrix products.Ahmatrix3Creates a real vector containing a range of values:linspace 5 (-3,7::Double)[-3.0,-0.5,2.0,4.5,7.0]it :: Vector Double.linspace 5 (8,3:+2) :: Vector (Complex Double):[8.0 :+ 0.0,6.75 :+ 0.5,5.5 :+ 1.0,4.25 :+ 1.5,3.0 :+ 2.0]it :: Vector (Complex Double).Logarithmic spacing can be defined as follows: )logspace n (a,b) = 10 ** linspace n (a,b)BhmatrixAn infix synonym for F&vector [1,2,3,4] <.> vector [-2,0,1,1]5.0let V = 0:+1 :: C%fromList [1+V,1] <.> fromList [1,1+V] 2.0 :+ 0.0Chmatrixdense matrix-vector productlet m = (2><3) [1..]m(2><3) [ 1.0, 2.0, 3.0 , 4.0, 5.0, 6.0 ]let v = vector [10,20,30]m #> v [140.0,320.0])it :: Vector Numeric.LinearAlgebra.Data.Rhmatrixdense matrix-vector productDhmatrixdense vector-matrix productEhmatrixoLeast squares solution of a linear system, similar to the \ operator of Matlab/Octave (based on linearSolveSVD) 4a = (3><2) [ 1.0, 2.0 , 2.0, 4.0 , 2.0, -1.0 ]  v = vector [13.0,27.0,1.0] let x = a <\> vx&[3.0799999999999996,5.159999999999999])it :: Vector Numeric.LinearAlgebra.Data.Ra #> x:[13.399999999999999,26.799999999999997,0.9999999999999991])it :: Vector Numeric.LinearAlgebra.Data.RGIt also admits multiple right-hand sides stored as columns in a matrix.HhmatrixBCompute mean vector and covariance matrix of the rows of a matrix.JmeanCov $ gaussianSample 666 1000 (fromList[4,5]) (trustSym $ diagl [2,3])3([3.9933155655086696,5.061409102770331],Herm (2><2)/ [ 1.9963242906624408, -4.227815571404954e-22 , -4.227815571404954e-2, 3.2003833097832857 ])"it :: (Vector Double, Herm Double)Jhmatrixm <- randn 4 10disp 2 m4x10D-0.31 0.41 0.43 -0.19 -0.17 -0.23 -0.17 -1.04 -0.07 -1.24D 0.26 0.19 0.14 0.83 -1.54 -0.09 0.37 -0.63 0.71 -0.50D-0.11 -0.10 -1.29 -1.40 -1.04 -0.89 -0.68 0.35 -1.46 1.86D 1.04 -0.29 0.19 -0.75 -2.20 -0.01 1.06 0.11 -2.09 -1.58*disp 2 $ m ?? (All, Pos $ sortIndex (m!1))4x10D-0.17 -1.04 -1.24 -0.23 0.43 0.41 -0.31 -0.17 -0.07 -0.19D-1.54 -0.63 -0.50 -0.09 0.14 0.19 0.26 0.37 0.71 0.83D-1.04 0.35 1.86 -0.89 -1.29 -0.10 -0.11 -0.68 -1.46 -1.40D-2.20 0.11 -1.58 -0.01 0.19 -0.29 1.04 1.06 -2.09 -0.75KhmatrixFExtract elements from positions given in matrices of rows and columns.r(3><3) [ 1, 1, 1 , 1, 2, 2 , 1, 2, 3 ]c(3><3) [ 0, 1, 5 , 2, 2, 1 , 4, 4, 1 ]m(4><6) [ 0, 1, 2, 3, 4, 5 , 6, 7, 8, 9, 10, 11 , 12, 13, 14, 15, 16, 17 , 18, 19, 20, 21, 22, 23 ] remap r c m(3><3) [ 6, 7, 11 , 8, 14, 13 , 10, 16, 19 ] The indexes are autoconformable.c'(3><1) [ 1 , 2 , 4 ] remap r c' m(3><3) [ 7, 7, 7 , 8, 14, 14 , 10, 16, 22 ]>?@ABCDEFGHIJK7B8C8D8E7(c) Alberto Ruiz 2012BSD3 Alberto Ruiz provisionalNone >Lhmatrix correlation)corr (fromList[1,2,3]) (fromList [1..10]))[14.0,20.0,26.0,32.0,38.0,44.0,50.0,56.0]9it :: (Enum t, Product t, Container Vector t) => Vector tMhmatrix convolution (LI with reversed kernel and padded input, equivalent to polynomial product)&conv (fromList[1,1]) (fromList [-1,1])[-1.0,0.0,1.0]1it :: (Product t, Container Vector t) => Vector tNhmatrix similar to L, using  instead of (*)Ohmatrix 2D correlation (without padding):disp 5 $ corr2 (konst 1 (3,3)) (ident 10 :: Matrix Double) 8x83 2 1 0 0 0 0 02 3 2 1 0 0 0 01 2 3 2 1 0 0 00 1 2 3 2 1 0 00 0 1 2 3 2 1 00 0 0 1 2 3 2 10 0 0 0 1 2 3 20 0 0 0 0 1 2 3Phmatrix2D convolution:disp 5 $ conv2 (konst 1 (3,3)) (ident 10 :: Matrix Double) 12x12"1 1 1 0 0 0 0 0 0 0 0 0"1 2 2 1 0 0 0 0 0 0 0 0"1 2 3 2 1 0 0 0 0 0 0 0"0 1 2 3 2 1 0 0 0 0 0 0"0 0 1 2 3 2 1 0 0 0 0 0"0 0 0 1 2 3 2 1 0 0 0 0"0 0 0 0 1 2 3 2 1 0 0 0"0 0 0 0 0 1 2 3 2 1 0 0"0 0 0 0 0 0 1 2 3 2 1 0"0 0 0 0 0 0 0 1 2 3 2 1"0 0 0 0 0 0 0 0 1 2 2 1"0 0 0 0 0 0 0 0 0 1 1 1QhmatrixRmatrix computation implemented as separated vector operations by rows and columns.LhmatrixkernelhmatrixsourcePhmatrixkernelLMNOPQ(c) Alberto Ruiz 2014BSD3 Alberto Ruiz provisionalNone s  !"#$%&'(234789:ABCEFHJKLMNOPRQSTUWVXYZ[\]^_`abcdefghijklmnopqrstuvwxyzs C!"#$%23479:B'&(A [h\c^efabZviqkrsnozxtwLMNOPRQSTUWVXYyJKg_`]dulmjp EF8H(c) Alberto Ruiz 2014BSD3 Alberto Ruiz provisionalNone  =>?@AHV (c) Alberto Ruiz 2011BSD3 Alberto Ruiz provisionalNone  =>?@AHV (c) Alberto Ruiz 2013BSD3 Alberto Ruiz provisionalNone %=>?@ACXI!RhmatrixAlternative indexing function.vector [1..10] ! 34.0-On a matrix it gets the k-th row as a vector:matrix 5 [1..15] ! 1[6.0,7.0,8.0,9.0,10.0]it :: Vector Doublematrix 5 [1..15] ! 1 ! 39.0Thmatrix.p-norm for vectors, operator norm for matrices[hmatriximaginary unit\hmatrixCreate a real vector. vector [1..5][1.0,2.0,3.0,4.0,5.0]it :: Vector R]hmatrixCreate a real matrix.matrix 5 [1..15](3><5) [ 1.0, 2.0, 3.0, 4.0, 5.0 , 6.0, 7.0, 8.0, 9.0, 10.0! , 11.0, 12.0, 13.0, 14.0, 15.0 ]^hmatrixGprint a real matrix with given number of digits after the decimal pointdisp 5 $ ident 2 / 32x20.33333 0.000000.00000 0.33333_hmatrix)create a real diagonal matrix from a list diagl [1,2,3](3><3) [ 1.0, 0.0, 0.0 , 0.0, 2.0, 0.0 , 0.0, 0.0, 3.0 ]hmatrixa real matrix of zeroshmatrixa real matrix of oneshmatrixconcatenation of real vectors`hmatrixhorizontal concatenationident 3 ||| konst 7 (3,4)(3><7)$ [ 1.0, 0.0, 0.0, 7.0, 7.0, 7.0, 7.0$ , 0.0, 1.0, 0.0, 7.0, 7.0, 7.0, 7.0& , 0.0, 0.0, 1.0, 7.0, 7.0, 7.0, 7.0 ]ahmatrixa synonym for (`) (unicode 0x00a6, broken bar)bhmatrixvertical concatenationchmatrixa synonym for (b) (unicode 0x2014, em dash)dhmatrix+create a single row real matrix from a list row [2,3,1,8](1><4) [ 2.0, 3.0, 1.0, 8.0 ]ehmatrix.create a single column real matrix from a list col [7,-2,4](3><1) [ 7.0 , -2.0 , 4.0 ]fhmatrix extract rows(20><4) [1..] ? [2,1,1](3><4) [ 9.0, 10.0, 11.0, 12.0 , 5.0, 6.0, 7.0, 8.0 , 5.0, 6.0, 7.0, 8.0 ]ghmatrixextract columns2(unicode 0x00bf, inverted question mark, Alt-Gr ?)(3><4) [1..] [3,0](3><2) [ 4.0, 1.0 , 8.0, 5.0 , 12.0, 9.0 ]hhmatrix)cross product (for three-element vectors)hmatrix2-norm of real vectorihmatrix)Frobenius norm (Schatten p-norm with p=2)jhmatrix1Sum of singular values (Schatten p-norm with p=1)khmatrixRCheck if the absolute value or complex magnitude is greater than a given thresholdmagnit 1E-6 (1E-12 :: R)Falsemagnit 1E-6 (3+iC :: C)Truemagnit 0 (3 :: I ./. 5)Truelhmatrix4Obtains a vector in the same direction with 2-norm=1hmatrix trans . invmhmatrixsize $ vector [1..10]10size $ (2><5)[1..10::Double](2,5)nhmatrixgMatrix of pairwise squared distances of row vectors (using the matrix product trick in blog.smola.org)ohmatrixouter products of rowsa(3><2) [ 1.0, 2.0 , 10.0, 20.0 , 100.0, 200.0 ]b(3><3) [ 1.0, 2.0, 3.0 , 4.0, 5.0, 6.0 , 7.0, 8.0, 9.0 ]rowOuters a (b ||| 1)(3><8)< [ 1.0, 2.0, 3.0, 1.0, 2.0, 4.0, 6.0, 2.0< , 40.0, 50.0, 60.0, 10.0, 80.0, 100.0, 120.0, 20.0> , 700.0, 800.0, 900.0, 100.0, 1400.0, 1600.0, 1800.0, 200.0 ]phmatrix5solution of overconstrained homogeneous linear systemqhmatrix?solution of overconstrained homogeneous symmetric linear systemhmatrix8generic reference implementation of gaussian elimination a <> gaussElim a b = buhmatrixExperimental implementation of 1 for any Fractional element type, including @ n  and @ n .3let m = ident 5 + (5><5) [0..] :: Matrix (Z ./. 17)(5><5) [ 1, 1, 2, 3, 4 , 5, 7, 7, 8, 9 , 10, 11, 13, 13, 14 , 15, 16, 0, 2, 2 , 3, 4, 5, 6, 8 ]$let (l,u,p,s) = luFact $ luPacked' ml(5><5) [ 1, 0, 0, 0, 0 , 6, 1, 0, 0, 0 , 12, 7, 1, 0, 0 , 7, 10, 7, 1, 0 , 8, 2, 6, 11, 1 ]u(5><5) [ 15, 16, 0, 2, 2 , 0, 13, 7, 13, 14 , 0, 0, 15, 0, 11 , 0, 0, 0, 15, 15 , 0, 0, 0, 0, 1 ]vhmatrixExperimental implementation of , for any Fractional element type, including @ n  and @ n .-let a = (2><2) [1,2,3,5] :: Matrix (Z ./. 13)(2><2) [ 1, 2 , 3, 5 ]b(2><3) [ 5, 1, 3 , 8, 6, 3 ]luSolve' (luPacked' a) b(2><3) [ 4, 7, 4 , 7, 10, 6 ]]hmatrixnumber of columnshmatrixelements in row orderhmatrixrowshmatrixcolumnshmatrixrowshmatrixcolumnsE<=LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuv S9 3`3a3b2c2f9 g9 0(c) Alberto Ruiz 2015BSD3 experimentalNone &'.=>?@ACHMSUVXNxhmatrixIWrapper with a phantom integer for statically checked modular arithmetic.hmatrix'this instance is only valid for prime mwxw5(c) Alberto Ruiz 2015BSD3 Alberto Ruiz provisionalNone UVP lmnopqrstu ./156;<=>?@DGI{|}~>?AIJKQRS\]^_`bdefgmrstwx~w \/ ]m56<de;D=>?@RS>?A_fgGK`bIJ^I~}|{rst.Qx1None "#=>?_s{hmatrixconjugate gradient|hmatrixresidual}hmatrixsquared norm of residual~hmatrixcurrent solutionhmatrixnormalized size of correctionhmatrixYSolve a sparse linear system using the conjugate gradient method with default parameters.hmatrixYSolve a sparse linear system using the conjugate gradient method with default parameters.hmatrix is symmetrichmatrixcoefficient matrixhmatrixright-hand sidehmatrixsolutionhmatrix symmetrichmatrix/relative tolerance for the residual (e.g. 1E-4)hmatrix%relative tolerance for x (e.g. 1E-3)hmatrixmaximum number of iterationshmatrixcoefficient matrixhmatrixinitial solutionhmatrixright-hand sidehmatrixsolution yz{|}~(c) Alberto Ruiz 2006-15BSD3 Alberto Ruiz provisionalNone >rhmatrixdense matrix productlet a = (3><5) [1..]a(3><5) [ 1.0, 2.0, 3.0, 4.0, 5.0 , 6.0, 7.0, 8.0, 9.0, 10.0! , 11.0, 12.0, 13.0, 14.0, 15.0 ])let b = (5><2) [1,3, 0,2, -1,5, 7,7, 6,0]b(5><2) [ 1.0, 3.0 , 0.0, 2.0 , -1.0, 5.0 , 7.0, 7.0 , 6.0, 0.0 ]a <> b(3><2) [ 56.0, 50.0 , 121.0, 135.0 , 186.0, 220.0 ]hmatrixSolve a linear system (for square coefficient matrix and several right-hand sides) using the LU decomposition, returning Nothing for a singular system. For underconstrained or overconstrained systems use   or  . %a = (2><2) [ 1.0, 2.0 , 3.0, 5.0 ]  3b = (2><3) [ 6.0, 1.0, 10.0 , 15.0, 3.0, 26.0 ] linearSolve a b Just (2><3)E [ -1.4802973661668753e-15, 0.9999999999999997, 1.999999999999997G , 3.000000000000001, 1.6653345369377348e-16, 4.000000000000002 ]let Just x = itdisp 5 x2x3-0.00000 1.00000 2.00000 3.00000 0.00000 4.00000a <> x(2><3) [ 6.0, 1.0, 10.0 , 15.0, 3.0, 26.0 ]hmatrixDreturn an orthonormal basis of the null space of a matrix. See also *.hmatrixEreturn an orthonormal basis of the range space of a matrix. See also +.lmnopqrstu )*+,-./0156;<=>?@DGI{|}~      !"#$%&'()*+,-./012346789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX[\]^_`bdefghijklmnopqrstuvwxyz{|}~FBCDhE  vu   %&'-.#"TUVWXijpq4 !$201/LMNOP,)*+-<=:;Honl)3k,G*+([78960@yz{|}~8(c) Alberto Ruiz 2006-14BSD3 Alberto Ruiz provisionalNone y#lmnopqrstu )*+,-./0156;<=>?@DGI{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ acZY58(c) Alberto Ruiz 2006-14BSD3 provisionalNone %.7=>?@ACHMSUVX6(c) Alberto Ruiz 2014BSD3 experimentalNone %&'.=>?@ACGHMSUVXhmatrix{Useful for constraining two dependently typed vectors to match each other in length when they are unknown at compile-time.hmatrixUseful for constraining two dependently typed matrices to match each other in dimensions when they are unknown at compile-time.hmatrixminimums of each rowhmatrixmaximums of each rowj)*+,TUVWXjTUVWX,)*+44238888 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNO P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j j k l m n o p o q r s t s u v w x y z { | } ~         !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~v"$%qr^;:HI=(tuYO|}zx[Z]OPN8.^`WMTURS`      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                      Q                                                                         ~                                       ! " # $ % & '()*()+ , - ./0123456789:;<=>?@ABCDEFGHIJK(LM(LN(LO(LP(LQ(LR(LS(LT(LU(LVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(~((      !"#$%&'()*+,-./0123456789_:;<=(>?@ABlCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstu!vwxyz{|}~9$%'hmatrix-0.20.0.0-55glPLJrBmaDg6GXqHKnUyNumeric.LinearAlgebra.DevelNumeric.LinearAlgebra.DataNumeric.LinearAlgebraNumeric.LinearAlgebra.HMatrixNumeric.LinearAlgebra.StaticInternal.VectorInternal.DevelInternal.VectorizedInternal.MatrixData.Packed.Matrix fromLists Internal.ST Internal.IOInternal.ElementInternal.ConversionInternal.LAPACKInternal.NumericInternal.SparseInternal.ChainInternal.AlgorithmsInternal.RandomInternal.ContainerInternal.ConvolutionNumeric.MatrixNumeric.Vector Internal.UtilInternal.Modular Internal.CGInternal.Static&vector-0.12.0.3-ChzWbiXyvuNAQj0dcU08SgData.Vector.StorableunsafeToForeignPtrunsafeFromForeignPtrfromListVectorCRZIfiti createVectortoList|>idxs subVectorat'vjointakesV zipVectorWithunzipVectorWith foldVectorfoldVectorWithIndexfoldLoop foldVectorG mapVectorM mapVectorM_mapVectorWithIndexMmapVectorWithIndexM_mapVectorWithIndex toByteStringfromByteString zipVector unzipVector TransArrayTransTransRawapplyapplyRaw//check#|RandDistUniformGaussianSeed randomVector roundVectorrangeElementMatrix MatrixOrderRowMajor ColumnMajorrowscolsorderOf showInternalcmatfmatflattentoListsfromRowstoRows fromColumns toColumnsatM'matrixFromVector createMatrixreshape liftMatrix liftMatrix2 subMatrix reorderVector saveMatrixSliceRowOperAXPYSCALSWAPRowRangeAllRowsRowFromRowColRangeAllColsColFromColSTMatrixSTVector thawVectorunsafeThawVector runSTVectorunsafeReadVectorunsafeWriteVector modifyVector liftSTVector freezeVectorunsafeFreezeVector readVector writeVectornewUndefinedVector newVector thawMatrixunsafeThawMatrix runSTMatrixunsafeReadMatrixunsafeWriteMatrix modifyMatrix liftSTMatrixunsafeFreezeMatrix freezeMatrix readMatrix writeMatrix setMatrixnewUndefinedMatrix newMatrixrowOper extractMatrixgemmmmutableformatdispsdispf latexFormatdispcf loadMatrix loadMatrix' ExtractorAllRangePosPosCycTakeTakeLastDropDropLast?? fromBlocks diagBlockflipudfliprldiagRecttakeDiag><takeRowsdropRows takeColumns dropColumnsasRowasColumn fromArray2DrepmatliftMatrix2AutotoBlocks toBlocksEverymapMatrixWithIndexM_mapMatrixWithIndexMmapMatrixWithIndex Complexable RealElementUpLoLowerUpperTestablecheckTioCheckTLinearscaleAdditiveadd Transposabletrtr'DoubleOfSingleOf ComplexOfRealOfConvertrealcomplexsingledouble toComplex fromComplexProductNumericKonstkonst ContainerIndexOfscalarconjarctan2cmodfromInttoIntfromZtoZcmapatIndexminIndexmaxIndex minElement maxElement sumElements prodElementsstepcondfindassocaccumudotouter kroneckerdiagidentGMatrixSparseRSparseCDiagDensegmCSRnRowsnColsgmCSCdiagValsgmDenseCSRcsrValscsrColscsrRowscsrNRowscsrNCols AssocMatrixmkCSRmkDensemkSparsefromCSRmkDiagR!#>toDenseHermQRLDLLUFieldsvdthinSVDsingularValues compactSVD compactSVDTolrightSVleftSVluPackedluSolve cholSolvetriSolve triDiagSolvelinearSolveSVD linearSolveLS ldlPackedldlSolveeiggeig eigenvalues geigenvalueseigSH'eigenvaluesSH'eigSH eigenvaluesSHqrthinQRqrRawqrgrrqthinRQhessschurmbCholSHcholSHcholmbCholinvlndetdetluinvpinvpinvTolranksvpeps nullspaceSVDorthSVD haussholderrcondrankmatFuncexpmsqrtmluFact relativeErrorgeigSHgeigSH'unSymsymmTmtrustSymgaussianSample uniformSamplerandrandnBuildbuildLSDivlinspace<.>#><#<\>dot optimiseMultmeanCov sortVector sortIndexremapcorrconvcorrMincorr2conv2 separable Indexable!Normednorm_0norm_1norm_2norm_InfℂℝiCvectormatrixdispdiagl|||¦===——rowcol?¿cross norm_Frob norm_nuclearmagnit normalizesize pairwiseD2 rowOutersnull1null1symdispDots dispBlanks dispShort luPacked'luSolve'./.ModCGStatecgpcgrcgr2cgxcgdxcgSolvecgSolve'<> linearSolve nullspaceorth<·>appmulDispSizedunwrapextractcreateMLDomaindiagRdvmapdmmap zipWithVectorHerSymEigen eigensystemSq&#vec2vec3vec4dimeyeblockAtunrowuncollinSolvesvdTallsvdFlat𝑖her withNullspacewithOrthwithCompactSVDsplitheadTail splitRows splitColswithRows withColumns withVector exactLength withMatrix exactDimsmean $fNormedL $fNormedR $fTestableL$fDiagMC$fDiagLR $fEigenLCM$fTransposableSymSym $fAdditiveSym $fFloatingSym$fFractionalSym$fNumSym $fEigenSymRL $fDispSym$fTransposableHerHer $fDispHer$fDomainComplexCM$fDomainDoubleRL $fShowSymsafeRead@>asReal asComplex mapVector buildVector unsafeWithavecinlinePerformIOfinit errorCodembCatch..>::>:>OkCIdxsOMCVCMsumFsumRsumQsumCprodFprodRprodQprodC toScalarR toScalarF toScalarC toScalarQ toScalarI toScalarL vectorMapR vectorMapC vectorMapF vectorMapQ vectorMapI vectorMapL vectorMapValR vectorMapValC vectorMapValF vectorMapValQ vectorMapValI vectorMapValL vectorZipR vectorZipC vectorZipF vectorZipQ vectorZipI vectorZipLTConstTVVVTVVFunCodeSMinIdxMaxIdxAbsSumNorm2MinMax FunCodeVVATan2PowMulSubAddDiv FunCodeSVModVSModSVPowVSPowSVNegate AddConstantRecipScaleFunCodeVSqrtSignLogATanhACoshASinhTanhCoshSinhATanACosASinAbsTanCosSinExp cconstantL cconstantI cconstantC cconstantQ cconstantR cconstantF c_conjugateC c_conjugateQc_stepLc_stepIc_stepDc_stepF c_long2int c_int2long c_float2int c_int2float c_double2long c_long2double c_double2int c_int2doublec_double2floatc_float2doublec_range_vectorc_round_vectorc_random_vector c_vectorScan c_vectorZipL c_vectorZipI c_vectorZipQ c_vectorZipF c_vectorZipC c_vectorZipRc_vectorMapValLc_vectorMapValIc_vectorMapValQc_vectorMapValFc_vectorMapValCc_vectorMapValR c_vectorMapL c_vectorMapI c_vectorMapQ c_vectorMapF c_vectorMapC c_vectorMapR c_toScalarL c_toScalarI c_toScalarQ c_toScalarC c_toScalarF c_toScalarRc_prodLc_prodIc_prodCc_prodQc_prodRc_prodFc_sumLc_sumIc_sumCc_sumQc_sumRc_sumF#!fromeisumIsumLsumgprodIprodLprodg toScalarAux vectorMapAuxvectorMapValAux vectorZipAux vectorScan float2DoubleV double2FloatV double2IntV int2DoubleV double2longV long2DoubleV float2IntV int2floatV int2longV long2intVtogstepgstepDstepFstepIstepL conjugateAux conjugateQ conjugateC cloneVector constantAuxtrans compatdim@@>ReorderTgemmRowOpRemSelSetRectExtrreorderVgemmrowOpremapMselectVcompareVsortVsortIsetRect constantDextractRxdatxColxRowicolsirows c_saveMatrix c_reorderL c_reorderQ c_reorderC c_reorderI c_reorderF c_reorderDc_gemmMLc_gemmMIc_gemmLc_gemmIc_gemmQc_gemmCc_gemmFc_gemmD c_rowOpML c_rowOpMIc_rowOpLc_rowOpIc_rowOpQc_rowOpCc_rowOpFc_rowOpDc_remapLc_remapQc_remapCc_remapIc_remapFc_remapD c_selectL c_selectQ c_selectC c_selectI c_selectF c_selectD c_compareL c_compareI c_compareF c_compareD c_sort_valL c_sort_valI c_sort_valF c_sort_valD c_sort_indexL c_sort_indexI c_sort_indexF c_sort_indexD c_setRectL c_setRectI c_setRectQ c_setRectC c_setRectF c_setRectD c_extractL c_extractI c_extractQ c_extractC c_extractF c_extractDrowOrdercolOrderis1disSliceamatramatcopy extractAllmaxZ conformMs conformVs conformMTo conformVTorepRowsrepColsshSizeshDimemptyM extractAux setRectAuxsortGsortIdxDsortIdxFsortIdxIsortIdxLsortValDsortValFsortValIsortValLcompareGcompareDcompareFcompareIcompareLselectGselectDselectFselectIselectLselectCselectQremapGremapDremapFremapIremapLremapCremapQrowOpAuxgemmg reorderAuxbaseGHC.STSTrunSTtablevecdisp showComplexcommonjoinVert joinHoriz takeLastRows dropLastRowstakeLastColumnsdropLastColumns buildMatrix extractRowsextractColumnssizesdspbreakAtppextminElmaxElcmodi extractError fromBlocksRaw adaptBlockslMcompat' toBlockRows toBlockColsmk mapMatrix Precision toComplexV fromComplexV Data.Complexphase magnitudepolarcismkPolar conjugateimagPartrealPartComplex:+ toComplex' fromComplex'comp'single'double' multiplyR multiplyC multiplyF multiplyQsvdRsvdRdsvdCsvdCdthinSVDRthinSVDC thinSVDRd thinSVDCdsvRsvCsvRdsvCdrightSVRrightSVCleftSVRleftSVCeigCeigOnlyCeigReigOnlyReigGeigGCeigSeigS'eigHeigH'eigOnlySeigOnlyH linearSolveRlinearSolveLSRlinearSolveSVDRlusR linearSolveClinearSolveLSClinearSolveSVDClusC cholSolveRcholS cholSolveCcholH triSolveR triSolveC triDiagSolveRmbCholH GHC.MaybeMaybembCholSqrRqrCqrgrRqrgrChessRhessCschurRschurCluRluCldlRldlCldlsRldlsCTMVMTSVDQFTMMMzsytrsdsytrszhetrfdsytrfzgetrsdgetrszgetrfdgetrfzgeesdgeeszgehrddgehrdzungqrdorgqrzgeqr2dgeqr2dpotrfzpotrfzgelssdgelsszgelsdgelszgttrsdgttrsztrtrs_ldtrtrs_lztrtrs_udtrtrs_uzpotrsdpotrszgesvdgesvzheevdsyevzggevzgeevdggevdgeevzgesdddgesddzgesvddgesvd c_multiplyL c_multiplyIcgemmcsgemmczgemmcdgemmcisTtt multiplyAux multiplyI multiplyLsvdAux thinSVDAuxsvAux rightSVAux leftSVAuxeigAux eigOnlyAuxeigRauxfixeig1fixeigfixeigGeigGaux eigGOnlyAuxeigOnlyG eigOnlyGCeigSHAuxvrevlinearSolveSQAuxmbLinearSolveRmbLinearSolveClinearSolveSQAux2linearSolveTRAux2linearSolveGTAux2 triDiagSolveClinearSolveAuxcholAuxqrAuxqrgrAuxhessAuxschurAuxluAuxlusAuxldlAuxmultiplyabsSumnorm1norm2normInf scaleRecipdivideGHC.RealmodGHC.Basefmapassoc'accum'CTransctrans ElementOftoZ'fromZ'toInt'fromInt'cmod'arctan2'find'cselect' ccompare'step' prodElements' sumElements' maxElement' minElement' maxIndex' minIndex'atIndex'build'konst'cmap'add' addConstantscale'scalar'size'conj'subequalArgOf emptyErrorV emptyErrorMemptyMulemptyValmXmmXvvXmbuildMbuildVfindVfindMassocVassocMaccumVaccumMcompareM compareCVselectMselectCVgmXv~!~fullSVD mbLinearSolveeps ldlPackedSHNothingrankSVD nullspacePrec nullVectorrelativeError'pnormNormTypeInfinityPNorm1PNorm2 Frobenius linearSolve' ldlPacked'svd'thinSVD'sv'mbLinearSolve' cholSolve' triSolve' triDiagSolve' ldlSolve'linearSolveSVD'linearSolveLS'eig'geig'eigSH''eigOnlygeigOnly eigOnlySHcholSH' mbCholSH'qr'qrgr'hess'schur'squareverticalexactHermitianrqFromQRzhztunpackQR thinUnpackQR unpackHessuH diagonalizegolubepsepslistgepsexpGolubsqrtmInvsignlpfixPermfixPerm'triangrandmccomparecselectghc-prim GHC.Classesminzerosonesnormmt gaussElim_2ℤℕ formatSparse approxInt formatShortblock2x2block3x3view1unView1 foldMatrix gaussElim_1 gaussElimluST luPacked'' luSolve'' invershur$fFractionalModVGMDimlift1Flift2FmkRmkCmkLmkMudmkVvconcatgvec2gvec3gvec4gvectgmatsingleVsingleMisDiagisDiagCisDiagg adaptDiagisFulllift1Llift2Llift2LD adaptDiagCisFullClift1Mlift2Mlift2MD overMatL' overMatM'