public void setDoubleCurrent(double val) { maa.setDouble(currElement, val); }
public void setDoubleCurrent(double val) { maa.setDouble(currElement, val); }
public void setDoubleCurrent(double val) { maa.setDouble(currElement, val); } public void setDoubleNext(double val) { maa.setDouble(++currElement, val); }
public void setDoubleCurrent(double val) { maa.setDouble(0, val); } public void setDoubleNext(double val) { currElement++; maa.setDouble(0, val); }
public void setDoubleCurrent(double val) { maa.setDouble(currElement, val); }
public void setDoubleNext(double val) { count++; currElement = counter.incr(); maa.setDouble(currElement, val); }
public void setDoubleNext(double val) { count++; currElement = counter.incr(); maa.setDouble(currElement, val); }
public void setDoubleNext(double val) { count++; currElement = counter.incr(); maa.setDouble(currElement, val); }
@Override public void setArray(Array array, int rowIndex, SeadasGrid grid) { array.setDouble(rowIndex, 180.0 / grid.getNumRows()); } });
@Override public void setArray(Array array, int rowIndex, SeadasGrid grid) { array.setDouble(rowIndex, 360.0 / grid.getNumCols(seadasGrid.convertRowIndex(rowIndex))); } });
public Attribute(String name, Number val, boolean isUnsigned) { super(name); if (name == null) throw new IllegalArgumentException("Trying to set name to null on "+this); int[] shape = new int[1]; shape[0] = 1; DataType dt = DataType.getType(val.getClass()); Array vala = Array.factory(dt.getPrimitiveClassType(), shape); Index ima = vala.getIndex(); vala.setDouble(ima.set0(0), val.doubleValue()); setValues(vala); this.isUnsigned = isUnsigned; if (isUnsigned) vala.setUnsigned(true); setImmutable(true); }
/** * Matrix multiply by a diagonal matrix, store result in this: this = this * diag * @param diag diagonal matrix stored as a Vector * @exception IllegalArgumentException if ncols != diag.getNelems(). */ public void postMultiplyDiagonal(MAVector diag) { if (ncols != diag.getNelems()) throw new IllegalArgumentException("MAMatrix.postMultiplyDiagonal "+ncols+" != "+ diag.getNelems()); for (int i=0; i<nrows; i++) { for (int j=0; j<ncols; j++) { double val = a.getDouble( ima.set(i,j)) * diag.getDouble(j); a.setDouble( ima, val); } } }
/** * Matrix multiply by a diagonal matrix, store result in this: this = diag * this * @param diag diagonal matrix stored as a Vector * @exception IllegalArgumentException if nrows != diag.getNelems(). */ public void preMultiplyDiagonal(MAVector diag) { if (nrows != diag.getNelems()) throw new IllegalArgumentException("MAMatrix.preMultiplyDiagonal "+nrows+" != "+ diag.getNelems()); for (int i=0; i<nrows; i++) { for (int j=0; j<ncols; j++) { double val = a.getDouble( ima.set(i,j)) * diag.getDouble(i); a.setDouble( ima, val); } } }
void transfer(Array slice, int k) { Index ima = work.getIndex(); ima.set1(k); // this one stays fixed int count = 0; IndexIterator ii = slice.getIndexIterator(); while (ii.hasNext()) { work.setDouble(ima.set0(count), ii.getDoubleNext()); count++; } }
void transfer(Array slice, int k) { Index ima = work.getIndex(); ima.set1(k); // this one stays fixed int count = 0; IndexIterator ii = slice.getIndexIterator(); while (ii.hasNext()) { work.setDouble(ima.set0(count), ii.getDoubleNext()); count++; } }
void transfer(Array slice, int k) { Index ima = work.getIndex(); ima.set1(k); // this one stays fixed int count = 0; IndexIterator ii = slice.getIndexIterator(); while (ii.hasNext()) { work.setDouble(ima.set0(count), ii.getDoubleNext()); count++; } }
private void doWrite2( NetcdfFileWriter ncfile, String varName) throws Exception { Variable v = ncfile.findVariable( varName); int[] w = getWeights( v); int[] shape = v.getShape(); Array aa = Array.factory(v.getDataType(), shape); Index ima = aa.getIndex(); for (int i=0; i<shape[0]; i++) { for (int j=0; j<shape[1]; j++) { aa.setDouble( ima.set(i,j), (double) (i*w[0] + j*w[1])); } } ncfile.write(varName, aa); }
private void doWrite3( NetcdfFileWriter ncfile, String varName) throws Exception { Variable v = ncfile.findVariable( varName); int[] w = getWeights( v); int[] shape = v.getShape(); Array aa = Array.factory(v.getDataType(), shape); Index ima = aa.getIndex(); for (int i=0; i<shape[0]; i++) { for (int j=0; j<shape[1]; j++) { for (int k=0; k<shape[2]; k++) { aa.setDouble( ima.set(i,j,k), (double) (i*w[0] + j*w[1] + k*w[2])); } } } ncfile.write(varName, aa); }
private void doWrite3( NetcdfFileWriter ncfile, String varName) throws Exception { Variable v = ncfile.findVariable( varName); int[] w = getWeights( v); int[] shape = v.getShape(); Array aa = Array.factory(v.getDataType(), shape); Index ima = aa.getIndex(); for (int i=0; i<shape[0]; i++) { for (int j=0; j<shape[1]; j++) { for (int k=0; k<shape[2]; k++) { aa.setDouble( ima.set(i,j,k), (double) (i*w[0] + j*w[1] + k*w[2])); } } } ncfile.write(varName, aa); }