use of com.tencent.angel.ml.math2.storage.Storage in project angel by Tencent.
the class RBCompIntIntMatrix method initEmpty.
@Override
public void initEmpty(int idx) {
int numComp = (int) ((getDim() + subDim - 1) / subDim);
if (null == rows[idx]) {
IntIntVector[] tmpParts = new IntIntVector[numComp];
for (int i = 0; i < numComp; i++) {
IntIntSparseVectorStorage storage = new IntIntSparseVectorStorage(subDim);
tmpParts[i] = new IntIntVector(matrixId, idx, clock, (int) getDim(), storage);
}
CompIntIntVector tmpVect = new CompIntIntVector(matrixId, idx, clock, (int) getDim(), tmpParts, subDim);
rows[idx] = tmpVect;
}
}
use of com.tencent.angel.ml.math2.storage.Storage in project angel by Tencent.
the class RBCompLongIntMatrix method initEmpty.
@Override
public void initEmpty(int idx) {
int numComp = (int) ((getDim() + subDim - 1) / subDim);
if (null == rows[idx]) {
LongIntVector[] tmpParts = new LongIntVector[numComp];
for (int i = 0; i < numComp; i++) {
LongIntSparseVectorStorage storage = new LongIntSparseVectorStorage(subDim);
tmpParts[i] = new LongIntVector(matrixId, idx, clock, (long) getDim(), storage);
}
CompLongIntVector tmpVect = new CompLongIntVector(matrixId, idx, clock, (long) getDim(), tmpParts, subDim);
rows[idx] = tmpVect;
}
}
use of com.tencent.angel.ml.math2.storage.Storage in project angel by Tencent.
the class RBIntDoubleMatrix method initEmpty.
@Override
public void initEmpty(int idx) {
if (null == rows[idx]) {
IntDoubleSparseVectorStorage storage = new IntDoubleSparseVectorStorage((int) getDim());
rows[idx] = new IntDoubleVector(matrixId, idx, clock, (int) getDim(), storage);
}
}
use of com.tencent.angel.ml.math2.storage.Storage in project angel by Tencent.
the class RBLongFloatMatrix method dot.
@Override
public Vector dot(Vector other) {
float[] resArr = new float[rows.length];
for (int i = 0; i < rows.length; i++) {
resArr[i] = (float) rows[i].dot(other);
}
IntFloatDenseVectorStorage storage = new IntFloatDenseVectorStorage(resArr);
return new IntFloatVector(matrixId, 0, clock, rows.length, storage);
}
use of com.tencent.angel.ml.math2.storage.Storage in project angel by Tencent.
the class RBLongLongMatrix method initEmpty.
@Override
public void initEmpty(int idx) {
if (null == rows[idx]) {
LongLongSparseVectorStorage storage = new LongLongSparseVectorStorage((long) getDim());
rows[idx] = new LongLongVector(matrixId, idx, clock, (long) getDim(), storage);
}
}
Aggregations