title: RealMatrix object in Java class
body: <p>It seems that I can`t use this Apache Commons Math library in my class because I get unexpected token on matrixSim when I try to use RealMatrix in my consructor like this:</p>
  
  <pre><code>class vecGenUn
  {
    double[][] prevMat;
    RealMatrix matrixSim;  //this is problematic
    int dataDim;
    int rowDim;
    double simVecMean;
    double simVecSD;
    double simVecUn;
    double sum;
  
    vecGenUn (double[][] tempPM)
    {
      prevMat = tempSM;
      matrixSim = new Array2DRowRealMatrix(prevMat);  //and possibly this
      dataDim = new int matrixSim.getColumnDimension();
      rowDim = new int matrixSim.getRowDimension();
      simVecMean = new double[dataDim];
      simVecSD = new double[dataDim];
      simVecUn = new double[dataDim];
      sum = new Sum();
    }
  
    public void vecGen()
    {
      for (int i = 0; i &lt; dataDim; i++)
      {
        simVecMean[i] = sum.evaluate(matrixSim.getColumn(i), 0, rowDim)/rowDim
      }
    }
  }
  </code></pre>
  
  <p>Now methods are yet to be implemented but how do I use RealMatrix data type here when I need it for all Appache math library methods but also I need to construct it from values (double array) supplied when creating this class instance.  </p>