class
Phase::ReadonlyView(S, R)
- Phase::ReadonlyView(S, R)
- Reference
- Object
Included Modules
Direct Known Subclasses
Defined in:
readonly_view.crview_util/transforms.cr
Constructors
Instance Method Summary
- #clone : self
- #permute(order : Enumerable | Nil = nil) : self
-
#permute(*args)
Tuple-accepting overload of
#"permute". - #permute!(order : Enumerable | Nil = nil) : self
-
#permute!(*args)
Tuple-accepting overload of
#"permute!". - #process(new_proc : R -> U) : ProcView(S, R, U) forall U
- #process(&block : R -> U) : ProcView(S, R, U) forall U
- #reshape(new_shape) : self
-
#reshape(*args)
Tuple-accepting overload of
#"reshape". - #reshape!(new_shape : Array(Int32)) : self
-
#reshape!(*args)
Tuple-accepting overload of
#"reshape!". - #reverse : self
- #reverse! : self
-
#shape_internal : Array(Int32)
Implementors must use this to expose the shape of a
MultiIndexable. -
#to_narr : NArray
Creates an
NArrayduplicate of thisMultiIndexable. -
#unsafe_fetch_chunk(region : IndexRegion) : self
Copies the elements described by region into a new
MultiIndexablewithout performing any bounds checking. -
#unsafe_fetch_element(coord : Indexable) : R
Returns the element at the provided coord, possibly mutating coord, without performing canonicalization or bounds-checking.
- #view(region = nil) : self
Instance methods inherited from module Phase::MultiIndexable(R)
%(other : MultiIndexable(U)) forall U%(other) %, &(other : MultiIndexable(U)) forall U
&(other) &, &*(other : MultiIndexable(U)) forall U
&*(other) &*, &**(other : MultiIndexable(U)) forall U
&**(other) &**, &+(other : MultiIndexable(U)) forall U
&+(other) &+, &-(other : MultiIndexable(U)) forall U
&-(other) &-, *(other : MultiIndexable(U)) forall U
*(other) *, **(other : MultiIndexable(U)) forall U
**(other) **, +(other : MultiIndexable(U)) forall U
+(other)
+ +, -(other : MultiIndexable(U)) forall U
-(other)
- -, /(other : MultiIndexable(U)) forall U
/(other) /, //(other : MultiIndexable(U)) forall U
//(other) //, <(other : MultiIndexable(U)) forall U
<(other) <, <=(other : MultiIndexable(U)) forall U
<=(other) <=, <=>(other : MultiIndexable(U)) forall U
<=>(other) <=>, ==(other : self) : Bool ==, =~(value) : MultiIndexable(Bool) =~, >(other : MultiIndexable(U)) forall U
>(other) >, >=(other : MultiIndexable(U)) forall U
>=(other) >=, [](region_literal : Indexable, drop : Bool = MultiIndexable::DROP_BY_DEFAULT)
[](region : IndexRegion)
[](*region_literal, drop : Bool = MultiIndexable::DROP_BY_DEFAULT) [], []?(bool_mask : MultiIndexable(Bool)) : MultiIndexable(T | Nil)
[]?(region : Indexable, drop : Bool = MultiIndexable::DROP_BY_DEFAULT) : MultiIndexable(T) | Nil
[]?(region : IndexRegion) : MultiIndexable(T) | Nil
[]?(*region_literal, drop : Bool = MultiIndexable::DROP_BY_DEFAULT) []?, ^(other : MultiIndexable(U)) forall U
^(other) ^, |(other : MultiIndexable(U)) forall U
|(other) |, ~ ~, apply : ApplyProxy apply, apply! : InPlaceApplyProxy apply!, colex_each : ElemIterator
colex_each(&) : Nil colex_each, colex_each_coord : ColexIterator
colex_each_coord(&) : Nil colex_each_coord, dimensions : Int dimensions, each : ElemIterator
each(&) : Nil each, each_coord : LexIterator
each_coord(&) : Nil each_coord, each_slice(axis = 0) : Iterator
each_slice(axis = 0, &) each_slice, each_with(*args, &) each_with, each_with_coord : ElemAndCoordIterator
each_with_coord(&) : Nil each_with_coord, empty? : Bool empty?, ensure_writable ensure_writable, eq(other : MultiIndexable(U)) : MultiIndexable(Bool) forall U
eq(value) : MultiIndexable(Bool) eq, equals?(other : MultiIndexable, &) : Bool equals?, fast_each : Iterator(T)
fast_each(&) : Nil fast_each, first : T first, get(coord : Indexable) : T
get(*coord : Int) get, get_available(region_literal : Indexable, drop : Bool = DROP_BY_DEFAULT)
get_available(region : IndexRegion, drop : Bool = DROP_BY_DEFAULT)
get_available(*region_literal, drop : Bool = MultiIndexable::DROP_BY_DEFAULT) get_available, get_chunk(coord : Indexable, region_shape : Indexable(I)) forall I
get_chunk(region_literal : Indexable, drop : Bool = DROP_BY_DEFAULT)
get_chunk(region : IndexRegion) : MultiIndexable(T)
get_chunk(*region_literal, drop : Bool = MultiIndexable::DROP_BY_DEFAULT) get_chunk, get_element(coord : Indexable) : T
get_element(*coord : Int) get_element, has_coord?(coord : Indexable) : Bool
has_coord?(*coord : Int) has_coord?, has_region?(region_literal : Indexable, drop : Bool = DROP_BY_DEFAULT) : Bool
has_region?(region : IndexRegion) : Bool
has_region?(*region_literal, drop : Bool = MultiIndexable::DROP_BY_DEFAULT) has_region?, hash(hasher) hash, last : T last, map(&block : T -> R) : MultiIndexable(R) forall R map, map!(&block : T -> T | MultiIndexable(T)) : MultiIndexable(T) map!, map_with(*args : *U, &) forall U
map_with(*args, &) map_with, map_with!(*args : *U, &) forall U map_with!, map_with_coord(&) map_with_coord, map_with_coord!(&block : T -> MultiIndexable(T)) map_with_coord!, permute(*args) : MultiIndexable(T) permute, process(&block : T -> R) : ProcView(self, T, R) forall R
process(proc : Proc(T, R)) : ProcView(self, T, R) forall R process, reshape(*args) : MultiIndexable(T) reshape, reverse(*args) : MultiIndexable(T) reverse, sample(n : Int, random = Random::DEFAULT) : Enumerable(T)
sample(random = Random::DEFAULT) : T sample, scalar? : Bool scalar?, shape : Array shape, size size, slices(axis = 0) : Indexable slices, tile(counts : Enumerable(Int)) : MultiIndexable
tile(*counts : Int) tile, to_f : Float to_f, to_literal_s(io : IO) : Nil to_literal_s, to_narr : NArray(T) to_narr, to_s(io : IO, settings = Formatter::Settings.new) : Nil
to_s(settings = Formatter::Settings.new) : String to_s, to_scalar : T to_scalar, to_scalar? : T | Nil to_scalar?, unsafe_fetch_chunk(region : IndexRegion) : MultiIndexable(T) unsafe_fetch_chunk, unsafe_fetch_element(coord : Indexable) : T unsafe_fetch_element, view(region : Indexable | Nil | IndexRegion = nil) : View(self, T)
view(*region) : View(self, T) view
Class methods inherited from module Phase::MultiIndexable(R)
each_with(*args : *U, &) forall U
each_with
Macros inherited from module Phase::MultiIndexable(R)
coord_splat_overload(name)
coord_splat_overload,
def_elementwise_binary(name)
def_elementwise_binary,
def_elementwise_unary(name)
def_elementwise_unary,
region_splat_overload(name)
region_splat_overload
Constructor Detail
Instance Method Detail
Implementors must use this to expose the shape of a MultiIndexable.
The returned Shape is allowed to be mutable, as callers of this method
are trusted to never mutate the result. This allows for performance
optimizations where cloning and wrapping are too costly.
Creates an NArray duplicate of this MultiIndexable.
# not_an_narray : MultiIndexable
narr = not_an_narray.to_narr # => NArray
not_an_narray.equals?(narr) { |el_1, el_2| el_1 == el_2 } # => true
Copies the elements described by region into a new MultiIndexable without performing any bounds checking.
Unless you are sure that your region will fit inside of this
MultiIndexable, you should opt to use #get_chunk instead.
This method may return any MultiIndexable - the default implementation
will return an NArray, however implementers of other MultiIndexables
are encouraged to override this method where it makes sense to do so.
This method's usage is identical to #get_chunk(region : IndexRegion),
but it is slightly faster.
Returns the element at the provided coord, possibly mutating coord, without performing canonicalization or bounds-checking. This method cannot be used with negative coordinates, and is not safe unless you are certain your coordinate is already canonicalized.