ucar.ma2.Array.reshapeNoCopy()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中ucar.ma2.Array.reshapeNoCopy()方法的一些代码示例,展示了Array.reshapeNoCopy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Array.reshapeNoCopy()方法的具体详情如下:
包路径:ucar.ma2.Array
类名称:Array
方法名:reshapeNoCopy

Array.reshapeNoCopy介绍

[英]Reshape this array without copying data
[中]在不复制数据的情况下重新调整此阵列的形状

代码示例

代码示例来源:origin: edu.ucar/netcdf

Cache(int[] shape, int[] newshape, DataType dataType)  {
 this.shape = shape;
 this.newshape = newshape;
 this.result = Array.factory(dataType, newshape);
 nt = shape[0];
 Section s = new Section(shape);
 chunksize = (int)(s.computeSize() / nt);
 // get view of result as a 2d array (any..., nt);
 int[] reshape = new int[] {chunksize, nt};
 this.work = this.result.reshapeNoCopy(reshape);
}

代码示例来源:origin: Unidata/thredds

Cache(int[] shape, int[] newshape, DataType dataType)  {
 System.out.printf("shape = %d, ", new Section(shape).computeSize()/1000);
 System.out.printf("newshape = %d, ", new Section(newshape).computeSize()/1000);
 this.nt = shape[0];
 Section s = new Section(shape);
 long totalSize = s.computeSize();
 this.chunksize = (int)(totalSize / nt);
 System.out.printf("chunksize = %d (Kb)%n", this.chunksize/1000);
 this.shape = shape;
 this.newshape = newshape;
 this.result = Array.factory(dataType, this.newshape);
 // get view of result as a 2d array (any..., nt);
 int[] reshape = new int[] {this.chunksize, this.nt};
 this.work = this.result.reshapeNoCopy(reshape);
}

代码示例来源:origin: edu.ucar/netcdf4

Cache(int[] shape, int[] newshape, DataType dataType)  {
 System.out.printf("shape = %d, ", new Section(shape).computeSize()/1000);
 System.out.printf("newshape = %d, ", new Section(newshape).computeSize()/1000);
 this.nt = shape[0];
 Section s = new Section(shape);
 long totalSize = s.computeSize();
 this.chunksize = (int)(totalSize / nt);
 System.out.printf("chunksize = %d (Kb)%n", this.chunksize/1000);
 this.shape = shape;
 this.newshape = newshape;
 this.result = Array.factory(dataType, this.newshape);
 // get view of result as a 2d array (any..., nt);
 int[] reshape = new int[] {this.chunksize, this.nt};
 this.work = this.result.reshapeNoCopy(reshape);
}

代码示例来源:origin: bcdev/beam

array = array.reshapeNoCopy(newshape);

相关文章

微信公众号

最新文章

更多