Class CscMatrix<T>
- Namespace
- NVMathNet.Sparse
- Assembly
- NVMath.Net.dll
A sparse matrix stored in Compressed Sparse Column (CSC) format on the GPU. Column offsets, row indices and values are each held in a separate NVMathNet.DeviceBuffer`1. Obtain one from a CSR matrix with NVMathNet.Sparse.CsrMatrix`1.ToCsc.
public sealed class CscMatrix<T> : IDisposable where T : unmanaged, INumberBase<T>Type Parameters
T-
Unmanaged numeric value element type (float, double, etc.).
Inheritance
Implements
Inherited Members
Constructors
CscMatrix(long, long, DeviceBuffer<int>, DeviceBuffer<int>, DeviceBuffer<T>, long?)
Creates a CSC sparse matrix from pre-allocated device buffers; the matrix takes ownership of them.
public CscMatrix(long rows, long cols, DeviceBuffer<int> colOffsets, DeviceBuffer<int> rowIndices, DeviceBuffer<T> values, long? nnz = null)Parameters
rowslong-
Number of rows.
colslong-
Number of columns.
colOffsetsDeviceBuffer<int>-
Column offsets (length cols+1).
rowIndicesDeviceBuffer<int>-
Row indices (length NNZ).
valuesDeviceBuffer<T>-
Non-zero values (length NNZ).
nnzlong?-
Number of stored entries when it is smaller than the buffer length (for example
0for an empty matrix backed by one-element placeholder buffers);nulluses the length ofvalues.
Properties
ColOffsets
Column offsets — length Cols+1.
public DeviceBuffer<int> ColOffsets { get; }Property Value
Cols
Number of columns.
public long Cols { get; }Property Value
NNZ
Number of non-zero elements.
public long NNZ { get; }Property Value
RowIndices
Row indices — length NNZ.
public DeviceBuffer<int> RowIndices { get; }Property Value
Rows
Number of rows.
public long Rows { get; }Property Value
Values
Non-zero values — length NNZ.
public DeviceBuffer<T> Values { get; }Property Value
- DeviceBuffer<T>
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()