@param float[] $c

@return float[]
12243
public function rgb2gray($c)
	{
		if (isset($c[4])) {
			return [1, ($c[1] * .21) + ($c[2] * .71) + ($c[3] * .07), ord(1), $c[4]];
		}

		return [1, ($c[1] * .21) + ($c[2] * .71) + ($c[3] * .07)];
	}
608206
public static float[] doubleArrayToFloatArray(double[] a) {
    float[] result = new float[a.length];
    for (int i = 0; i < a.length; i++) {
      result[i] = (float) a[i];
    }
    return result;
  }
609041
public static function execute($value, ContextInterface $context): array
    {
        return is_float($value) === true ?
            static::createSuccessReply($value) :
            static::createErrorReply($context, $value, ErrorCodes::IS_FLOAT, Messages::IS_FLOAT, []);
    }
486543
public function flatMap(callable $func) : array
    {
        $list = $this->list;
        $acc = [];

        foreach ($list as $val) {
            $acc[] = $func($val);
        }

        return $acc;
    }
271482
function getColumn($c) {
		if (!isset($this->columns[$c])) {
			throw new \OutOfBoundsException("Unknown column $c");
		}
		return $this->columns[$c];
	}
340214
public static void normalize2Prop(float[] c) {
		float sum = sum(c);
		
		if (sum == 0)
			return;
		for (int i = 0; i < c.length; i++) {
			c[i] = c[i] / sum;
		}
	}
1098461
public int[] getMetricsTT(int c) {
        if (cmapExt != null) {
            return (int[])cmapExt.get(Integer.valueOf(c));
        }
        if (!fontSpecific && cmap31 != null) { 
            return (int[])cmap31.get(Integer.valueOf(c));
        }
        if (fontSpecific && cmap10 != null) { 
            return (int[])cmap10.get(Integer.valueOf(c));
        }
        if (cmap31 != null) { 
            return (int[])cmap31.get(Integer.valueOf(c));
        }
        if (cmap10 != null) {
            return (int[])cmap10.get(Integer.valueOf(c));
        }
        return null;
    }
151732
public float[] normalise(float[] z) {
    float[] result = new float[z.length];

    for (int i = 0; i < z.length; i++) {
      float bound = (float) 2.0 * (i + 1);
      result[i] = z[i] / bound;
      result[i] = correctTo01(result[i]);
    }

    return result;
  }
314025
protected function fixColor($c)
    {
        foreach ([1, 2, 3] as $i) {
            if ($c[$i] < 0) {
                $c[$i] = 0;
            }

            if ($c[$i] > 255) {
                $c[$i] = 255;
            }
        }

        return $c;
    }
643914
public ComplexFloat muli(ComplexFloat c, ComplexFloat result) {
    float newR = r * c.r - i * c.i;
    float newI = r * c.i + i * c.r;
    result.r = newR;
    result.i = newI;
    return result;
  }
893494
public static boolean[] toBooleanArray(Collection<Boolean> c){
        boolean arr[] = new boolean[c.size()];
        int i=0;
        for(Boolean item: c)
            arr[i++] = item;
        return arr;
    }
262443
public function rgb2cmyk($c)
	{
		$cyan = 1 - ($c[1] / 255);
		$magenta = 1 - ($c[2] / 255);
		$yellow = 1 - ($c[3] / 255);
		$min = min($cyan, $magenta, $yellow);

		if ($min == 1) {
			if ($c[0] == 5) {
				return [6, 100, 100, 100, 100, $c[4]];
			}

			return [4, 100, 100, 100, 100];
			// For K-Black
			//if ($c[0]==5) { return array (6,0,0,0,100, $c[4]); }
			//else { return array (4,0,0,0,100); }
		}
		$K = $min;
		$black = 1 - $K;
		if ($c[0] == 5) {
			return [6, ($cyan - $K) * 100 / $black, ($magenta - $K) * 100 / $black, ($yellow - $K) * 100 / $black, $K * 100, $c[4]];
		}

		return [4, ($cyan - $K) * 100 / $black, ($magenta - $K) * 100 / $black, ($yellow - $K) * 100 / $black, $K * 100];
	}
165905
public function readFloats($count)
    {
        $floats = array();

        for ($i = 0; $i < $count; $i++) {
            $float = $this->readFloat();

            if (! is_nan($float)) {
                $floats[] = $float;
            }
        }

        return $floats;
    }
487308
public float[] getFloatArray(final String key) {
		final String[] value = getArray(key);
		if (value != null) {
			final float[] result = new float[value.length];
			for (int i = 0; i < value.length; i++) {
				result[i] = Float.parseFloat(value[i]);
			}
			return result;
		}
		return null;
	}
506972
static public function floatArrayToInteger($floatArray)
    {
        $integerArray = array();
        foreach ($floatArray as $f) {
            $integerArray[] = (is_null($f) === false) ? intval($f) : null;
        }

        return $integerArray;
    }
377895
public static function array_filter_values($array, $c = null)
    {
        if (isset($c['with'])) {

            $data = array();

            foreach ($array as $key => $value) {
                if (strpos($value, $c['with'])) {
                    $data[$key] = $value;
                }
            }

            return $data;
        } else {
            return array_filter($array);
        }
    }
936909
public float[] extractFloatArray() {
	float[] argout;
	argout = new float[values.length];
	for (int i = 0; i < values.length; i++) {
	    argout[i] = new Float(values[i]);
	}
	return argout;
    }