}
Arguments arg = new Arguments(args);
if (arg.hasCommand("sparse2dense"))
{
IDoubleArray T = doublesNew.fromFile(arg.getArgument("sparse2dense"));
doubles.writeMatrixDense(T, System.out);
}
if (arg.hasCommand("dense2sparse"))
{
IDoubleArray T = doublesNew.fromFile(arg.getArgument("dense2sparse"));
doubles.writeMatrixSparse(T, System.out);
}
if (arg.hasCommand("eigenvalues"))
{
IDoubleArray T = doublesNew.fromFile(arg.getArgument("eigenvalues"));
IEigenvalueDecomposition evd = alg.evd(T);
if (arg.hasCommand("norm"))
{
doubles.print(evd.getEvalNorm(), "\n");
}
else if (arg.hasCommand("complex"))
{
IComplexArray eval = evd.getEval();
for (int i=0; i<eval.size(); i++)
System.out.println(eval.getRe(i)+" + "+eval.getIm(i)+"i");
}
else
{
doubles.print(evd.getEvalRe(), "\n");
}
}
if (arg.hasCommand("eigenvectors"))
{
IDoubleArray T = doublesNew.fromFile(arg.getArgument("eigenvectors"));
if (arg.hasCommand("left"))
alg.transpose(T);
int n = arg.getIntArgument("eigenvectors", 1);
IDoubleArray EV = alg.evd(T).R();
EV = EV.viewBlock(0, EV.rows(), 0, n);
doubles.print(EV, " ", "\n");
}
}