Search in sources :

Example 1 with Storage

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;
    }
}
Also used : IntIntSparseVectorStorage(com.tencent.angel.ml.math2.storage.IntIntSparseVectorStorage) IntIntVector(com.tencent.angel.ml.math2.vector.IntIntVector) CompIntIntVector(com.tencent.angel.ml.math2.vector.CompIntIntVector) CompIntIntVector(com.tencent.angel.ml.math2.vector.CompIntIntVector)

Example 2 with Storage

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;
    }
}
Also used : LongIntVector(com.tencent.angel.ml.math2.vector.LongIntVector) CompLongIntVector(com.tencent.angel.ml.math2.vector.CompLongIntVector) CompLongIntVector(com.tencent.angel.ml.math2.vector.CompLongIntVector) LongIntSparseVectorStorage(com.tencent.angel.ml.math2.storage.LongIntSparseVectorStorage)

Example 3 with Storage

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);
    }
}
Also used : IntDoubleSparseVectorStorage(com.tencent.angel.ml.math2.storage.IntDoubleSparseVectorStorage) IntDoubleVector(com.tencent.angel.ml.math2.vector.IntDoubleVector)

Example 4 with 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);
}
Also used : IntFloatDenseVectorStorage(com.tencent.angel.ml.math2.storage.IntFloatDenseVectorStorage) IntFloatVector(com.tencent.angel.ml.math2.vector.IntFloatVector)

Example 5 with 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);
    }
}
Also used : LongLongVector(com.tencent.angel.ml.math2.vector.LongLongVector) LongLongSparseVectorStorage(com.tencent.angel.ml.math2.storage.LongLongSparseVectorStorage)

Aggregations

IntDoubleVectorStorage (com.tencent.angel.ml.math2.storage.IntDoubleVectorStorage)187 IntFloatVectorStorage (com.tencent.angel.ml.math2.storage.IntFloatVectorStorage)186 LongFloatVectorStorage (com.tencent.angel.ml.math2.storage.LongFloatVectorStorage)185 LongIntVectorStorage (com.tencent.angel.ml.math2.storage.LongIntVectorStorage)183 LongDoubleVectorStorage (com.tencent.angel.ml.math2.storage.LongDoubleVectorStorage)182 IntLongVectorStorage (com.tencent.angel.ml.math2.storage.IntLongVectorStorage)181 IntIntVectorStorage (com.tencent.angel.ml.math2.storage.IntIntVectorStorage)180 LongLongVectorStorage (com.tencent.angel.ml.math2.storage.LongLongVectorStorage)180 Storage (com.tencent.angel.ml.math2.storage.Storage)169 ObjectIterator (it.unimi.dsi.fastutil.objects.ObjectIterator)139 IntDoubleSparseVectorStorage (com.tencent.angel.ml.math2.storage.IntDoubleSparseVectorStorage)123 IntFloatSparseVectorStorage (com.tencent.angel.ml.math2.storage.IntFloatSparseVectorStorage)123 LongFloatSparseVectorStorage (com.tencent.angel.ml.math2.storage.LongFloatSparseVectorStorage)121 IntDoubleSortedVectorStorage (com.tencent.angel.ml.math2.storage.IntDoubleSortedVectorStorage)119 LongDoubleSortedVectorStorage (com.tencent.angel.ml.math2.storage.LongDoubleSortedVectorStorage)119 LongDoubleSparseVectorStorage (com.tencent.angel.ml.math2.storage.LongDoubleSparseVectorStorage)119 LongIntSparseVectorStorage (com.tencent.angel.ml.math2.storage.LongIntSparseVectorStorage)119 IntFloatSortedVectorStorage (com.tencent.angel.ml.math2.storage.IntFloatSortedVectorStorage)118 LongFloatSortedVectorStorage (com.tencent.angel.ml.math2.storage.LongFloatSortedVectorStorage)118 IntIntSparseVectorStorage (com.tencent.angel.ml.math2.storage.IntIntSparseVectorStorage)117