Java Code Examples for org.apache.commons.math.exception.MathInternalError

Following code examples demonstrate how to use org.apache.commons.math.exception.MathInternalErrorfrom android. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.apache.commons.math.exception.MathInternalErrorand various code implementation of this class.

                switch (method) {
                case ILLINOIS:
                    f0 *= 0.5;
                    break;
                case PEGASUS:
                    f0 *= f1 / (f1 + fx);
                    break;
                case REGULA_FALSI:
                    if (x == x1) {
                        x0 = 0.5 * (x0 + x1 + 1 - FastMath.max(rtol * FastMath.abs(x1), atol));
                        f0 = computeObjectiveValue(x0);
                    }
                    break;
                default:
                    throw new MathInternalError();
                } 


                switch (method) {
                case ILLINOIS:
                    f0 *= 0.5;
                    break;
                case PEGASUS:
                    f0 *= f1 / (f1 + fx);
                    break;
                case REGULA_FALSI:
                    if (x == x1) {

                        f0 = computeObjectiveValue(x0);
                    }
                    break;
                default:
                    throw new MathInternalError();
                } 

  




  public TiesStrategy getTiesStrategy()
  {
    return tiesStrategy;
  } 

  















  private void resolveTie(double[] ranks, List<Integer> tiesTrace)
  {
    double c = ranks[((Integer)tiesTrace.get(0)).intValue()];
    

    int length = tiesTrace.size();
    Iterator<Integer> iterator;
    long f; switch (1.$SwitchMap$org$apache$commons$math$stat$ranking$TiesStrategy[tiesStrategy.ordinal()]) {
    case 1: 
      fill(ranks, tiesTrace, (2.0D * c + length - 1.0D) / 2.0D);
      break;
    case 2: 
      fill(ranks, tiesTrace, c + length - 1.0D);
      break;
    case 3: 
      fill(ranks, tiesTrace, c);
      break;
    case 4: 
      iterator = tiesTrace.iterator();
      f = FastMath.round(c);
    case 5: default:  while (iterator.hasNext()) {
        ranks[((Integer)iterator.next()).intValue()] = randomData.nextLong(f, f + length - 1L); continue;
        




        iterator = tiesTrace.iterator();
        f = FastMath.round(c);
        int i = 0;
        while (iterator.hasNext()) {
          ranks[((Integer)iterator.next()).intValue()] = (f + i++); continue;
          


          throw new MathInternalError();
        }
      }
    }
    
  } 

            public double value(double t) {
              try {
                interpolator.setInterpolatedTime(t);
                return handler.g(t, interpolator.getInterpolatedState());
              } catch (DerivativeException e) {
                throw new EventState.EmbeddedDerivativeException(e);
              } catch (EventException e) {
                throw new EventState.EmbeddedEventException(e);
              }
            } 

        switch (allowedSolution) {
        case ANY_SIDE :
            Assert.assertTrue(yResult.abs().lessThan(functionValueAccuracy.multiply(2)));
            break;
        case LEFT_SIDE : {
            boolean increasing = f.value(xResult).add(absoluteAccuracy).greaterThan(yResult);
            Assert.assertTrue(increasing ? yResult.negativeOrNull() : yResult.positiveOrNull());
            break;
        }
        case RIGHT_SIDE : {
            boolean increasing = f.value(xResult).add(absoluteAccuracy).greaterThan(yResult);
            Assert.assertTrue(increasing ? yResult.positiveOrNull() : yResult.negativeOrNull());
            break;
        }
        case BELOW_SIDE :
            Assert.assertTrue(yResult.negativeOrNull());
            break;
        case ABOVE_SIDE :
            Assert.assertTrue(yResult.positiveOrNull());
            break;
        default :
            throw new MathInternalError(null);
        }