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

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

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

Index.reduce介绍

[英]Create a new Index based on current one by eliminating any dimensions with length one.
[中]通过消除任何长度为1的维度,在当前索引的基础上创建新索引。

代码示例

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

  1. /**
  2. * Create a new Index based on current one by
  3. * eliminating any dimensions with length one.
  4. *
  5. * @return the new Index
  6. */
  7. Index reduce() {
  8. Index c = this;
  9. for (int ii = 0; ii < rank; ii++)
  10. if (shape[ii] == 1) { // do this on the first one you find
  11. Index newc = c.reduce(ii);
  12. return newc.reduce(); // any more to do?
  13. }
  14. return c;
  15. }

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

  1. /**
  2. * Create a new Index based on current one by
  3. * eliminating any dimensions with length one.
  4. *
  5. * @return the new Index
  6. */
  7. Index reduce() {
  8. Index c = this;
  9. for (int ii = 0; ii < rank; ii++)
  10. if (shape[ii] == 1) { // do this on the first one you find
  11. Index newc = c.reduce(ii);
  12. return newc.reduce(); // any more to do?
  13. }
  14. return c;
  15. }

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

  1. /**
  2. * Create a new Index based on current one by
  3. * eliminating any dimensions with length one.
  4. *
  5. * @return the new Index
  6. */
  7. Index reduce() {
  8. Index c = this;
  9. for (int ii = 0; ii < rank; ii++)
  10. if (shape[ii] == 1) { // do this on the first one you find
  11. Index newc = c.reduce(ii);
  12. return newc.reduce(); // any more to do?
  13. }
  14. return c;
  15. }

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

  1. /**
  2. * Create a new Array using same backing store as this Array, by
  3. * eliminating the specified dimension.
  4. *
  5. * @param dim dimension to eliminate: must be of length one, else IllegalArgumentException
  6. * @return the new Array
  7. */
  8. public Array reduce(int dim) {
  9. return createView(indexCalc.reduce(dim));
  10. }

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

  1. /**
  2. * Create a new Array using same backing store as this Array, by
  3. * eliminating any dimensions with length one.
  4. *
  5. * @return the new Array, or the same array if no reduction was done
  6. */
  7. public Array reduce() {
  8. Index ri = indexCalc.reduce();
  9. if (ri == indexCalc) return this;
  10. return createView(ri);
  11. }

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

  1. /**
  2. * Create a new Array using same backing store as this Array, by
  3. * eliminating the specified dimension.
  4. *
  5. * @param dim dimension to eliminate: must be of length one, else IllegalArgumentException
  6. * @return the new Array
  7. */
  8. public Array reduce(int dim) {
  9. return createView(indexCalc.reduce(dim));
  10. }

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

  1. /**
  2. * Create a new Array using same backing store as this Array, by
  3. * eliminating the specified dimension.
  4. *
  5. * @param dim dimension to eliminate: must be of length one, else IllegalArgumentException
  6. * @return the new Array
  7. */
  8. public Array reduce(int dim) {
  9. return createView(indexCalc.reduce(dim));
  10. }

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

  1. /**
  2. * Create a new Array using same backing store as this Array, by
  3. * eliminating any dimensions with length one.
  4. *
  5. * @return the new Array, or the same array if no reduction was done
  6. */
  7. public Array reduce() {
  8. Index ri = indexCalc.reduce();
  9. if (ri == indexCalc) return this;
  10. return createView(ri);
  11. }

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

  1. /**
  2. * Create a new Array using same backing store as this Array, by
  3. * eliminating any dimensions with length one.
  4. *
  5. * @return the new Array, or the same array if no reduction was done
  6. */
  7. public Array reduce() {
  8. Index ri = indexCalc.reduce();
  9. if (ri == indexCalc) return this;
  10. return createView(ri);
  11. }

相关文章