Class: CScalar

Inherits:
CArray show all
Defined in:
yard-stubs/ruby_carray.rb,
yard-stubs/ca_obj_array.rb

Overview

Zero-dimensional CArray. One element, broadcasts like a scalar in elementwise ops.

Constant Summary

Constants inherited from CArray

CArray::HAVE_COMPLEX, CArray::LAZY_BINCMP_OP_IDS, CArray::LAZY_BINCMP_TOL_OP_IDS, CArray::LAZY_BINOP_OP_IDS, CArray::LAZY_MONOP_OP_IDS, CArray::LAZY_TRIOP_OP_IDS, CArray::UNSPECIFIED, CArray::VERSION

Construction collapse

Construction (typed shorthands) collapse

Construction (legacy-name aliases) collapse

Methods inherited from CArray

#%, #/, #<=>, #==, #T, #[], #[]=, _scan_float, _scan_int, #addr2index, addr2index, #address, align_addr, align_nearest_addr, #all, #all_masked?, #ancestors, #any, #any_masked?, #as_boolean, #as_byte, #as_cmplx128, #as_cmplx256, #as_cmplx64, #as_complex, #as_dcomplex, #as_double, #as_fixlen, #as_float, #as_float128, #as_float32, #as_float64, #as_int, #as_int16, #as_int32, #as_int64, #as_int8, #as_object, #as_short, #as_strided, #as_type, #as_uint16, #as_uint32, #as_uint64, #as_uint8, attach, #attach, #attach!, attach!, #attached?, #attr, #attrs, #axis2addr, #axis_group, big_endian?, #bin, #bin_to, #bincount, #bincount_nd, #bitarray, #bitfield, #bits, #block_view, #blocks, #boolean, #boolean?, #broadcast_to, #bsearch, #bsearch_addr, #byte, #bytes, cast, #cast_with, #categorize, #choose, #clip, #clip_int16, #clip_int32, #clip_int64, #clip_int8, #clip_uint16, #clip_uint32, #clip_uint64, #clip_uint8, #cmplx128, #cmplx64, #coerce, #collect!, #collect_addr!, #collect_index!, #collect_with_addr!, #collect_with_index!, #complex, #complex?, concatenate, #concatenate, #conditional, const_string, #convert, #copy, #count, #count_masked, #count_not_masked, #crop, #data_class, #data_class=, #data_type, data_type_code, #data_type_name, data_type_name, #dcomplex, #delete_block, #diagonal, #difference, #dim, #dim0, #dim1, #dim2, #dim3, #dim_view, #div, #div!, #divmod, #double, #drop_axis, dump, #dump_binary, #each, #each_addr, #each_index, each_index, #each_slab, #each_with_addr, #each_with_index, #elem_copy, #elem_decr, #elem_fetch, #elem_incr, #elem_mask, #elem_masked?, #elem_max, #elem_min, #elem_store, #elem_swap, #elem_unmask, #elements, #empty?, endian, #endian, #entity?, #eql?, #face?, #fake, #false, #farray, #field, #fields, #fields_at, #fill, #fill_copy, #first, #fixlen, #fixlen?, fixlen_string, #flags, #flatten, #flip, #float, #float32, #float64, #float?, #fmod, #fmod!, format, #format, #frac, #freeze, from_bit_string, #from_bit_string, from_memory_view, fuse, #gather_nd, #grid, #group_by_category, #group_by_run, guard_undef, guess_type_and_bytes, #has_attr?, #has_data_class?, #has_mask?, #hash, #histogram, #histogram1d, #histogram2d, #imag, #imag=, #index, #index2addr, index2addr, #indices, #inherit_mask, #inherit_mask_replace, #insert_axis, #insert_block, #inspect, #int, #int16, #int32, #int64, #int8, #integer?, #intersection, #invert_mask, #is_in, #is_masked, #is_mode, #is_not_masked, #is_real, jit_each, jit_for, jit_map, #join, #last, #lazy, #length, #linear_fetch, #linear_section, little_endian?, load, load_arrow_tensor, #load_binary, #locate_addr, #locate_nearest_addr, #lookup, #map!, #map_addr!, #map_index!, #map_slab, #map_with_addr!, #map_with_index!, #marshal_dump, #marshal_load, #mask, #mask=, #mask_array?, #mask_duplicates, #mask_eq, #mask_invalid, #mask_where, #median, meld, #meld, #members, memory_view_available?, memory_view_reject_reason, meshgrid, #mod, #mod!, #mode, montage, mosaic, #ndim, #none, #normalize_axes, #normalize_axis, normalize_axis, #normalize_index, #numeric?, #nunique, #obj_type, #object, #object?, #order, #pack_bits, #parent, #partition, #partition_copy, #paste, #percentile, #project, promote_list, #put_nd, #quantile, #random, #random!, #randomn, #randomn!, #rank, #read_only?, #real, #real=, #real?, #reduce_slab, #refer, #replace_where, #reshape, #resize, result_type, #roll, #root_array, #round, #same_shape?, save, #save_arrow_tensor, #scalar?, #scale, #scale!, #scatter_add!, #scatter_max!, #scatter_min!, #scatter_mul!, #scatter_replace!, #scatter_sub!, #search, #search_addr, #search_nearest, #search_nearest_addr, select, #seq, #seq!, #set_attr, #set_read_only_flag, #shape, #shift, #short, #shuffle, #shuffle!, #size, sizeof, #sliding_windows, #snap, #snap_to, #sort, sort_addr, #sort_addr, #sort_copy, #source_code, #span, #span!, #split, #st, stack, #stack, string, #strip_mask, struct, #swap_bytes, tabulate, #template, #then_else, #tile, time, #time, time_range, time_series, #timedelta, #to_a, #to_bit_string, #to_ca, #to_s, #to_type, #transpose, #true, #uint16, #uint32, #uint64, #uint8, #unfold, #union, union, #unique, #unmask, #valid_addr?, #valid_index?, #validity_bits, #value, #value_array?, #value_counts, #virtual?, #where, #window, #windows, wrap, wrap_memory_view, wrap_readonly, wrap_writable

