# HG changeset patch # User Chris Cannam # Date 1369064798 -3600 # Node ID bb5fec8db722463ca8f12d1c508fb0d209ff2ec9 # Parent 1313764cb89ce8afeb6097752be107a8e6ae0bfe ColMajor -> ColumnMajor diff -r 1313764cb89c -r bb5fec8db722 yetilab/matrix/matrix.yeti --- a/yetilab/matrix/matrix.yeti Mon May 20 16:45:34 2013 +0100 +++ b/yetilab/matrix/matrix.yeti Mon May 20 16:46:38 2013 +0100 @@ -125,19 +125,19 @@ SparseCSC _: true; esac; -newColMajorStorage { rows, columns } = +newColumnMajorStorage { rows, columns } = if rows < 1 then array [] else array (map \(vec.zeros rows) [1..columns]) fi; zeroMatrix { rows, columns } = - DenseCols (newColMajorStorage { rows, columns }); + DenseCols (newColumnMajorStorage { rows, columns }); zeroMatrixWithTypeOf m { rows, columns } = if isRowMajor? m then - DenseRows (newColMajorStorage { rows = columns, columns = rows }); + DenseRows (newColumnMajorStorage { rows = columns, columns = rows }); else - DenseCols (newColMajorStorage { rows, columns }); + DenseCols (newColumnMajorStorage { rows, columns }); fi; zeroSizeMatrix () = zeroMatrix { rows = 0, columns = 0 }; @@ -173,7 +173,7 @@ esac); makeSparse type size data = - (isRow = case type of RowMajor (): true; ColMajor (): false esac; + (isRow = case type of RowMajor (): true; ColumnMajor (): false esac; ordered = sortBy do a b: if a.maj == b.maj then a.min < b.min else a.maj < b.maj fi @@ -224,7 +224,7 @@ _: []; esac; makeSparse - if isRowMajor? m then RowMajor () else ColMajor () fi + if isRowMajor? m then RowMajor () else ColumnMajor () fi (size m) (enumerate m [0..rows-1] [0..columns-1]); fi; @@ -252,7 +252,7 @@ flipped m = if isSparse? m then if isRowMajor? m then - makeSparse (ColMajor ()) (size m) (enumerateSparse m) + makeSparse (ColumnMajor ()) (size m) (enumerateSparse m) else makeSparse (RowMajor ()) (size m) (enumerateSparse m) fi