Giter Site home page Giter Site logo

etmendz / mendz.matrix Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 25 KB

Provides a library of APIs for working with dense, (DOK) sparse and compressed (CRS, CCS, CVS) matrices.

License: Other

C# 100.00%
mendz matrix sparse-matrix compressed-matrix crs ccs cvs

mendz.matrix's Introduction

Mendz.Matrix

Provides a library of APIs for working with dense, (DOK) sparse and compressed (CRS, CCS, CVS) matrices. Wiki

Implementation

Namespaces

Mendz.Matrix

Contents

Name Description
Matrix Provides methods to work on a dense matrix.
SquareMatrix Provides methods to work on a square matrix.
MatrixCoordinates Provides methods to work on matrix coordinates.
DOKSparseMatrixBase The base class of DOK sparse matrix.
CoordinatesKeyedSparseMatrix Represents a coordinates keyed DOK sparse matrix.
LinearIndexKeyedSparseMatrix Represents a linear index keyed DOK sparse matrix.
DOKSparseMatrixExtensions Provides extensions to the DOK sparse matrix type.
MatrixLinearIndexMode An enumeration of the matrix linear index mode, if row- or column- major order.
MDAS An enumeration of basic mathematical operations: Multiply, Divide, Add or Subtract.

Mendz.Matrix.Compressed

Contents

Name Description
CRS An implementation of the Compressed Row Storage format, also known as Compressed Sparse Row (CSR) or Yale format.
CCS An implementation of the Compressed Column Storage format, also known as Compressed Sparse Column (CSC).
CVS An implementation of the Compressed Value Storage format, a lossless compression of matrices by their entry values.
DOKSparseMatrixCompressions Provides extensions to the DOK sparse matrix type to compress sparse matrices.

CRS and CCS

CRS and CCS are two popular matrix compression formats. Both formats can achieve typical compression ratio of 4:1 and up to 76% space savings.

CRS is a tuple of 4 values:

(
    List<T> value, 
    List<int> rowPointer, 
    List<int> columnIndex, 
    (int rows, int columns) size
)

CCS is a tuple of 4 values:

(
    List<T> value, 
    List<int> columnPointer, 
    List<int> rowIndex, 
    (int rows, int columns) size
)

The implementation of CRS/CCS in Mendz.Matrix.Compressed includes methods to compress, decompress, deconstruct and perform matrix vector multiplication.

CVS

CVS applies basic lossless compression techniques to compress a matrix. Essentially, lossless compression exploits redundancy. For matrices with redundant data, like the adjacency matrix, CVS can achieve compression ratios of 13:1 and up to 92% space savings.

CVS is a tuple of 4 values:

(
    List<int> value, 
    List<List<int>> linearIndex, 
    MatrixLinearIndexMode linearIndexMode,
    (int rows, int columns) size
)

The implementation of CVS in Mendz.Matrix.Compressed includes methods to compress, decompress, deconstruct, switch linear index mode, and to perform transpose, matrix addition, matrix substraction, matrix scalar multiplication, matrix multiplication and matrix vector multiplication.

DOKSparseMatrixCompressions

By "using Mendz.Matrix.Compressed", extension methods are added to DOKSparseMatrixBase implementations such that the DOK sparse matrix can be compressed:

  • ToCRS(),
  • ToCCS(), or
  • ToCVS()

NuGet it...

https://www.nuget.org/packages/Mendz.Matrix/

mendz.matrix's People

Contributors

etmendz avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

lanicon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.