FillArrays.FillArrays
— ModuleFillArrays
module to lazily represent matrices with a single value
diff --git a/dev/index.html b/dev/index.html index e31fd4a7..be3be377 100644 --- a/dev/index.html +++ b/dev/index.html @@ -91,7 +91,7 @@ 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
FillArrays.FillArrays
— ModuleFillArrays
module to lazily represent matrices with a single value
FillArrays.AbstractFill
— TypeAbstractFill{T, N, Axes} <: AbstractArray{T, N}
Supertype for lazy array types whose entries are all equal to constant.
FillArrays.Falses
— TypeFalses = Zeros{Bool, N, Axes}
(see Trues
)
FillArrays.Fill
— TypeFill{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
FillArrays.FillArrays
— ModuleFillArrays
module to lazily represent matrices with a single value
FillArrays.AbstractFill
— TypeAbstractFill{T, N, Axes} <: AbstractArray{T, N}
Supertype for lazy array types whose entries are all equal to constant.
FillArrays.Falses
— TypeFalses = Zeros{Bool, N, Axes}
(see Trues
)
FillArrays.Fill
— TypeFill{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,2,Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}}:
7 7 7
7 7 7
@@ -99,11 +99,11 @@
julia> Fill{Float64, 1, Tuple{UnitRange{Int64}}}(7., (1:2,))
2-element Fill{Float64,1,Tuple{UnitRange{Int64}}} with indices 1:2:
7.0
- 7.0
FillArrays.Fill
— MethodFill(x, dims)
construct lazy version of fill(x, dims)
FillArrays.Fill
— MethodFill(x, dims...)
construct lazy version of fill(x, dims...)
FillArrays.OneElement
— TypeOneElement(val, ind, axesorsize) <: AbstractArray
Represents an array with the specified axes (if its a tuple of AbstractUnitRange
s) or size (if its a tuple of Integer
s), with a single entry set to val
and all others equal to zero, specified by ind
`.
FillArrays.OneElement
— MethodOneElement(val, ind::Int, n::Int)
Creates a length n
vector where the ind
entry is equal to val
, and all other entries are zero.
FillArrays.OneElement
— MethodOneElement(ind::Int, n::Int)
Creates a length n
vector where the ind
entry is equal to 1
, and all other entries are zero.
FillArrays.OneElement
— MethodOneElement{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.
FillArrays.Ones
— TypeOnes{T, N, Axes} <: AbstractFill{T, N, Axes}
(lazy ones
with axes)
FillArrays.Ones
— MethodOnes{T}(dims...)
construct lazy version of ones(dims...)
FillArrays.Trues
— TypeTrues = Ones{Bool, N, Axes} where {N, Axes}
Lazy version of trues
with axes. Typically created using Trues(dims)
or Trues(dims...)
Example
julia> Trues(1,3)
+ 7.0
FillArrays.Fill
— MethodFill(x, dims)
construct lazy version of fill(x, dims)
FillArrays.Fill
— MethodFill(x, dims...)
construct lazy version of fill(x, dims...)
FillArrays.OneElement
— TypeOneElement(val, ind, axesorsize) <: AbstractArray
Represents an array with the specified axes (if its a tuple of AbstractUnitRange
s) or size (if its a tuple of Integer
s), with a single entry set to val
and all others equal to zero, specified by ind
`.
FillArrays.OneElement
— MethodOneElement(val, ind::Int, n::Int)
Creates a length n
vector where the ind
entry is equal to val
, and all other entries are zero.
FillArrays.OneElement
— MethodOneElement(ind::Int, n::Int)
Creates a length n
vector where the ind
entry is equal to 1
, and all other entries are zero.
FillArrays.OneElement
— MethodOneElement{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.
FillArrays.Ones
— TypeOnes{T, N, Axes} <: AbstractFill{T, N, Axes}
(lazy ones
with axes)
FillArrays.Ones
— MethodOnes{T}(dims...)
construct lazy version of ones(dims...)
FillArrays.Trues
— TypeTrues = Ones{Bool, N, Axes} where {N, Axes}
Lazy version of trues
with axes. Typically created using Trues(dims)
or Trues(dims...)
Example
julia> Trues(1,3)
1×3 Ones{Bool,2,Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}} = true
julia> Trues((2,3))
-2×3 Ones{Bool,2,Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}} = true
FillArrays.Zeros
— TypeZeros{T, N, Axes} <: AbstractFill{T, N, Axes}
(lazy zeros
with axes)
FillArrays.Zeros
— MethodZeros{T}(dims...)
construct lazy version of zeros(dims...)
FillArrays.fillsimilar
— Methodfillsimilar(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.
FillArrays.getindex_value
— Functiongetindex_value(F::AbstractFill)
Return the value that F
is filled with.
Examples
julia> f = Ones(3);
+2×3 Ones{Bool,2,Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}} = true
FillArrays.Zeros
— TypeZeros{T, N, Axes} <: AbstractFill{T, N, Axes}
(lazy zeros
with axes)
FillArrays.Zeros
— MethodZeros{T}(dims...)
construct lazy version of zeros(dims...)
FillArrays.fillsimilar
— Methodfillsimilar(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.
FillArrays.getindex_value
— Functiongetindex_value(F::AbstractFill)
Return the value that F
is filled with.
Examples
julia> f = Ones(3);
julia> FillArrays.getindex_value(f)
1.0
@@ -111,4 +111,4 @@
julia> g = Fill(2, 10);
julia> FillArrays.getindex_value(g)
-2
FillArrays.unique_value
— Methodunique_value(arr::AbstractArray)
Return only(unique(arr))
without intermediate allocations. Throws an error if arr
does not contain one and only one unique value.
Settings
This document was generated with Documenter.jl version 0.27.24 on Sunday 2 July 2023. Using Julia version 1.9.1.