C = alg.addWeightedToNew(0.5, C, 0.5, alg.transposeToNew(C));
}
if (arg.hasCommand("subset"))
{
IIntArray S = intseq.loadIntSequence(arg.getArgument("subset"));
C = C.view(S.getArray(), S.getArray());
}
doubles.writeMatrixSparse(C, System.out);
}
if (arg.hasCommand("submatrix"))
{
IDoubleArray C = doublesNew.fromFile(arg.getArgument("submatrix", 0));
IIntArray S = intseq.loadIntSequence(arg.getArgument("submatrix", 1));
C = C.view(S.getArray(), S.getArray());
doubles.writeMatrixSparse(C, System.out);
}
if (arg.hasCommand("populousSet"))
{
IDoubleArray C = doublesNew.fromFile(arg.getArgument("populousSet", 0));
int n = C.rows();
double minCount = arg.getIntArgument("populousSet",1);
double minIn = arg.getIntArgument("populousSet",2);
double minOut = arg.getIntArgument("populousSet",3);
IDoubleArray counts = alg.rowSums(C);
IDoubleArray ins = alg.columnSums(C);
IDoubleArray outs = alg.rowSums(C);
for (int i=0; i<n; i++)
{
ins.set(i,i, ins.get(i,i)-C.get(i,i));
outs.set(i,i, outs.get(i,i)-C.get(i,i));
}
IIntArray iC = doubles.largeValueIndexes(counts, minCount);
IIntArray iI = doubles.largeValueIndexes(ins, minIn);
IIntArray iO = doubles.largeValueIndexes(outs, minOut);
IIntArray I = ints.intersectionToNew(ints.intersectionToNew(iC, iI), iO);
ints.print(I,"\n");
}
}