java.io.ObjectOutput#writeDouble ( )源码实例Demo

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

/** {@inheritDoc} */
@Override
public void writeExternal(final ObjectOutput out)
  throws IOException {

  final int dimension = (currentState == null) ? -1 : currentState.length;

  // save the state of the base class
  writeBaseExternal(out);

  // save the local attributes (but not the temporary vectors)
  out.writeInt(currentDegree);
  for (int k = 0; k <= currentDegree; ++k) {
    for (int l = 0; l < dimension; ++l) {
      out.writeDouble(polynoms[k][l]);
    }
  }

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

  try {
    // save the local attributes
    finalizeStep();
  } catch (DerivativeException e) {
    throw MathRuntimeException.createIOException(e);
  }
  final int dimension = (currentState == null) ? -1 : currentState.length;
  out.writeInt(dimension);
  for (int i = 0; i < dimension; ++i) {
    out.writeDouble(yDotKLast[0][i]);
    out.writeDouble(yDotKLast[1][i]);
    out.writeDouble(yDotKLast[2][i]);
  }

  // save the state of the base class
  super.writeExternal(out);

}
 
/** {@inheritDoc} */
@Override
public void writeExternal(final ObjectOutput out)
  throws IOException {

  final int dimension = (currentState == null) ? -1 : currentState.length;

  // save the state of the base class
  writeBaseExternal(out);

  // save the local attributes (but not the temporary vectors)
  out.writeInt(currentDegree);
  for (int k = 0; k <= currentDegree; ++k) {
    for (int l = 0; l < dimension; ++l) {
      out.writeDouble(polynoms[k][l]);
    }
  }

}
 
源代码4 项目: hlta   文件: CRSMatrix.java
@Override
public void writeExternal(ObjectOutput out) throws IOException {

    out.writeInt(rows);
    out.writeInt(columns);
    out.writeInt(cardinality);

    // write pairs (value, column index)
    for (int i = 0; i < cardinality; i++) {
        out.writeDouble(values[i]);
        out.writeInt(columnIndices[i]);
    }

    // write row pointers
    for (int i = 0; i < rows + 1; i++) {
        out.writeInt(rowPointers[i]);
    }
}
 
源代码5 项目: astor   文件: RungeKuttaStepInterpolator.java
/** {@inheritDoc} */
@Override
public void writeExternal(final ObjectOutput out)
  throws IOException {

  // save the state of the base class
  writeBaseExternal(out);

  // save the local attributes
  final int n = (currentState == null) ? -1 : currentState.length;
  for (int i = 0; i < n; ++i) {
    out.writeDouble(previousState[i]);
  }

  final int kMax = (yDotK == null) ? -1 : yDotK.length;
  out.writeInt(kMax);
  for (int k = 0; k < kMax; ++k) {
    for (int i = 0; i < n; ++i) {
      out.writeDouble(yDotK[k][i]);
    }
  }

  // we do not save any reference to the equations

}
 
/** {@inheritDoc} */
@Override
public void writeExternal(final ObjectOutput out)
  throws IOException {

  final int dimension = (currentState == null) ? -1 : currentState.length;

  // save the state of the base class
  writeBaseExternal(out);

  // save the local attributes (but not the temporary vectors)
  out.writeInt(currentDegree);
  for (int k = 0; k <= currentDegree; ++k) {
    for (int l = 0; l < dimension; ++l) {
      out.writeDouble(polynoms[k][l]);
    }
  }

}
 
源代码7 项目: astor   文件: RungeKuttaStepInterpolator.java
/** {@inheritDoc} */
@Override
public void writeExternal(final ObjectOutput out)
  throws IOException {

  // save the state of the base class
  writeBaseExternal(out);

  // save the local attributes
  final int n = (currentState == null) ? -1 : currentState.length;
  for (int i = 0; i < n; ++i) {
    out.writeDouble(previousState[i]);
  }

  final int kMax = (yDotK == null) ? -1 : yDotK.length;
  out.writeInt(kMax);
  for (int k = 0; k < kMax; ++k) {
    for (int i = 0; i < n; ++i) {
      out.writeDouble(yDotK[k][i]);
    }
  }

  // we do not save any reference to the equations

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

  try {
    // save the local attributes
    finalizeStep();
  } catch (DerivativeException e) {
    throw MathRuntimeException.createIOException(e);
  }
  final int dimension = (currentState == null) ? -1 : currentState.length;
  out.writeInt(dimension);
  for (int i = 0; i < dimension; ++i) {
    out.writeDouble(yDotKLast[0][i]);
    out.writeDouble(yDotKLast[1][i]);
    out.writeDouble(yDotKLast[2][i]);
  }

  // save the state of the base class
  super.writeExternal(out);

}
 
源代码9 项目: astor   文件: DormandPrince853StepInterpolator.java
/** {@inheritDoc} */
@Override
public void writeExternal(final ObjectOutput out)
  throws IOException {

  try {
    // save the local attributes
    finalizeStep();
  } catch (MathUserException e) {
      IOException ioe = new IOException(e.getLocalizedMessage());
      ioe.initCause(e);
      throw ioe;
  }
  final int dimension = (currentState == null) ? -1 : currentState.length;
  out.writeInt(dimension);
  for (int i = 0; i < dimension; ++i) {
    out.writeDouble(yDotKLast[0][i]);
    out.writeDouble(yDotKLast[1][i]);
    out.writeDouble(yDotKLast[2][i]);
  }

  // save the state of the base class
  super.writeExternal(out);

}
 
