Compute a ring buffer on one side of the geometry
@param geom
@param bufferSize
@param numBuffer
@return
@throws java.sql.SQLException
493602
public static Geometry ringSideBuffer(Geometry geom, double bufferSize, int numBuffer) throws SQLException {
        return ringSideBuffer(geom, bufferSize, numBuffer, "endcap=flat");
    }
700034
private ByteBuffer ringGet() {
		ByteBuffer bb = null;
		synchronized(ring) {
			bb=ring[start];
			ring[start]=null;
			if(bb!=null && ++start>15)start=0;
		}
		if(bb==null) {
			bb=ByteBuffer.allocate(DEFAULT_CHUNK);
		} else {
			bb.clear();// refresh reused buffer
		}
		return bb;
	}
1144157
function toBufferGeometry (geometry, doBuffer) {
  var bufferGeometry;
  if (!doBuffer) { return geometry; }

  bufferGeometry = new THREE.BufferGeometry().fromGeometry(geometry);
  bufferGeometry.metadata = {type: geometry.type, parameters: geometry.parameters || {}};
  geometry.dispose();  // Dispose no longer needed non-buffer geometry.
  return bufferGeometry;
}
249616
public static Geometry node(Geometry geom) {
        if (geom == null) {
            return null;
        }        
        Noder noder = new MCIndexNoder(new IntersectionAdder(new RobustLineIntersector()));
        noder.computeNodes(SegmentStringUtil.extractNodedSegmentStrings(geom));
        return SegmentStringUtil.toGeometry(noder.getNodedSubstrings(), geom.getFactory());
    }
596191
function BufferSegment(buf, offset, count) {
  if (!Buffer.isBuffer(buf)) throw new TypeError('buf must be a buffer');

  this.buffer = buf;
  this.offset = offset || 0;
  this.count = count || buf.length;
}
248150
private static Polygon insertVertexInPolygon(Polygon polygon,
            Point vertexPoint, double tolerance) throws SQLException {        
        Polygon geom =polygon;
        LineString linearRing = polygon.getExteriorRing();
        int index = -1;
        for (int i = 0; i < polygon.getNumInteriorRing(); i++) {
            double distCurr = computeDistance(polygon.getInteriorRingN(i),vertexPoint, tolerance);
            if (distCurr<tolerance){
                index = i;
            }
        }        
        if(index==-1){
            //The point is a on the exterior ring.
            LinearRing inserted = insertVertexInLinearRing(linearRing, vertexPoint, tolerance);
            if(inserted!=null){
            LinearRing[] holes = new LinearRing[polygon.getNumInteriorRing()];
            for (int i = 0; i < holes.length; i++) {
                holes[i]= (LinearRing) polygon.getInteriorRingN(i);
            }
            geom = FACTORY.createPolygon(inserted, holes);
            }
        }
        else{
            //We add the vertex on the first hole
            LinearRing[] holes = new LinearRing[polygon.getNumInteriorRing()];
            for (int i = 0; i < holes.length; i++) {
                if (i == index) {
                    holes[i] = insertVertexInLinearRing(polygon.getInteriorRingN(i), vertexPoint, tolerance);
                } else {
                    holes[i] = (LinearRing) polygon.getInteriorRingN(i);
                }
            }
            geom = FACTORY.createPolygon((LinearRing) linearRing, holes);
        }       
        if(geom!=null){
        if (!geom.isValid()) {
            throw new SQLException("Geometry not valid");
        }
        }
        return geom;
    }
