|R9      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd ef g h i jk l m n o p q r s t u v w x y z { | }~                         !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJ K L M N O P Q R S T U VWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~1 experimental%Patrick Perry <patperry@stanford.edu> experimental%Patrick Perry <patperry@stanford.edu>4The base class for objects with shapes and indices  (i.e. Vector, Matrix, etc.). AGet the shape of the tensor. For vectors this is the dimension. # For matrices, this will be a pair (m,n) of the number of rows  and columns. .Get the range of valid indices in the tensor.  experimental%Patrick Perry <patperry@stanford.edu> A class for immutable tensors. 0Get the numer of elements stored in the tensor. AGet a new tensor by replacing the elements at the given indices. EGet the value at the given index, without doing any bounds-checking. Same as '()' but doesn't do any bounds-checking. 6Get the indices of the elements stored in the tensor. 'Get the elements stored in the tensor. Get the list of (index, element) pairs stored in the tensor. *Apply a function elementwise to a tensor. (Scale every element by the given value. !Add a constant to every element. >Get the value at the given index. Range-checks the argument.         experimental%Patrick Perry <patperry@stanford.edu>Multiplication side. Diagonal storage. #Lower or upper triangular storage. Transpose type. Matrix element storage order.   Exchange RowMajor and ColMajor. ! Exchange NoTrans and  ConjTrans. " Exchange Upper and Lower. # Exchange LeftSide and  RigthSide.  !"# !"# experimental%Patrick Perry <patperry@stanford.edu> $/A base class for objects shaped like matrices. %>Creates a new matrix view that conjugates and transposes the  given matrix. &CA class for matrix types that use a matrix internally for storage,  Data.Matrix.Banded.Class for example. '6An associated type for the underlying matrix storage. (BA class for matrices with an associated type for row, column, and  diagonal vector views. )8An associated type for a vector view into a matrix type a. @ Typically, the view will share the same storage as the matrix, : so that modifying an element in the view will affect the 6 corresponding element in the matrix, and vice versa. *&Get the number of rows in the matrix. +&Get the number of rows in the matrix. ,JIndicate whether or not a matrix has the same number of rows and columns. -EIndicate whether or not the number of rows is less than or equal to  the number of columns. .HIndicate whether or not the number of rows is greater than or equal to  the number of columns. / Replaces (m,n) with (n,m)  !"#$%&'()*+,-./$%*+,-./()&' !"# $%%&''())*+,-./ experimental%Patrick Perry <patperry@stanford.edu>0BA hermitian view of an underlying matrix. The view can either be J of the upper or lower triangular part of the matrix. The type arguments  are as follows:  a: the underlyting matrix type.  nn.: a phantom type for the shape of the matrix.  e": the element type of the matrix. 12Cast the phantom shape type. 3*Apply a function to the unerlying matrix. 47Convert from a base matrix type to a Herm matrix type. 5?Convert from a Herm matrix type to a base matrix type. 6FConstruct a lower-triangular hermitian view into a matrix. This also - checks to see if the base matrix is square. 7GConstruct an upper-triangular hermitian view into a matrix. This also - checks to see if the base matrix is square. 01234567011234567 experimental%Patrick Perry <patperry@stanford.edu>0123456701453672 experimental%Patrick Perry <patperry@stanford.edu> 8EA triangular or trapezoidal view of an underlying matrix. The view H can either be of the upper or lower triangular part of the matrix, and H can optionally include or exclude the diagonal. If the diagonal enum  is Unit8, the diagonal entries of the underlying matrix are not # referenced, but are assumed to be 1&. The type arguments are as follows:  a: the underlyting matrix type.  np,: a phantom type for the shape of the view.  e": the element type of the matrix. 9:Cast the phantom shape type. ;%Apply a function to the base matrix. <6Convert from a base matrix type to a triangular view. =3Convert from a triangular view to the base matrix. >)Get a lower triangular view of a matrix. ?=Get a lower triangular view of a matrix, with unit diagonal. @*Get an upper triangular view of a matrix. A>Get an upper triangular view of a matrix, with unit diagonal. 89:;<=>?@A 899:;<=>?@A experimental%Patrick Perry <patperry@stanford.edu> experimental%Patrick Perry <patperry@stanford.edu>  experimental%Patrick Perry <patperry@stanford.edu>       !"#       !"#       !"#! experimental%Patrick Perry <patperry@stanford.edu>BThe base class for elements. C&Get the complex conjugate of a value. DGet the magnitude of a value. EGet the l1 norm of a value. F Convert a double to an element. G>Try to coerce a value to a double. This will fail unless the 4 complex part is zero (according to a comparison by (~==)). BCDEFGBCDEFGCDEFG" experimental%Patrick Perry <patperry@stanford.edu>H%Types with vector-vector operations. $%&'()*+,-./01234H$%&'()*+,-./01234H$%&'()*+,-./01234$%&'()*+,-./01234# experimental%Patrick Perry <patperry@stanford.edu> I%Types with matrix-vector operations. 56789:;<=>?@ I56789:;<=>?@ I 56789:;<=>?@56789:;<=>?@$ experimental%Patrick Perry <patperry@stanford.edu> J-Types with matrix-matrix operations. ABCDEFGHI JABCDEFGHI J ABCDEFGHIABCDEFGHI experimental%Patrick Perry <patperry@stanford.edu> JKBCDEFGHIJ BCDEFGHIJ experimental%Patrick Perry <patperry@stanford.edu>K&Class for modifiable mutable tensors. LEGet the maximum number of elements that can be stored in the tensor. M"Sets all stored elements to zero. N-Sets all stored elements to the given value. O2True if the value at a given index can be changed PCSet the value of the element at the given index, without doing any  range checking. QBModify the value of the element at the given index, without doing  any range checking. R1Replace each element by a function applied to it SSame as swapElem& but arguments are not range-checked. T2Replace every element with its complex conjugate. U6Scale every element in the vector by the given value. V*Add a value to every element in a vector. W%Class for mutable read-only tensors. X1Get the number of elements stored in the tensor. Y9Get the value at the specified index, without doing any  range-checking. Z4Returns a lazy list of the indices in the tensor. B Because of the laziness, this function should be used with care.  See also  getIndices'. [7Returns a list of the indices in the tensor. See also  Z. \5Returns a lazy list of the elements in the tensor. B Because of the laziness, this function should be used with care.  See also  getElems'. ]8Returns a list of the elements in the tensor. See also  \. ^AReturns a lazy list of the elements-index pairs in the tensor. B Because of the laziness, this function should be used with care.  See also  getAssocs' . _DReturns a list of the index-elements pairs in the tensor. See also  ^. `GGets the value at the specified index after checking that the argument  is in bounds. a1Set the value of the element at the given index. b4Update the value of the element at the given index. c7Swap the values stored at two positions in the tensor. KLMNOPQRSTUVWXYZ[\]^_`abcWXYZ[\]^_`KLMNOPQRSTUVabcK LMNOPQRSTUVLMNOPQRSTUVWXYZ[\]^_XYZ[\]^_`abc% experimental%Patrick Perry <patperry@stanford.edu>#dDense vectors in the L, monad. The type arguments are as follows:  n1: a phantom type for the dimension of the vector  e>: the element type of the vector. Only certain element types  are supported. ef%View an array in memory as a vector. offset length g<View an array in memory as a vector, with the given stride. stride offset length MNOPQh Execute an L3 action with a pointer to the first element in the  vector. RSTUVWXYZ[\]^_`abcdefghij#defgMNOPQhRSTUVWXYZ[\]^_`abcdefghij#deefgMNOPQhRSTUVWXYZ[\]^_`abcdefghij& experimental%Patrick Perry <patperry@stanford.edu>-iDense matrix in the L, monad. The type arguments are as follows:  np>: a phantom type for the shape of the matrix. Most functions N will demand that this be specified as a pair. When writing a function + signature, you should always prefer IOMatrix (n,p) e to   IOMatrix np e.  e>: the element type of the matrix. Only certain element types  are supported. jk%View an array in memory as a matrix. offset shape lFView an array in memory as a matrix, with the given leading dimension  size. leading dimension size offset shape klmnopqrstuvwxym Perform an L3 action with a pointer to the first element of the  matrix. zHCreate a new matrix of given shape, but do not initialize the elements. {|}~-ijklklmnopqrstuvwxymz{|}~-ijjklklmnopqrstuvwxymz{|}~' experimental%Patrick Perry <patperry@stanford.edu>gn4Vectors that can be created or modified in a monad. oUnsafely convert an L action that creates an ed into  an action in m that creates a vector. p@Creates a new vector of the given length. The elements will be  uninitialized. qBConvert an immutable vector to a mutable one by taking a complete  copy of it. rs%Vectors that can be read in a monad. tCast the vector to an ed , perform an IO action, and  convert the IO" action to an action in the monad m. This  operation is very unsafe. uBConvert a mutable vector to an immutable one by taking a complete  copy of it. vw+Common functionality for all vector types. x*Get the dimension (length) of the vector. yBGet the memory stride (in elements) between consecutive elements. zAIndicate whether or not internally the vector stores the complex  conjugates of its elements. {3Get a view into the complex conjugate of a vector. |#Cast the shape type of the vector. }~ Unsafe cast from a vector to an ed. <Immutable dense vectors. The type arguments are as follows:  n1: a phantom type for the dimension of the vector  e>: the element type of the vector. Only certain element types  are supported. CCreates a new vector with the given association list. Unspecified ' indices will get initialized to zero. ECreates a new vector of the given dimension with the given elements. F If the list has length less than the passed-in dimenson, the tail of # the vector will be uninitialized. .Create a zero vector of the specified length. )Set every element in the vector to zero. BCreate a vector with every element initialized to the same value. /Set every element in the vector to a constant. newBasisVector n i creates a vector of length n that is all zero  except for at position i, where it equal to one.  setBasis x i sets the ith coordinate of x to 1, and all other  coordinates to 06. If the vector has been scaled, it is possible that  readVector x i will not return exactly 1. See setElem. -Creates a new vector by copying another one. BCreates a new vector by copying another one. The returned vector C is gauranteed not to be a view into another vector. That is, the  returned vector will have isConj to be False. copyVector dst src replaces the values in dst with those in / source. The operands must be the same shape. 'Swap the values stored in two vectors. subvectorView x o n creates a subvector view of x starting at index o  and having length n. subvectorViewWithStride s x o n creates a subvector view of x starting  at index o, having length n and stride s. CGet a new vector with elements with the conjugates of the elements  of the given vector 'Conjugate every element of the vector. ;Get a new vector by scaling the elements of another vector  by a given value. (Scale every element by the given value. <Get a new vector by shifting the elements of another vector  by a given value. &Add the given value to every element. getAddVector x y' creates a new vector equal to the sum x+y. The ( operands must have the same dimension.  addVector y x replaces y with y+x. getSubVector x y. creates a new tensor equal to the difference x-y. , The operands must have the same dimension.  subVector y x replaces y with y-x. axpyVector alpha x y replaces y with  alpha * x + y. getMulVector x y8 creates a new vector equal to the elementwise product  x*y-. The operands must have the same dimensino  mulVector y x replaces y with y*x. getDivVector x y0 creates a new vector equal to the elementwise  ratio x/y*. The operands must have the same shape.  divVector y x replaces y with y/x. ;Gets the sum of the absolute values of the vector entries. Gets the 2-norm of a vector. IGets the index and norm of the element with maximum magnitude. This is & undefined if any of the elements are NaN". It will throw an exception if # the dimension of the vector is 0. )Computes the dot product of two vectors. ECreate a vector with the given dimension and elements. The elements G given in the association list must all have unique indices, otherwise  the result is undefined. ACreate a vector of the given dimension with elements initialized  to the values from the list. listVector n es is equivalent to  vector n (zip [0..(n-1)] es)', except that the result is undefined  if  length es is less than n.  zeroVector n creates a vector of dimension n with all values  set to zero. constantVector n e creates a vector of dimension n with all values  set to e. basisVector n i creates a vector of dimension n with zeros  everywhere but position i, where there is a one. subvector x o n creates a subvector of x starting at index o  and having length n. subvectorWithStride s x o n creates a subvector of x starting  at index o, having length n and stride s. =Compute the sum of absolute values of entries in the vector.  Compute the 2-norm of a vector. FGet the index and norm of the element with absulte value. Not valid " if any of the vector entries are NaN. Raises an exception if the  vector has length 0. (Compute the dot product of two vectors. gnopqrstuvwxyz{|}~gnopqropqrstuvtuvwxyz{|}~xyz{|}~( experimental%Patrick Perry <patperry@stanford.edu>=A type class for mutable matrices with inverses. The member G functions of the type class do not perform any checks on the validity G of shapes or indices, so in general their safe counterparts should be  preferred. GA type class for mutable matrices associated with a monad. The member J functions of the type class do not perform any checks on the validity of D shapes or indices, so in general their safe counterparts should be  preferred. /Get a lazy list the row vectors in the matrix. 5Get a lazy list of the column vectors in the matrix. ;Dense matrices that can be created or modified in a monad. @Creates a new matrix of the given shape. The elements will be  uninitialized. Unsafely convert an L action that creates an ji into  an action in m that creates a matrix. BConvert an immutable matrix to a mutable one by taking a complete  copy of it. ,Dense matrices that can be read in a monad. Cast the matrix to an ji , perform an IO action, and  convert the IO" action to an action in the monad m. This  operation is very unsafe. BConvert a mutable matrix to an immutable one by taking a complete  copy of it. 1Common functionality for all dense matrix types. #Cast the shape type of the matrix. BPossibly create a vector view of a matrix. This will fail if the B matrix is hermed or if the lda of the matrix is not equal to the  number of rows in the matrix. BPossibly create a matrix view of a row vector. This will fail if ! the stride of the vector is not 1 or the vector is conjugated. BPossibly create a matrix view of a column vector. This will fail $ if the stride of the vector is not 1" or the vector is not conjugated. @Possible create a matrix view of the vector. This will fail if ! the stride of the vector is not 1 or the vector is conjugated. E An error will be called if the vector does not have the same number $ of elements as the desired matrix.  Unsafe cast from a matrix to an ji. >Immutable dense matrices. The type arguments are as follows:  np>: a phantom type for the shape of the matrix. Most functions N will demand that this be specified as a pair. When writing a function + signature, you should always prefer Matrix (n,p) e to   Matrix np e.  e>: the element type of the matrix. Only certain element types  are supported. CCreates a new matrix with the given association list. Unspecified ' indices will get initialized to zero. CCreate a new matrix with the given elements in column-major order. -Form a matrix from a list of column vectors. *Form a matrix from a list of row vectors. *Create a new matrix from a column vector. 'Create a new matrix from a row vector. -Create a zero matrix of the specified shape. )Set every element in the matrix to zero. 1Create a constant matrix of the specified shape. 7Set every element in the matrix to the given constant. FCreate a new matrix of the given shape with ones along the diagonal,  and zeros everywhere else. =Set diagonal elements to one and all other elements to zero. Get a copy of a matrix. @Get a copy of a matrix and make sure the returned matrix is not 7 a view. Specififially, the returned matrix will have  isHermMatrix  equal to False. copyMatrix dst src replaces the values in dst with those in / source. The operands must be the same shape. swapMatrix x y* swaps the values stored in two matrices. +Swap the elements in two rows of a matrix. .Swap the elements in two columns of a matrix. submatrixView a ij mn$ returns a view of the submatrix of a with element (0,0)  being element ij in a, and having shape mn. FDivide the rows of a matrix into two blocks and return views into the H blocks. The integer argument indicates how many rows should be in the  first block. IDivide the columns of a matrix into two blocks and return views into the K blocks. The integer argument indicates how many columns should be in the  first block. 6Get a list of vector views of the rows of the matrix. 9Get a list of vector views of the columns of the matrix. 0Get a vector view of the given row in a matrix. 3Get a vector view of the given column in a matrix.  5Get a vector view of the given diagonal in a matrix.  AGet the given diagonal in a matrix. Negative indices correspond  to sub-diagonals.   %Conjugate every element of a matrix.  CGet a new matrix with elements with the conjugates of the elements  of the given matrix. 4Scale every element of a matrix by the given value. ;Get a new matrix by scaling the elements of another matrix  by a given value. -Add a constant to every element in a matrix. <Get a new matrix by shifting the elements of another matrix  by a given value. 5Replace the first argument with the elementwise sum. getAddMatrix a b' creates a new matrix equal to the sum a+b. The $ operands must have the same shape. 5Replace the first argument with the elementwise sum. getSubMatrix a b. creates a new matrix equal to the difference a-b. The $ operands must have the same shape. axpyMatrix a x y replaces  y := a x + y. 9Replace the first argument with the elementwise product. getMulMatrix a b8 creates a new matrix equal to the elementwise product  a*b*. The operands must have the same shape.  :Replace the first argument with the elementwise quotient. !"getDivMatrix a b5 creates a new matrix equal to the elementwise ratio  a/b*. The operands must have the same shape. #$%&'gemv alpha a x beta y replaces y := alpha a * x + beta y. gemm alpha a b beta c replaces c := alpha a * b + beta c. (KCreate a new matrix of the given size and initialize the given elements to 8 the given values. All other elements get set to zero. )*@Create a new matrix with the given elements in row-major order. +7Create a matrix of the given shape from a list of rows ,:Create a matrix of the given shape from a list of columns - Get a matrix from a row vector. .#Get a matrix from a column vector. /IGet a matrix from the elements stored in columnwise order in the vector. 09Get a vector by concatenating the columns of the matrix. 1#Get a new zero of the given shape. 2'Get a new constant of the given shape. 3EGet a new matrix of the given shape with ones along the diagonal and  zeroes everywhere else. 4submatrix a ij mn returns the submatrix of a with element (0,0)  being element ij in a, and having shape mn. 56FGet a the given diagonal in a matrix. Negative indices correspond to  sub-diagonals. 78GTake a unary elementwise vector operation and apply it to the elements  of a matrix. 9HTake a binary elementwise vector operation and apply it to the elements  of a pair of matrices.       !"#$%&'()*+,-./0123456789        !"#$%&'()*+,-./0123456789  experimental%Patrick Perry <patperry@stanford.edu> wxz{|wxz{|  experimental%Patrick Perry <patperry@stanford.edu>JKLMNOPQRSTUVWXYZ[\]^_`abcnopqrstuvwxyz{|~1wxyz{|~stuvnopqr) experimental%Patrick Perry <patperry@stanford.edu>:Get the given row in a matrix. ;"Get the given column in a matrix. <1Get a strict list the row vectors in the matrix. =7Get a strict list of the column vectors in the matrix. >Scale and apply to a vector ?Scale and apply to a matrix @ y := alpha a x + beta yA c := alpha a b + beta cBApply to a vector CApply to a matrix D  x := alpha a xE  b := alpha a bF9Apply to a vector and store the result in another vector G9Apply to a matrix and store the result in another matrix H x := a xI  b := a b'$%&':;<=>?@ABCDEFGHI:;<=>?@ABCDEFGHI experimental%Patrick Perry <patperry@stanford.edu>:;<=>?@ABCDEFGHI:;<=B>C?F@HDGAIE experimental%Patrick Perry <patperry@stanford.edu> !"#$%&'()*+,-./KLMNOPQRSTUVWXYZ[\]^_`abc     "89:;<=>?@ABCDEFGHI> 89   "  experimental%Patrick Perry <patperry@stanford.edu> !"#$%&'()*+,-./KLMNOPQRSTUVWXYZ[\]^_`abciklm     "89:;<=>?@ABCDEFGHIimkl* experimental%Patrick Perry <patperry@stanford.edu>JReturn x such that a x = y. KReturn x such that  a x = alpha y. LReturn b such that a b = c. MReturn b such that  a b = alpha c. NSet  x := a^{-1} y. OSet  b := a^{-1} c. PSet x := a^{-1} (alpha y). QSet b := a^{-1} (alpha c). RSet  x := a^{-1} x. SSet x := a^{-1} (alpha x). TSet  b := a^{-1} b. USet b := a^{-1} (alpha b). JKLMNOPQRSTUJKLMNOPQRSTU  experimental%Patrick Perry <patperry@stanford.edu> JKLMNOPQRSTU JLKMNOPQRTSU  experimental%Patrick Perry <patperry@stanford.edu>NKLMNOPQRSTUVWXYZ[\]^_`abcdfghnopqrstuvwxyz{|~dfgh+ experimental%Patrick Perry <patperry@stanford.edu>VDense vectors in the , monad. The type arguments are as follows:  s&: the state variable argument for the  type  n1: a phantom type for the dimension of the vector  e>: the element type of the vector. Only certain element types  are supported. WFA safe way to create and work with a mutable vector before returning E an immutable vector for later perusal. This function avoids copying I the vector before returning it - it uses unsafeFreezeVector internally, 9 but this wrapper is a safe interface to that function. VWVW, experimental%Patrick Perry <patperry@stanford.edu>XDense matrix in the , monad. The type arguments are as follows:  s&: the state variable argument for the  type  np>: a phantom type for the shape of the matrix. Most functions N will demand that this be specified as a pair. When writing a function + signature, you should always prefer STMatrix s (n,p) e to  STMatrix s np e.  e>: the element type of the matrix. Only certain element types  are supported. YFA safe way to create and work with a mutable matrix before returning E an immutable matrix for later perusal. This function avoids copying I the matrix before returning it - it uses unsafeFreezeMatrix internally, 9 but this wrapper is a safe interface to that function. XYXY experimental%Patrick Perry <patperry@stanford.edu> !"#$%&'()*+,-./KLMNOPQRSTUVWXYZ[\]^_`abc     "89:;<=>?@ABCDEFGHIXYXY experimental%Patrick Perry <patperry@stanford.edu>LKLMNOPQRSTUVWXYZ[\]^_`abcnopqrstuvwxyz{|~VWWV- experimental%Patrick Perry <patperry@stanford.edu>ZBA type class for immutable matrices. The member functions of the C type class do not perform any checks on the validity of shapes or E indices, so in general their safe counterparts should be preferred. [Get the given row in a matrix. \"Get the given column in a matrix. ]*Get a list the row vectors in the matrix. ^-Get a list the column vectors in the matrix. _#Matrix multiplication by a vector. `#Matrix multiplication by a matrix. a"Scale and multiply by a vector.   sapply k a x is equal to a < *> (k *> x), and often it is faster. b Scale and multiply by a matrix.  sapplyMat k a b is equal to a < **> (k *> b), and often it is faster. Z[\]^_`abZ[\]^_`ab experimental%Patrick Perry <patperry@stanford.edu> Z[\]^_`ab Z[\]^_`ab experimental%Patrick Perry <patperry@stanford.edu>J  !"#$%&'()*+,-./(*+,-./012346Z[\]^_`ab(*+,123-./046. experimental%Patrick Perry <patperry@stanford.edu> c?A type class for immutable matrices with inverses. The member G functions of the type class do not perform any checks on the validity G of shapes or indices, so in general their safe counterparts should be  preferred. dSolve for a vector. eSolve for a matrix. fSolve for a vector and scale.   ssolve k a y is equal to a <\ > (k *> y) but is often faster. gSolve for a matrix and scale.  ssolveMat k a c is equal to a <\\ > (k *> c) but is often faster. cdefg cdefg experimental%Patrick Perry <patperry@stanford.edu>cdefgcdefg experimental%Patrick Perry <patperry@stanford.edu>89:;<=>?@AJKLMNOPQRSTUcdefg 89<=;>?@A:/ experimental%Patrick Perry <patperry@stanford.edu>=hBanded matrix in the L, monad. The type arguments are as follows:  np>: a phantom type for the shape of the matrix. Most functions N will demand that this be specified as a pair. When writing a function + signature, you should always prefer IOBanded (n,p) e to   IOBanded np e.  e>: the element type of the matrix. Only certain element types  are supported. ijklmnopqr Execute an L3 action with a pointer to the first element in the  banded matrix. ICreate a new banded matrix of given shape and (lower,upper), bandwidths, % but do not initialize the elements. CCreate a zero banded matrix of the specified shape and bandwidths. GCreate a constant banded matrix of the specified shape and bandwidths.      gbmv alpha a x beta y replaces y := alpha a * x + beta y gbmm alpha a b beta c replaces c := alpha a * b + beta c. =hijklmnopqr     =h ijklmnopqijklmnopqr     0 experimental%Patrick Perry <patperry@stanford.edu>Ks<Banded matrices that can be created or modified in a monad. tACreates a new banded matrix of the given shape and bandwidths. % The elements will be uninitialized. uUnsafely convert an L action that creates an h into  an action in m that creates a matrix. vAConvert an immutable banded matrix to a mutable one by taking a  complete copy of it. wx-Banded matrices that can be read in a monad. yCast the banded matrix to an h , perform an IO action, and  convert the IO" action to an action in the monad m. This  operation is very unsafe. zAConvert a mutable banded matrix to an immutable one by taking a  complete copy of it. {|2Common functionality for all banded matrix types. }8Get the number of lower diagonals in the banded matrix. ~7Get the number of upper diagonals in the banded matrix 7Get the range of valid diagonals in the banded matrix.   bandwidthds a is equal to (numLower a, numUpper a). ;Get the leading dimension of the underlying storage of the  banded matrix. <Indicate whether or not the banded matrix is transposed and  conjugated. *Cast the shape type of the banded matrix. ?Get a matrix with the underlying storage of the banded matrix. 0 This will fail if the banded matrix is hermed. @Given a shape and bandwidths, possibly view the elements stored @ in a dense matrix as a banded matrix. This will if the matrix C storage is hermed. An error will be called if the number of rows A in the matrix does not equal the desired number of diagonals or C if the number of columns in the matrix does not equal the desired  number of columns. AView a vector as a banded matrix of the given shape. The vector < must have length equal to one of the specified dimensions. +View a vector as a diagonal banded matrix. ?If the banded matrix has only a single diagonal, return a view ( into that diagonal. Otherwise, return Nothing.  Unsafe cast from a matrix to an h. ?Immutable banded matrices. The type arguments are as follows:  np>: a phantom type for the shape of the matrix. Most functions N will demand that this be specified as a pair. When writing a function + signature, you should always prefer Banded (n,p) e to   Banded np e.  e>: the element type of the matrix. Only certain element types  are supported.  !>Create a banded matrix with the given shape, bandwidths, and C associations. The indices in the associations list must all fall C in the bandwidth of the matrix. Unspecified elements will be set  to zero. "GCreate a banded matrix of the given shape and bandwidths by specifying H its diagonal elements. The lists must all have the same length, equal E to the number of elements in the main diagonal of the matrix. The C sub-diagonals are specified first, then the super-diagonals. In  subdiagonal i , the first i# elements of the list are ignored. ECreate a zero banded matrix with the specified shape and bandwidths. GCreate a constant banded matrix of the specified shape and bandwidths. .Set every element of a banded matrix to zero. 4Set every element of a banded matrix to a constant. <Create a new banded matrix by taking a copy of another one. GCopy the elements of one banded matrix into another. The two matrices ) must have the same shape and badwidths. #BGet a view of a diagonal of the banded matrix. This will fail if ( the index is outside of the bandwidth. EGet a view into the partial row of the banded matrix, along with the 3 number of zeros to pad before and after the view. HGet a view into the partial column of the banded matrix, along with the 3 number of zeros to pad before and after the view. 5Get a copy of the given diagonal of a banded matrix. $%&'()*+,-./>Create a banded matrix with the given shape, bandwidths, and C associations. The indices in the associations list must all fall C in the bandwidth of the matrix. Unspecified elements will be set  to zero. GCreate a banded matrix of the given shape and bandwidths by specifying H its diagonal elements. The lists must all have the same length, equal E to the number of elements in the main diagonal of the matrix. The C sub-diagonals are specified first, then the super-diagonals. In  subdiagonal i , the first i# elements of the list are ignored. ECreate a zero banded matrix with the specified shape and bandwidths. GCreate a constant banded matrix of the specified shape and bandwidths. CCreate a banded matrix from a vector. The vector must have length 0 equal to one of the specified dimension sizes. /Create a diagonal banded matrix from a vector. BConvert a diagonal banded matrix to a vector. Fail if the banded # matrix has more than one diagonal KGet a the given diagonal in a banded matrix. Negative indices correspond  to sub-diagonals. 012Kstuvwxyz{|}~ !"#$%&'()*+,-./012Kstuvwtuvwxyz{yz{|}~}~ !"#$%&'()*+,-./012 experimental%Patrick Perry <patperry@stanford.edu>G  !"#$%&'()*+,-./Z[\]^_`ab|}~|}~ experimental%Patrick Perry <patperry@stanford.edu>p !"#$%&'()*+,-./KLMNOPQRSTUVWXYZ[\]^_`abc:;<=>?@ABCDEFGHIstuvwxyz{|}~"|}~xyz{stuvw experimental%Patrick Perry <patperry@stanford.edu>r !"#$%&'()*+,-./KLMNOPQRSTUVWXYZ[\]^_`abc:;<=>?@ABCDEFGHIhrstuvwxyz{|}~hr1 experimental%Patrick Perry <patperry@stanford.edu>Banded matrix in the , monad. The type arguments are as follows:  s&: the state variable argument for the  type  np>: a phantom type for the shape of the matrix. Most functions N will demand that this be specified as a pair. When writing a function + signature, you should always prefer STBanded s (n,p) e to  STBanded s np e.  e>: the element type of the matrix. Only certain element types  are supported. 3MA safe way to create and work with a mutable banded matrix before returning B an immutable one for later perusal. This function avoids copying I the matrix before returning it - it uses unsafeFreezeBanded internally, 9 but this wrapper is a safe interface to that function. 333 experimental%Patrick Perry <patperry@stanford.edu>r !"#$%&'()*+,-./KLMNOPQRSTUVWXYZ[\]^_`abc:;<=>?@ABCDEFGHIstuvwxyz{|}~ experimental%Patrick Perry <patperry@stanford.edu>_deij} !#$%&')57Zchijklmnopq_de}ij)57 #!hijklmnopqZc&'$% experimental%Patrick Perry <patperry@stanford.edu>4567=Element types that can be tested with QuickCheck properties. @Inicates whether or not the value should be used in tests. For  8s, isTestElemElem e is defined as  1not (isNaN e || isInfinite e || isDenormalized e). 7Generate a list of elements suitable for testing with. EGenerate a list of elements for testing that have no imaginary part. 1Get an appropriate dimension for a random vector ,Generate a random vector of the given size. 9:;3Generate an appropriate shape for a random matrix. -Generate a random matrix of the given shape. <=>?@;Generate valid bandwidth for a given matrix dimension size 6Generate valid bandwidths for the given matrix shape. !Generate a random banded matrix. AB   C23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abbcdefghiijklmnopq!r!s!t!u!v!w"x#y$z{|}~%%%%%&&&&&'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''((((((((((((((((((((((((((((( ( ( ( ( ((((((((((((((((((( (!("(#($(%(&('((()(*(+(,(-(.(/(0(1(2(3(4(5(6(7(8(9(:(;(<(=(>(?(@(A(B(C(D(E(F(G(H(I(J(K(L(M(N(O(P(Q(R(S(T(U(V(W(X(Y(Z([(\(](^(_(`(a(b(c(d(e(f(g)h)i)j)k)l)m)n)o)p)q)r)s)t)u)v)w*x*y*z*{*|*}*~*****++,,---------.....///////////00000000000000000000000000000000000000000000000000000115Vpn      !"# $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C"D"E"F"G"H"I"J"K"L"M"N"O"P"Q"R"S"T#U#V#W#X#Y#Z#[#\#]#^#_#`$a$b$c$d$e$f$g$h$ijkljkmnop%q%r%s%t%u%v%w%x%y%z%{%|%}%~%%%%%%%%%%%%%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&''''''''''''''''''''''((((((((((((U(a([(c(((((((((W(d(((Y(e(((((((((((((())))))****j+,------....////// / / / / /////////////////// /!/"/#/$/%/&/'/(/V/)/\/*/X/+/,/-/Z/.///0/100203040506070V0)0\0*0X0+0,0-0Z0.0/0008090:1;;<<no=>?@ADBCDEF blas-0.7.2 Unsafe.BLASData.Tensor.ClassData.Tensor.Class.ITensorData.Matrix.ClassData.Matrix.HermData.Matrix.TriData.Elem.BLASData.Tensor.Class.MTensorData.Vector.Dense.IOData.Matrix.Dense.IOData.Vector.Dense.ClassData.Vector.DenseData.Matrix.Class.MSolveData.Matrix.Class.MMatrixData.Matrix.Dense.ClassData.Matrix.DenseData.Vector.Dense.STData.Matrix.Dense.STData.Matrix.Class.IMatrixData.Matrix.Class.ISolveData.Matrix.Banded.IOData.Matrix.Banded.ClassData.Matrix.BandedData.Matrix.Banded.STTest.QuickCheck.BLAS BLAS.Internal BLAS.TypesData.Matrix.HermBaseData.Matrix.TriBase BLAS.CTypesData.Elem.BLAS.DoubleData.Elem.BLAS.ZomplexData.Elem.BLAS.BaseData.Elem.BLAS.Level1Data.Elem.BLAS.Level2Data.Elem.BLAS.Level3Data.Vector.Dense.IOBaseData.Matrix.Dense.IOBaseData.Vector.Dense.BaseData.Matrix.Dense.BaseData.Matrix.Class.MMatrixBaseData.Matrix.Class.MSolveBaseData.Vector.Dense.STBaseData.Matrix.Dense.STBaseData.Matrix.Class.IMatrixBaseData.Matrix.Class.ISolveBaseData.Matrix.Banded.IOBaseData.Matrix.Banded.BaseData.Matrix.Banded.STBase clearArrayinlinePerformIOShapedshapeboundsITensorsize//unsafeAt unsafeReplaceindiceselemsassocstmap*>shift!SideEnum RightSideLeftSideDiagEnumNonUnitUnitUpLoEnumLowerUpper TransEnum ConjTransNoTrans OrderEnumColMajorRowMajor flipOrder flipTransflipUpLoflipSide MatrixShapedhermHasMatrixStorage MatrixStorage HasVectorView VectorViewnumRowsnumColsisSquareisFatisTall flipShapeHerm coerceHermmapHerm hermFromBase hermToBasehermLhermUTri coerceTrimapTri triFromBase triToBaselowerlowerUupperupperUElem conjugatenormnorm1fromReal maybeToRealBLAS1BLAS2BLAS3 WriteTensor getMaxSizesetZero setConstant canModifyElemunsafeWriteElemunsafeModifyElem modifyWithunsafeSwapElemsdoConjscaleByshiftBy ReadTensorgetSizeunsafeReadElem getIndices getIndices'getElems getElems' getAssocs getAssocs'readElem writeElem modifyElem swapElemsIOVectorvectorViewArrayvectorViewArrayWithStride withIOVectorIOMatrixmatrixViewArraymatrixViewArrayWithLda withIOMatrix WriteVectorunsafeConvertIOVector newVector_ thawVectorunsafeThawVector ReadVectorunsafePerformIOWithVector freezeVectorunsafeFreezeVector BaseVectordimstrideisConjconj coerceVectorunsafeSubvectorViewWithStrideunsafeVectorToIOVectorunsafeIOVectorToVectorVector newVectorunsafeNewVector newListVector newZeroVector setZeroVectornewConstantVectorsetConstantVectornewBasisVectorsetBasisVector newCopyVectornewCopyVector' copyVectorunsafeCopyVector swapVectorunsafeSwapVector subvectorViewunsafeSubvectorViewsubvectorViewWithStride getConjVector doConjVectorgetScaledVector scaleByVectorgetShiftedVector shiftByVector getAddVectorunsafeGetAddVector addVectorunsafeAddVector getSubVectorunsafeGetSubVector subVectorunsafeSubVector axpyVectorunsafeAxpyVector getMulVectorunsafeGetMulVector mulVectorunsafeMulVector getDivVectorunsafeGetDivVector divVectorunsafeDivVector getSumAbsgetNorm2getWhichMaxAbsgetDot unsafeGetDotvector unsafeVector listVector zeroVectorconstantVector basisVector subvectorunsafeSubvectorunsafeSubvectorWithStridesubvectorWithStridesumAbsnorm2 whichMaxAbs<.> unsafeDotMSolve unsafeDoSolveunsafeDoSolveMatunsafeDoSSolveunsafeDoSSolveMatunsafeDoSolve_unsafeDoSSolve_unsafeDoSolveMat_unsafeDoSSolveMat_MMatrixunsafeGetSApplyunsafeGetSApplyMatunsafeDoSApplyAddunsafeDoSApplyAddMatunsafeDoSApply_unsafeDoSApplyMat_ unsafeGetRow unsafeGetColgetRowsgetCols WriteMatrix newMatrix_unsafeConvertIOMatrix thawMatrixunsafeThawMatrix ReadMatrixunsafePerformIOWithMatrix freezeMatrixunsafeFreezeMatrix BaseMatrix ldaMatrix isHermMatrix coerceMatrixunsafeSubmatrixViewunsafeDiagView unsafeRowView unsafeColViewmaybeViewMatrixAsVectormaybeViewVectorAsRowmaybeViewVectorAsColmaybeViewVectorAsMatrixunsafeMatrixToIOMatrixunsafeIOMatrixToMatrixMatrix newMatrixunsafeNewMatrix newListMatrix newColsMatrix newRowsMatrix newColMatrix newRowMatrix newZeroMatrix setZeroMatrixnewConstantMatrixsetConstantMatrixnewIdentityMatrixsetIdentityMatrix newCopyMatrixnewCopyMatrix' copyMatrixunsafeCopyMatrix swapMatrixunsafeSwapMatrixswapRowsswapColsunsafeSwapRowsunsafeSwapCols submatrixView splitRowsAt splitColsAtrowViewscolViewsrowViewcolViewdiagViewgetDiag unsafeGetDiag doConjMatrix getConjMatrix scaleByMatrixgetScaledMatrix shiftByMatrixgetShiftedMatrix addMatrixunsafeAddMatrix getAddMatrixunsafeGetAddMatrix subMatrixunsafeSubMatrix getSubMatrixunsafeGetSubMatrix axpyMatrixunsafeAxpyMatrix mulMatrixunsafeMulMatrix getMulMatrixunsafeGetMulMatrix divMatrixunsafeDivMatrix getDivMatrixunsafeGetDivMatrix getColsIO getColsST getRowsIO getRowsSTmatrix unsafeMatrix listMatrix rowsMatrix colsMatrix matrixFromRow matrixFromColmatrixFromVectorvectorFromMatrix zeroMatrixconstantMatrixidentityMatrix submatrixunsafeSubmatrixdiag unsafeDiag liftMatrix liftMatrix2getRowgetColgetRows'getCols' getSApply getSApplyMat doSApplyAdddoSApplyAddMatgetApply getApplyMat doSApply_ doSApplyMat_doApply doApplyMatdoApply_ doApplyMat_getSolve getSSolve getSolveMat getSSolveMatdoSolve doSolveMatdoSSolve doSSolveMatdoSolve_ doSSolve_ doSolveMat_ doSSolveMat_STVector runSTVectorSTMatrix runSTMatrixIMatrixrowcolrowscols<*><**>sapply sapplyMatISolve<\><\\>ssolve ssolveMatIOBanded fptrIOBanded ptrIOBandednumRowsIOBandednumColsIOBandednumLowerIOBandednumUpperIOBanded ldaIOBandedisHermIOBanded withIOBanded WriteBanded newBanded_unsafeConvertIOBanded thawBandedunsafeThawBanded ReadBandedunsafePerformIOWithBanded freezeBandedunsafeFreezeBanded BaseBandednumLowernumUpper bandwidths ldaBanded isHermBanded coerceBandedmaybeMatrixStorageFromBandedmaybeBandedFromMatrixStorageviewVectorAsBandedviewVectorAsDiagBandedmaybeViewBandedAsVectorunsafeDiagViewBandedunsafeRowViewBandedunsafeColViewBandedunsafeBandedToIOBandedunsafeIOBandedToBandedBanded newBandedunsafeNewBandednewListsBanded newZeroBandednewConstantBanded setZeroBandedsetConstantBanded newCopyBanded copyBandeddiagViewBanded rowViewBanded colViewBanded getDiagBandedunsafeGetDiagBandedunsafeGetRowBandedunsafeGetColBandedbanded unsafeBanded listsBanded zeroBandedconstantBandedbandedFromVectordiagBandedFromVectormaybeVectorFromBanded diagBandedunsafeDiagBandedSTBanded runSTBandedTestElemisTestElemElemelements realElementsbzero_bzerocheckedSubvectorcheckedSubvectorWithStride checkVecVecOp checkedRow checkedCol checkedDiag diagStartdiagLencheckedSubmatrix checkMatMatOpcheckMatVecMultcheckMatMatMultcheckMatVecMultAddcheckMatMatMultAddcheckMatVecSolvcheckMatVecSolvTocheckMatMatSolvcheckMatMatSolvTo checkSquarecheckFat checkTall checkBinaryOpcheckTernaryOp CBLASSide CBLASDiag CBLASUpLo CBLASTrans CBLASOrderrowMajorcolMajor cblasOrdernoTranstrans conjTrans cblasTrans cblasUpLononUnitunit cblasDiagleftSide rightSide cblasSidedsyr2kdsyrkdtrsmdtrmmdsymmdgemmdsyr2dsyrdgerdsbmvdsymvdtbsvdtrsvdtbmvdtrmvdgbmvdgemvdrotmdrotmgdrotdrotgdaxpydcopydswapdscalidamaxdasumdnrm2ddotzher2kzherkzsyr2kzsyrkztrsmztrmmzhemmzsymmzgemmzher2zherzgerczgeruzhbmvzhemvztbsvztrsvztbmvztrmvzgbmvzgemvzdrotzrotgzaxpyzcopyzswapzscalizamaxzasumznrm2 zdotc_sub zdotu_subdotudotcnrm2asumiamaxscalswapcopyaxpyrotgrotvconjacxpyvmulvcmulvdivvcdivgemvgbmvtrmvtbmvtrsvtbsvhemvhbmvgerugercherher2gemmsymmhemmtrmmtrsmsyrksyr2kherkher2kbase Data.Complex:+Complexghc-prim GHC.TypesIO dimIOVectorstrideIOVectorisConjIOVector conjIOVector%unsafeSubvectorViewWithStrideIOVector newIOVector_newCopyIOVector shapeIOVectorboundsIOVector sizeIOVectorgetSizeIOVectorgetMaxSizeIOVectorindicesIOVectorgetIndicesIOVectorgetIndicesIOVector'getElemsIOVectorgetElemsIOVector'getAssocsIOVectorgetAssocsIOVector'unsafeReadElemIOVectorcanModifyElemIOVectorunsafeWriteElemIOVectorunsafeModifyElemIOVectorunsafeSwapElemsIOVectormodifyWithIOVectorsetZeroIOVectorsetConstantIOVectordoConjIOVectorscaleByIOVectorshiftByIOVectornumRowsIOMatrixnumColsIOMatrixldaMatrixIOMatrixisHermIOMatrix hermIOMatrixunsafeSubmatrixViewIOMatrixunsafeRowViewIOMatrixunsafeColViewIOMatrixunsafeDiagViewIOMatrixmaybeViewVectorAsRowIOMatrixmaybeViewVectorAsColIOMatrixmaybeViewIOMatrixAsVectormaybeViewVectorAsIOMatrix liftIOMatrix liftIOMatrix2 newIOMatrix_newCopyIOMatrix shapeIOMatrixboundsIOMatrix sizeIOMatrixgetSizeIOMatrixgetMaxSizeIOMatrixindicesIOMatrixgetIndicesIOMatrixgetIndicesIOMatrix'getElemsIOMatrixgetElemsIOMatrix'getAssocsIOMatrixgetAssocsIOMatrix'unsafeReadElemIOMatrixcanModifyElemIOMatrixunsafeWriteElemIOMatrixunsafeModifyElemIOMatrixunsafeSwapElemsIOMatrixmodifyWithIOMatrixsetZeroIOMatrixsetConstantIOMatrixdoConjIOMatrixscaleByIOMatrixshiftByIOMatrixfreezeIOVector thawIOVectorunsafeFreezeIOVectorunsafeThawIOVector replaceVectorunsafeReplaceVector sizeVector indicesVector elemsVector assocsVectorunsafeAtVector tmapVectortzipWithVector scaleVector shiftVectorcompareVectorWith vectorCall vectorCall2checkVectorOp2getUnaryVectorOpunsafeGetBinaryVectorOpfreezeIOMatrix thawIOMatrixunsafeFreezeIOMatrixunsafeThawIOMatrixunsafeSplitRowsAtunsafeSplitColsAtunsafeGetRowMatrixunsafeGetColMatrixgetColsMgetRowsMhemv'hemm'unsafeDoSApplyAddTriMatrixunsafeDoSApplyAddMatTriMatrixunsafeDoSApplyTriMatrixunsafeDoSApplyMatTriMatrixtoLowertoUpperunsafeDoSSolveTriMatrixunsafeDoSSolveMatTriMatrix replaceMatrixunsafeReplaceMatrixunsafeAtMatrix indicesMatrix elemsMatrix assocsMatrix tmapMatrixtzipWithMatrixcompareMatrixWithcheckMatrixOp2getUnaryMatrixOpunsafeGetBinaryMatrixOp transMatrix indexOfMatrixunsafeGetApplyunsafeGetApplyMat unsafeDoApplyunsafeDoApplyMatunsafeDoApply_unsafeDoApplyMat_unsafeGetSolveunsafeGetSSolveunsafeGetSolveMatunsafeGetSSolveMatGHC.STST unsafeSApplyunsafeSApplyMat unsafeRow unsafeCol unsafeApplyunsafeApplyMat unsafeSolveunsafeSolveMat unsafeSSolveunsafeSSolveMat hermIOBanded indexIOBandedhasStorageIOBandedwithIOBandedElemmaybeMatrixStorageFromIOBandedmaybeIOBandedFromMatrixStorageviewVectorAsIOBandedmaybeViewIOBandedAsVectorbandwidthsIOBandedcoerceIOBanded shapeIOBandedboundsIOBanded sizeIOBandedindicesIOBandedgetSizeIOBandedgetIndicesIOBandedgetIndicesIOBanded'getAssocsIOBandedgetAssocsIOBanded'getElemsIOBandedgetElemsIOBanded'unsafeReadElemIOBandedunsafeWriteElemIOBandedmodifyWithIOBandedcanModifyElemIOBanded newIOBanded_newZeroIOBandedsetZeroIOBandednewConstantIOBandedsetConstantIOBandednewCopyIOBandedunsafeCopyIOBandedunsafeRowViewIOBandedunsafeColViewIOBandedunsafeDiagViewIOBandedunsafeGetRowIOBandedunsafeGetColIOBandedgbmmhbmmtbmmtbmv'tbmm'tbsmtbsv'tbsm' transIOBandedfreezeIOBanded thawIOBandedunsafeFreezeIOBandedunsafeThawIOBanded newBandedHelpunsafeCopyBandedlistsFromBandedcompareBandedHelpreplaceBandedHelp SubMatrix SubVectorDouble rawVector conjVector rawMatrix hermedMatrix rawSubMatrix bandwidth rawBanded hermedBanded