Static methods

staticfromCOO<T>(ctx:Context, rowInd:Tensor_I32, colInd:Tensor_I32, values:TensorArg<T>, nRows:Int, nCols:Int):SparseMatrix<T>

staticfromCSR<T>(ctx:Context, rowPtr:Tensor_I32, colInd:Tensor_I32, values:TensorArg<T>, nRows:Int, nCols:Int):SparseMatrix<T>

@:value({ storageFormat : SparseStorageFormat.CSR, dtype : DType.F32 })staticmmread<T>(ctx:Context, path:String, dtype:DType = DType.F32, storageFormat:SparseStorageFormat = SparseStorageFormat.CSR):SparseMatrix<T>

Constructor

@:value({ storageFormat : SparseStorageFormat.CSR, dtype : DType.F32 })new(context:Context, rows:Int, cols:Int, dtype:DType = DType.F32, storageFormat:SparseStorageFormat = SparseStorageFormat.CSR)

Variables

finalcols:Int

read onlynnz:Int

finalrows:Int

Methods

inlineapply(x:TensorArg<T>, y:TensorArg<T>):Void

buildFromTensor(dense:TensorArg<T>, ?options:{eps:Null<Float>}):Void

clear():Void

close():Void

get(row:Int, col:Int):T

has(row:Int, col:Int):Bool

matVec(x:TensorArg<T>, y:TensorArg<T>):Void

inlinematvec(x:TensorArg<T>, y:TensorArg<T>):Void

mmwrite(path:String):Void

scale(value:T):SparseMatrix<T>

set(row:Int, col:Int, value:T):Void

toCOO(rowInd:Tensor_I32, colInd:Tensor_I32, values:TensorArg<T>):Int

toCSR(rowPtr:Tensor_I32, colInd:Tensor_I32, values:TensorArg<T>):Int

toDense():Array<Float>