,yVy      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxNone 6<    None 'Mutable matrix. You can modify elementsy*Verify matrix dimensions and memory layout%QCreate 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. !"#$y%&'()*+,- !"#$%&'()*+,- !"#$%&)*+,'(-  !"#$y%&'()*+,-None.1Sets the max number of threads reserved for Eigen/1Gets the max number of threads reserved for Eigen././././None6HM90GMatrix to be used in pure computations, uses column major memory layout5Empty 0x0 matrix6Is matrix empty?7Is matrix square?83Matrix where all coeffs are filled with given value9Matrix where all coeff are 0:Matrix where all coeff are 1;5Square matrix with 1 on main diagonal and 0 elsewhere<!The random matrix of a given size=Number of rows for the matrix> Number of columns for the matrixzMtrix size as (rows, cols) pair?*Matrix coefficient at specific row and col@*Matrix coefficient at specific row and colAPUnsafe version of coeff function. No bounds check performed so SEGFAULT possibleB&List of coefficients for the given colC&List of coefficients for the given rowDVExtract rectangular block from matrix defined by startRow startCol blockRows blockColsE*Verify matrix dimensions and memory layoutF)The maximum of all coefficients of matrixG)The minimum of all coefficients of matrixHTop n rows of matrixIBottom n rows of matrixJLeft n columns of matrixKRight n columns of matrixLvConstruct matrix from a list of rows, column count is detected as maximum row length. Missing values are filled with 0M Convert matrix to a list of rowsN=Create matrix using generator function f :: row -> col -> valO)The sum of all coefficients of the matrixP-The product of all coefficients of the matrixQ*The mean of all coefficients of the matrixRjThe trace of a matrix is the sum of the diagonal coefficients and can also be computed as sum (diagonal m)SJReturns true if all of the coefficients in a given matrix evaluate to trueTTReturns true if at least one of the coefficients in a given matrix evaluates to trueUJReturns the number of coefficients in a given matrix that evaluate to trueVFor 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.WFor 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.XThe 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.YThe l2 norm of the matrix avoiding undeflow and overflow. This version use a concatenation of hypot calls, and it is very slow.ZThe determinant of the matrix[@Adding two matrices by adding the corresponding entries together\ Return a + b]Matrix multiplication Khttp://upload.wikimedia.org/math/7/3/f/73fc7ef1bf6f6822115c41cff58535e1.png^Diagonal of the matrix_Inverse of the matrix}For small fixed sizes up to 4x4, this method uses cofactors. In the general case, this method uses PartialPivLU decomposition`Adjoint of the matrixaTranspose of the matrixbConjugate of the matrixc*Nomalize the matrix by deviding it on its VdApply 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.e-Yield an immutable copy of the mutable matrixf,Yield a mutable copy of the immutable matrixg}Unsafe convert a mutable matrix to an immutable one without copying. The mutable matrix may not be used after this operation.hUnsafely convert an immutable matrix to a mutable one without copying. The immutable matrix may not be used after this operation.igPass a pointer to the matrix's data to the IO action. The data may not be modified through the pointer.{Nm instance for the matrix|Pretty prints the matrix@0123456789:;<=>z?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi}~{|:0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi:01234ELMN5679:;8<>=?@ABCDHIJKOPQGFRVWXYZSTU[\]^a_`bcdfehgi<0123456789:;<=>z?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi}~{|None j Decomposition 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 - +++ + - - The best way to do least squares solving for square matrices is with a SVD decomposition (JacobiSVD) k;Two-sided Jacobi SVD decomposition of a rectangular matrix.l8Robust Cholesky decomposition of a matrix with pivoting.m3Standard Cholesky decomposition (LL^T) of a matrix.nKHouseholder rank-revealing QR decomposition of a matrix with full pivoting.oMHouseholder rank-revealing QR decomposition of a matrix with column-pivoting.p)Householder QR decomposition of a matrix.q4LU decomposition of a matrix with complete pivoting.r3LU decomposition of a matrix with partial pivoting.t>Return matrix whose columns form a basis of the null-space of AuBReturn a matrix whose columns form a basis of the column-space of Av x = solve d a bfinds a solution x of ax = b equation using decomposition dw e = relativeError x a b computes norm (ax - b) / norm b where norm is L2 normx )(coeffs, error) = linearRegression points$computes multiple linear regression #y = a1 x1 + a2 x2 + ... + an xn + b using o decompositionpoint format is  [y, x1..xn]coeffs format is  [b, a1..an]error is calculated using w 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) jklmnopqrstuvwxjklmnopqrstuvwxjrqponmlkstuvwx jrqponmlkstuvwx      !"#$%&&'()*+,-./01234556789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkl2mnopqrstuvwxyz{I|}~ eigen-1.2.2Data.Eigen.InternalData.Eigen.Matrix.MutableData.Eigen.ParallelData.Eigen.Matrix Data.Eigen.LACastcast 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$fCastCDoubleDoubleSTMatrixIOMatrixMMatrixmm_rowsmm_colsmm_valsnew replicatesetcopyreadwrite unsafeRead unsafeWrite unsafeWith setNbThreads getNbThreadsMatrixm_rowsm_colsm_valsemptynullsquareconstantzeroonesidentityrandomrowscols!coeff unsafeCoeffcolrowblockvalidmaxCoeffminCoefftopRows bottomRowsleftCols rightColsfromListtoListgeneratesumprodmeantraceallanycountnorm squaredNormblueNorm hypotNorm determinantaddsubmuldiagonalinverseadjoint transpose conjugate normalizemodifyfreezethaw unsafeFreeze unsafeThaw Decomposition JacobiSVDLDLTLLTFullPivHouseholderQRColPivHouseholderQR HouseholderQR FullPivLU PartialPivLUrankkernelimagesolve relativeErrorlinearRegressiondims $fNumMatrix $fShowMatrix_prop_binop_unopc_freec_kernelc_imagec_rankc_relativeErrorc_solve