use of com.tencent.angel.ml.math2.storage.IntIntDenseVectorStorage in project angel by Tencent.
the class RBLongIntMatrix method diag.
@Override
public Vector diag() {
int[] resArr = new int[rows.length];
for (int i = 0; i < rows.length; i++) {
if (null == rows[i]) {
resArr[i] = 0;
} else {
resArr[i] = rows[i].get(i);
}
}
IntIntDenseVectorStorage storage = new IntIntDenseVectorStorage(resArr);
return new IntIntVector(getMatrixId(), 0, getClock(), resArr.length, storage);
}
Aggregations