Access the value of a bin with new data.

@param coord Coordinate
@return bin contents
482104
@SuppressWarnings("unchecked")
  public T get(double coord) {
    if(coord == Double.NEGATIVE_INFINITY) {
      return getSpecial(0);
    }
    if(coord == Double.POSITIVE_INFINITY) {
      return getSpecial(1);
    }
    if(Double.isNaN(coord)) {
      return getSpecial(2);
    }
    int bin = getBinNr(coord);
    if(bin < 0) {
      if(size - bin > data.length) {
        // Reallocate. TODO: use an arraylist-like grow strategy!
        Object[] tmpdata = new Object[growSize(data.length, size - bin)];
        System.arraycopy(data, 0, tmpdata, -bin, size);
        data = tmpdata;
      }
      else {
        // Shift in place
        System.arraycopy(data, 0, data, -bin, size);
      }
      for(int i = 0; i < -bin; i++) {
        data[i] = supplier.make();
      }
      // Note that bin is negative, -bin is the shift offset!
      offset -= bin;
      size -= bin;
      // TODO: modCounter++; and have iterators fast-fail
      // Unset max value when resizing
      max = Double.MAX_VALUE;
      return (T) data[0];
    }
    else if(bin >= size) {
      if(bin >= data.length) {
        Object[] tmpdata = new Object[growSize(data.length, bin + 1)];
        System.arraycopy(data, 0, tmpdata, 0, size);
        data = tmpdata;
      }
      for(int i = size; i <= bin; i++) {
        data[i] = supplier.make();
      }
      size = bin + 1;
      // TODO: modCounter++; and have iterators fast-fail
      // Unset max value when resizing
      max = Double.MAX_VALUE;
      return (T) data[bin];
    }
    else {
      return (T) data[bin];
    }
  }
1182928
def _show_coords_command(self, infile, outfile):
        ''''''
        command = 'show-coords -dTlro'

        if not self.coords_header:
            command += ' -H'

        return command + ' ' + infile + ' > ' + outfile
217922
public static Coordinate[] removeDuplicatedCoordinates(Coordinate[] coords, boolean closeRing) {
        LinkedHashSet<Coordinate> finalCoords = new LinkedHashSet<Coordinate>();
        Coordinate prevCoord = coords[0];
        finalCoords.add(prevCoord);
        Coordinate firstCoord = prevCoord;
        int nbCoords = coords.length;
        for (int i = 1; i < nbCoords; i++) {
            Coordinate currentCoord = coords[i];
            if (currentCoord.equals2D(prevCoord)) {
                continue;
            }
            finalCoords.add(currentCoord);
            prevCoord = currentCoord;
        }
        if (closeRing) {
            Coordinate[] coordsFinal = finalCoords.toArray(new Coordinate[0]);
            Coordinate[] closedCoords = Arrays.copyOf(coordsFinal, coordsFinal.length + 1);
            closedCoords[closedCoords.length-1] = firstCoord;
            return closedCoords;
        }
        return finalCoords.toArray(new Coordinate[0]);

    }
1099020
public static FloatBuffer createFloatBuffer(float[] coords) {
        // Allocate a direct ByteBuffer, using 4 bytes per float, and copy coords into it.
        ByteBuffer bb = ByteBuffer.allocateDirect(coords.length * SIZEOF_FLOAT);
        bb.order(ByteOrder.nativeOrder());
        FloatBuffer fb = bb.asFloatBuffer();
        fb.put(coords);
        fb.position(0);
        return fb;
    }
982909
public float getTexCoordU(int vertex, int coords) {
        if (!hasTexCoords(coords)) {
            throw new IllegalStateException(
                    "mesh has no texture coordinate set " + coords);
        }
        
        checkVertexIndexBounds(vertex);
        /* bound checks for coords are done by java for us */
        
        return m_texcoords[coords].getFloat(
                vertex * m_numUVComponents[coords] * SIZEOF_FLOAT);
    }
649657
function parseCoordinates(coord) {
    if (Array.isArray(coord) && coord.length === 2) {
        return {
            lng: coord[0],
            lat: coord[1],
        };
    }

    if (coord instanceof Object && coord !== null) {
        return {
            lng: coord.lng || coord.lon,
            lat: coord.lat,
        };
    }

    return {};
}
1024
public double getValueAt( Coordinate coordinate ) {
        if (geodata == null) {
            throw new IllegalArgumentException("The data have first to be read!");
        }
        int[] coordinateToNearestRowCol = GrassLegacyUtilities.coordinateToNearestRowCol(inWindow, coordinate);
        if (coordinateToNearestRowCol != null) {
            int row = coordinateToNearestRowCol[0];
            int col = coordinateToNearestRowCol[1];
            if (row > 0 && row < geodata.length) {
                if (col > 0 && col < geodata[0].length) {
                    return geodata[row][col];
                }
            }
        }
        return HMConstants.doubleNovalue;
    }
