Package com.jmatio.types

Examples of com.jmatio.types.MLDouble


                    cell.set(cellmatrix, i);
                }
                mlArray = cell;
                break;
            case MLArray.mxDOUBLE_CLASS:
                mlArray = new MLDouble(name, dims, type, attributes);
                //read real
                tag = new ISMatTag(buf);
                tag.readToByteBuffer( ((MLNumericArray) mlArray).getRealByteBuffer(),
                                            (MLNumericArray) mlArray );
                //read complex
View Full Code Here


    if (absoluteFileName == false// save to the current working directory
        matFileName = Directory.Current().get().path()+File.separator+matFileName;

      //  varName - array name, valrValues - One-dimensional array of doubles, packed by columns (ala Fortran).
      int m = 1// Number of rows
      MLDouble  mlDouble = new MLDouble(varName, varValues, m);
      ArrayList<MLArray>  list = new ArrayList<MLArray>();
      list.add(mlDouble);
        try {
            MatFileWriter mfw = new MatFileWriter(matFileName, list);
        } catch (IOException ex) {
View Full Code Here

    if (absoluteFileName == false// save to the current working directory
        matFileName = Directory.Current().get().path()+File.separator+matFileName;

      //  varName - array name, valrValues - One-dimensional array of doubles, packed by columns (ala Fortran).
      int m = 1// Number of rows
      MLDouble  mlDouble = new MLDouble(varName, varValues);
      ArrayList<MLArray>  list = new ArrayList<MLArray>();
      list.add(mlDouble);
        try {
            MatFileWriter mfw = new MatFileWriter(matFileName, list);
        } catch (IOException ex) {
View Full Code Here

        MLArray  objArrayRetrived = mfr.getMLArray(currentVariable);
        if (objArrayRetrived instanceof  MLDouble) {
            // public MLArray getMLArray(String name)
        // Returns the value to which the read file maps the specified array name. Returns null if the file contains no content for this name.
// Returns: - the MLArray to which this file maps the specified name, or null if the file contains no content for this name.
         MLDouble mlArrayRetrived = (MLDouble)mfr.getMLArray(currentVariable);
         String arrayName = mlArrayRetrived.getName();
         int nrows  = mlArrayRetrived.getM();
         int ncols = mlArrayRetrived.getN();
         double [][] data  = mlArrayRetrived.getArray();   // get data
         scalaExec.Interpreter.GlobalValues.data = new double[nrows][ncols]// copy of data array
         for (int r=0; r < nrows; r++)
             for (int c=0; c< ncols; c++)
                  scalaExec.Interpreter.GlobalValues.data[r][c] = data[r][c];
         // keep a global reference in order to be accessible from the interpreter
View Full Code Here

  public void add(String name, float[][] data) {
    if (!MU.isMatrix(data)) {
      throw new IllegalArgumentException("Data must be a matrix (same number of columns in each row)");
    }
    name=makeVariableNameValid(name);
    MLDouble mld = new MLDouble(name, MU.convert(data));
    myData.put(name, mld);
  }
View Full Code Here

TOP

Related Classes of com.jmatio.types.MLDouble

Copyright © 2018 www.massapicom. 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.