/*
@description
Multiplies an integer n by a group element p and
returns the resulting group element.
199677
public static byte [] scalseMult(byte [] n, byte [] p) {
            if (!(n.length==scalarLength && p.length==groupElementLength))
                return null;

            byte [] q = new byte [scalarLength];

            crypto_scalarmult(q, n, p);

            return q;
        }
1124291
public Integer getInt(String key, String group, Integer defaultValue) {
		return Convert.toInt(getByGroup(key, group), defaultValue);
	}
150414
public static int[] cs_pinv(int[] p, int n) {
        int k, pinv[];
        if (p == null)
            return (null); /* p = NULL denotes identity */
        pinv = new int[n]; /* allocate result */
        for (k = 0; k < n; k++)
            pinv[p[k]] = k;/* invert the permutation */
        return (pinv); /* return result */
    }
673445
public <N extends Number & Comparable<N>> NumberExpression<T> multiply(N right) {
        return Expressions.numberOperation(getType(), Ops.MULT, mixin, ConstantImpl.create(right));
    }
750182
function (arr, groupSize) {
		var groups = [];
		groupSize = groupSize || 100;
		arr.forEach(function (n, i) {
			var index = Math.trunc(i / groupSize);
			if (groups.length === index) {
				groups.push([]);
			}
			groups[index].push(n);
		});
		return groups;
	}
986787
private static int getMultiplier(final String unit) {
    int multiplier = 1;
    if(!StringUtils.isBlank(unit)) {
      if(UNIT_MILLION.equalsIgnoreCase(unit.trim())) {
        multiplier = 1000000;
      }
      if(UNIT_THOUSAND.equalsIgnoreCase(unit.trim())) {
        multiplier = 1000;
      }
    }
    return multiplier;
  }
1075047
@Override
    public int nextInt(int n) {
        if (n <= 0) {
            throw new IllegalArgumentException("n must be positive");
        }

        // the special treatment of powers of 2 as in Random.nextInt(int) shouldn't be necessary
        int bits, val;
        do {
            bits = nextInt() >>> 1;
            val = bits % n;
        } while (bits - val + (n - 1) < 0);
        return val;
    }
80455
public static double fastElementP(DMatrixD1 A , double p ) {
        if( p == 2 ) {
            return fastNormF(A);
        } else {
            double total = 0;

            int size = A.getNumElements();

            for( int i = 0; i < size; i++ ) {
                double a = A.get(i);

                total += Math.pow(Math.abs(a),p);
            }

            return Math.pow(total,1.0/p);
        }
    }
1246992
function(p) {
            var m = this.m;
            return {
                x: m[0] * p.x + m[2] * p.y + m[4],
                y: m[1] * p.x + m[3] * p.y + m[5]
            };
        }
372823
public D multipliedBy(int factor) {

        switch (factor) {
            case -1:
                return this.inverse();
            case 1:
                return this.self();
            default:
                return this.with(MathUtils.safeMultiply(this.amount, factor));
        }

    }
289779
public static Point multiply(Point p, BigInteger k) {
      BigInteger e = k;
      BigInteger h = e.multiply(BigInteger.valueOf(3));

      Point neg = p.negate();
      Point R = p;

      for (int i = h.bitLength() - 2; i > 0; --i) {
         R = R.twice();

         boolean hBit = h.testBit(i);
         boolean eBit = e.testBit(i);

         if (hBit != eBit) {
            R = R.add(hBit ? p : neg);
         }
      }

      return R;
   }
26677
final private void printBalance(Integer p, N n) {
    if (n != null) {
      printBalance((p + 1), n.leftChild);
      String format = "%" + (3 * p) + "s";
      System.out.print(String.format(format, ""));
      if (n.left == n.right) {
        System.out.println(
            "[" + n.left + "] (" + n.max + ") : " + n.ids.size() + " tokens");
      } else {
        System.out.println("[" + n.left + "-" + n.right + "] (" + n.max + ") : "
            + n.ids.size() + " tokens");
      }
      printBalance((p + 1), n.rightChild);
    }
  }
170175
public Double getDouble(String key, String group) {
		return getDouble(key, group, null);
	}
182086
public int[] multiply(int[] p, int[] q) {
    int len = p.length + q.length - 1;
    int[] result = new int[len];
    for (int i = 0; i < len; i++) {
      result[i] = 0;
    }
    for (int i = 0; i < p.length; i++) {
      for (int j = 0; j < q.length; j++) {
        result[i + j] = add(result[i + j], multiply(p[i], q[j]));
      }
    }
    return result;
  }
1310747
public static long parseSize(String s) {
        Matcher m = p_mem.matcher(s);
        if (m.find()) {
            long i = Long.parseLong(m.group(1));
            char multiplier = 'B';
            if (m.group(2) != null && m.group(2).length() == 1) {
                multiplier = m.group(2).charAt(0);
            }
            if (multiplier == 'B') {
                return (long) i;
            }
            if (multiplier == 'K') {
                return (long) i * 1024l;
            }
            if (multiplier == 'M') {
                return (long) i * 1024l * 1024l;
            }
            if (multiplier == 'G') {
                return (long) i * 1024l * 1024l * 1024l;
            }
        }
        return -1;
    }
1021095
@Override
  public ByteAmount multiply(int factor) {
    checkArgument(value <= Long.MAX_VALUE / factor,
        String.format("Multiplying %s by %d would exceed Long.MAX_LONG", this, factor));
    return ByteAmount.fromBytes(value * factor);
  }
66420
private static BigInteger getFactorial (int n) {
		BigInteger fact = BigInteger.ONE;
		for (int i = n; i > 1; i--) {
			fact = fact.multiply (new BigInteger (Integer.toString (i)));
		}
		return fact;
	}