diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 5cb5ad54..501affc3 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-08-19T10:11:55","documenter_version":"1.5.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-08-20T09:04:28","documenter_version":"1.5.0"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 83133d02..9da18e73 100644 --- a/dev/index.html +++ b/dev/index.html @@ -91,16 +91,16 @@ julia> ones(1,5) .+ (_ -> rand()).(fill("vec", 2)) # fused, 10 evaluations 2×5 Matrix{Float64}: 1.00745 1.43924 1.95674 1.99667 1.11008 - 1.19938 1.68253 1.64786 1.74919 1.49138

API

FillArrays.FillArraysModule

FillArrays module to lazily represent matrices with a single value

source
FillArrays.AbstractFillType
AbstractFill{T, N, Axes} <: AbstractArray{T, N}

Supertype for lazy array types whose entries are all equal. Subtypes of AbstractFill should implement FillArrays.getindex_value to return the value of the entries.

source
FillArrays.FalsesType
Falses = Zeros{Bool, N, Axes}

Lazy version of falses with axes.

See also: Trues

source
FillArrays.FillType
Fill{T, N, Axes} where {T,N,Axes<:Tuple{Vararg{AbstractUnitRange,N}}}

A lazy representation of an array of dimension N whose entries are all equal to a constant of type T, with axes of type Axes. Typically created by Fill or Zeros or Ones

Examples

julia> Fill(7, (2,3))
+ 1.19938  1.68253  1.64786  1.74919  1.49138

API

FillArrays.FillType
Fill{T, N, Axes} where {T,N,Axes<:Tuple{Vararg{AbstractUnitRange,N}}}

A lazy representation of an array of dimension N whose entries are all equal to a constant of type T, with axes of type Axes. Typically created by Fill or Zeros or Ones

Examples

julia> Fill(7, (2,3))
 2×3 Fill{Int64}, with entries equal to 7
 
 julia> Fill{Float64, 1, Tuple{UnitRange{Int64}}}(7.0, (1:2,))
-2-element Fill{Float64, 1, Tuple{UnitRange{Int64}}} with indices 1:2, with entries equal to 7.0
source
FillArrays.OneElementType
OneElement(val, ind, axesorsize) <: AbstractArray

Represents an array with the specified axes (if its a tuple of AbstractUnitRanges) or size (if its a tuple of Integers), with a single entry set to val and all others equal to zero, specified by ind`.

source
FillArrays.OneElementMethod
OneElement(val, ind::Int, n::Int)

Creates a length n vector where the ind entry is equal to val, and all other entries are zero.

source
FillArrays.OneElementMethod
OneElement(ind::Int, n::Int)

Creates a length n vector where the ind entry is equal to 1, and all other entries are zero.

source
FillArrays.OneElementMethod
OneElement{T}(val, ind::Int, n::Int)

Creates a length n vector where the ind entry is equal to one(T), and all other entries are zero.

source
FillArrays.TruesType
Trues = Ones{Bool, N, Axes} where {N, Axes}

Lazy version of trues with axes. Typically created using Trues(dims) or Trues(dims...)

Example

julia> T = Trues(1,3)
+2-element Fill{Float64, 1, Tuple{UnitRange{Int64}}} with indices 1:2, with entries equal to 7.0
source
FillArrays.OneElementType
OneElement(val, ind, axesorsize) <: AbstractArray

Represents an array with the specified axes (if its a tuple of AbstractUnitRanges) or size (if its a tuple of Integers), with a single entry set to val and all others equal to zero, specified by ind`.

source
FillArrays.OneElementMethod
OneElement(val, ind::Int, n::Int)

Creates a length n vector where the ind entry is equal to val, and all other entries are zero.

source
FillArrays.OneElementMethod
OneElement(ind::Int, n::Int)

Creates a length n vector where the ind entry is equal to 1, and all other entries are zero.

source
FillArrays.OneElementMethod
OneElement{T}(val, ind::Int, n::Int)

