java.io.ObjectInput#readDouble ( )源码实例Demo

下面列出了java.io.ObjectInput#readDouble ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: astor   文件: DummyStepInterpolator.java
/** Read the instance from an input channel.
 * @param in input channel
 * @exception IOException if the instance cannot be read
 */
@Override
public void readExternal(final ObjectInput in)
  throws IOException, ClassNotFoundException {

  // read the base class
  final double t = readBaseExternal(in);

  if (currentState == null) {
      currentDerivative = null;
  } else {
      currentDerivative  = new double[currentState.length];
      for (int i = 0; i < currentDerivative.length; ++i) {
          currentDerivative[i] = in.readDouble();
      }
  }

  // we can now set the interpolated time and state
  setInterpolatedTime(t);

}
 
源代码2 项目: astor   文件: DormandPrince853StepInterpolator.java
/** {@inheritDoc} */
@Override
public void readExternal(final ObjectInput in)
  throws IOException {

  // read the local attributes
  yDotKLast = new double[3][];
  final int dimension = in.readInt();
  yDotKLast[0] = (dimension < 0) ? null : new double[dimension];
  yDotKLast[1] = (dimension < 0) ? null : new double[dimension];
  yDotKLast[2] = (dimension < 0) ? null : new double[dimension];

  for (int i = 0; i < dimension; ++i) {
    yDotKLast[0][i] = in.readDouble();
    yDotKLast[1][i] = in.readDouble();
    yDotKLast[2][i] = in.readDouble();
  }

  // read the base state
  super.readExternal(in);

}
 
源代码3 项目: astor   文件: DormandPrince853StepInterpolator.java
/** {@inheritDoc} */
@Override
public void readExternal(final ObjectInput in)
  throws IOException {

  // read the local attributes
  yDotKLast = new double[3][];
  final int dimension = in.readInt();
  yDotKLast[0] = (dimension < 0) ? null : new double[dimension];
  yDotKLast[1] = (dimension < 0) ? null : new double[dimension];
  yDotKLast[2] = (dimension < 0) ? null : new double[dimension];

  for (int i = 0; i < dimension; ++i) {
    yDotKLast[0][i] = in.readDouble();
    yDotKLast[1][i] = in.readDouble();
    yDotKLast[2][i] = in.readDouble();
  }

  // read the base state
  super.readExternal(in);

}
 
/** {@inheritDoc} */
@Override
public void readExternal(final ObjectInput in)
  throws IOException {

  // read the base class
  final double t = readBaseExternal(in);
  final int dimension = (currentState == null) ? -1 : currentState.length;

  // read the local attributes
  final int degree = in.readInt();
  resetTables(degree);
  currentDegree = degree;

  for (int k = 0; k <= currentDegree; ++k) {
    for (int l = 0; l < dimension; ++l) {
      polynoms[k][l] = in.readDouble();
    }
  }

  // we can now set the interpolated time and state
  setInterpolatedTime(t);

}
 
/** {@inheritDoc} */
@Override
public void readExternal(final ObjectInput in)
  throws IOException {

  // read the base class
  final double t = readBaseExternal(in);
  final int dimension = (currentState == null) ? -1 : currentState.length;

  // read the local attributes
  final int degree = in.readInt();
  resetTables(degree);
  currentDegree = degree;

  for (int k = 0; k <= currentDegree; ++k) {
    for (int l = 0; l < dimension; ++l) {
      polynoms[k][l] = in.readDouble();
    }
  }

  // we can now set the interpolated time and state
  setInterpolatedTime(t);

}
 
源代码6 项目: astor   文件: DormandPrince853StepInterpolator.java
/** {@inheritDoc} */
@Override
public void readExternal(final ObjectInput in)
  throws IOException {

  // read the local attributes
  yDotKLast = new double[3][];
  final int dimension = in.readInt();
  yDotKLast[0] = (dimension < 0) ? null : new double[dimension];
  yDotKLast[1] = (dimension < 0) ? null : new double[dimension];
  yDotKLast[2] = (dimension < 0) ? null : new double[dimension];

  for (int i = 0; i < dimension; ++i) {
    yDotKLast[0][i] = in.readDouble();
    yDotKLast[1][i] = in.readDouble();
    yDotKLast[2][i] = in.readDouble();
  }

  // read the base state
  super.readExternal(in);

}
 
