úΕMõe      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdNone 6<$efghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ efghijklmnopqrstuvwxyz{|}~€‚ƒ„#efghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆNone 'Mutable matrix. You can modify elements‰*Verify matrix dimensions and memory layoutQCreate a mutable matrix of the given size and fill it with 0 as an initial value.OCreate a mutable matrix of the given size and fill it with as an initial value. 1Set all elements of the matrix to the given value NCopy a matrix. The two matrices must have the same length and may not overlap. (Yield the element at the given position. *Replace the element at the given position. HYield the element at the given position. No bounds checks are performed.JReplace the element at the given position. No bounds checks are performed. Pass a pointer to the matrix's data to the IO action. Modifying data through the pointer is unsafe if the matrix could have been frozen before the modification.‰     ‰ None1Sets the max number of threads reserved for Eigen1Gets the max number of threads reserved for EigenNone6HMCiMatrix to be used in pure computations, uses column major memory layout, features copy-free FFI with C++  http://eigen.tuxfamily.orgEigen library.Empty 0x0 matrixIs matrix empty?Is matrix square?3Matrix where all coeffs are filled with given valueMatrix where all coeff are 0Matrix where all coeff are 15Square matrix with 1 on main diagonal and 0 elsewhere!The random matrix of a given sizeNumber of rows for the matrix  Number of columns for the matrixŠMtrix size as (rows, cols) pair!*Matrix coefficient at specific row and col"*Matrix coefficient at specific row and col#PUnsafe version of coeff function. No bounds check performed so SEGFAULT possible$&List of coefficients for the given col%&List of coefficients for the given row&VExtract rectangular block from matrix defined by startRow startCol blockRows blockCols'*Verify matrix dimensions and memory layout(%The maximum coefficient of the matrix)%The minimum coefficient of the matrix*Top N rows of matrix+Bottom N rows of matrix,Left N columns of matrix-Right N columns of matrix.vConstruct matrix from a list of rows, column count is detected as maximum row length. Missing values are filled with 0/ Convert matrix to a list of rows0=Create matrix using generator function f :: row -> col -> val1)The sum of all coefficients of the matrix2-The product of all coefficients of the matrix3*The mean of all coefficients of the matrix4jThe trace of a matrix is the sum of the diagonal coefficients and can also be computed as sum (diagonal m)5iApplied to a predicate and a matrix, all determines if all elements of the matrix satisfies the predicate6hApplied to a predicate and a matrix, any determines if any element of the matrix satisfies the predicate7JReturns the number of coefficients in a given matrix that evaluate to true8ÿFor vectors, the l2 norm, and for matrices the Frobenius norm. In both cases, it consists in the square root of the sum of the square of all the matrix entries. For vectors, this is also equals to the square root of the dot product of this with itself.9ÞFor vectors, the squared l2 norm, and for matrices the Frobenius norm. In both cases, it consists in the sum of the square of all the matrix entries. For vectors, this is also equals to the dot product of this with itself.:˜The l2 norm of the matrix using the Blue's algorithm. A Portable Fortran Program to Find the Euclidean Norm of a Vector, ACM TOMS, Vol 4, Issue 1, 1978.;The l2 norm of the matrix avoiding undeflow and overflow. This version use a concatenation of hypot calls, and it is very slow.<The determinant of the matrix=NAdding two matrices by adding the corresponding entries together. You can use (+) function as well.>XSubtracting two matrices by subtracting the corresponding entries together. You can use (-) function as well.?#Matrix multiplication. You can use (*) function as well.@5Apply a given function to each element of the matrix.AHere is an example how to implement scalar matrix multiplication:let a = fromList [[1,2],[3,4]]a Matrix 2x21.0 2.03.0 4.0 map (*10) a Matrix 2x2 10.0 20.0 30.0 40.0A5Apply a given function to each element of the matrix.JHere is an example how getting upper triangular matrix can be implemented:*let a = fromList [[1,2,3],[4,5,6],[7,8,9]]a Matrix 3x3 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.06imap (\row col val -> if row <= col then val else 0) a Matrix 3x3 1.0 2.0 3.0 0.0 5.0 6.0 0.0 0.0 9.0BUpper trinagle of the matrixCLower trinagle of the matrixDFFilter elements in the matrix. Filtered elements will be replaced by 0EFFilter elements in the matrix. Filtered elements will be replaced by 0FCReduce matrix using user provided function applied to each element.G^Reduce matrix using user provided function applied to each element. This is strict version of FHQReduce matrix using user provided function applied to each element and it's indexImReduce matrix using user provided function applied to each element and it's index. This is strict version of HJDiagonal of the matrixKInverse of the matrix}For small fixed sizes up to 4x4, this method uses cofactors. In the general case, this method uses PartialPivLU decompositionLAdjoint of the matrixMTranspose of the matrixNConjugate of the matrixO*Nomalize the matrix by deviding it on its 8PšApply a destructive operation to a matrix. The operation will be performed in place if it is safe to do so and will modify a copy of the matrix otherwise.Q-Yield an immutable copy of the mutable matrixR,Yield a mutable copy of the immutable matrixS}Unsafe convert a mutable matrix to an immutable one without copying. The mutable matrix may not be used after this operation.TUnsafely convert an immutable matrix to a mutable one without copying. The immutable matrix may not be used after this operation.UgPass a pointer to the matrix's data to the IO action. The data may not be modified through the pointer.‹Shortcuts for basic matrix mathŒPretty prints the matrixJ Š!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUŽ‹ŒD !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUD'./0 !"#$%&*+,-123)(489:;<FGHI567=>?@ADEJMKLNOPBCRQTSUF Š!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUŽ‹ŒNone V ÿSDecomposition Requirements on the matrix Speed Accuracy Rank Kernel Image PartialPivLU Invertible ++ + - - - FullPivLU None - +++ + + + HouseholderQR None ++ + - - - ColPivHouseholderQR None + ++ + - - FullPivHouseholderQR None - +++ + - - LLT Positive definite +++ + - - - LDLT Positive or negative semidefinite +++ ++ - - - JacobiSVD None - +++ + - - ZThe best way to do least squares solving for square matrices is with a SVD decomposition (W)W;Two-sided Jacobi SVD decomposition of a rectangular matrix.X8Robust Cholesky decomposition of a matrix with pivoting.Y3Standard Cholesky decomposition (LL^T) of a matrix.ZKHouseholder rank-revealing QR decomposition of a matrix with full pivoting.[MHouseholder rank-revealing QR decomposition of a matrix with column-pivoting.\)Householder QR decomposition of a matrix.]4LU decomposition of a matrix with complete pivoting.^3LU decomposition of a matrix with partial pivoting._ x = solve d a bfinds a solution x of ax = b equation using decomposition d` e = relativeError x a b computes norm (ax - b) / norm b where norm is L2 normaThe rank of the matrixb>Return matrix whose columns form a basis of the null-space of AcBReturn a matrix whose columns form a basis of the column-space of Ad )(coeffs, error) = linearRegression points$computes multiple linear regression #y = a1 x1 + a2 x2 + ... + an xn + b using [ decompositionpoint format is  [y, x1..xn]coeffs format is  [b, a1..an]error is calculated using ` ´import Data.Eigen.LA main = print $ linearRegression [ [-4.32, 3.02, 6.89], [-3.79, 2.01, 5.39], [-4.01, 2.41, 6.01], [-3.86, 2.09, 5.55], [-4.10, 2.58, 6.32]] produces the following output V([-2.3466569233817127,-0.2534897541434826,-0.1749653335680988],1.8905965120153139e-3) VWXYZ[\]^_`abcdVWXYZ[\]^_`abcdV^]\[ZYXW_`abcdV^]\[ZYXW_`abcd      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹+ŒŽ‘’ eigen-1.2.5Data.Eigen.Matrix.MutableData.Eigen.ParallelData.Eigen.Matrix Data.Eigen.LAData.Eigen.InternalSTMatrixIOMatrixMMatrixmm_rowsmm_colsmm_valsnew replicatesetcopyreadwrite unsafeRead unsafeWrite unsafeWith setNbThreads getNbThreadsMatrixm_rowsm_colsm_valsemptynullsquareconstantzeroonesidentityrandomrowscols!coeff unsafeCoeffcolrowblockvalidmaxCoeffminCoefftopRows bottomRowsleftCols rightColsfromListtoListgeneratesumprodmeantraceallanycountnorm squaredNormblueNorm hypotNorm determinantaddsubmulmapimapupperTriangulelowerTriangulefilterifilterfoldfold'ifoldifold'diagonalinverseadjoint transpose conjugate normalizemodifyfreezethaw unsafeFreeze unsafeThaw Decomposition JacobiSVDLDLTLLTFullPivHouseholderQRColPivHouseholderQR HouseholderQR FullPivLU PartialPivLUsolve relativeErrorrankkernelimagelinearRegressionCastcastc_relativeErrorc_solvec_freec_kernelc_imagec_rank c_determinant c_hypotNorm c_blueNorm c_squaredNormc_tracec_normc_meanc_prodc_sum c_normalize c_conjugate c_adjoint c_inverse c_transpose c_diagonalc_mulc_subc_addc_randomc_getNbThreadsc_setNbThreads c_freeString performIOcall $fCastIntCInt $fCastCIntInt$fCastDoubleCDouble$fCastCDoubleDoubledims $fNumMatrix $fShowMatrix_prop_binop_unop