1156552
def get_bin_index(self, value):
        """"""
        if value == self.max_value:
            return self.num_bins - 1

        return int(self.C * log(value / self.min_value))
61976
def fetch_coords(self, query):
        """"""
        q = query.add_query_parameter(req='coord')
        return self._parse_messages(self.get_query(q).content)
1042187
static Point2d[] reorderCoords(Point2d[] coords, int[] order) {
        Point2d[] neworder = new Point2d[coords.length];
        for (int i = 0; i < order.length; i++)
            neworder[order[i]] = coords[i];
        return neworder;
    }
1146306
private int getValueAccordingBoundaries(final int value) {

		// check boundaries
		final int newValue;
		if (value < 0) {
			newValue = 0;
		}
		else if (value > getMaxValue()) {
			newValue = getMaxValue();
		}
		else {
			newValue = value;
		}
		return newValue;

	}
600509
def from_coords(cls, coords, sort=True):
        
        coords = list(coords)
        if sort:
            coords.sort()
        if len(coords[0]) == 2:  # 2D coordinates
            lons, lats = zip(*coords)
            depths = None
        else:  # 3D coordinates
            lons, lats, depths = zip(*coords)
            depths = numpy.array(depths)
        return cls(numpy.array(lons), numpy.array(lats), depths)
106372
def getCoords(self):
        '''
        
        '''

        if DEBUG_COORDS:
            print >>sys.stderr, "getCoords(%s %s ## %s)" % (self.getClass(), self.getId(), self.getUniqueId())

        (x, y) = self.getXY();
        w = self.getWidth()
        h = self.getHeight()
        return ((x, y), (x+w, y+h))
758158
public function addCoord(LatLng $coord)
    {
        $cloned = clone $coord;
        $cloned->name = null;
        $this->options['paths'][] = $coord;

        return $this;
    }
663112
public static long[] interleaveBits(long[] coords, int iter) {
    final int numdim = coords.length;
    final long[] bitset = BitsUtil.zero(numdim);
    // convert longValues into zValues
    final long mask = 1L << 63 - iter;
    for(int dim = 0; dim < numdim; dim++) {
      if((coords[dim] & mask) != 0) {
        BitsUtil.setI(bitset, dim);
      }
    }
    return bitset;
  }
842720
public static ByteOrder getOrderFromByte(byte val) {
        if (val == org.nd4j.graph.ByteOrder.LE)
            return ByteOrder.LITTLE_ENDIAN;
        else
            return ByteOrder.BIG_ENDIAN;
    }
962489
private IAtomContainer readCoordinates(IAtomContainer molecule, boolean coordinatesUnits) throws IOException {

        /*
         * Coordinates must all be given in angstr???ms.
         */
        double unitScaling = GamessReader.scalesCoordinatesUnits(coordinatesUnits);

        String retrievedLineFromFile;

        while (this.input.ready() == true) {
            retrievedLineFromFile = this.input.readLine();
            /*
             * A coordinate set is followed by an empty line, so when this line
             * is reached, there are no more coordinates to add to the current
             * set.
             */
            if ((retrievedLineFromFile == null) || (retrievedLineFromFile.trim().length() == 0)) {
                break;
            }

            int atomicNumber;
            String atomicSymbol;

            //StringReader sr = new StringReader(retrievedLineFromFile);
            StreamTokenizer token = new StreamTokenizer(new StringReader(retrievedLineFromFile));

            /*
             * The first token is ignored. It contains the atomic symbol and may
             * be concatenated with a number.
             */
            token.nextToken();

            if (token.nextToken() == StreamTokenizer.TT_NUMBER) {
                atomicNumber = (int) token.nval;
                atomicSymbol = this.identifyAtomicSymbol(atomicNumber);
                /*
                 * Dummy atoms are assumed to be given with an atomic number set
                 * to zero. We will do not add them to the molecule.
                 */
                if (atomicNumber == 0) {
                    continue;
                }
            } else {
                throw new IOException("Error reading coordinates");
            }

            /*
             * Atom's coordinates are stored in an array.
             */
            double[] coordinates = new double[3];
            for (int i = 0; i < coordinates.length; i++) {
                if (token.nextToken() == StreamTokenizer.TT_NUMBER) {
                    coordinates[i] = token.nval * unitScaling;
                } else {
                    throw new IOException("Error reading coordinates");
                }
            }
            IAtom atom = molecule.getBuilder().newInstance(IAtom.class, atomicSymbol,
                    new Point3d(coordinates[0], coordinates[1], coordinates[2]));
            molecule.addAtom(atom);
        }
        return molecule;
    }