源代码7 项目: astor   文件: DummyStepInterpolator.java
/** Read the instance from an input channel.
 * @param in input channel
 * @exception IOException if the instance cannot be read
 */
@Override
public void readExternal(final ObjectInput in)
  throws IOException, ClassNotFoundException {

  // read the base class
  final double t = readBaseExternal(in);

  if (currentState == null) {
      currentDerivative = null;
  } else {
      currentDerivative  = new double[currentState.length];
      for (int i = 0; i < currentDerivative.length; ++i) {
          currentDerivative[i] = in.readDouble();
      }
  }

  // we can now set the interpolated time and state
  setInterpolatedTime(t);

}
 
源代码8 项目: astor   文件: DormandPrince853StepInterpolator.java
/** {@inheritDoc} */
@Override
public void readExternal(final ObjectInput in)
  throws IOException {

  // read the local attributes
  yDotKLast = new double[3][];
  final int dimension = in.readInt();
  yDotKLast[0] = (dimension < 0) ? null : new double[dimension];
  yDotKLast[1] = (dimension < 0) ? null : new double[dimension];
  yDotKLast[2] = (dimension < 0) ? null : new double[dimension];

  for (int i = 0; i < dimension; ++i) {
    yDotKLast[0][i] = in.readDouble();
    yDotKLast[1][i] = in.readDouble();
    yDotKLast[2][i] = in.readDouble();
  }

  // read the base state
  super.readExternal(in);

}
 
源代码9 项目: astor   文件: NordsieckStepInterpolator.java
/** {@inheritDoc} */
@Override
public void readExternal(final ObjectInput in)
    throws IOException, ClassNotFoundException {

    // read the base class
    final double t = readBaseExternal(in);

    // read the local attributes
    scalingH      = in.readDouble();
    referenceTime = in.readDouble();

    final int n = (currentState == null) ? -1 : currentState.length;
    final boolean hasScaled = in.readBoolean();
    if (hasScaled) {
        scaled = new double[n];
        for (int j = 0; j < n; ++j) {
            scaled[j] = in.readDouble();
        }
    } else {
        scaled = null;
    }

    final boolean hasNordsieck = in.readBoolean();
    if (hasNordsieck) {
        nordsieck = (Array2DRowRealMatrix) in.readObject();
    } else {
        nordsieck = null;
    }

    if (hasScaled && hasNordsieck) {
        // we can now set the interpolated time and state
        stateVariation = new double[n];
        setInterpolatedTime(t);
    } else {
        stateVariation = null;
    }

}
 
源代码10 项目: hlta   文件: BasicVector.java
@Override
public void readExternal(ObjectInput in) throws IOException,
        ClassNotFoundException {

    length = in.readInt();

    self = new double[length];

    for (int i = 0; i < length; i++) {
        self[i] = in.readDouble();
    }
}
 
源代码11 项目: astor   文件: RungeKuttaStepInterpolator.java
/** {@inheritDoc} */
@Override
public void readExternal(final ObjectInput in)
  throws IOException {

  // read the base class 
  final double t = readBaseExternal(in);

  // read the local attributes
  final int n = (currentState == null) ? -1 : currentState.length;
  final int kMax = in.readInt();
  yDotK = (kMax < 0) ? null : new double[kMax][];
  for (int k = 0; k < kMax; ++k) {
    yDotK[k] = (n < 0) ? null : new double[n];
    for (int i = 0; i < n; ++i) {
      yDotK[k][i] = in.readDouble();
    }
  }

  integrator = null;

  if (currentState != null) {
      // we can now set the interpolated time and state
      setInterpolatedTime(t);
  } else {
      interpolatedTime = t;
  }

}
 
