Scalar multiplies each item with c
@param c
188
public void scalarMultiply(double c)
    {
        int m = rows;
        int n = cols;
        for (int i = 0; i < m; i++)
        {
            for (int j = 0; j < n; j++)
            {
                consumer.set(i, j, c * supplier.get(i, j));
            }
        }
    }
714970
public static <E, C extends Counter<E>> Counter<E> L2NormalizeInPlace(Counter<E> c) {
    return multiplyInPlace(c, 1.0 / L2Norm(c));
  }
815111
private void simpleIncrement(TensorBase other, double multiplier) {
    Preconditions.checkArgument(Arrays.equals(other.getDimensionNumbers(), getDimensionNumbers()));
    if (other instanceof DenseTensorBase) {
      double[] otherTensorValues = ((DenseTensorBase) other).values;
      Preconditions.checkArgument(otherTensorValues.length == values.length);
      int length = values.length;
      for (int i = 0; i < length; i++) {
        values[i] += otherTensorValues[i] * multiplier;
      }
    } else {
      int otherSize = other.size();
      for (int i = 0; i < otherSize; i++) {
        long keyNum = other.indexToKeyNum(i);
        double value = other.getByIndex(i);
        values[keyNumToIndex(keyNum)] += value * multiplier;
      }
    }
  }
774748
public static double[] multiply(double[] a, double c) {
    double[] result = new double[a.length];
    for (int i = 0; i < a.length; i++) {
      result[i] = a[i] * c;
    }
    return result;
  }
699075
public static void printSizes(Component c) {
        System.out.println("minimumSize = " + c.getMinimumSize());
        System.out.println("preferredSize = " + c.getPreferredSize());
        System.out.println("maximumSize = " + c.getMaximumSize());
    }
974565
@Override
  public void readIntegers(int total, WritableColumnVector c, int rowId) {
    int left = total;
    while (left > 0) {
      if (this.currentCount == 0) this.readNextGroup();
      int n = Math.min(left, this.currentCount);
      switch (mode) {
        case RLE:
          c.putInts(rowId, n, currentValue);
          break;
        case PACKED:
          c.putInts(rowId, n, currentBuffer, currentBufferIdx);
          currentBufferIdx += n;
          break;
      }
      rowId += n;
      left -= n;
      currentCount -= n;
    }
  }
585804
private void mmuli(int n, double[] A, double[] B, double[] C) {
        for (int i = 0; i < n * n; i++) {
            C[i] = 0;
        }

        for (int j = 0; j < n; j++) {
            int jn = j * n;
            for (int k = 0; k < n; k++) {
                int kn = k * n;
                double bkjn = B[k + jn];
                for (int i = 0; i < n; i++) {
                    C[i + jn] += A[i + kn] * bkjn;
                }
            }
        }
    }
719738
public static int cs_cumsum(int[] p, int[] c, int n) {
        int i, nz = 0;
        float nz2 = 0;
        if (p == null || c == null)
            return (-1); /* check inputs */
        for (i = 0; i < n; i++) {
            p[i] = nz;
            nz += c[i];
            nz2 += c[i]; /* also in float to avoid int overflow */
            c[i] = p[i]; /* also copy p[0.f.n-1] back into c[0.f.n-1]*/
        }
        p[n] = nz;
        return (int) nz2; /* return sum (c [0.f.n-1]) */
    }
41003
private static double[] plusAndConstMult(double[] a, double[] b, double c,
      double[] d) {
    for (int i = 0; i < a.length; i++) {
      d[i] = a[i] + c * b[i];
    }
    return d;
  }
912904
public static void multRow(Matrix A, int i, double[] c)
    {
        if(A.cols() != c.length)
            throw new ArithmeticException("Can not perform row update, length miss match " + A.cols() + " and " + c.length);
        multRow(A, i, 0, c.length, c);
    }
100271
public Matrix multiply(double c, ExecutorService threadPool)
    {
        Matrix toReturn = getThisSideMatrix(null);
        toReturn.mutableMultiply(c, threadPool);
        return toReturn;
    }
490955
public static <T1, T2> TwoDimensionalCounter<T1, T2> scale(TwoDimensionalCounter<T1, T2> c, double d) {
    TwoDimensionalCounter<T1, T2> result = new TwoDimensionalCounter<T1, T2>(c.getOuterMapFactory(), c.getInnerMapFactory());
    for (T1 key : c.firstKeySet()) {
      ClassicCounter<T2> ctr = c.getCounter(key);
      result.setCounter(key, scale(ctr, d));
    }
    return result;
  }
941198
public final void setToOne(int c) {
        if( 0x10ffff<c) {
            return;
        }

        if(c<0xffff) {
            bmpLength=length=2;
            array[0]=(char)c;
            array[1]=(char)(c+1);
        } else if(c==0xffff) {
            bmpLength=1;
            length=3;
            array[0]=0xffff;
            array[1]=1;
            array[2]=0;
        } else if(c<0x10ffff) {
            bmpLength=0;
            length=4;
            array[0]=(char)(c>>16);
            array[1]=(char)c;
            ++c;
            array[2]=(char)(c>>16);
            array[3]=(char)c;
        } else /* c==0x10ffff */ {
            bmpLength=0;
            length=2;
            array[0]=0x10;
            array[1]=0xffff;
        }
    }
368082
@Override
  public boolean addAll(int index, Collection<? extends Float> c) {
    if (index < 0 || index > size) {
      throw new IndexOutOfBoundsException();
    }
    ensureCapacity(size + c.size());
    size += c.size();
    for (int i = size + c.size() - 1, j = size - 1; j >= index; i--, j--) {
      elements[i] = elements[j];
    }
    for (float e : c) {
      elements[index++] = e;
    }
    return c.size() > 0;
  }
893469
public static void addMultInPlace(double[] a, double[] b, double c) {
    for (int i=0; i<a.length; i++) {
      a[i] += b[i] * c;
    }
  }
1190641
public float dotProduct(LinearSparseVector sv, float c) {
		float product = 0;

		for (int i = 0; i < sv.length; i++) {
			int p = Arrays.binarySearch(index, sv.index[i]);
			if (p >= 0) {
				float val = (float) sv.data[i] + c;
				val *= (float) data[p];
				product += val;
			}
		}

		return product;
	}
1132989
private static void getCounts(BaseArray T, BaseArray C, int n, int k) {
        for (int i = 0; i < k; ++i) {
            C.set(i, 0);
        }
        for (int i = 0; i < n; ++i) {
            C.update(T.get(i), 1);
        }
    }