Reference Every exported name
API reference
Vector
PatternVectors.PatternVector — Type
PatternVector(n, pattern)Immutable AbstractVector of length n whose elements are given by pattern, an AbstractPattern: only n and the values of the pattern are stored, so a PatternVector of isbits values is isbits. All the values of the pattern have the same type, the element type, and n must be at least the minimum length of the pattern.
A broadcast on PatternVectors and scalars only evaluates the function once per distinct value and returns a PatternVector; mixed with another array it returns an array of the type of the other one. Indexing with a range returns a PatternVector, and sum is O(1).
julia> x = PatternVector(6, EvenOddPattern(1.0, 2.0))
6-element PatternVector{Float64, EvenOddPattern{Float64}}:
1.0
2.0
1.0
2.0
1.0
2.0
julia> sum(x)
9.0Patterns
PatternVectors.ZeroPattern — Type
ZeroPattern(x)Pattern of a vector of zeros of the type of x, [0, 0, 0, …]: it stores no value, x only sets the element type. Minimum length 1.
PatternVectors.FillPattern — Type
FillPattern(a)Pattern of a constant vector, [a, a, a, …]. Minimum length 1.
PatternVectors.InitialValuePattern — Type
InitialValuePattern(first_value, other_value)Pattern with a different first value, [first_value, other_value, other_value, …]. Minimum length 2.
PatternVectors.FinalValuePattern — Type
FinalValuePattern(other_value, final_value)Pattern with a different last value, [other_value, …, other_value, final_value]. Minimum length 2.
PatternVectors.PaddedFillPattern — Type
PaddedFillPattern(bound_initial_value, value, bound_final_value)Constant pattern with its own first and last values, [bound_initial_value, value, …, value, bound_final_value]. Minimum length 3.
PatternVectors.EvenOddPattern — Type
EvenOddPattern(value_odd, value_even)Pattern alternating two values, [value_odd, value_even, value_odd, …]: value_odd at odd indices, value_even at even ones. Minimum length 2.
PatternVectors.PaddedEvenOddPattern — Type
PaddedEvenOddPattern(bound_initial_value, value_even, value_odd, bound_final_value)Alternating pattern with its own first and last values, [bound_initial_value, value_even, value_odd, value_even, …, bound_final_value]: inside the bounds, value_even at even indices and value_odd at odd ones. Minimum length 4; Simpson's weights are PaddedEvenOddPattern(1/3, 4/3, 2/3, 1/3).