源代码12 项目: astor   文件: RungeKuttaStepInterpolator.java
/** {@inheritDoc} */
@Override
public void readExternal(final ObjectInput in)
  throws IOException, ClassNotFoundException {

  // read the base class
  final double t = readBaseExternal(in);

  // read the local attributes
  final int n = (currentState == null) ? -1 : currentState.length;
  if (n < 0) {
    previousState = null;
  } else {
    previousState = new double[n];
    for (int i = 0; i < n; ++i) {
      previousState[i] = in.readDouble();
    }
  }

  final int kMax = in.readInt();
  yDotK = (kMax < 0) ? null : new double[kMax][];
  for (int k = 0; k < kMax; ++k) {
    yDotK[k] = (n < 0) ? null : new double[n];
    for (int i = 0; i < n; ++i) {
      yDotK[k][i] = in.readDouble();
    }
  }

  integrator = null;

  if (currentState != null) {
      // we can now set the interpolated time and state
      setInterpolatedTime(t);
  } else {
      interpolatedTime = t;
  }

}
 
源代码13 项目: astor   文件: NordsieckStepInterpolator.java
/** {@inheritDoc} */
@Override
public void readExternal(final ObjectInput in)
    throws IOException, ClassNotFoundException {

    // read the base class
    final double t = readBaseExternal(in);

    // read the local attributes
    scalingH      = in.readDouble();
    referenceTime = in.readDouble();

    final int n = (currentState == null) ? -1 : currentState.length;
    final boolean hasScaled = in.readBoolean();
    if (hasScaled) {
        scaled = new double[n];
        for (int j = 0; j < n; ++j) {
            scaled[j] = in.readDouble();
        }
    } else {
        scaled = null;
    }

    final boolean hasNordsieck = in.readBoolean();
    if (hasNordsieck) {
        nordsieck = (Array2DRowRealMatrix) in.readObject();
    } else {
        nordsieck = null;
    }

    if (hasScaled && hasNordsieck) {
        // we can now set the interpolated time and state
        stateVariation = new double[n];
        setInterpolatedTime(t);
    } else {
        stateVariation = null;
    }

}
 
源代码14 项目: JOML   文件: Rayd.java
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    oX = in.readDouble();
    oY = in.readDouble();
    oZ = in.readDouble();
    dX = in.readDouble();
    dY = in.readDouble();
    dZ = in.readDouble();
}
 
源代码15 项目: JOML   文件: Quaterniond.java
public void readExternal(ObjectInput in) throws IOException,
        ClassNotFoundException {
    x = in.readDouble();
    y = in.readDouble();
    z = in.readDouble();
    w = in.readDouble();
}
 
源代码16 项目: astor   文件: NordsieckStepInterpolator.java
/** {@inheritDoc} */
@Override
public void readExternal(final ObjectInput in)
    throws IOException, ClassNotFoundException {

    // read the base class
    final double t = readBaseExternal(in);

    // read the local attributes
    scalingH      = in.readDouble();
    referenceTime = in.readDouble();

    final int n = (currentState == null) ? -1 : currentState.length;
    final boolean hasScaled = in.readBoolean();
    if (hasScaled) {
        scaled = new double[n];
        for (int j = 0; j < n; ++j) {
            scaled[j] = in.readDouble();
        }
    } else {
        scaled = null;
    }

    final boolean hasNordsieck = in.readBoolean();
    if (hasNordsieck) {
        nordsieck = (Array2DRowRealMatrix) in.readObject();
    } else {
        nordsieck = null;
    }

    if (hasScaled && hasNordsieck) {
        // we can now set the interpolated time and state
        stateVariation = new double[n];
        setInterpolatedTime(t);
    } else {
        stateVariation = null;
    }

}
 
