Sparse Tensors
GCPDecompositions.SparseArrayCOO — Type
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 dimensionsinds::Vector{NTuple{N,Ti}}: vector of indicesvals::Vector{Tv}: vector of values
GCPDecompositions.numstored — Function
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.
GCPDecompositions.check_Ti — Function
check_Ti(dims, Ti)Check that the dims tuple and Ti index type are valid:
dimsare nonnegative and fit inTi(0 ≤ dims[k] ≤ typemax(Ti))- corresponding length fits in
Int(prod(dims) ≤ typemax(Int))
If not, throw an ArgumentError.
GCPDecompositions.check_coo_buffers — Function
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.
GCPDecompositions.check_coo_inds — Function
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.
GCPDecompositions.checkbounds_dims — Function
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.
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.