public void CostEstimate(int []vshape,int []pshape,Vector<int[]> shapes, int []start, int []off) throws IOException, WrongArgumentException
	{
		
		DataChunk chunk = new DataChunk(vshape,pshape);
		Set<DataChunk> chunks = chunk.getAdjacentChunks(start, off);
		int rsize = 1;
		for(int i = 0 ; i < start.length; i++)
			rsize *= off[i];
		
		if(this.doRead ) {
		}
	
		
		Vector<int []> strategy = shapes;
		int [] count = new int [strategy.size() - 1];
		for(DataChunk c:chunks)
		{
			int dataSize = java.lang.Integer.MAX_VALUE;
			int take = -1;
		
			int [] nstart = new int [start.length];
			int [] noff = new int [start.length];
			// start in the partition
			int [] rstart = new int [start.length];
		
			
			int [] cstart = c.getStart();
			int [] coff = c.getChunkStep();
			
			for(int i = 0 ; i < start.length; i++)
			{
				nstart[i] = start[i] > cstart[i] ? start[i] : cstart[i];
				noff[i] = start[i] + off[i] < cstart[i] + coff[i] ? start[i] + off[i]:cstart[i] + coff[i]; 
				noff[i] -= nstart[i];
				
				rstart[i] =nstart[i] - cstart[i]; // 
			}
			
			for(int i = 0; i < strategy.size() - 1; i++)
			{
				DataChunk tmp = new DataChunk(pshape,strategy.get(i));
				tmp.setStart(c.getStart());
				
				Set<DataChunk> scunks = tmp.getAdjacentChunks(rstart, noff);
				int t = 0;
				
				t=scunks.size();
				/*for( DataChunk s: scunks )
				{
					t +=s.getSize();
				}*/
					
				if( t < dataSize )
				{
					take = i;
					dataSize = t;
				}
				
			}
			count[take]++;
			totalSize += dataSize;
		}
		for(int i = 0 ; i < count.length; i++)
		{
			System.out.print(count[i]+" ");
		}
		System.out.print("\n");
		this.printMatrix();
		System.out.println();
	}