源代码17 项目: astor   文件: AbstractStepInterpolator.java
/** Read the base state of the instance.
 * This method does <strong>neither</strong> set the interpolated
 * time nor state. It is up to the derived class to reset it
 * properly calling the {@link #setInterpolatedTime} method later,
 * once all rest of the object state has been set up properly.
 * @param in stream where to read the state from
 * @return interpolated time be set later by the caller
 * @exception IOException in case of read error
 */
protected double readBaseExternal(final ObjectInput in)
  throws IOException {

  final int dimension = in.readInt();
  globalPreviousTime  = in.readDouble();
  globalCurrentTime   = in.readDouble();
  softPreviousTime    = in.readDouble();
  softCurrentTime     = in.readDouble();
  h                   = in.readDouble();
  forward             = in.readBoolean();
  dirtyState          = true;

  if (dimension < 0) {
      currentState = null;
  } else {
      currentState  = new double[dimension];
      for (int i = 0; i < currentState.length; ++i) {
          currentState[i] = in.readDouble();
      }
  }

  // we do NOT handle the interpolated time and state here
  interpolatedTime        = Double.NaN;
  interpolatedState       = (dimension < 0) ? null : new double[dimension];
  interpolatedDerivatives = (dimension < 0) ? null : new double[dimension];

  finalized = true;

  return in.readDouble();

}
 
源代码18 项目: ignite   文件: GridClientNodeMetricsBean.java
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    lastUpdateTime = in.readLong();
    maxActiveJobs = in.readInt();
    curActiveJobs = in.readInt();
    avgActiveJobs = in.readFloat();
    maxWaitingJobs = in.readInt();
    curWaitingJobs = in.readInt();
    avgWaitingJobs = in.readFloat();
    maxRejectedJobs = in.readInt();
    curRejectedJobs = in.readInt();
    avgRejectedJobs = in.readFloat();
    maxCancelledJobs = in.readInt();
    curCancelledJobs = in.readInt();
    avgCancelledJobs = in.readFloat();
    totalRejectedJobs = in.readInt();
    totalCancelledJobs = in.readInt();
    totalExecutedJobs = in.readInt();
    maxJobWaitTime = in.readLong();
    curJobWaitTime = in.readLong();
    avgJobWaitTime = in.readDouble();
    maxJobExecTime = in.readLong();
    curJobExecTime = in.readLong();
    avgJobExecTime = in.readDouble();
    totalExecTasks = in.readInt();
    totalIdleTime = in.readLong();
    curIdleTime = in.readLong();
    availProcs = in.readInt();
    load = in.readDouble();
    avgLoad = in.readDouble();
    gcLoad = in.readDouble();
    heapInit = in.readLong();
    heapUsed = in.readLong();
    heapCommitted = in.readLong();
    heapMax = in.readLong();
    nonHeapInit = in.readLong();
    nonHeapUsed = in.readLong();
    nonHeapCommitted = in.readLong();
    nonHeapMax = in.readLong();
    upTime = in.readLong();
    startTime = in.readLong();
    nodeStartTime = in.readLong();
    threadCnt = in.readInt();
    peakThreadCnt = in.readInt();
    startedThreadCnt = in.readLong();
    daemonThreadCnt = in.readInt();
    fileSysFreeSpace = in.readLong();
    fileSysTotalSpace = in.readLong();
    fileSysUsableSpace = in.readLong();
    lastDataVer = in.readLong();
    sentMsgsCnt = in.readInt();
    sentBytesCnt = in.readLong();
    rcvdMsgsCnt = in.readInt();
    rcvdBytesCnt = in.readLong();
}
 
源代码19 项目: JOML   文件: Vector3d.java
public void readExternal(ObjectInput in) throws IOException,
        ClassNotFoundException {
    x = in.readDouble();
    y = in.readDouble();
    z = in.readDouble();
}
 
源代码20 项目: JOML   文件: Matrix2d.java
public void readExternal(ObjectInput in) throws IOException {
    m00 = in.readDouble();
    m01 = in.readDouble();
    m10 = in.readDouble();
    m11 = in.readDouble();
}