Calculate an LPC using the given Auto-correlation data. Static method
used since this is slightly faster than a more strictly object-oriented
approach.

@param lpc LPC to calculate
@param R Autocorrelation data to use
482455
public static void calculate(LPC lpc, long[] R) {
    int coeffCount = lpc.order;

    //calculate first iteration directly
    double[] A = lpc.rawCoefficients;
    for(int i = 0; i < coeffCount+1; i++) A[i] = 0.0;
    A[0] = 1;
    double E = R[0];

    //calculate remaining iterations

    if(R[0] == 0) {
      for(int i = 0; i < coeffCount+1; i++)
        A[i] = 0.0;
    }
    else {
      double[] ATemp = lpc.tempCoefficients;
      for(int i = 0; i < coeffCount+1; i++) ATemp[i] = 0.0;

      for(int k = 0; k < coeffCount; k++) {
        double lambda = 0.0;
        double temp = 0;
        for(int j = 0; j <= k; j++) {
          temp += A[j]*R[k+1-j];
        }
        lambda = -temp/E;

        for(int i = 0; i <= k+1; i++) {
          ATemp[i] = A[i]+lambda*A[k+1-i];
        }
        System.arraycopy(ATemp, 0, A, 0, coeffCount+1);
        E = (1-lambda*lambda)*E;
      }
    }
    lpc.rawError = E;
  }
785211
private void doLog(LogRecord lr, String rbname) {
        lr.setLoggerName(name);
        if (rbname != null) {
            lr.setResourceBundleName(rbname);
            lr.setResourceBundle(findResourceBundle(rbname, false));
        }
        log(lr);
    }
138412
static void computeRotation(DMatrix3 t , DMatrix3x3 R ) {
		for (int i = 1; i >= 0; i--) {
			double a = t.get(i,0);
			double b = t.get(i+1,0);

			// compute the rotator such that [a,b] = [||X||,0]
			double r = Math.sqrt(a*a + b*b);
			double q11 = a/r;
			double q21 = b/r;

			// apply rotator to t and R
			t.set(i,0,r);
			t.set(i+1,0,0);

			if( i == 1 ) {
				R.a11 = 1; R.a12 =  0;   R.a13 =  0;
				R.a21 = 0; R.a22 =  q11; R.a23 = q21;
				R.a31 = 0; R.a32 = -q21; R.a33 = q11;
			} else {
				R.a11 = q11;  R.a12 = R.a22*q21; R.a13 = R.a23*q21;
				R.a21 = -q21; R.a22 = R.a22*q11; R.a23 = R.a23*q11;
			}
		}
	}
1109380
def _compute_Lp_matrix(self):
        
        self.Lp = sum([1/self.eigen_values[i]
                      * np.outer(self.eigen_basis[:, i], self.eigen_basis[:, i])
                      for i in range(1, self.eigen_values.size)])
745593
def _rlFindStart(rl,lz,pot,lower=False):
    """"""
    rtry= 2.*rl
    while (2.*lower-1.)*_rlfunc(rtry,lz,pot) > 0.:
        if lower:
            rtry/= 2.
        else:
            rtry*= 2.
    return rtry
1327148
public static boolean areEquivalent(Coordinate l, Coordinate r)
   {
      if (l == r)
      {
         return true;
      }
      if ((l == null) && (r == null))
      {
         return true;
      }
      else if ((l == null) || (r == null))
      {
         return false;
      }

      String lPackacking = l.getPackaging() == null ? "jar" : l.getPackaging();
      String rPackaging = r.getPackaging() == null ? "jar" : r.getPackaging();

      return !(l.getArtifactId() != null ? !l.getArtifactId()
               .equals(r.getArtifactId()) : r.getArtifactId() != null)
               &&
               !(l.getGroupId() != null ? !l.getGroupId()
                        .equals(r.getGroupId()) : r.getGroupId() != null)
               &&
               !(l.getClassifier() != null ? !l.getClassifier()
                        .equals(r.getClassifier()) : r.getClassifier() != null)
               &&
               lPackacking.equals(rPackaging);
   }
366681
def autocorrelation_plot(time)
      r = autocorrelation time
      start = @times[:repeat].first
      ende = (start + r.size)
      (start...ende).to_a.zip(r)
    end
287137
public ReleaseCompleteMessage createRLC() {

        ReleaseCompleteMessage msg = new ReleaseCompleteMessageImpl(_RLC_HOLDER.mandatoryCodes,
                _RLC_HOLDER.mandatoryVariableCodes, _RLC_HOLDER.optionalCodes, _RLC_HOLDER.mandatoryCodeToIndex,
                _RLC_HOLDER.mandatoryVariableCodeToIndex, _RLC_HOLDER.optionalCodeToIndex);

        return msg;
    }
92534
def _lmder1_linear_r1zcr(n, m, factor, target_fnorm1, target_fnorm2, target_params):
    """"""

    def func(params, vec):
        s = 0
        for j in range(1, n - 1):
            s += (j + 1) * params[j]
        for i in range(m):
            vec[i] = i * s - 1
        vec[m-1] = -1

    def jac(params, jac):
        jac.fill(0)

        for i in range(1, n - 1):
            for j in range(1, m - 1):
                jac[i,j] = j * (i + 1)

    guess = np.ones(n) * factor

    #_lmder1_test(m, func, jac, guess)
    _lmder1_driver(m, func, jac, guess,
                   target_fnorm1, target_fnorm2, None)
977012
private Counter<L> probabilityOfRVFDatum(RVFDatum<L, F> example) {
    // NB: this duplicate method is needed so it calls the scoresOf method
    // with a RVFDatum signature
    Counter<L> scores = logProbabilityOfRVFDatum(example);
    for (L label : scores.keySet()) {
      scores.setCount(label, Math.exp(scores.getCount(label)));
    }
    return scores;
  }
897522
public void updateMetricFromRPC(Object value) {
        if (value == null) {
            incr();
        } else if (value instanceof Long) {
            incrBy((Long) value);
        } else {
            throw new RuntimeException("CountShellMetric updateMetricFromRPC params should be null or Long");
        }
    }
226725
@Override
	public boolean isOverlapping(ConstantRange r) {
		if (!(r instanceof VarcharConstantRange))
			throw new IllegalArgumentException();
		if (!isValid() || !r.isValid())
			return false;
		VarcharConstantRange sr = (VarcharConstantRange) r;
		VarcharConstant rh = sr.high;
		boolean rhi = sr.highIncl;
		if (!low.equals(NEG_INF)
				&& ((lowIncl && ((rhi && rh.compareTo(low) < 0) || (!rhi && rh
						.compareTo(low) <= 0))) || (!lowIncl && rh
						.compareTo(low) <= 0)))
			return false;
		VarcharConstant rl = sr.low;
		boolean rli = sr.lowIncl;
		if (!high.equals(INF)
				&& ((highIncl && ((rli && rl.compareTo(high) > 0) || (!rli && rl
						.compareTo(high) >= 0))) || (!highIncl && rl
						.compareTo(high) >= 0)))
			return false;
		return true;
	}
406425
public boolean checkVariance( ImageRectangle r ) {

		double sigma2 = computeVariance(r.x0,r.y0,r.x1,r.y1);

		return sigma2 >= thresholdLower;
	}
4181
float lpc_from_curve(float[] curve, float[] lpc){
    int n=ln;
    float[] work=new float[n+n];
    float fscale=(float)(.5/n);
    int i, j;

    // input is a real curve. make it complex-real
    // This mixes phase, but the LPC generation doesn't care.
    for(i=0; i<n; i++){
      work[i*2]=curve[i]*fscale;
      work[i*2+1]=0;
    }
    work[n*2-1]=curve[n-1]*fscale;

    n*=2;
    fft.backward(work);

    // The autocorrelation will not be circular.  Shift, else we lose
    // most of the power in the edges.

    for(i=0, j=n/2; i<n/2;){
      float temp=work[i];
      work[i++]=work[j];
      work[j++]=temp;
    }

    return (lpc_from_data(work, lpc, n, m));
  }
1043835
public static <T, R> void processObject(R r, T src) {
        processObject(r, src, (r1, src1) -> {
        });
    }
681852
public static double distance( LasRecord r1, LasRecord r2 ) {
        double distance = NumericsUtilities.pythagoras(r1.x - r2.x, r1.y - r2.y);
        return distance;
    }
1234007
public synchronized void
addRR(Record r) {
	if (rrs.size() == 0) {
		safeAddRR(r);
		return;
	}
	Record first = first();
	if (!r.sameRRset(first))
		throw new IllegalArgumentException("record does not match " +
						   "rrset");

	if (r.getTTL() != first.getTTL()) {
		if (r.getTTL() > first.getTTL()) {
			r = r.cloneRecord();
			r.setTTL(first.getTTL());
		} else {
			for (int i = 0; i < rrs.size(); i++) {
				Record tmp = (Record) rrs.get(i);
				tmp = tmp.cloneRecord();
				tmp.setTTL(r.getTTL());
				rrs.set(i, tmp);
			}
		}
	}

	if (!rrs.contains(r))
		safeAddRR(r);
}