All Downloads are FREE. Search and download functionalities are using the official Maven repository.

parallel.partitioners.MatrixRowPartitionPolicy Maven / Gradle / Ivy

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;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy