Java Code Examples for org.apache.commons.math3.exception.util.LocalizedFormats#PROPAGATION_DIRECTION_MISMATCH

The following examples show how to use org.apache.commons.math3.exception.util.LocalizedFormats#PROPAGATION_DIRECTION_MISMATCH . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ContinuousOutputModel.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/** Append another model at the end of the instance.
 * @param model model to add at the end of the instance
 * @exception MathIllegalArgumentException if the model to append is not
 * compatible with the instance (dimension of the state vector,
 * propagation direction, hole between the dates)
 * @exception MaxCountExceededException if the number of functions evaluations is exceeded
 * during step finalization
 */
public void append(final ContinuousOutputModel model)
  throws MathIllegalArgumentException, MaxCountExceededException {

  if (model.steps.size() == 0) {
    return;
  }

  if (steps.size() == 0) {
    initialTime = model.initialTime;
    forward     = model.forward;
  } else {

    if (getInterpolatedState().length != model.getInterpolatedState().length) {
        throw new DimensionMismatchException(model.getInterpolatedState().length,
                                             getInterpolatedState().length);
    }

    if (forward ^ model.forward) {
        throw new MathIllegalArgumentException(LocalizedFormats.PROPAGATION_DIRECTION_MISMATCH);
    }

    final StepInterpolator lastInterpolator = steps.get(index);
    final double current  = lastInterpolator.getCurrentTime();
    final double previous = lastInterpolator.getPreviousTime();
    final double step = current - previous;
    final double gap = model.getInitialTime() - current;
    if (FastMath.abs(gap) > 1.0e-3 * FastMath.abs(step)) {
      throw new MathIllegalArgumentException(LocalizedFormats.HOLE_BETWEEN_MODELS_TIME_RANGES,
                                             FastMath.abs(gap));
    }

  }

  for (StepInterpolator interpolator : model.steps) {
    steps.add(interpolator.copy());
  }

  index = steps.size() - 1;
  finalTime = (steps.get(index)).getCurrentTime();

}
 
Example 2
Source File: ContinuousOutputModel.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/** Append another model at the end of the instance.
 * @param model model to add at the end of the instance
 * @exception MathIllegalArgumentException if the model to append is not
 * compatible with the instance (dimension of the state vector,
 * propagation direction, hole between the dates)
 * @exception MaxCountExceededException if the number of functions evaluations is exceeded
 * during step finalization
 */
public void append(final ContinuousOutputModel model)
  throws MathIllegalArgumentException, MaxCountExceededException {

  if (model.steps.size() == 0) {
    return;
  }

  if (steps.size() == 0) {
    initialTime = model.initialTime;
    forward     = model.forward;
  } else {

    if (getInterpolatedState().length != model.getInterpolatedState().length) {
        throw new DimensionMismatchException(model.getInterpolatedState().length,
                                             getInterpolatedState().length);
    }

    if (forward ^ model.forward) {
        throw new MathIllegalArgumentException(LocalizedFormats.PROPAGATION_DIRECTION_MISMATCH);
    }

    final StepInterpolator lastInterpolator = steps.get(index);
    final double current  = lastInterpolator.getCurrentTime();
    final double previous = lastInterpolator.getPreviousTime();
    final double step = current - previous;
    final double gap = model.getInitialTime() - current;
    if (FastMath.abs(gap) > 1.0e-3 * FastMath.abs(step)) {
      throw new MathIllegalArgumentException(LocalizedFormats.HOLE_BETWEEN_MODELS_TIME_RANGES,
                                             FastMath.abs(gap));
    }

  }

  for (StepInterpolator interpolator : model.steps) {
    steps.add(interpolator.copy());
  }

  index = steps.size() - 1;
  finalTime = (steps.get(index)).getCurrentTime();

}
 
Example 3
Source File: ContinuousOutputModel.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/** Append another model at the end of the instance.
 * @param model model to add at the end of the instance
 * @exception MathIllegalArgumentException if the model to append is not
 * compatible with the instance (dimension of the state vector,
 * propagation direction, hole between the dates)
 */