617874
private static int clipFilter_(EditShape edit_shape,
			int fixed_vertices_index, int from_vertex, int to_vertex, int dir,
			double abs_distance, double densify_distance, final int max_filter) {
		// Note: vertices marked with fixed_vertices_index cannot be deleted.

		Point2D pt1 = edit_shape.getXY(from_vertex);
		Point2D pt2 = edit_shape.getXY(to_vertex);
		if (pt1.equals(pt2))
			return -1;

		double densify_distance_delta = densify_distance * 0.25;// distance by
																// which we can
																// move the
																// point closer
																// to the chord
																// (introducing
																// an error into
																// the buffer).
		double erase_distance_delta = densify_distance * 0.25;// distance when
																// we can erase
																// the point
																// (introducing
																// an error into
																// the buffer).
		// This function goal is to modify or remove vertices between
		// from_vertex and to_vertex in such a way that the result would not
		// affect buffer to the left of the
		// chain.
		Point2D v_gap = new Point2D();
		v_gap.sub(pt2, pt1);
		double gap_length = v_gap.length();
		double h2_4 = gap_length * gap_length * 0.25;
		double sqr_center_to_chord = abs_distance * abs_distance - h2_4; // squared
																			// distance
																			// from
																			// the
																			// chord
																			// to
																			// the
																			// circle
																			// center
		if (sqr_center_to_chord <= h2_4)
			return -1;// center to chord distance is less than half gap, that
						// means the gap is too wide for useful filtering (maybe
						// this).

		double center_to_chord = Math.sqrt(sqr_center_to_chord); // distance
																	// from
																	// circle
																	// center to
																	// the
																	// chord.

		v_gap.normalize();
		Point2D v_gap_norm = new Point2D(v_gap);
		v_gap_norm.rightPerpendicular();
		double chord_to_corner = h2_4 / center_to_chord; // cos(a) =
															// center_to_chord /
															// distance;
															// chord_to_corner =
															// distance / cos(a)
															// -
															// center_to_chord;
		boolean can_erase_corner_point = chord_to_corner <= erase_distance_delta;
		Point2D chord_midpoint = new Point2D();
		MathUtils.lerp(pt2, pt1, 0.5, chord_midpoint);
		Point2D corner = new Point2D(v_gap_norm);
		double corrected_chord_to_corner = chord_to_corner
				- densify_distance_delta;// using slightly smaller than needed
											// distance let us filter more.
		corner.scaleAdd(Math.max(0.0, corrected_chord_to_corner),
				chord_midpoint);
		// corner = (p1 + p2) * 0.5 + v_gap_norm * chord_to_corner;

		Point2D center = new Point2D(v_gap_norm);
		center.negate();
		center.scaleAdd(center_to_chord, chord_midpoint);

		double allowed_distance = abs_distance - erase_distance_delta;
		double sqr_allowed_distance = MathUtils.sqr(allowed_distance);
		double sqr_large_distance = sqr_allowed_distance * (1.9 * 1.9);

		Point2D co_p1 = new Point2D();
		co_p1.sub(corner, pt1);
		Point2D co_p2 = new Point2D();
		co_p2.sub(corner, pt2);

		boolean large_distance = false;// set to true when distance
		int cnt = 0;
		char[] locations = new char[64];
		{
			// check all vertices in the gap verifying that the gap can be
			// clipped.
			//

			Point2D pt = new Point2D();
			// firstly remove any duplicate vertices in the end.
			for (int v = edit_shape.getPrevVertex(to_vertex, dir); v != from_vertex;) {
				if (edit_shape.getUserIndex(v, fixed_vertices_index) == 1)
					return -1;// this range contains protected vertex

				edit_shape.getXY(v, pt);
				if (pt.equals(pt2)) {
					int v1 = edit_shape.getPrevVertex(v, dir);
					edit_shape.removeVertex(v, false);
					v = v1;
					continue;
				} else {
					break;
				}
			}

			Point2D prev_prev_pt = new Point2D();
			prev_prev_pt.setNaN();
			Point2D prev_pt = new Point2D();
			prev_pt.setCoords(pt1);
			locations[cnt++] = 1;
			int prev_v = from_vertex;
			Point2D dummyPt = new Point2D();
			for (int v = edit_shape.getNextVertex(from_vertex, dir); v != to_vertex;) {
				if (edit_shape.getUserIndex(v, fixed_vertices_index) == 1)
					return -1;// this range contains protected vertex

				edit_shape.getXY(v, pt);
				if (pt.equals(prev_pt)) {
					int v1 = edit_shape.getNextVertex(v, dir);
					edit_shape.removeVertex(v, false);
					v = v1;
					continue;
				}

				locations[cnt++] = 0;

				Point2D v1 = new Point2D();
				v1.sub(pt, pt1);
				if (v1.dotProduct(v_gap_norm) < 0)// we are crossing on the
													// wrong site of the chord.
													// Just bail out earlier.
													// Maybe we could continue
													// clipping though here, but
													// it seems to be
													// unnecessary complicated.
					return 0;

				if (Point2D.sqrDistance(pt, pt1) > sqr_large_distance
						|| Point2D.sqrDistance(pt, pt2) > sqr_large_distance)
					large_distance = true; // too far from points, may
											// contribute to the outline (in
											// case of a large loop)

				char next_location = 0;

				dummyPt.sub(pt, pt1);
				double cs1 = dummyPt.crossProduct(co_p1);
				if (cs1 >= 0) {
					next_location = 1;
				}

				dummyPt.sub(pt, pt2);
				double cs2 = dummyPt.crossProduct(co_p2);
				if (cs2 <= 0) {
					next_location |= 2;
				}

				if (next_location == 0)
					return 0;

				locations[cnt - 1] = next_location;
				prev_prev_pt.setCoords(prev_pt);
				prev_pt.setCoords(pt);
				prev_v = v;
				v = edit_shape.getNextVertex(v, dir);
			}

			if (cnt == 1)
				return 0;

			assert (!pt2.equals(prev_pt));
			locations[cnt++] = 2;
		}

		boolean can_clip_all = true;
		// we can remove all points and replace them with a single corner point
		// if we are moving from location 1 via location 3 to location 2
		for (int i = 1, k = 0; i < cnt; i++) {
			if (locations[i] != locations[i - 1]) {
				k++;
				can_clip_all = k < 3
						&& ((k == 1 && locations[i] == 3) || (k == 2 && locations[i] == 2));
				if (!can_clip_all)
					return 0;
			}
		}

		if (cnt > 2 && can_clip_all && (cnt == 3 || !large_distance)) {
			int clip_count = 0;
			int v = edit_shape.getNextVertex(from_vertex, dir);
			if (!can_erase_corner_point) {
				edit_shape.setXY(v, corner);
				v = edit_shape.getNextVertex(v, dir);
			}

			// we can remove all vertices between from and to, because they
			// don't contribute
			while (v != to_vertex) {
				int v1 = edit_shape.getNextVertex(v, dir);
				edit_shape.removeVertex(v, false);
				v = v1;
				++clip_count;
			}

			return clip_count;
		}

		if (cnt == 3) {
			boolean case1 = (locations[0] == 1 && locations[1] == 2 && locations[2] == 2);
			boolean case2 = (locations[0] == 1 && locations[1] == 1 && locations[2] == 2);
			if (case1 || case2) {
				// special case, when we cannot clip, but we can move the point
				Point2D p1 = edit_shape.getXY(from_vertex);
				int v = edit_shape.getNextVertex(from_vertex, dir);
				Point2D p2 = edit_shape.getXY(v);
				Point2D p3 = edit_shape.getXY(edit_shape.getNextVertex(v, dir));
				if (case2) {
					Point2D temp = p1;
					p1 = p3;
					p3 = temp;
				}

				Point2D vec = new Point2D();
				vec.sub(p1, p2);
				p3.sub(p2);
				double veclen = vec.length();
				double w = p3.length();
				double wcosa = vec.dotProduct(p3) / veclen;
				double wsina = Math.abs(p3.crossProduct(vec) / veclen);
				double z = 2 * abs_distance - wsina;
				if (z < 0)
					return 0;

				double x = wcosa + Math.sqrt(wsina * z);
				if (x > veclen)
					return 0;

				Point2D hvec = new Point2D();
				hvec.scaleAdd(-x / veclen, vec, p3); // hvec = p3 - vec * (x /
														// veclen);
				double h = hvec.length();
				double y = -(h * h * veclen) / (2 * hvec.dotProduct(vec));

				double t = (x - y) / veclen;
				MathUtils.lerp(p2, p1, t, p2);
				edit_shape.setXY(v, p2);
				return 0;
			}
		}

		if (large_distance && cnt > 3) {
			// we are processing more than 3 points and there are some points
			// further than the
			return 0;
		}

		int v_prev = -1;
		Point2D pt_prev = new Point2D();
		int v_cur = from_vertex;
		Point2D pt_cur = new Point2D(pt1);
		int cur_location = 1;
		int prev_location = -1; // 1 - semiplane to the right of [f,c]. 3 -
								// semiplane to the right of [c,t], 2 - both
								// above fc and ct, 0 - cannot clip, -1 -
								// unknown
		int v_next = v_cur;
		int clip_count = 0;
		cnt = 1;
		while (v_next != to_vertex) {
			v_next = edit_shape.getNextVertex(v_next, dir);
			int next_location = locations[cnt++];
			if (next_location == 0) {
				if (v_next == to_vertex)
					break;

				continue;
			}

			Point2D pt_next = edit_shape.getXY(v_next);

			if (prev_location != -1) {
				int common_location = (prev_location & cur_location & next_location);
				if ((common_location & 3) != 0) {
					// prev and next are on the same semiplane as the current we
					// can safely remove the current point.
					edit_shape.removeVertex(v_cur, true);
					clip_count++;// do not change prev point.
					v_cur = v_next;
					pt_cur.setCoords(pt_next);
					cur_location = next_location;
					continue;
				}

				if (cur_location == 3 && prev_location != 0
						&& next_location != 0) {
					assert ((prev_location & next_location) == 0);// going from
																	// one semi
																	// plane to
																	// another
																	// via the
																	// mid.
					pt_cur.setCoords(corner);
					if (can_erase_corner_point || pt_cur.equals(pt_prev)) {// this
																			// point
																			// can
																			// be
																			// removed
						edit_shape.removeVertex(v_cur, true);
						clip_count++;// do not change prev point.
						v_cur = v_next;
						pt_cur.setCoords(pt_next);
						cur_location = next_location;
						continue;
					} else {
						edit_shape.setXY(v_cur, pt_cur); // snap to the corner
					}
				} else {
					if (next_location == 0
							&& cur_location != 0
							|| next_location != 0
							&& cur_location == 0
							|| ((next_location | cur_location) == 3
									&& next_location != 3 && cur_location != 3)) {
						// clip
					}
				}
			}

			prev_location = cur_location;
			v_prev = v_cur;
			pt_prev.setCoords(pt_cur);
			v_cur = v_next;
			cur_location = next_location;
			pt_cur.setCoords(pt_next);
		}

		return clip_count;
	}
