SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse
Interface SparseStructure

All Known Subinterfaces:
SparseMatrix
All Known Implementing Classes:
CsrSparseMatrix, DokSparseMatrix, LilSparseMatrix, SparseVector

public interface SparseStructure

This interface defines common operations on sparse structures like sparse vector or sparse matrix.


Method Summary
 int dropTolerance(double tolerance)
          Remove non-zero entries x whose magnitude is less than or equal to the tolerance, i.e., (|x| <= tolerance).
 int nnz()
          Get the number of non-zero entries in the matrix.
 

Method Detail

nnz

int nnz()
Get the number of non-zero entries in the matrix.

Returns:
the number of non-zero entries in the matrix

dropTolerance

int dropTolerance(double tolerance)
Remove non-zero entries x whose magnitude is less than or equal to the tolerance, i.e., (|x| <= tolerance).

Parameters:
tolerance - the tolerance for non-zeros
Returns:
the number of non-zeros removed

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.