下面列出了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]);
}
}
}
/** {@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]);
}
}
}
@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]);
}
}
/** {@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]);
}
}
}
/** {@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 {
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 {
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);
}
/** 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]);
}
}
}
/** {@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
}
/** 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]);
}
}
/** {@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);
}
/**
* {@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);
}
/** {@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
}
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);
}
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);
}
/** 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]);
}
}
public void writeExternal(ObjectOutput out) throws IOException {
out.writeDouble(angle);
out.writeDouble(x);
out.writeDouble(y);
out.writeDouble(z);
}
public void writeExternal(ObjectOutput out) throws IOException {
out.writeDouble(x);
out.writeDouble(y);
out.writeDouble(r);
}