Package java.io

Examples of java.io.DataInputStream.readFloat()


                        delegate.size++;
                    }
                    break;
                case 'f':
                    for (int i = 0; i < count; i++, index++) {
                        Array.setFloat(data, index, dis.readFloat());
                        delegate.size++;
                    }
                    break;
                case 'd':
                    for (int i = 0; i < count; i++, index++) {
View Full Code Here


        int nRows = stream.readInt();
        int nColumns = stream.readInt();
        float[][] data = new float[nRows][nColumns];
        for (int y = 0; y < nRows; ++y) {
            for (int x = 0; x < nColumns; ++x) {
                data[y][x] = stream.readFloat();
            }
        }
        return new VerticalDatum(lowerLeftLongitude, lowerLeftLatitude, deltaLatitude * nColumns, deltaLongitude * nRows, data);
    }

View Full Code Here

      content[i] = (byte) readByte();
    }
    byteIn =  new ByteArrayInputStream(content);
    dataIn = new DataInputStream(byteIn);
    try {
      result = dataIn.readFloat();
      dataIn.close();
    } catch (IOException e) {
      e.printStackTrace();
    }
   
View Full Code Here

    public static float toFloat(byte[] bytes) throws IOException {
        ByteArrayInputStream in = new ByteArrayInputStream(bytes);
        DataInputStream datas = new DataInputStream(in);
       
        try {
            return datas.readFloat();
        } finally {
            if ( datas != null ) datas.close();
        }
    }
   
View Full Code Here

      bis2 = new ByteArrayInputStream(bos.toByteArray());
      dis2 = new DataInputStream(bis2);
      bos.reset();
      float[] outsample = new float[numofloats];
      for(int i=0;i<numofloats;i++){
        outsample[i]=dis.readFloat()+dis2.readFloat();
        if(SampleOut.max < Math.abs(outsample[i])){
          SampleOut.max = Math.abs(outsample[i]);
        }
        dos.writeFloat(outsample[i]);
      }
View Full Code Here

   
    this.IterationComplete = in.readInt();
    this.CurrentIteration = in.readInt();
   
    this.TrainedRecords = in.readInt(); // d.writeInt(this.TrainedRecords);
    this.AvgLogLikelihood = in.readFloat(); // d.writeFloat(this.AvgLogLikelihood);
    this.PercentCorrect = in.readFloat(); // d.writeFloat(this.PercentCorrect);
   
    this.parameter_vector = MatrixWritable.readMatrix(in);
   
  }
View Full Code Here

    this.IterationComplete = in.readInt();
    this.CurrentIteration = in.readInt();
   
    this.TrainedRecords = in.readInt(); // d.writeInt(this.TrainedRecords);
    this.AvgLogLikelihood = in.readFloat(); // d.writeFloat(this.AvgLogLikelihood);
    this.PercentCorrect = in.readFloat(); // d.writeFloat(this.PercentCorrect);
   
    this.parameter_vector = MatrixWritable.readMatrix(in);
   
  }
 
View Full Code Here

      this.IterationComplete = in.readInt();
      this.CurrentIteration = in.readInt();
      this.batchTimeMS = in.readLong();
     
      this.TrainedRecords = in.readInt(); // d.writeInt(this.TrainedRecords);
      this.AvgError = in.readFloat(); // d.writeFloat(this.PercentCorrect);
     
      this.parameter_vector = MatrixWritable.readMatrix(in);
     
    }
   
View Full Code Here

        this.IterationComplete = in.readInt();
        this.CurrentIteration = in.readInt();
       
        this.TrainedRecords = in.readInt(); // d.writeInt(this.TrainedRecords);
        //this.AvgLogLikelihood = in.readFloat(); // d.writeFloat(this.AvgLogLikelihood);
        this.PercentCorrect = in.readFloat(); // d.writeFloat(this.PercentCorrect);
        this.RMSE = in.readDouble();

         ObjectInputStream oistream = null;

          try {
View Full Code Here

              break;
            }
            case TFormat.CF_FLOAT:
            {
              float[] d = new float[len];
              for (int k=0; k<len; k++) d[k] = dis.readFloat();
              dt = new TDataType(d);
              break;
            }
            case TFormat.CF_DOUBLE:
            {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.