anchor.diff:                  yield f (seq [for rowi=0 to m.NumRows-1 do yield m.[rowi,coli]])
                   ]
           // TM
  -        /// Applies function f along colmn axis 
  +        /// Applies function f along colúmn axis 
           let enumerateColumnWise f (m:matrix) =
               seq [ 
                   for rowi=0 to m.NumRows-1 do 
                   yield f (seq [for coli=0 to m.NumCols-1 do yield m.[rowi,coli]])
                   ]    
  -
       end
   
       module MG = Generic
  
positive.code:         [<DebuggerBrowsable(DebuggerBrowsableState.Collapsed)>]
  #endif
          member x.Norm              = Matrix.Generic.norm x
  
          member x.Column(n)         = Matrix.Generic.getCol x n
          member x.Row(n)            = Matrix.Generic.getRow x n
          member x.Columns (i,ni)    = Matrix.Generic.getCols x i ni
  
negative.code: 
      // Accessors
      let get (a:matrix) i j   = MG.get a i j
      let set (a:matrix) i j x = MG.set a i j x    
      // Creation
      let init m n f = DS.initDenseMatrixDS m n f |> MS.dense 
      let ofList xss = DS.listDenseMatrixDS xss |> MS.dense
      let ofSeq xss = DS.seqDenseMatrixDS xss |> MS.dense
      let diag (v:vector) = MG.diag v 
      let initDiagonal (v:vector) = MG.diag v 
      let constDiag n x : matrix = MG.constDiag n x 
      let create m n x = DS.constDenseMatrixDS  m n x |> MS.dense
      let ofScalar x = DS.scalarDenseMatrixDS x |> MS.dense
      let ofArray2D arr : matrix = MG.ofArray2D arr
      let toArray2D (m : matrix) = MG.toArray2D m
      let getDiagN  (a:matrix) n = MG.getDiagN a n
      let getDiag  (a:matrix) = MG.getDiag a
      // Operators
      // Operators
      /// Performs a element wise addition of matrices a and b (a+b).
      /// Only usable if both matrices have the same dimensions.
      let add (a:matrix) (b:matrix) = MS.addM a b
      /// Performs a element wise substraction of matrices a and b (a-b).
      /// Only usable if both matrices have the same dimensions.
      let sub (a:matrix) (b:matrix) = MS.subM a b
      /// Performs a left sided matrix multiplication of a and b (a*b).
      /// Only usable if both matrices have the same dimensions.
      let mul (a:matrix) (b:matrix) = MS.mulM a b
      /// Performs a matrix multiplication m*n matrix a and the m*1 vector b (a*b).
      /// Only usable if column number (n) of the matrix equals the row number (m) of the vector.
      let mulV (a:matrix) (b:vector) = MS.mulMV a b
      /// Performs a matrix multiplication of the 1*n rowvector a and the m*n matrix b (a*b).
      /// Only usable if column number (n) of the vector equals the row number (m) of the matrix.
      let mulRV (a:rowvec) (b:matrix) = MS.mulRVM a b
      /// Performs a element wise multiplication of matrices a and b (a+b, Hadamard-Product).
      /// Only usable if both matrices have the same dimensions.
      let cptMul (a:matrix) (b:matrix) = MS.cptMulM a b
      /// Performs a element wise comparison of matrices a and b always preserving the greater value.
      /// Only usable if both matrices have the same dimensions.
      let cptMax (a:matrix) (b:matrix) = MS.cptMaxM a b
      /// Performs a element wise comparison of matrices a and b always preserving the smaller value.
      /// Only usable if both matrices have the same dimensions.
      let cptMin (a:matrix) (b:matrix) = MS.cptMinM a b
      /// Builds a new matrix where the elements are the result of multiplying every element of the given matrix with the given value
      let scale a (b:matrix) = MS.scaleM a b
      /// Scales matrix a by element wise mulitplication with minus 1.
      let neg (a:matrix) = MS.negM a
      /// Computes the trace of matrix a by summing elements of the diagonal.
      /// Only usable if matrices a is a square matrix (m*m).
      let trace (a:matrix) = MS.traceM a
      /// Returns the transpose of matrix a 
      let transpose (a:matrix) = MG.transpose a
      /// Iterates the given Matrix row wise and applies function f element wise.
      /// The iteration stops and returns false if an element fails the condition or true when the end of
      /// the matrix is reached.
      let forall f (a:matrix) = MG.forall f a
      /// Iterates the given Matrix row wise and applies function f element wise.
      /// The iteration stops and returns true if an element satisfies the condition or false when the end of
      /// the matrix is reached.
      let exists f (a:matrix) = MG.exists f a
      /// Iterates the given Matrix row wise and applies function f element wise.
      /// The iteration stops and returns false if an element fails the condition or true when the end of
      /// the matrix is reached.
      let foralli f (a:matrix) = MG.foralli f a
      /// Iterates the given Matrix row wise and applies function f element wise.
      /// The iteration stops and returns true if an element satisfies the condition or false when the end of
      /// the matrix is reached.
      let existsi f (a:matrix) = MG.existsi f a
      let x = List.fold
      /// Builds a new matrix whose elements are the result of row wise applying the given function on each element of a.
      let map f (a:matrix) = MG.map f a
      /// Builds a new matrix whose elements are identical to the elements of a.
      let copy (a:matrix) = MG.copy a
      /// Builds a new matrix whose elements are the result of row wise applying the given function on each element of a. The integer index
      /// passed to the function indicates the index (from 0) the of the element being transformed.
      let mapi f (a:matrix) : matrix = MG.mapi f a
      /// Applies a function f row wise to each element of the matrix, threading an accumulator argument through the computation.
      /// The fold function takes the second argument, and applies the function f to it and the first element of the matrix.
      /// Then, it feeds this result into the function f along with the second element, and so on. It returns the final result.
      /// If the input function is f and the elements are i0...iN, then this function computes f (... (f s i0) i1 ...) iN.
      let fold f z (a:matrix) = MG.fold f z a
      /// Applies a function f row wise to each element of the matrix, threading an accumulator argument through the computation.
      /// The fold function takes the second argument, and applies the function f to it and the first element of the matrix.
      /// Then, it feeds this result into the function f along with the second element, and so on. It returns the final result.
      /// If the input function is f and the elements are i0...iN, then this function computes f (... (f s i0) i1 ...) iN.   
      /// The integers indicies passed to the function indicate row and column position (from 0) the of the element being transformed.
      let foldi f z (a:matrix) = MG.foldi f z a
      /// Transforms the matrix a to a dense matrix representation
      let toDense (a:matrix) = MG.toDense a 
      /// Creates a dense matrix with i rows and j columns. All values are initialized to the value of a.
      let initDense i j a : matrix = MG.initDense i j a     
      /// Creates a sparse matrix with i rows and j columns. All values are initialized to the value of a.
      let initSparse i j a : matrix = MG.initSparse i j a 
      /// Iterates the m*n matrix a row wise and returns a list of tuples (mi,ni,v) containing non zero elements of a
      /// and their row (m) and column (n) indicies. 
      let nonzero_entries (a:matrix) = MG.nonzero_entries a 
      /// Creates a dense matrix with i rows and j columns. All values are initialized to yero (0.).
      let zero m n = DS.zeroDenseMatrixDS m n |> MS.dense
      /// Creates a dense identiy m*m matrix. A identity matrix is always squared and the elements are set to zero exept elements
      /// on the diagonal, which are set to 1.
      /// e.g.
      /// [[1.;0.;0.]
      ///  [0.;1.;0.]
      ///  [0.;0.;1.]]
      let identity m : matrix = MG.identity m      
      /// Creates a dense matrix with i rows and j columns. All values are initialized to one (1.).
      let ones m n = create m n 1.0
      /// Returns row of index i of matrix a    
      let getRow (a:matrix) i = MG.getRow a i
      /// Replaces row of index i of matrix a with values of vector v, if vector length matches rowsize
      let setRow (a:Matrix<_>) i (v:Vector<_>) = MG.setRow a i v
      /// Returns col of index j of matrix a
      let getCol (a:matrix) j = MG.getCol a j
      /// Replaces column of index j of matrix a with values of vector v, if vector length matches columnsize
      let setCol (a:Matrix<_>) j (v:Vector<_>) = MG.setCol a j v
      /// Accesses the m*n matrix a and returns a total of j2 Columns starting from column index j1. The Result is a new
      /// m*j2 matrix.
      /// Only usable if (j1+j2-1) does not exceed n.
      let getCols (a:matrix) j1 j2 = MG.getCols a j1 j2 
      /// Accesses the m*n matrix a and returns a total of i2 rows starting from row index i1. The Result is a new
      /// i2*n matrix.
      /// Only usable if (i1+i2-1) does not exceed m.
      let getRows (a:matrix) i1 i2 = MG.getRows a i1 i2
      /// Accesses the m*n matrix a and returns a total of i2 rows and j2 columns starting from row index i1 and colum index j1. The Result is a new
      /// i2*j2 matrix.
      /// Only usable if (i1+i2-1) does not exceed m and (j1+j2-1) does not exceed n.
      let getRegion (a:matrix) i1 j1 i2 j2 = MG.getRegion a i1 j1 i2 j2
      let rowRange (a:Matrix<_>) = (0,a.NumRows - 1)
      let colRange (a:Matrix<_>) = (0,a.NumCols - 1)
      let wholeRegion a = (colRange a, rowRange a)
      let foldByRow f (z:Vector<'T>) (a:matrix) = 
          colRange a |> GU.foldR (fun z j -> MS.mapiV (fun i z -> f z (get a i j)) z) z
      let foldByCol f (z:RowVector<'T>) (a:matrix) = 
          rowRange a |> GU.foldR (fun z i -> MS.mapiRV (fun j z -> f z (get a i j)) z) z
      let foldRow f (z:'T) (a:matrix) i = 
          colRange a |> GU.foldR (fun (z:'T) j -> f z (get a i j)) z
      let foldCol f (z:'T) (a:matrix) j = 
          rowRange a |> GU.foldR (fun (z:'T) i -> f z (get a i j)) z
      let sum (a:matrix)  = MS.sumM a
      let prod (a:matrix)  = MS.prodM a
      let norm  (a:matrix) = MS.normM  a
      let dot (a:matrix) b = MS.dotM a b
      let cptPow  a y = map (fun x -> x ** y) a
      // Functions that only make sense on this type
      let randomize v = map (fun vij -> MRandom.float vij) v      (* res_ij = random [0,vij] values *)
      let ofRowVector x : matrix = MS.rowvecM x
      let ofVector    x : matrix = MS.vectorM x
      let toVector    x : vector = MS.toVectorM x
      let toRowVector x : rowvec = MS.toRowVectorM x
      let toScalar    x : float  = MS.toScalarM x
      let inplaceAdd  (a:matrix) b = MS.inplaceAddM a b
      let inplaceSub  (a:matrix) b = MS.inplaceSubM a b
      // Mutation
      let inplace_assign  f (a:matrix) = MG.inplace_assign f a
      let inplace_mapi  f (a:matrix) = MG.inplace_mapi f a
      let inplace_cptMul (a:matrix) b = MS.inplaceCptMulM a b
      let inplace_scale  a (b:matrix) = MS.inplaceScaleM a b
      let inplace_add  a b = inplaceAdd a b
      let inplace_sub  a b = inplaceSub a b
      let of_rowvec x = ofRowVector x
  