ucar.ma2.Index.computeStrides()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(129)

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

Index.computeStrides介绍

[英]Compute standard strides based on array's shape. Ignore vlen
[中]根据阵列的形状计算标准步幅。忽略vlen

代码示例

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

  1. /**
  2. * Constructor for subclasses only.
  3. * @param _shape describes an index section: slowest varying comes first (row major)
  4. */
  5. protected Index(int[] _shape) {
  6. this.shape = new int[_shape.length]; // optimization over clone
  7. System.arraycopy(_shape, 0, this.shape, 0, _shape.length);
  8. rank = shape.length;
  9. current = new int[rank];
  10. stride = new int[rank];
  11. size = computeStrides(shape, stride);
  12. offset = 0;
  13. }

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

  1. /**
  2. * Constructor for subclasses only.
  3. * @param _shape describes an index section: slowest varying comes first (row major)
  4. */
  5. protected Index(int[] _shape) {
  6. this.shape = new int[_shape.length]; // optimization over clone
  7. System.arraycopy(_shape, 0, this.shape, 0, _shape.length);
  8. rank = shape.length;
  9. current = new int[rank];
  10. stride = new int[rank];
  11. size = computeStrides(shape, stride);
  12. offset = 0;
  13. hasvlen = (shape.length > 0 && shape[shape.length-1] < 0);
  14. }

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

  1. /**
  2. * Constructor for subclasses only.
  3. *
  4. * @param _shape describes an index section: slowest varying comes first (row major)
  5. */
  6. protected Index(int[] _shape) {
  7. this.shape = new int[_shape.length]; // optimization over clone
  8. System.arraycopy(_shape, 0, this.shape, 0, _shape.length);
  9. rank = shape.length;
  10. current = new int[rank];
  11. stride = new int[rank];
  12. size = computeStrides(shape, stride);
  13. offset = 0;
  14. hasvlen = (shape.length > 0 && shape[shape.length - 1] < 0);
  15. }

相关文章