parallel.partitioners.MatrixRowPartitionPolicy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jstat Show documentation
Show all versions of jstat Show documentation
Java Library for Statistical Analysis.
The newest version!
package parallel.partitioners;
import java.util.List;
public class MatrixRowPartitionPolicy implements IPartitionPolicy {
/**
* Constructor
*/
public MatrixRowPartitionPolicy(List> partitions){
this.partitions = partitions;
}
/**
* Set the partitions
*/
public void setPartitions(List> partitions){
this.partitions = partitions;
}
/**
* Returns the indices associted with the i-th partition
* @param i
* @return
*/
public List getParition(int i){
return this.partitions.get(i);
}
/**
* How many partitions this policy has
*/
public int numPartitions(){
return this.partitions.size();
}
/**
* The partitions of the matrix rows
*/
List> partitions;
}