585536
function ( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) {

	BufferGeometry.call( this );

	this.type = '';

	this.parameters = {
		innerRadius: innerRadius,
		outerRadius: outerRadius,
		thetaSegments: thetaSegments,
		phiSegments: phiSegments,
		thetaStart: thetaStart,
		thetaLength: thetaLength
	};

	innerRadius = innerRadius || 0.5;
	outerRadius = outerRadius || 1;

	thetaStart = thetaStart !== undefined ? thetaStart : 0;
	thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2;

	thetaSegments = thetaSegments !== undefined ? Math.max( 3, thetaSegments ) : 8;
	phiSegments = phiSegments !== undefined ? Math.max( 1, phiSegments ) : 1;

	// buffers

	var indices = [];
	var vertices = [];
	var normals = [];
	var uvs = [];

	// some helper variables

	var segment;
	var radius = innerRadius;
	var radiusStep = ( ( outerRadius - innerRadius ) / phiSegments );
	var vertex = new Vector3();
	var uv = new Vector2();
	var j, i;

	// generate vertices, normals and uvs

	for ( j = 0; j <= phiSegments; j ++ ) {

		for ( i = 0; i <= thetaSegments; i ++ ) {

			// values are generate from the inside of the ring to the outside

			segment = thetaStart + i / thetaSegments * thetaLength;

			// vertex

			vertex.x = radius * Math.cos( segment );
			vertex.y = radius * Math.sin( segment );

			vertices.push( vertex.x, vertex.y, vertex.z );

			// normal

			normals.push( 0, 0, 1 );

			// uv

			uv.x = ( vertex.x / outerRadius + 1 ) / 2;
			uv.y = ( vertex.y / outerRadius + 1 ) / 2;

			uvs.push( uv.x, uv.y );

		}

		// increase the radius for next row of vertices

		radius += radiusStep;

	}

	// indices

	for ( j = 0; j < phiSegments; j ++ ) {

		var thetaSegmentLevel = j * ( thetaSegments + 1 );

		for ( i = 0; i < thetaSegments; i ++ ) {

			segment = i + thetaSegmentLevel;

			var a = segment;
			var b = segment + thetaSegments + 1;
			var c = segment + thetaSegments + 2;
			var d = segment + 1;

			// faces

			indices.push( a, b, d );
			indices.push( b, c, d );

		}

	}

	// build geometry

	this.setIndex( indices );
	this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
	this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
	this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );

}
1206008
public static void bufferedToInterleaved(DataBufferInt buffer, WritableRaster src, InterleavedU8 dst) {
		int[] srcData = buffer.getData();

		int srcStride = stride(src);
		int srcOffset = getOffset(src);

		int numBands = src.getNumBands();
		if( numBands == 3 ) {
			//CONCURRENT_BELOW BoofConcurrency.loopFor(0, dst.height, y -> {
			for (int y = 0; y < dst.height; y++) {
				int indexSrc = srcOffset + y*srcStride;
				int indexDst = dst.startIndex + y * dst.stride;
				for (int x = 0; x < dst.width; x++) {

					int rgb = srcData[indexSrc++];

					dst.data[indexDst++] = (byte) (rgb >>> 16);
					dst.data[indexDst++] = (byte) (rgb >>> 8);
					dst.data[indexDst++] = (byte) rgb;
				}
			}
			//CONCURRENT_ABOVE });
		} else if( numBands == 4 ) {

			//CONCURRENT_BELOW BoofConcurrency.loopFor(0, dst.height, y -> {
			for (int y = 0; y < dst.height; y++) {
				int indexSrc = srcOffset + y*srcStride;
				int indexDst = dst.startIndex + y * dst.stride;
				for (int x = 0; x < dst.width; x++) {

					int rgb = srcData[indexSrc++];

					dst.data[indexDst++] = (byte) (rgb >>> 24);
					dst.data[indexDst++] = (byte) (rgb >>> 16);
					dst.data[indexDst++] = (byte) (rgb >>> 8);
					dst.data[indexDst++] = (byte) rgb;
				}
			}
			//CONCURRENT_ABOVE });
		}
	}