Methods included from CArray::DataTypeExtension

#arange, #empty, #eye, #full, #identity, #linspace, #ones, #zeros

Constructor Details

#initialize(data_type) ⇒ self #initialize(data_type, bytes:) ⇒ self #initialize(data_type) {|scalar| ... } ⇒ self

Returns a new instance of CScalar.

Overloads:

  • #initialize(data_type) ⇒ self

    Allocates a CScalar (0-D CArray) of the given data_type.

    Parameters:

    • data_type (Symbol, Integer, Class, String)
  • #initialize(data_type, bytes:) ⇒ self

    For data_type == :fixlen, sets the per-element byte size.

    Parameters:

    • data_type (Symbol)
    • bytes (Integer)
  • #initialize(data_type) {|scalar| ... } ⇒ self

    Yields the freshly allocated scalar; the block's return value is stored at the cell unless it is scalar itself.

    Yield Parameters:

    Yield Returns:

    • (Object)


261
# File 'yard-stubs/ca_obj_array.rb', line 261

def initialize(*); end

Class Method Details

.boolean({ ... }) ⇒ CScalar

Equivalent to CScalar.new(:boolean) { ... }.

Returns:



284
# File 'yard-stubs/ca_obj_array.rb', line 284

def boolean; end

.byteObject

Alias of uint8.



357
# File 'yard-stubs/ca_obj_array.rb', line 357

def byte; end

.cmplx128({ ... }) ⇒ CScalar

Equivalent to CScalar.new(:cmplx128) { ... }.

Returns:



344
# File 'yard-stubs/ca_obj_array.rb', line 344

def cmplx128; end

.cmplx64({ ... }) ⇒ CScalar

Equivalent to CScalar.new(:cmplx64) { ... }.

Returns:



339
# File 'yard-stubs/ca_obj_array.rb', line 339

def cmplx64; end

.complexObject

Alias of cmplx64.



377
# File 'yard-stubs/ca_obj_array.rb', line 377

def complex; end

.dcomplexObject

Alias of cmplx128.



381
# File 'yard-stubs/ca_obj_array.rb', line 381

def dcomplex; end

.doubleObject

Alias of float64.



373
# File 'yard-stubs/ca_obj_array.rb', line 373

def double; end

.fixlen(bytes:) ⇒ CScalar

Equivalent to CScalar.new(:fixlen, bytes: bytes) { ... }.

Parameters:

  • bytes (Integer)

Returns:



279
# File 'yard-stubs/ca_obj_array.rb', line 279

def fixlen(bytes:); end

.floatObject

Alias of float32.



369
# File 'yard-stubs/ca_obj_array.rb', line 369

def float; end

.float32({ ... }) ⇒ CScalar

Equivalent to CScalar.new(:float32) { ... }.

Returns:



329
# File 'yard-stubs/ca_obj_array.rb', line 329

def float32; end

.float64({ ... }) ⇒ CScalar

Equivalent to CScalar.new(:float64) { ... }.

Returns:



334
# File 'yard-stubs/ca_obj_array.rb', line 334

def float64; end

.intObject

Alias of int32.



365
# File 'yard-stubs/ca_obj_array.rb', line 365

def int; end

.int16({ ... }) ⇒ CScalar

Equivalent to CScalar.new(:int16) { ... }.

Returns:



299
# File 'yard-stubs/ca_obj_array.rb', line 299

def int16; end

.int32({ ... }) ⇒ CScalar

Equivalent to CScalar.new(:int32) { ... }.

Returns:



309
# File 'yard-stubs/ca_obj_array.rb', line 309

def int32; end

.int64({ ... }) ⇒ CScalar

Equivalent to CScalar.new(:int64) { ... }.

Returns:



319
# File 'yard-stubs/ca_obj_array.rb', line 319

def int64; end

.int8({ ... }) ⇒ CScalar

Equivalent to CScalar.new(:int8) { ... }.

Returns:



289
# File 'yard-stubs/ca_obj_array.rb', line 289

def int8; end

.object({ ... }) ⇒ CScalar

Equivalent to CScalar.new(:object) { ... }.

Returns:



349
# File 'yard-stubs/ca_obj_array.rb', line 349

def object; end

.shortObject

Alias of int16.



361
# File 'yard-stubs/ca_obj_array.rb', line 361

def short; end

.uint16({ ... }) ⇒ CScalar

Equivalent to CScalar.new(:uint16) { ... }.

Returns:



304
# File 'yard-stubs/ca_obj_array.rb', line 304

def uint16; end

.uint32({ ... }) ⇒ CScalar

Equivalent to CScalar.new(:uint32) { ... }.

Returns:



314
# File 'yard-stubs/ca_obj_array.rb', line 314

def uint32; end

.uint64({ ... }) ⇒ CScalar

Equivalent to CScalar.new(:uint64) { ... }.

Returns:



324
# File 'yard-stubs/ca_obj_array.rb', line 324

def uint64; end

.uint8({ ... }) ⇒ CScalar

Equivalent to CScalar.new(:uint8) { ... }.

Returns:



294
# File 'yard-stubs/ca_obj_array.rb', line 294

def uint8; end

Instance Method Details

#initialize_copy(other) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Copies other's data_type and stored value into self.

Parameters:

Returns:

  • (self)


268
# File 'yard-stubs/ca_obj_array.rb', line 268

def initialize_copy(other); end