源代码10 项目: astor   文件: DummyStepInterpolator.java
/** Write the instance to an output channel.
 * @param out output channel
 * @exception IOException if the instance cannot be written
 */
@Override
public void writeExternal(final ObjectOutput out)
  throws IOException {

    // save the state of the base class
  writeBaseExternal(out);

  if (currentDerivative != null) {
      for (int i = 0; i < currentDerivative.length; ++i) {
          out.writeDouble(currentDerivative[i]);
      }
  }

}
 
源代码11 项目: astor   文件: NordsieckStepInterpolator.java
/** {@inheritDoc} */
@Override
public void writeExternal(final ObjectOutput out)
    throws IOException {

    // save the state of the base class
    writeBaseExternal(out);

    // save the local attributes
    out.writeDouble(scalingH);
    out.writeDouble(referenceTime);

    final int n = (currentState == null) ? -1 : currentState.length;
    if (scaled == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        for (int j = 0; j < n; ++j) {
            out.writeDouble(scaled[j]);
        }
    }

    if (nordsieck == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        out.writeObject(nordsieck);
    }

    // we don't save state variation, it will be recomputed

}
 
源代码12 项目: astor   文件: FirstOrderIntegratorWithJacobians.java
/** Write an array.
 * @param out output stream
 * @param array array to write
 * @exception IOException if array cannot be read
 */
private static void writeArray(final ObjectOutput out, final double[] array)
    throws IOException {
    for (int i = 0; i < array.length; ++i) {
        out.writeDouble(array[i]);
    }
}
 
源代码13 项目: ignite   文件: VisorQueryDetailMetrics.java
/** {@inheritDoc} */
@Override protected void writeExternalData(ObjectOutput out) throws IOException {
    U.writeString(out, qryType);
    U.writeString(out, qry);
    U.writeString(out, cache);
    out.writeInt(execs);
    out.writeInt(completions);
    out.writeInt(failures);
    out.writeLong(minTime);
    out.writeLong(maxTime);
    out.writeDouble(avgTime);
    out.writeLong(totalTime);
    out.writeLong(lastStartTime);
}
 
源代码14 项目: blip   文件: TIntDoubleHash.java
/**
 * {@inheritDoc}
 */
public void writeExternal(ObjectOutput out) throws IOException {
    // VERSION
    out.writeByte(0);

    // SUPER
    super.writeExternal(out);

    // NO_ENTRY_KEY
    out.writeInt(no_entry_key);

    // NO_ENTRY_VALUE
    out.writeDouble(no_entry_value);
}
 
源代码15 项目: astor   文件: NordsieckStepInterpolator.java
/** {@inheritDoc} */
@Override
public void writeExternal(final ObjectOutput out)
    throws IOException {

    // save the state of the base class
    writeBaseExternal(out);

    // save the local attributes
    out.writeDouble(scalingH);
    out.writeDouble(referenceTime);

    final int n = (currentState == null) ? -1 : currentState.length;
    if (scaled == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        for (int j = 0; j < n; ++j) {
            out.writeDouble(scaled[j]);
        }
    }

    if (nordsieck == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        out.writeObject(nordsieck);
    }

    // we don't save state variation, it will be recomputed

}
 
源代码16 项目: jdk8u60   文件: ExternObjTrees.java
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeBoolean(z);
    out.writeByte(b);
    out.writeChar(c);
    out.writeShort(s);
    out.writeInt(i);
    out.writeFloat(f);
    out.writeLong(j);
    out.writeDouble(d);
    out.writeObject(str);
    out.writeObject(parent);
    out.writeObject(left);
    out.writeObject(right);
}
 
源代码17 项目: openjdk-jdk8u-backup   文件: ExternObjTrees.java
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeBoolean(z);
    out.writeByte(b);
    out.writeChar(c);
    out.writeShort(s);
    out.writeInt(i);
    out.writeFloat(f);
    out.writeLong(j);
    out.writeDouble(d);
    out.writeObject(str);
    out.writeObject(parent);
    out.writeObject(left);
    out.writeObject(right);
}
 
源代码18 项目: astor   文件: FirstOrderIntegratorWithJacobians.java
/** Write an array.
 * @param out output stream
 * @param array array to write
 * @exception IOException if array cannot be read
 */
private static void writeArray(final ObjectOutput out, final double[] array)
    throws IOException {
    for (int i = 0; i < array.length; ++i) {
        out.writeDouble(array[i]);
    }
}
 
源代码19 项目: JOML   文件: AxisAngle4d.java
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeDouble(angle);
    out.writeDouble(x);
    out.writeDouble(y);
    out.writeDouble(z);
}
 
源代码20 项目: JOML   文件: Circled.java
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeDouble(x);
    out.writeDouble(y);
    out.writeDouble(r);
}