Sparse representation of a boolean matrix, using binary search (memory efficient)
Fast row-wise access is possible. Indexes are zero-based.
Inheritance: IBooleanMatrix
Ejemplo n.º 1
0
        /// <summary>Get the transpose of the matrix, i.e. a matrix where rows and columns are interchanged</summary>
        /// <returns>the transpose of the matrix</returns>
        public IMatrix <bool> Transpose()
        {
            var transpose = new SparseBooleanMatrixBinarySearch();

            for (int i = 0; i < row_list.Count; i++)
            {
                foreach (int j in this[i])
                {
                    transpose[j, i] = true;
                }
            }
            return(transpose);
        }
 /// <summary>Get the transpose of the matrix, i.e. a matrix where rows and columns are interchanged</summary>
 /// <returns>the transpose of the matrix</returns>
 public IMatrix<bool> Transpose()
 {
     var transpose = new SparseBooleanMatrixBinarySearch();
     for (int i = 0; i < row_list.Count; i++)
         foreach (int j in this[i])
             transpose[j, i] = true;
     return transpose;
 }