User`s guide
Matrix Math Example
result = theFactor.cholesky(1, a);
System.out.println("Cholesky factorization:");
System.out.println(result[0]);
MWArray.disposeArray(result);
/* Compute LU factorization and print results. */
result = theFactor.ludecomp(2, a);
System.out.println("LU factorization:");
System.out.println("L matrix:");
System.out.println(result[0]);
System.out.println("U matrix:");
System.out.println(result[1]);
MWArray.disposeArray(result);
/* Compute QR factorization and print results. */
result = theFactor.qrdecomp(2, a);
System.out.println("QR factorization:");
System.out.println("Q matrix:");
System.out.println(result[0]);
System.out.println("R matrix:");
System.out.println(result[1]);
}
catch (Exception e)
{
System.out.println("Exception:"+e.toString());
}
finally
{
/* Free native resources */
MWArray.disposeArray(a);
MWArray.disposeArray(result);
if (theFactor != null)
theFactor.dispose();
}
}
}
The statementtheFactor = new factor();
5-21