14.2.25 Class NDSparseArray

mosek::fusion::NDSparseArray

Representation of a sparse n-dimensional array.

Static members:

NDSparseArray.make – Create a sparse n-dimensional matrix (tensor).

NDSparseArray.make
NDSparseArray::t NDSparseArray::make(shared_ptr<ndarray<int,1>> dims, shared_ptr<ndarray<int,2>> sub, shared_ptr<ndarray<double,1>> cof)
NDSparseArray::t NDSparseArray::make(shared_ptr<ndarray<int,1>> dims, shared_ptr<ndarray<long long,1>> inst, shared_ptr<ndarray<double,1>> cof)
NDSparseArray::t NDSparseArray::make(Matrix::t m)

Create a sparse n-dimensional matrix (tensor).

Parameters:
  • dims (int[]) – Dimensions.

  • sub (int[][]) – Positions of nonzeros. Array where each row is an \(n\)-dimensional index.

  • cof (double[]) – Values of nonzero elements. Array of coefficients corresponding to subscripts.

  • inst (long long[]) – Positions of nonzeros using linear indexes into the array.

  • m (Matrix) – An initializing matrix.

Return:

(NDSparseArray)