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:
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 < dataDim; i++)
{
simVecMean[i] = sum.evaluate(matrixSim.getColumn(i), 0, rowDim)/rowDim
}
}
}
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.
In the code provided, you have all sorts of compiler errors unrelated to Apache Commons Math. Fix those before trying to determine if you have problems with that library.
Correction comments are in-line marked with (*):