public Member(String name, String desc, String units, DataType dtype, int[] shape) { this.name = name; this.desc = desc; this.units = units; this.dtype = dtype; this.shape = shape; this.size = (int) Index.computeSize(shape); }
public Member(Member from) { this.name = from.name; this.desc = from.desc; this.units = from.units; this.dtype = from.dtype; this.shape = from.shape; this.size = (int) Index.computeSize(shape); this.members = from.members; }
CoordIterator() { done = 0; total = Index.computeSize(shape); // total number of elements }
public void setShape(int[] shape) { this.shape = shape; this.size = (int) Index.computeSize(shape); this.isVariableLength = (shape.length > 0 && shape[shape.length - 1] < 0); }
public void setShape(int[] shape) { this.shape = Objects.requireNonNull(shape); this.size = (int) Index.computeSize(shape); this.isVariableLength = (shape.length > 0 && shape[shape.length - 1] < 0); }
/** * /** Compute total number of elements represented by the section. * * @param section List of Range objects * @return total number of elements * @deprecated use Section.computeSize() */ static public long computeSize(List section) { int[] shape = getShape(section); return Index.computeSize(shape); }
/** * /** Compute total number of elements represented by the section. * * @param section List of Range objects * @return total number of elements * @deprecated use Section.computeSize() */ static public long computeSize(List section) { int[] shape = getShape(section); return Index.computeSize(shape); }
SectionIterator() { int ss = 1; for (int i = getRank() - 1; i >= 0; i--) { // fastest varying last stride[i] = ss; ss *= fullShape[i]; } for (int i = 0; i < getRank(); i++) { java.util.Iterator<Integer> iter = getRange(i).iterator(); odo[i] = iter.next(); rangeIterList.add(iter); } done = 0; total = Index.computeSize(getShape()); // total in the section }
Iterator(int[] shape) { int ss = 1; for (int i = getRank() - 1; i >= 0; i--) { odo[i] = getRange(i).first(); stride[i] = ss; ss *= shape[i]; } done = 0; total = Index.computeSize(getShape()); // total in the section }
Iterator(int[] shape) { int ss = 1; for (int i = getRank() - 1; i >= 0; i--) { odo[i] = getRange(i).first(); stride[i] = ss; ss *= shape[i]; } done = 0; total = Index.computeSize(getShape()); // total in the section }
static public void main2(String args[]) throws InvalidRangeException { int[] totalShape = new int[] {1, 40, 530, 240}; int[] chunkShape = new int[] {1, 1, 530, 240}; FileWriter2.ChunkingIndex index = new FileWriter2.ChunkingIndex(totalShape); long size = 0; while (index.currentElement() < index.getSize()) { int[] chunkOrigin = index.getCurrentCounter(); System.out.printf(" %s%n", new Section(chunkOrigin, chunkShape)); index.setCurrentCounter(index.currentElement() + (int) Index.computeSize(chunkShape)); } }
static public void main2(String args[]) throws InvalidRangeException { int[] totalShape = new int[]{1, 40, 530, 240}; int[] chunkShape = new int[]{1, 1, 530, 240}; FileWriter2.ChunkingIndex index = new FileWriter2.ChunkingIndex(totalShape); while (index.currentElement() < index.getSize()) { int[] chunkOrigin = index.getCurrentCounter(); System.out.printf(" %s%n", new Section(chunkOrigin, chunkShape)); index.setCurrentCounter(index.currentElement() + (int) Index.computeSize(chunkShape)); } }
static public void main2(String args[]) throws InvalidRangeException { int[] totalShape = new int[]{1, 40, 530, 240}; int[] chunkShape = new int[]{1, 1, 530, 240}; FileWriter2.ChunkingIndex index = new FileWriter2.ChunkingIndex(totalShape); while (index.currentElement() < index.getSize()) { int[] chunkOrigin = index.getCurrentCounter(); System.out.printf(" %s%n", new Section(chunkOrigin, chunkShape)); index.setCurrentCounter(index.currentElement() + (int) Index.computeSize(chunkShape)); } }
static public void main2(String args[]) throws InvalidRangeException { int[] totalShape = new int[]{1, 40, 530, 240}; int[] chunkShape = new int[]{1, 1, 530, 240}; FileWriter2.ChunkingIndex index = new FileWriter2.ChunkingIndex(totalShape); long size = 0; while (index.currentElement() < index.getSize()) { int[] chunkOrigin = index.getCurrentCounter(); System.out.printf(" %s%n", new Section(chunkOrigin, chunkShape)); index.setCurrentCounter(index.currentElement() + (int) Index.computeSize(chunkShape)); } }
static public void main2(String args[]) throws InvalidRangeException { int[] totalShape = new int[] {1, 40, 530, 240}; int[] chunkShape = new int[] {1, 1, 530, 240}; FileWriter2.ChunkingIndex index = new FileWriter2.ChunkingIndex(totalShape); while (index.currentElement() < index.getSize()) { int[] chunkOrigin = index.getCurrentCounter(); System.out.printf(" %s%n", new Section(chunkOrigin, chunkShape)); index.setCurrentCounter(index.currentElement() + (int) Index.computeSize(chunkShape)); } }
static public void main(String args[]) throws InvalidRangeException { long maxChunkElems = maxChunk / 4; int[] totalShape = new int[]{1, 40, 530, 240}; //int[] chunkShape = new int[] {1, 1, 530, 240}; FileWriter2.ChunkingIndex index = new FileWriter2.ChunkingIndex(totalShape); while (index.currentElement() < index.getSize()) { int[] chunkOrigin = index.getCurrentCounter(); int[] chunkShape = index.computeChunkShape(maxChunkElems); System.out.printf(" %s%n", new Section(chunkOrigin, chunkShape)); index.setCurrentCounter(index.currentElement() + (int) Index.computeSize(chunkShape)); } }
static public void main(String args[]) throws InvalidRangeException { long maxChunkElems = maxChunk / 4; int[] totalShape = new int[] {1, 40, 530, 240}; //int[] chunkShape = new int[] {1, 1, 530, 240}; FileWriter2.ChunkingIndex index = new FileWriter2.ChunkingIndex(totalShape); while (index.currentElement() < index.getSize()) { int[] chunkOrigin = index.getCurrentCounter(); int[] chunkShape = index.computeChunkShape(maxChunkElems); System.out.printf(" %s%n", new Section(chunkOrigin, chunkShape)); index.setCurrentCounter(index.currentElement() + (int) Index.computeSize(chunkShape)); } }
static public void main(String args[]) throws InvalidRangeException { long maxChunkElems = maxChunk / 4; int[] totalShape = new int[]{1, 40, 530, 240}; //int[] chunkShape = new int[] {1, 1, 530, 240}; FileWriter2.ChunkingIndex index = new FileWriter2.ChunkingIndex(totalShape); while (index.currentElement() < index.getSize()) { int[] chunkOrigin = index.getCurrentCounter(); int[] chunkShape = index.computeChunkShape(maxChunkElems); System.out.printf(" %s%n", new Section(chunkOrigin, chunkShape)); index.setCurrentCounter(index.currentElement() + (int) Index.computeSize(chunkShape)); } }
static public void main(String args[]) throws InvalidRangeException { long maxChunkElems = maxChunk / 4; int[] totalShape = new int[] {1, 40, 530, 240}; //int[] chunkShape = new int[] {1, 1, 530, 240}; FileWriter2.ChunkingIndex index = new FileWriter2.ChunkingIndex(totalShape); long size = 0; while (index.currentElement() < index.getSize()) { int[] chunkOrigin = index.getCurrentCounter(); int[] chunkShape = index.computeChunkShape(maxChunkElems); System.out.printf(" %s%n", new Section(chunkOrigin, chunkShape)); index.setCurrentCounter(index.currentElement() + (int) Index.computeSize(chunkShape)); } }
static public void main(String args[]) throws InvalidRangeException { long maxChunkElems = maxChunk / 4; int[] totalShape = new int[]{1, 40, 530, 240}; //int[] chunkShape = new int[] {1, 1, 530, 240}; FileWriter2.ChunkingIndex index = new FileWriter2.ChunkingIndex(totalShape); long size = 0; while (index.currentElement() < index.getSize()) { int[] chunkOrigin = index.getCurrentCounter(); int[] chunkShape = index.computeChunkShape(maxChunkElems); System.out.printf(" %s%n", new Section(chunkOrigin, chunkShape)); index.setCurrentCounter(index.currentElement() + (int) Index.computeSize(chunkShape)); } }