Creates a length n vector where the ind entry is equal to one(T), and all other entries are zero.

source
FillArrays.TruesType
Trues = Ones{Bool, N, Axes} where {N, Axes}

Lazy version of trues with axes. Typically created using Trues(dims) or Trues(dims...)

Example

julia> T = Trues(1,3)
 1×3 Ones{Bool}
 
 julia> Array(T)
 1×3 Matrix{Bool}:
- 1  1  1
source
FillArrays.fillsimilarMethod
fillsimilar(a::AbstractFill, axes...)

creates a fill object that has the same fill value as a but with the specified axes. For example, if a isa Zeros then so is the returned object.

source
FillArrays.getindex_valueFunction
FillArrays.getindex_value(F::AbstractFill)

Return the value that F is filled with.

Examples

julia> f = Ones(3);
+ 1  1  1
source
FillArrays.fillsimilarMethod
fillsimilar(a::AbstractFill, axes...)

creates a fill object that has the same fill value as a but with the specified axes. For example, if a isa Zeros then so is the returned object.

source
FillArrays.getindex_valueFunction
FillArrays.getindex_value(F::AbstractFill)

Return the value that F is filled with.

Examples

julia> f = Ones(3);
 
 julia> FillArrays.getindex_value(f)
 1.0
@@ -108,14 +108,14 @@
 julia> g = Fill(2, 10);
 
 julia> FillArrays.getindex_value(g)
-2
source
FillArrays.getindex_valueMethod
getindex_value(A::OneElement)

Return the only non-zero value stored in A.

Note

If the index at which the value is stored doesn't lie within the valid indices of A, then this returns zero(eltype(A)).

Examples

julia> A = OneElement(2, 3)
+2
source
FillArrays.getindex_valueMethod
getindex_value(A::OneElement)

Return the only non-zero value stored in A.

Note

If the index at which the value is stored doesn't lie within the valid indices of A, then this returns zero(eltype(A)).

Examples

julia> A = OneElement(2, 3)
 3-element OneElement{Int64, 1, Tuple{Int64}, Tuple{Base.OneTo{Int64}}}:
  ⋅
  1
  ⋅
 
 julia> FillArrays.getindex_value(A)
-1
source
FillArrays.nzindMethod
nzind(A::OneElement{T,N}) -> CartesianIndex{N}

Return the index where A contains a non-zero value.

Note

The indices are not guaranteed to lie within the valid index bounds for A, and if FillArrays.nzind(A) ∉ CartesianIndices(A) then all(iszero, A). On the other hand, if FillArrays.nzind(A) in CartesianIndices(A) then A[FillArrays.nzind(A)] == FillArrays.getindex_value(A)

Examples

julia> A = OneElement(2, (1,2), (2,2))
+1
source
FillArrays.nzindMethod
nzind(A::OneElement{T,N}) -> CartesianIndex{N}

Return the index where A contains a non-zero value.

Note

The indices are not guaranteed to lie within the valid index bounds for A, and if FillArrays.nzind(A) ∉ CartesianIndices(A) then all(iszero, A). On the other hand, if FillArrays.nzind(A) in CartesianIndices(A) then A[FillArrays.nzind(A)] == FillArrays.getindex_value(A)

Examples

julia> A = OneElement(2, (1,2), (2,2))
 2×2 OneElement{Int64, 2, Tuple{Int64, Int64}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}:
  ⋅  2
  ⋅  ⋅
@@ -124,4 +124,4 @@
 CartesianIndex(1, 2)
 
 julia> A[FillArrays.nzind(A)]
-2
source
FillArrays.unique_valueMethod
unique_value(arr::AbstractArray)

Return only(unique(arr)) without intermediate allocations. Throws an error if arr does not contain one and only one unique value.

source
+2source
FillArrays.unique_valueMethod
unique_value(arr::AbstractArray)

Return only(unique(arr)) without intermediate allocations. Throws an error if arr does not contain one and only one unique value.

source