Sparse Tensors

Work-in-progress

This page of the docs is still a work-in-progress. Check back later!

GCPDecompositions.SparseArrayCOOType
SparseArrayCOO{Tv,Ti<:Integer,N} <: AbstractArray{Tv,N}

N-dimensional sparse array stored in the COOrdinate format. Elements are stored as a vector of indices (using type Ti) and a vector of values (of type Tv). Values for duplicate indices are summed.

Fields:

  • dims::Dims{N} : tuple of dimensions
  • inds::Vector{NTuple{N,Ti}} : vector of indices
  • vals::Vector{Tv} : vector of values
source
GCPDecompositions.numstoredFunction
numstored(A::SparseArrayCOO{Tv,Ti,N})

Return the number of stored entries. Includes any stored numerical zeros and duplicates; use count(!iszero,A) to count the number of nonzeros.

source
GCPDecompositions.check_TiFunction
check_Ti(dims, Ti)

Check that the dims tuple and Ti index type are valid:

  • dims are nonnegative and fit in Ti (0 ≤ dims[k] ≤ typemax(Ti))
  • corresponding length fits in Int (prod(dims) ≤ typemax(Int))

If not, throw an ArgumentError.

source
GCPDecompositions.check_coo_buffersFunction
check_coo_buffers(inds, vals)

Check that the inds and vals buffers are valid:

  • their lengths match (length(inds) == length(vals))

If not, throw an ArgumentError.

source
GCPDecompositions.check_coo_indsFunction
check_coo_inds(dims, inds)

Check that the indices in inds are valid:

  • each index is in bounds (1 ≤ inds[ptr][k] ≤ dims[k])

If not, throw an ArgumentError.

source
GCPDecompositions.checkbounds_dimsFunction
checkbounds_dims(Bool, dims, I...)

Return true if the specified indices I are in bounds for an array with the given dimensions dims. Useful for checking the inputs to constructors.

source
checkbounds_dims(dims, I...)

Throw an error if the specified indices I are not in bounds for an array with the given dimensions dims. Useful for checking the inputs to constructors.

source