Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A lightweight library for dense matrix manipulation, dense matrix is implemented based on java hashmaps. It provides some basic operations like addition, subtraction and average calculation..
Java
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
src/org/densematrix
README.md

README.md

HashmapDenseMatrix

A lightweight library for dense matrix manipulation, dense matrix is implemented based on java hashmaps. It provides some basic operations like addition, subtraction and average calculation.

An Example Code:


public static void main( String args[]){    
    long abc[][]={{1,2,3},{2,3,4}};
    long def[][]={{1,2,3},{2,3}};
    HashmapDenseMatrix matrix=new HashmapDenseMatrix(abc);

    HashmapDenseMatrix matrix_temp=new HashmapDenseMatrix(def);


    matrix=matrix_temp.subtractMatrix(matrix);
    int coordinates[][]=matrix.getXYValues();

    for(int i=0;i<coordinates.length;i++){
        System.out.println("i="+coordinates[i][0]+"\n"+"j="+coordinates[i][1]+"value="+matrix.getValueatXY(coordinates[i][0], coordinates[i][1]));
    }

}

Available functions:

public HashmapDenseMatrix  getAverageofMatrix(HashmapDenseMatrix matrix_to_add)

public HashmapDenseMatrix addMatrix(HashmapDenseMatrix matrix_to_add)

public HashmapDenseMatrix subtractMatrix(HashmapDenseMatrix matrix_to_subtract)

public int[][] getXYValues()
Something went wrong with that request. Please try again.