package mikera.arrayz.impl;
import mikera.arrayz.Arrayz;
import mikera.arrayz.INDArray;
import mikera.vectorz.Op;
import mikera.vectorz.util.ErrorMessages;
/**
* Array created by joining two arrays along a specific dimension
*
* @author Mike
*
*/
public class JoinedArray extends BaseShapedArray {
private static final long serialVersionUID = 4929988077055768422L;
final INDArray left;
final INDArray right;
final int dimension;
final int split;
private JoinedArray(INDArray left, INDArray right, int dim) {
super(left.getShapeClone());
this.left=left;
this.right=right;
dimension=dim;
this.split=shape[dimension];
shape[dimension]+=right.getShape(dimension);
}
public static INDArray join(INDArray a, INDArray b, int dim) {
int n=a.dimensionality();
if (b.dimensionality()!=n) throw new IllegalArgumentException(ErrorMessages.incompatibleShapes(a, b));
for (int i=0; i=sliceCount())) {
throw new IndexOutOfBoundsException(ErrorMessages.invalidIndex(this, x));
}
if (x=sliceCount())) {
throw new IndexOutOfBoundsException(ErrorMessages.invalidIndex(this, x,y));
}
if (x=getShape(1))) {
throw new IndexOutOfBoundsException(ErrorMessages.invalidIndex(this, x,y));
}
if (y
Ads help maintain this website.