public void append(final ContinuousOutputModel model)
  throws MathIllegalArgumentException {

  if (model.steps.size() == 0) {
    return;
  }

  if (steps.size() == 0) {
    initialTime = model.initialTime;
    forward     = model.forward;
  } else {

    if (getInterpolatedState().length != model.getInterpolatedState().length) {
        throw new DimensionMismatchException(model.getInterpolatedState().length,
                                             getInterpolatedState().length);
    }

    if (forward ^ model.forward) {
        throw new MathIllegalArgumentException(LocalizedFormats.PROPAGATION_DIRECTION_MISMATCH);
    }

    final StepInterpolator lastInterpolator = steps.get(index);
    final double current  = lastInterpolator.getCurrentTime();
    final double previous = lastInterpolator.getPreviousTime();
    final double step = current - previous;
    final double gap = model.getInitialTime() - current;
    if (FastMath.abs(gap) > 1.0e-3 * FastMath.abs(step)) {
      throw new MathIllegalArgumentException(LocalizedFormats.HOLE_BETWEEN_MODELS_TIME_RANGES,
                                             FastMath.abs(gap));
    }

  }

  for (StepInterpolator interpolator : model.steps) {
    steps.add(interpolator.copy());
  }

  index = steps.size() - 1;
  finalTime = (steps.get(index)).getCurrentTime();

}
 
Example 4
Source File: ContinuousOutputModel.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/** Append another model at the end of the instance.
 * @param model model to add at the end of the instance
 * @exception MathIllegalArgumentException if the model to append is not
 * compatible with the instance (dimension of the state vector,
 * propagation direction, hole between the dates)
 * @exception MaxCountExceededException if the number of functions evaluations is exceeded
 * during step finalization
 */
public void append(final ContinuousOutputModel model)
  throws MathIllegalArgumentException, MaxCountExceededException {

  if (model.steps.size() == 0) {
    return;
  }

  if (steps.size() == 0) {
    initialTime = model.initialTime;
    forward     = model.forward;
  } else {

    if (getInterpolatedState().length != model.getInterpolatedState().length) {
        throw new DimensionMismatchException(model.getInterpolatedState().length,
                                             getInterpolatedState().length);
    }

    if (forward ^ model.forward) {
        throw new MathIllegalArgumentException(LocalizedFormats.PROPAGATION_DIRECTION_MISMATCH);
    }

    final StepInterpolator lastInterpolator = steps.get(index);
    final double current  = lastInterpolator.getCurrentTime();
    final double previous = lastInterpolator.getPreviousTime();
    final double step = current - previous;
    final double gap = model.getInitialTime() - current;
    if (FastMath.abs(gap) > 1.0e-3 * FastMath.abs(step)) {
      throw new MathIllegalArgumentException(LocalizedFormats.HOLE_BETWEEN_MODELS_TIME_RANGES,
                                             FastMath.abs(gap));
    }

  }

  for (StepInterpolator interpolator : model.steps) {
    steps.add(interpolator.copy());
  }

  index = steps.size() - 1;
  finalTime = (steps.get(index)).getCurrentTime();

}
 
Example 5
Source File: ContinuousOutputModel.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/** Append another model at the end of the instance.
 * @param model model to add at the end of the instance
 * @exception MathIllegalArgumentException if the model to append is not
 * compatible with the instance (dimension of the state vector,
 * propagation direction, hole between the dates)
 */
public void append(final ContinuousOutputModel model)
  throws MathIllegalArgumentException {

  if (model.steps.size() == 0) {
    return;
  }

  if (steps.size() == 0) {
    initialTime = model.initialTime;
    forward     = model.forward;
  } else {

    if (getInterpolatedState().length != model.getInterpolatedState().length) {
        throw new DimensionMismatchException(model.getInterpolatedState().length,
                                             getInterpolatedState().length);
    }

    if (forward ^ model.forward) {
        throw new MathIllegalArgumentException(LocalizedFormats.PROPAGATION_DIRECTION_MISMATCH);
    }

    final StepInterpolator lastInterpolator = steps.get(index);
    final double current  = lastInterpolator.getCurrentTime();
    final double previous = lastInterpolator.getPreviousTime();
    final double step = current - previous;
    final double gap = model.getInitialTime() - current;
    if (FastMath.abs(gap) > 1.0e-3 * FastMath.abs(step)) {
      throw new MathIllegalArgumentException(LocalizedFormats.HOLE_BETWEEN_MODELS_TIME_RANGES,
                                             FastMath.abs(gap));
    }

  }

  for (StepInterpolator interpolator : model.steps) {
    steps.add(interpolator.copy());
  }

  index = steps.size() - 1;
  finalTime = (steps.get(index)).getCurrentTime();

}
 
Example 6
Source File: ContinuousOutputModel.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/** Append another model at the end of the instance.
 * @param model model to add at the end of the instance
 * @exception MathIllegalArgumentException if the model to append is not
 * compatible with the instance (dimension of the state vector,
 * propagation direction, hole between the dates)
 * @exception MaxCountExceededException if the number of functions evaluations is exceeded
 * during step finalization
 */
