@Override
	public BooleanWritable JoinArray(Partition array1, Partition array2,
			Partition array3, OptimusCalculator c) throws IOException {

		OptimusZone zone1 = this.rmanger.getZone(array1.getZid());
		OptimusZone zone2 = this.rmanger.getZone(array2.getZid());
		OptimusZone zone3 = this.rmanger.getZone(array3.getZid());

		int[] s1 = zone1.getStrategy().getShapes().get(array1.getRid().getId());
		int[] s2 = zone2.getStrategy().getShapes().get(array1.getRid().getId());
		boolean sameStrategy = true;
		for (int i = 0; i < s1.length; i++) {
			if (s1[i] != s2[i]) {
				sameStrategy = false;
			}
		}
		array1.setRmanager(this.rmanger);
		array2.setRmanager(this.rmanger);
		array3.setRmanager(this.rmanger);
		
		if (sameStrategy == true) {
			array1.open();
			array2.open();
			DataChunk chunk = new DataChunk(zone1.getPstep().getShape(), s1);
			PartitionStreamCreater creater = new PartitionStreamCreater(
					this.rmanger.getCI(), array3, zone3,chunk.getChunkStep());
			ByteWriter writer = creater.getWriter();
			
			try {
				do {
					double [] c3  = null;
					double[] c1 = array1.read(chunk);
					if(array1.equals(array2))
					{
						c3 = c.calcArray(c1, c1);
					}else{
						double[] c2 = array2.read(chunk);
						c3 = c.calcArray(c1, c2);
					}
					writer.writeDouble(c3);

				} while (chunk.nextChunk());
				
				return new BooleanWritable(!creater.close());
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

		}
		return new BooleanWritable(false);
	}