/** * Create a new Array of type long and the given shape. * dimensions.length determines the rank of the new Array. * * @param dimensions the shape of the Array. */ public ArrayString(int[] dimensions) { super(dimensions); storage = new String[(int) indexCalc.getSize()]; }
/** * Create a new Array of type StructureData and the given members and shape. * dimensions.length determines the rank of the new Array. * * @param members a description of the structure members * @param shape the shape of the Array. */ protected ArrayStructure(StructureMembers members, int[] shape) { super(shape); this.members = members; this.nelems = (int) indexCalc.getSize(); }
/** * Create a new Array of type Object and the given shape. * dimensions.length determines the rank of the new Array. * @param elementType the type of element, eg String * @param shape the shape of the Array. */ public ArrayObject(Class elementType, int [] shape) { super(shape); this.elementType = elementType; storage = new Object[(int) indexCalc.getSize()]; }
/** * Create a new Array of type int and the given shape. * dimensions.length determines the rank of the new Array. * * @param dimensions the shape of the Array. */ public ArrayInt(int[] dimensions) { super(dimensions); storage = new int[(int) indexCalc.getSize()]; }
/** * Create a new Array of type byte and the given shape. * dimensions.length determines the rank of the new Array. * * @param dimensions the shape of the Array. */ public ArrayByte(int[] dimensions) { super(dimensions); storage = new byte[(int) indexCalc.getSize()]; }
/** * Create a new Array of type short and the given shape. * dimensions.length determines the rank of the new Array. * * @param dimensions the shape of the Array. */ public ArrayShort(int[] dimensions) { super(dimensions); storage = new short[(int) indexCalc.getSize()]; }
/** * Create a new Array of type boolean and the given shape. * dimensions.length determines the rank of the new Array. * @param dimensions the shape of the Array. */ public ArrayBoolean(int [] dimensions) { super(dimensions); storage = new boolean[(int)indexCalc.getSize()]; }
protected ArrayStructure(StructureMembers members, Index ima) { super(ima); this.members = members; this.nelems = (int) indexCalc.getSize(); }
/** * Create a new Array of type long and the given shape. * dimensions.length determines the rank of the new Array. * @param dimensions the shape of the Array. */ public ArrayLong(int [] dimensions) { super(dimensions); storage = new long[(int)indexCalc.getSize()]; }
/** * Create a new Array of type float and the given shape. * dimensions.length determines the rank of the new Array. * @param dimensions the shape of the Array. */ public ArrayFloat(int [] dimensions) { super(dimensions); storage = new float[(int) indexCalc.getSize()]; }
/** * Create a new Array of type double and the given shape. * dimensions.length determines the rank of the new Array. * @param shape the shape of the Array. */ public ArrayDouble(int [] shape) { super(shape); storageD = new double[(int) indexCalc.getSize()]; }
/** * Create a new Array of type StructureData and the given members and shape. * dimensions.length determines the rank of the new Array. * * @param members a description of the structure members * @param shape the shape of the Array. */ protected ArrayStructure(StructureMembers members, int[] shape) { super(shape); this.members = members; this.nelems = (int) indexCalc.getSize(); }
/** * Create a new Array of type StructureData and the given members and shape. * dimensions.length determines the rank of the new Array. * * @param members a description of the structure members * @param shape the shape of the Array. */ protected ArrayStructure(StructureMembers members, int[] shape) { super(DataType.STRUCTURE, shape); this.members = members; this.nelems = (int) indexCalc.getSize(); }
/** * Create a new Array of type boolean and the given shape. * dimensions.length determines the rank of the new Array. * @param dimensions the shape of the Array. */ public ArrayBoolean(int [] dimensions) { super(DataType.BOOLEAN, dimensions); storage = new boolean[(int)indexCalc.getSize()]; }
/** * DO NOT USE, throws UnsupportedOperationException */ protected Array createView(Index index) { if (index.getSize() == getSize()) return this; throw new UnsupportedOperationException(); }
/** * DO NOT USE, throws UnsupportedOperationException */ public Array createView(Index index) { if (index.getSize() == getSize()) return this; throw new UnsupportedOperationException(); }
/** * DO NOT USE, throws UnsupportedOperationException */ protected Array createView(Index index) { if (index.getSize() == getSize()) return this; throw new UnsupportedOperationException(); }
/** * Get the total number of bytes in the array. * * @return total number of bytes in the array */ public long getSizeBytes() { DataType dtype = DataType.getType(this); return indexCalc.getSize() * dtype.getSize(); }
/** * Get the total number of bytes in the array. * * @return total number of bytes in the array */ public long getSizeBytes() { DataType dtype = DataType.getType( getElementType()); return indexCalc.getSize() * dtype.getSize(); }
public void testSection() { Index ima = secA.getIndex(); int [] shape = ima.getShape(); //System.out.println(ima); assert( ima.getRank() == 3); assert( ima.getSize() == (mlen * n * p)); assert( shape[0] == mlen); assert( shape[1] == n); assert( shape[2] == p); }