1026257
public static Geometry getGeometryN(Geometry geometry, Integer n) throws SQLException {
        if (geometry == null) {
            return null;
        }
        if (n >= 1 && n <= geometry.getNumGeometries()) {
            return geometry.getGeometryN(n - 1);
        } else {
            throw new SQLException(OUT_OF_BOUNDS_ERR_MESSAGE);
        }
    }
780139
public static int cusolverDnSgeqrf_bufferSize(
        cusolverDnHandle handle, 
        int m, 
        int n, 
        Pointer A, 
        int lda, 
        int[] lwork)
    {
        return checkResult(cusolverDnSgeqrf_bufferSizeNative(handle, m, n, A, lda, lwork));
    }
1349846
@Override
  public void aggregate(final ByteBuffer buf, final int position)
  {
    for (int i = 0; i < valueSelectors.length; i++) {
      values[i] = valueSelectors[i].getDouble();
    }
    final IndexedInts keys = keySelector.getRow();
    // Wrapping memory and ArrayOfDoublesSketch is inexpensive compared to sketch operations.
    // Maintaining a cache of wrapped objects per buffer position like in Theta sketch aggregator
    // might might be considered, but it would increase complexity including relocate() support.
    final WritableMemory mem = WritableMemory.wrap(buf, ByteOrder.LITTLE_ENDIAN);
    final WritableMemory region = mem.writableRegion(position, maxIntermediateSize);
    final Lock lock = stripedLock.getAt(lockIndex(position)).writeLock();
    lock.lock();
    try {
      final ArrayOfDoublesUpdatableSketch sketch = ArrayOfDoublesSketches.wrapUpdatableSketch(region);
      for (int i = 0, keysSize = keys.size(); i < keysSize; i++) {
        final String key = keySelector.lookupName(keys.get(i));
        sketch.update(key, values);
      }
    }
    finally {
      lock.unlock();
    }
  }
183725
public static void geometryOffSetCurve(ArrayList<LineString> list, Geometry geometry, double offset, BufferParameters bufferParameters) {
        final List curves = new OffsetCurveSetBuilder(geometry, offset, new OffsetCurveBuilder(geometry.getFactory().getPrecisionModel(), bufferParameters)).getCurves();
        final Iterator<SegmentString> iterator = curves.iterator();
        while (iterator.hasNext()) {
            list.add(geometry.getFactory().createLineString(iterator.next().getCoordinates()));
        }
    }
359119
function ( width, height, depth, widthSegments, heightSegments, depthSegments ) {

	BufferGeometry.call( this );

	this.type = '';

	this.parameters = {
		width: width,
		height: height,
		depth: depth,
		widthSegments: widthSegments,
		heightSegments: heightSegments,
		depthSegments: depthSegments
	};

	var scope = this;

	width = width || 1;
	height = height || 1;
	depth = depth || 1;

	// segments

	widthSegments = Math.floor( widthSegments ) || 1;
	heightSegments = Math.floor( heightSegments ) || 1;
	depthSegments = Math.floor( depthSegments ) || 1;

	// buffers

	var indices = [];
	var vertices = [];
	var normals = [];
	var uvs = [];

	// helper variables

	var numberOfVertices = 0;
	var groupStart = 0;

	// build each side of the box geometry

	buildPlane( 'z', 'y', 'x', - 1, - 1, depth, height, width, depthSegments, heightSegments, 0 ); // px
	buildPlane( 'z', 'y', 'x', 1, - 1, depth, height, - width, depthSegments, heightSegments, 1 ); // nx
	buildPlane( 'x', 'z', 'y', 1, 1, width, depth, height, widthSegments, depthSegments, 2 ); // py
	buildPlane( 'x', 'z', 'y', 1, - 1, width, depth, - height, widthSegments, depthSegments, 3 ); // ny
	buildPlane( 'x', 'y', 'z', 1, - 1, width, height, depth, widthSegments, heightSegments, 4 ); // pz
	buildPlane( 'x', 'y', 'z', - 1, - 1, width, height, - depth, widthSegments, heightSegments, 5 ); // nz

	// build geometry

	this.setIndex( indices );
	this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
	this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
	this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );

	function buildPlane( u, v, w, udir, vdir, width, height, depth, gridX, gridY, materialIndex ) {

		var segmentWidth = width / gridX;
		var segmentHeight = height / gridY;

		var widthHalf = width / 2;
		var heightHalf = height / 2;
		var depthHalf = depth / 2;

		var gridX1 = gridX + 1;
		var gridY1 = gridY + 1;

		var vertexCounter = 0;
		var groupCount = 0;

		var ix, iy;

		var vector = new Vector3();

		// generate vertices, normals and uvs

		for ( iy = 0; iy < gridY1; iy ++ ) {

			var y = iy * segmentHeight - heightHalf;

			for ( ix = 0; ix < gridX1; ix ++ ) {

				var x = ix * segmentWidth - widthHalf;

				// set values to correct vector component

				vector[ u ] = x * udir;
				vector[ v ] = y * vdir;
				vector[ w ] = depthHalf;

				// now apply vector to vertex buffer

				vertices.push( vector.x, vector.y, vector.z );

				// set values to correct vector component

				vector[ u ] = 0;
				vector[ v ] = 0;
				vector[ w ] = depth > 0 ? 1 : - 1;

				// now apply vector to normal buffer

				normals.push( vector.x, vector.y, vector.z );

				// uvs

				uvs.push( ix / gridX );
				uvs.push( 1 - ( iy / gridY ) );

				// counters

				vertexCounter += 1;

			}

		}

		// indices

		// 1. you need three indices to draw a single face
		// 2. a single segment consists of two faces
		// 3. so we need to generate six (2*3) indices per segment

		for ( iy = 0; iy < gridY; iy ++ ) {

			for ( ix = 0; ix < gridX; ix ++ ) {

				var a = numberOfVertices + ix + gridX1 * iy;
				var b = numberOfVertices + ix + gridX1 * ( iy + 1 );
				var c = numberOfVertices + ( ix + 1 ) + gridX1 * ( iy + 1 );
				var d = numberOfVertices + ( ix + 1 ) + gridX1 * iy;

				// faces

				indices.push( a, b, d );
				indices.push( b, c, d );

				// increase counter

				groupCount += 6;

			}

		}

		// add a group to the geometry. this will ensure multi material support

		scope.addGroup( groupStart, groupCount, materialIndex );

		// calculate new start value for groups

		groupStart += groupCount;

		// update total number of vertices

		numberOfVertices += vertexCounter;

	}

}
1316531
public static int cusolverDnSpotrf_bufferSize(
        cusolverDnHandle handle, 
        int uplo, 
        int n, 
        Pointer A, 
        int lda, 
        int[] Lwork)
    {
        return checkResult(cusolverDnSpotrf_bufferSizeNative(handle, uplo, n, A, lda, Lwork));
    }
691057
public void appendToBuffer(StringBuilder buf) {
    Iterator<Polygon> iter = polygons.iterator();
    while(iter.hasNext()) {
      Polygon poly = iter.next();
      poly.appendToBuffer(buf);
      if(iter.hasNext()) {
        buf.append(" -- ");
      }
    }
  }
1099716
public static int cusolverDnSsytrf_bufferSize(
        cusolverDnHandle handle, 
        int n, 
        Pointer A, 
        int lda, 
        int[] lwork)
    {
        return checkResult(cusolverDnSsytrf_bufferSizeNative(handle, n, A, lda, lwork));
    }