public void append(final ContinuousOutputModel model)
  throws MathIllegalArgumentException, MaxCountExceededException {

  if (model.steps.size() == 0) {
    return;
  }

  if (steps.size() == 0) {
    initialTime = model.initialTime;
    forward     = model.forward;
  } else {

    if (getInterpolatedState().length != model.getInterpolatedState().length) {
        throw new DimensionMismatchException(model.getInterpolatedState().length,
                                             getInterpolatedState().length);
    }

    if (forward ^ model.forward) {
        throw new MathIllegalArgumentException(LocalizedFormats.PROPAGATION_DIRECTION_MISMATCH);
    }

    final StepInterpolator lastInterpolator = steps.get(index);
    final double current  = lastInterpolator.getCurrentTime();
    final double previous = lastInterpolator.getPreviousTime();
    final double step = current - previous;
    final double gap = model.getInitialTime() - current;
    if (FastMath.abs(gap) > 1.0e-3 * FastMath.abs(step)) {
      throw new MathIllegalArgumentException(LocalizedFormats.HOLE_BETWEEN_MODELS_TIME_RANGES,
                                             FastMath.abs(gap));
    }

  }

  for (StepInterpolator interpolator : model.steps) {
    steps.add(interpolator.copy());
  }

  index = steps.size() - 1;
  finalTime = (steps.get(index)).getCurrentTime();

}
 
Example 7
Source File: ContinuousOutputModel.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/** Append another model at the end of the instance.
 * @param model model to add at the end of the instance
 * @exception MathIllegalArgumentException if the model to append is not
 * compatible with the instance (dimension of the state vector,
 * propagation direction, hole between the dates)
 * @exception MaxCountExceededException if the number of functions evaluations is exceeded
 * during step finalization
 */
public void append(final ContinuousOutputModel model)
  throws MathIllegalArgumentException, MaxCountExceededException {

  if (model.steps.size() == 0) {
    return;
  }

  if (steps.size() == 0) {
    initialTime = model.initialTime;
    forward     = model.forward;
  } else {

    if (getInterpolatedState().length != model.getInterpolatedState().length) {
        throw new DimensionMismatchException(model.getInterpolatedState().length,
                                             getInterpolatedState().length);
    }

    if (forward ^ model.forward) {
        throw new MathIllegalArgumentException(LocalizedFormats.PROPAGATION_DIRECTION_MISMATCH);
    }

    final StepInterpolator lastInterpolator = steps.get(index);
    final double current  = lastInterpolator.getCurrentTime();
    final double previous = lastInterpolator.getPreviousTime();
    final double step = current - previous;
    final double gap = model.getInitialTime() - current;
    if (FastMath.abs(gap) > 1.0e-3 * FastMath.abs(step)) {
      throw new MathIllegalArgumentException(LocalizedFormats.HOLE_BETWEEN_MODELS_TIME_RANGES,
                                             FastMath.abs(gap));
    }

  }

  for (StepInterpolator interpolator : model.steps) {
    steps.add(interpolator.copy());
  }

  index = steps.size() - 1;
  finalTime = (steps.get(index)).getCurrentTime();

}
 
Example 8
Source File: ContinuousOutputModel.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/** Append another model at the end of the instance.
 * @param model model to add at the end of the instance
 * @exception MathIllegalArgumentException if the model to append is not
 * compatible with the instance (dimension of the state vector,
 * propagation direction, hole between the dates)
 * @exception MaxCountExceededException if the number of functions evaluations is exceeded
 * during step finalization
 */
public void append(final ContinuousOutputModel model)
  throws MathIllegalArgumentException, MaxCountExceededException {

  if (model.steps.size() == 0) {
    return;
  }

  if (steps.size() == 0) {
    initialTime = model.initialTime;
    forward     = model.forward;
  } else {

    if (getInterpolatedState().length != model.getInterpolatedState().length) {
        throw new DimensionMismatchException(model.getInterpolatedState().length,
                                             getInterpolatedState().length);
    }

    if (forward ^ model.forward) {
        throw new MathIllegalArgumentException(LocalizedFormats.PROPAGATION_DIRECTION_MISMATCH);
    }

    final StepInterpolator lastInterpolator = steps.get(index);
    final double current  = lastInterpolator.getCurrentTime();
    final double previous = lastInterpolator.getPreviousTime();
    final double step = current - previous;
    final double gap = model.getInitialTime() - current;
    if (FastMath.abs(gap) > 1.0e-3 * FastMath.abs(step)) {
      throw new MathIllegalArgumentException(LocalizedFormats.HOLE_BETWEEN_MODELS_TIME_RANGES,
                                             FastMath.abs(gap));
    }

  }

  for (StepInterpolator interpolator : model.steps) {
    steps.add(interpolator.copy());
  }

  index = steps.size() - 1;
  finalTime = (steps.get(index)).getCurrentTime();

}