|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.multicorebsp.util.Matrix<DataType> com.multicorebsp.util.SparseMatrix<DataType,TS<DataType>> com.multicorebsp.util.TS<DataType>
public class TS<DataType extends MatrixData<DataType>>
Base class for reading in a matrix in Triplet Scheme format, from an (Extended) Matrix-market file. Supports distributed matrices.
Field Summary | |
---|---|
int[] |
i
Holds, for each nonzero, the row index |
int[] |
j
Holds, for each nonzero, the column index |
int[] |
p
Holds, for matrices in global view, the processor index |
int[] |
Pstart
Controls which parts of the triplet structure corresponds to which processor. |
protected com.multicorebsp.util.SortSupport<DataType,TS<DataType>> |
SORT
Sort method to be used for this class of matrices. |
Fields inherited from class com.multicorebsp.util.SparseMatrix |
---|
data, n |
Fields inherited from class com.multicorebsp.util.Matrix |
---|
m, nz |
Constructor Summary | |
---|---|
|
TS(DataType data)
Constructs an empty 0 by 0 TS matrix. |
protected |
TS(DataType _data,
int _m,
int _n,
int _nz,
int[] _i,
int[] _j,
int[] _p,
int[] _Pstart)
Deep copy constructor. |
|
TS(DataType data,
int m,
int n,
int nz,
int distributed,
boolean global_view)
Constructs a new matrix, holding the given data with the other arrays (e.g., i and j) zeroed-out. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
void |
CRSSort()
Sorts the data structure using the standard sort defined in the final class. |
protected int[] |
getSubMatrixColumnSizes()
This function assumes Pstart is not null. |
protected int[] |
getSubMatrixRowSizes()
This function assumes Pstart is not null. |
protected int |
partition(com.multicorebsp.util.SortSupport<DataType,TS<DataType>> sup,
int left,
int right,
int pivotIndex)
Quicksort helper function. |
void |
printLocalStats()
Prints ranges of this matrix: for each processor, the size of its submatrix is reported. |
protected void |
quicksort()
Quicksort implementation on arbitrary datatypes. |
protected void |
quicksort(com.multicorebsp.util.SortSupport<DataType,TS<DataType>> sup,
int lo_bound,
int hi_bound)
Quicksort implementation on arbitrary datatypes. |
void |
removeAndAddDuplicates()
Takes care of detecting duplicates and adding combining those values. |
TS<DataType> |
safeClone()
|
protected void |
setCRSSort()
Activates sorting for CRS-ordering |
CRS<DataType> |
toCRS()
Warning: returns current matrix if this matrix already is CRS. |
ICRS<DataType> |
toICRS()
Warning: returns current matrix if this matrix already is CRS. |
java.util.ArrayList<CRS<DataType>> |
toLocalCRS()
|
java.util.ArrayList<ICRS<DataType>> |
toLocalICRS()
|
TS<DataType> |
toTS()
Warning: returns current matrix if this matrix already is TS. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int[] i
public int[] j
public int[] p
MMobject
public int[] Pstart
protected com.multicorebsp.util.SortSupport<DataType extends MatrixData<DataType>,TS<DataType extends MatrixData<DataType>>> SORT
Constructor Detail |
---|
public TS(DataType data)
data
- Where to store the new matrix data.public TS(DataType data, int m, int n, int nz, int distributed, boolean global_view)
data
- Where data is to be stored.m
- Row dimension of the input matrix.n
- Column dimension of the input matrix.nz
- Number of nonzeroes in the input matrix.distributed
- Equal to the number of processors the matrix is distributed over; 0 if not distributed.global_view
- Whether the matrix is in global view.protected TS(DataType _data, int _m, int _n, int _nz, int[] _i, int[] _j, int[] _p, int[] _Pstart)
Method Detail |
---|
public java.util.ArrayList<CRS<DataType>> toLocalCRS()
protected int[] getSubMatrixColumnSizes()
protected int[] getSubMatrixRowSizes()
public java.util.ArrayList<ICRS<DataType>> toLocalICRS()
public void CRSSort()
public void removeAndAddDuplicates()
removeAndAddDuplicates
in class Matrix<DataType extends MatrixData<DataType>>
protected int partition(com.multicorebsp.util.SortSupport<DataType,TS<DataType>> sup, int left, int right, int pivotIndex)
sup
- The sort-enabling class.left
- Left bound.right
- Right bound, inclusive.pivotIndex
- Pivot index.
protected void quicksort()
protected void quicksort(com.multicorebsp.util.SortSupport<DataType,TS<DataType>> sup, int lo_bound, int hi_bound)
sup
- Supporting class required for sortinglo_bound
- Lower bound on index (incusive)hi_bound
- Upper bound on index (exclusive)public void printLocalStats()
public java.lang.Object clone()
clone
in interface com.multicorebsp.core.CompulsaryCloneable<TS<DataType extends MatrixData<DataType>>>
clone
in class SparseMatrix<DataType extends MatrixData<DataType>,TS<DataType extends MatrixData<DataType>>>
public TS<DataType> safeClone()
safeClone
in interface com.multicorebsp.core.CompulsaryCloneable<TS<DataType extends MatrixData<DataType>>>
protected void setCRSSort()
public ICRS<DataType> toICRS()
SparseMatrix
toICRS
in class SparseMatrix<DataType extends MatrixData<DataType>,TS<DataType extends MatrixData<DataType>>>
public CRS<DataType> toCRS()
SparseMatrix
toCRS
in class SparseMatrix<DataType extends MatrixData<DataType>,TS<DataType extends MatrixData<DataType>>>
public TS<DataType> toTS()
SparseMatrix
toTS
in class SparseMatrix<DataType extends MatrixData<DataType>,TS<DataType extends MatrixData<DataType>>>
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |