/* (non-Javadoc)
@see org.joml.Matrix4fc#unprojectRay(float, float, int[], org.joml.Vector3f, org.joml.Vector3f)
433672
public Matrix4f unprojectRay(float winX, float winY, int[] viewport, Vector3f originDest, Vector3f dirDest) {
        float a = m00 * m11 - m01 * m10;
        float b = m00 * m12 - m02 * m10;
        float c = m00 * m13 - m03 * m10;
        float d = m01 * m12 - m02 * m11;
        float e = m01 * m13 - m03 * m11;
        float f = m02 * m13 - m03 * m12;
        float g = m20 * m31 - m21 * m30;
        float h = m20 * m32 - m22 * m30;
        float i = m20 * m33 - m23 * m30;
        float j = m21 * m32 - m22 * m31;
        float k = m21 * m33 - m23 * m31;
        float l = m22 * m33 - m23 * m32;
        float det = a * l - b * k + c * j + d * i - e * h + f * g;
        det = 1.0f / det;
        float im00 = ( m11 * l - m12 * k + m13 * j) * det;
        float im01 = (-m01 * l + m02 * k - m03 * j) * det;
        float im02 = ( m31 * f - m32 * e + m33 * d) * det;
        float im03 = (-m21 * f + m22 * e - m23 * d) * det;
        float im10 = (-m10 * l + m12 * i - m13 * h) * det;
        float im11 = ( m00 * l - m02 * i + m03 * h) * det;
        float im12 = (-m30 * f + m32 * c - m33 * b) * det;
        float im13 = ( m20 * f - m22 * c + m23 * b) * det;
        float im20 = ( m10 * k - m11 * i + m13 * g) * det;
        float im21 = (-m00 * k + m01 * i - m03 * g) * det;
        float im22 = ( m30 * e - m31 * c + m33 * a) * det;
        float im23 = (-m20 * e + m21 * c - m23 * a) * det;
        float im30 = (-m10 * j + m11 * h - m12 * g) * det;
        float im31 = ( m00 * j - m01 * h + m02 * g) * det;
        float im32 = (-m30 * d + m31 * b - m32 * a) * det;
        float im33 = ( m20 * d - m21 * b + m22 * a) * det;
        float ndcX = (winX-viewport[0])/viewport[2]*2.0f-1.0f;
        float ndcY = (winY-viewport[1])/viewport[3]*2.0f-1.0f;
        float px = im00 * ndcX + im10 * ndcY + im30;
        float py = im01 * ndcX + im11 * ndcY + im31;
        float pz = im02 * ndcX + im12 * ndcY + im32;
        float invNearW = 1.0f / (im03 * ndcX + im13 * ndcY - im23 + im33);
        float nearX = (px - im20) * invNearW;
        float nearY = (py - im21) * invNearW;
        float nearZ = (pz - im22) * invNearW;
        float invFarW = 1.0f / (im03 * ndcX + im13 * ndcY + im23 + im33);
        float farX = (px + im20) * invFarW;
        float farY = (py + im21) * invFarW;
        float farZ = (pz + im22) * invFarW;
        originDest.x = nearX; originDest.y = nearY; originDest.z = nearZ;
        dirDest.x = farX - nearX; dirDest.y = farY - nearY; dirDest.z = farZ - nearZ;
        return this;
    }
626830
public static float[] copyOf(float[] floatArray) {

    	float[] copy = new float[floatArray.length];
        System.arraycopy(floatArray, 0, copy, 0, floatArray.length);
        return copy;
    }
1111137
@SuppressWarnings({ "rawtypes"})
	@Override
	public ArrayList<Object> unbag()
	{
		if(arrayObj == null || arrayObj.length == 0)
			return null;
		
		ArrayList<Object> list = new ArrayList<Object>(this.arrayObj.length);
		
		Object value = null;
		for (int i = 0; i < arrayObj.length; i++)
		{
			value = arrayObj[i];
			
			if(value instanceof BaggedObject)
				value = ((BaggedObject)value).unbag();
			
			list.add(value);
		}
		return list;
	}
846311
public Vector3f mulProject(Matrix4fc mat, Vector3f dest) {
        float invW = 1.0f / (mat.m03() * x + mat.m13() * y + mat.m23() * z + mat.m33());
        float rx = (mat.m00() * x + mat.m10() * y + mat.m20() * z + mat.m30()) * invW;
        float ry = (mat.m01() * x + mat.m11() * y + mat.m21() * z + mat.m31()) * invW;
        float rz = (mat.m02() * x + mat.m12() * y + mat.m22() * z + mat.m32()) * invW;
        dest.x = rx;
        dest.y = ry;
        dest.z = rz;
        return dest;
    }
850419
public static <T> T subArray(final T array, final int start, final int end) {

    if (isEmpty(array) || start < 0 || start > end || end >= Array.getLength(array)) {
      return array;
    }
    int newArraySize = end - start + 1;
    @SuppressWarnings("unchecked")
    T newArray = (T) buildArray(ClassUtils.getPrimitiveClass(ClassUtils.getComponentClass(array)),
      newArraySize, null);
    System.arraycopy(array, start, newArray, 0, newArraySize);
    return newArray;
  }
1056267
def unbroadcast_numpy_to(array, shape):
  
  axis = create_unbroadcast_axis(shape, numpy.shape(array))
  return numpy.reshape(numpy.sum(array, axis=axis), shape)
461118
@Pure
	public double[] toDoubleArray(Transform3D transform) {
		double[] clone = new double[this.numCoords];
		if (transform==null) {
			for(int i=0; i<this.numCoords; ++i) {
				clone[i] = this.coords[i];
			}
		}
		else {
			Point3f p = new Point3f();
			for(int i=0; i<clone.length;) {
				p.x = this.coords[i];
				p.y = this.coords[i+1];
				p.y = this.coords[i+2];
				transform.transform(p);
				clone[i++] = p.x;
				clone[i++] = p.y;
				clone[i++] = p.z;
			}
		}
		return clone;
	}
141520
public static Object[] copyArray(Object[] array, int from, int to) {
    Object[] result = new Object[to - from];
    System.arraycopy(array, from, result, 0, to - from);
    return result;
  }
61528
public static float[] unboxFloats(Object src, int srcPos, int len) {
        return unboxFloats(array(src), srcPos, len);
    }
111486
function (projectionMatrix) {
        Matrix4.copy(this.projectionMatrix, projectionMatrix);
        Matrix4.invert(this.invProjectionMatrix, projectionMatrix);
        this.decomposeProjectionMatrix();
    }
326965
function _removeArrayMember(arr, elem) {
		// TODO: use Array.indexOf for IE >= 9
		var i;
		for (i = arr.length - 1; i >= 0; i--) {
			if (arr[i] === elem) {
				arr.splice(i, 1);
				return true;
			}
		}
		return false;
	}
881575
public static int[] removeFromIntArray(int[] a, int value) {
		
		if(a == null) {
			throw new NullPointerException("Array was null");
		}
		
		int index = -1;
		for(int i = 0; i < a.length; i++) {
			if(a[i] == value) {
				index = i;
				break;
			}
		}
		if(index < 0) {
			throw new IllegalArgumentException(String.format("Element %d not found in array", value));
		}
		
		int[] array = new int[a.length - 1];
		if(index > 0) {
			System.arraycopy(a, 0, array, 0, index);
		}
		if(index < a.length) {
			System.arraycopy(a, index + 1, array, index, array.length - index);
		}
		
		return array;
	}
210386
public static long[] unshuffleLongArray(byte[] input) throws IOException {
        long[] output = new long[input.length / 8];
        int numProcessed = impl.unshuffle(input, 0, 8, input.length, output, 0);
        assert(numProcessed == input.length);
        return output;
    }
1159182
public static int[] unWrap(Integer... values) {
		if (null == values) {
			return null;
		}
		final int length = values.length;
		if (0 == length) {
			return new int[0];
		}

		final int[] array = new int[length];
		for (int i = 0; i < length; i++) {
			array[i] = values[i].intValue();
		}
		return array;
	}
515078
public static String[][] invert(final String[][] array) {
        final String[][] newarray = new String[array.length][2];
        for(int i = 0; i<array.length; i++) {
            newarray[i][0] = array[i][1];
            newarray[i][1] = array[i][0];
        }
        return newarray;
    }
590572
float[] unquantize(){

    if(maptype==1||maptype==2){
      int quantvals;
      float mindel=float32_unpack(q_min);
      float delta=float32_unpack(q_delta);
      float[] r=new float[entries*dim];

      // maptype 1 and 2 both use a quantized value vector, but
      // different sizes
      switch(maptype){
        case 1:
          // most of the time, entries%dimensions == 0, but we need to be
          // well defined.  We define that the possible vales at each
          // scalar is values == entries/dim.  If entries%dim != 0, we'll
          // have 'too few' values (values*dim<entries), which means that
          // we'll have 'left over' entries; left over entries use zeroed
          // values (and are wasted).  So don't generate codebooks like that
          quantvals=maptype1_quantvals();
          for(int j=0; j<entries; j++){
            float last=0.f;
            int indexdiv=1;
            for(int k=0; k<dim; k++){
              int index=(j/indexdiv)%quantvals;
              float val=quantlist[index];
              val=Math.abs(val)*delta+mindel+last;
              if(q_sequencep!=0)
                last=val;
              r[j*dim+k]=val;
              indexdiv*=quantvals;
            }
          }
          break;
        case 2:
          for(int j=0; j<entries; j++){
            float last=0.f;
            for(int k=0; k<dim; k++){
              float val=quantlist[j*dim+k];
              //if((j*dim+k)==0){System.err.println(" | 0 -> "+val+" | ");}
              val=Math.abs(val)*delta+mindel+last;
              if(q_sequencep!=0)
                last=val;
              r[j*dim+k]=val;
              //if((j*dim+k)==0){System.err.println(" $ r[0] -> "+r[0]+" | ");}
            }
          }
          //System.err.println("\nr[0]="+r[0]);
      }
      return (r);
    }
    return (null);
  }
487795
public double[] unproject(double x, double y, double z) {
    double[] out = new double[3];
    unproject(x, y, z, out);
    return out;
  }