package nuod:mdarray
Index
Types (1)
Constants (3)
Variables (0)
This section is empty.
Procedures (319)
- add_arrays
- add_arrays_scalar
- add_scalar_array
- all
- all_close_default
- all_close_with_args
- all_reduce_avg
- all_reduce_map
- all_reduce_max
- all_reduce_min
- all_reduce_prod_no_init
- all_reduce_prod_with_init
- all_reduce_sum_no_init
- all_reduce_sum_with_init
- any
- atan2_arrays
- atan2_arrays_scalar
- atan2_scalar_array
- bitwise_and_arrays
- bitwise_and_arrays_scalar
- bitwise_and_scalar_array
- bitwise_andnot_arrays
- bitwise_andnot_arrays_scalar
- bitwise_andnot_scalar_array
- bitwise_or_arrays
- bitwise_or_arrays_scalar
- bitwise_or_scalar_array
- bitwise_xor_arrays
- bitwise_xor_arrays_scalar
- bitwise_xor_scalar_array
- broadcast_map
- broadcast_shape
- broadcast_to
- cast_array
- cflatten
- compute_strides
- concat
- copy_array
- cpermute_dims
- creshape
- cswap_axes
- dim_reduce_avg
- dim_reduce_map
- dim_reduce_max
- dim_reduce_min
- dim_reduce_prod_no_init
- dim_reduce_prod_with_init
- dim_reduce_sum_no_init
- dim_reduce_sum_with_init
- div_arrays
- div_arrays_scalar
- div_scalar_array
- element_wise_map
- eprint
- eprintln
- equal_arrays
- equal_arrays_scalar
- equal_scalar_array
- expand_dim_copy
- expand_dim_view
- extract_linear_array
- eye
- fills
- fills_like
- flatten_copy
- flatten_view
- fprint
- fprintln
- free_mdarray
- from_range
- from_slice
- gcd_arrays
- gcd_arrays_scalar
- gcd_scalar_array
- get
- get_default_tol
- get_linear
- get_linear_ref
- get_reduced_pos
- get_ref
- get_type
- greater_arrays
- greater_arrays_scalar
- greater_equal_arrays
- greater_equal_arrays_scalar
- greater_equal_scalar_array
- greater_scalar_array
- heaviside_arrays
- heaviside_arrays_scalar
- heaviside_scalar_array
- hstack
- hypot_arrays
- hypot_arrays_scalar
- hypot_scalar_array
- i_abs
- i_acos
- i_acosh
- i_asin
- i_asinh
- i_atan
- i_atanh
- i_bitwise_comp
- i_cbrt
- i_conj
- i_cos
- i_cosh
- i_deg2rad
- i_degrees
- i_degs
- i_exp
- i_exp2
- i_ln
- i_log10
- i_log1p
- i_log2
- i_neg
- i_rad2deg
- i_radians
- i_rads
- i_reciprocal
- i_sign
- i_sin
- i_sinc
- i_sinh
- i_sq
- i_sqrt
- i_tan
- i_tanh
- identity
- inplace_abs
- inplace_acos
- inplace_acosh
- inplace_asin
- inplace_asinh
- inplace_atan
- inplace_atanh
- inplace_bitwise_comp
- inplace_cbrt
- inplace_conj
- inplace_cos
- inplace_cosh
- inplace_degrees
- inplace_exp
- inplace_exp2
- inplace_ln
- inplace_log10
- inplace_log1p
- inplace_log2
- inplace_neg
- inplace_radians
- inplace_reciprocal
- inplace_sign
- inplace_sin
- inplace_sinc
- inplace_sinh
- inplace_sq
- inplace_sqrt
- inplace_tan
- inplace_tanh
- inplace_unary_map
- is_close_default
- is_close_with_args
- is_empty
- is_none
- keepdim_reduce_avg
- keepdim_reduce_map
- keepdim_reduce_max
- keepdim_reduce_min
- keepdim_reduce_prod_no_init
- keepdim_reduce_prod_with_init
- keepdim_reduce_sum_no_init
- keepdim_reduce_sum_with_init
- lcm_arrays
- lcm_arrays_scalar
- lcm_scalar_array
- left_shift_arrays
- left_shift_arrays_scalar
- left_shift_scalar_array
- less_arrays
- less_arrays_scalar
- less_equal_arrays
- less_equal_arrays_scalar
- less_equal_scalar_array
- less_scalar_array
- linspace
- logaddexp_arrays
- logaddexp_arrays_scalar
- logaddexp_scalar_array
- logical_and_arrays
- logical_and_arrays_scalar
- logical_and_scalar_array
- logical_or_arrays
- logical_or_arrays_scalar
- logical_or_scalar_array
- logspace
- make_mdarray
- max_arrays
- max_arrays_scalar
- max_scalar_array
- min_arrays
- min_arrays_scalar
- min_scalar_array
- mod_arrays
- mod_arrays_scalar
- mod_scalar_array
- mul_arrays
- mul_arrays_scalar
- mul_scalar_array
- narrow
- ndim
- not_equal_arrays
- not_equal_arrays_scalar
- not_equal_scalar_array
- o_abs
- o_acos
- o_acosh
- o_asin
- o_asinh
- o_atan
- o_atanh
- o_bitwise_comp
- o_cbrt
- o_conj
- o_cos
- o_cosh
- o_deg2rad
- o_degrees
- o_degs
- o_exp
- o_exp2
- o_ln
- o_log10
- o_log1p
- o_log2
- o_neg
- o_rad2deg
- o_radians
- o_rads
- o_reciprocal
- o_sign
- o_sin
- o_sinc
- o_sinh
- o_sq
- o_sqrt
- o_tan
- o_tanh
- ones
- ones_like
- outplace_abs
- outplace_acos
- outplace_acosh
- outplace_asin
- outplace_asinh
- outplace_atan
- outplace_atanh
- outplace_bitwise_comp
- outplace_cbrt
- outplace_conj
- outplace_cos
- outplace_cosh
- outplace_degrees
- outplace_exp
- outplace_exp2
- outplace_ln
- outplace_log10
- outplace_log1p
- outplace_log2
- outplace_neg
- outplace_radians
- outplace_reciprocal
- outplace_sign
- outplace_sin
- outplace_sinc
- outplace_sinh
- outplace_sq
- outplace_sqrt
- outplace_tan
- outplace_tanh
- outplace_unary_map
- permute_default_copy
- permute_default_view
- permute_dims_copy
- permute_dims_view
- placein_linear_array
- println
- ravel
- reshape_copy
- reshape_view
- reshaped_range
- right_shift_arrays
- right_shift_arrays_scalar
- right_shift_scalar_array
- scalar_map
- size
- slice_view
- stack
- subtract_arrays
- subtract_arrays_scalar
- subtract_scalar_array
- swap
- swap_axes_copy
- swap_axes_view
- validate_axes
- validate_axis
- validate_initialized
- validate_pos_within_shape
- validate_positive_shape
- validate_shape_and_get_size
- validate_shape_match
- vflatten
- vpermute_dims
- vreshape
- vstack
- vswap_axes
- where_cond
- zeros
- zeros_like
Procedure Groups (39)
- add
- all_close
- all_reduce_prod
- all_reduce_sum
- atan2
- bitwise_and
- bitwise_andnot
- bitwise_or
- bitwise_xor
- ctranspose
- dim_reduce_prod
- dim_reduce_sum
- div
- equal
- gcd
- greater
- greater_equal
- heaviside
- hypot
- is_close
- keepdim_reduce_prod
- keepdim_reduce_sum
- lcm
- left_shift
- less
- less_equal
- logaddexp
- logical_and
- logical_or
- maximum
- minimum
- mod
- mul
- not_equal
- right_shift
- subtract
- transpose_copy
- transpose_view
- vtranspose
Types
MdArray ¶
MdArray :: struct($T: typeid, $Nd := ) { … // See source for fields }
A structure that represents a multi-dimensional array. it stores all data in a singular slice. The dimensionality of the array is decided based on the shape field. To traverse the array an array of strides is precomputed based on the shape of the array.
This structure does not now allows own the data in its buffer. If that's the case, then it's is called a view. Views may have shapes and strides that don't corresbond to the buffer length, typically because the view narrows the array or the shape of the arry has been permutated. How these fields are managed should not concern the user, as they are handled internally by Nuod.
CAUTION: do not create instances of this structure manually. Used the make_mdarray procedure instead. It ensures that the array is valid and can be traversed correctly.
Related Procedures With Parameters
- add_arrays
- add_arrays_scalar
- add_scalar_array
- all
- all_close_default
- all_close_with_args
- all_reduce_avg
- all_reduce_map
- all_reduce_max
- all_reduce_min
- all_reduce_prod_no_init
- all_reduce_prod_with_init
- all_reduce_sum_no_init
- all_reduce_sum_with_init
- any
- atan2_arrays
- atan2_arrays_scalar
- atan2_scalar_array
- bitwise_and_arrays
- bitwise_and_arrays_scalar
- bitwise_and_scalar_array
- bitwise_andnot_arrays
- bitwise_andnot_arrays_scalar
- bitwise_andnot_scalar_array
- bitwise_or_arrays
- bitwise_or_arrays_scalar
- bitwise_or_scalar_array
- bitwise_xor_arrays
- bitwise_xor_arrays_scalar
- bitwise_xor_scalar_array
- broadcast_map
- broadcast_shape
- broadcast_to
- cast_array
- copy_array
- dim_reduce_avg
- dim_reduce_map
- dim_reduce_max
- dim_reduce_min
- dim_reduce_prod_no_init
- dim_reduce_prod_with_init
- dim_reduce_sum_no_init
- dim_reduce_sum_with_init
- div_arrays
- div_arrays_scalar
- div_scalar_array
- element_wise_map
- eprint
- eprintln
- equal_arrays
- equal_arrays_scalar
- equal_scalar_array
- expand_dim_copy
- expand_dim_view
- extract_linear_array
- fills_like
- flatten_copy
- flatten_view
- fprint
- fprintln
- free_mdarray
- gcd_arrays
- gcd_arrays_scalar
- gcd_scalar_array
- get
- get_linear
- get_linear_ref
- get_ref
- get_type
- greater_arrays
- greater_arrays_scalar
- greater_equal_arrays
- greater_equal_arrays_scalar
- greater_equal_scalar_array
- greater_scalar_array
- heaviside_arrays
- heaviside_arrays_scalar
- heaviside_scalar_array
- hypot_arrays
- hypot_arrays_scalar
- hypot_scalar_array
- inplace_abs
- inplace_acos
- inplace_acosh
- inplace_asin
- inplace_asinh
- inplace_atan
- inplace_atanh
- inplace_bitwise_comp
- inplace_cbrt
- inplace_conj
- inplace_cos
- inplace_cosh
- inplace_degrees
- inplace_exp
- inplace_exp2
- inplace_ln
- inplace_log10
- inplace_log1p
- inplace_log2
- inplace_neg
- inplace_radians
- inplace_reciprocal
- inplace_sign
- inplace_sin
- inplace_sinc
- inplace_sinh
- inplace_sq
- inplace_sqrt
- inplace_tan
- inplace_tanh
- inplace_unary_map
- is_close_default
- is_close_with_args
- is_none
- keepdim_reduce_avg
- keepdim_reduce_map
- keepdim_reduce_max
- keepdim_reduce_min
- keepdim_reduce_prod_no_init
- keepdim_reduce_prod_with_init
- keepdim_reduce_sum_no_init
- keepdim_reduce_sum_with_init
- lcm_arrays
- lcm_arrays_scalar
- lcm_scalar_array
- left_shift_arrays
- left_shift_arrays_scalar
- left_shift_scalar_array
- less_arrays
- less_arrays_scalar
- less_equal_arrays
- less_equal_arrays_scalar
- less_equal_scalar_array
- less_scalar_array
- logaddexp_arrays
- logaddexp_arrays_scalar
- logaddexp_scalar_array
- logical_and_arrays
- logical_and_arrays_scalar
- logical_and_scalar_array
- logical_or_arrays
- logical_or_arrays_scalar
- logical_or_scalar_array
- max_arrays
- max_arrays_scalar
- max_scalar_array
- min_arrays
- min_arrays_scalar
- min_scalar_array
- mod_arrays
- mod_arrays_scalar
- mod_scalar_array
- mul_arrays
- mul_arrays_scalar
- mul_scalar_array
- narrow
- ndim
- not_equal_arrays
- not_equal_arrays_scalar
- not_equal_scalar_array
- ones_like
- outplace_abs
- outplace_acos
- outplace_acosh
- outplace_asin
- outplace_asinh
- outplace_atan
- outplace_atanh
- outplace_bitwise_comp
- outplace_cbrt
- outplace_conj
- outplace_cos
- outplace_cosh
- outplace_degrees
- outplace_exp
- outplace_exp2
- outplace_ln
- outplace_log10
- outplace_log1p
- outplace_log2
- outplace_neg
- outplace_radians
- outplace_reciprocal
- outplace_sign
- outplace_sin
- outplace_sinc
- outplace_sinh
- outplace_sq
- outplace_sqrt
- outplace_tan
- outplace_tanh
- outplace_unary_map
- permute_default_copy
- permute_default_view
- permute_dims_copy
- permute_dims_view
- placein_linear_array
- println
- ravel
- reshape_copy
- reshape_view
- right_shift_arrays
- right_shift_arrays_scalar
- right_shift_scalar_array
- scalar_map
- size
- slice_view
- subtract_arrays
- subtract_arrays_scalar
- subtract_scalar_array
- swap_axes_copy
- swap_axes_view
- validate_initialized
- validate_shape_match
- where_cond
- zeros_like
- add (procedure groups)
- all_close (procedure groups)
- all_reduce_prod (procedure groups)
- all_reduce_sum (procedure groups)
- atan2 (procedure groups)
- bitwise_and (procedure groups)
- bitwise_andnot (procedure groups)
- bitwise_or (procedure groups)
- bitwise_xor (procedure groups)
- ctranspose (procedure groups)
- dim_reduce_prod (procedure groups)
- dim_reduce_sum (procedure groups)
- div (procedure groups)
- equal (procedure groups)
- gcd (procedure groups)
- greater (procedure groups)
- greater_equal (procedure groups)
- heaviside (procedure groups)
- hypot (procedure groups)
- is_close (procedure groups)
- keepdim_reduce_prod (procedure groups)
- keepdim_reduce_sum (procedure groups)
- lcm (procedure groups)
- left_shift (procedure groups)
- less (procedure groups)
- less_equal (procedure groups)
- logaddexp (procedure groups)
- logical_and (procedure groups)
- logical_or (procedure groups)
- maximum (procedure groups)
- minimum (procedure groups)
- mod (procedure groups)
- mul (procedure groups)
- not_equal (procedure groups)
- right_shift (procedure groups)
- subtract (procedure groups)
- transpose_copy (procedure groups)
- transpose_view (procedure groups)
- vtranspose (procedure groups)
Related Procedures With Returns
Constants
N_THREADS ¶
N_THREADS :: #config(N_THREADS, 4)
THREAD_THR ¶
THREAD_THR :: #config(THREAD_THR, 1_000_000)
Variables
This section is empty.
Procedures
add_arrays ¶
add_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise addition operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
add_arrays_scalar ¶
add_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise addition operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
add_scalar_array ¶
add_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise addition operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
all ¶
all :: proc(mdarray: MdArray($T=bool, $Nd), location := #caller_location) -> (accum: bool, ok: bool) #optional_ok {…}
Verify that all elements in a boolean array are set to true.
Inputs:
mdarray: a multidimensional boolean array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: a boolean representing that all elements are set to true.
ok: an optional boolean for error handling.
all_close_default ¶
all_close_default :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), location := #caller_location) -> (result: bool, ok: bool) #optional_ok {…}
Verify that all the elements in two different arrays are close to each other based on the defualt tolerances.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
all_close_with_args ¶
all_close_with_args :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), rtol: f64, atol: f64, location := #caller_location) -> (result: bool, ok: bool) #optional_ok {…}
Verify that all the elements in two different arrays are close to each other based on custom tolerance values provided by the user.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
rtol: the relative tolerance.
atol: the absolute tolerance.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
all_reduce_avg ¶
all_reduce_avg :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (accum: $T, ok: bool) #optional_ok {…}
Reduce all elements in an array to their average value.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced final scalar value.
ok: an optional boolean for error handling.
all_reduce_map ¶
all_reduce_map :: proc(mdarray: MdArray($T, $Nd), f: proc($T, $T, .. ..$T) -> $T, initial: $T, .. args: ..$T, location := #caller_location) -> (accum: $T, ok: bool) #optional_ok {…}
Reduce all elements in an array to a singular value according to a binary operator.
Inputs:
mdarray: a multidimensional array.
f: a binary procedure with arguments.
initial: the initial value to reduce over.
args: the aguments to be provided to the binary operator f.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced final scalar value.
ok: an optional boolean for error handling.
all_reduce_max ¶
all_reduce_max :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (accum: $T, ok: bool) #optional_ok {…}
Reduce all elements in an array to their maximum value.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced final scalar value.
ok: an optional boolean for error handling.
all_reduce_min ¶
all_reduce_min :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (accum: $T, ok: bool) #optional_ok {…}
Reduce all elements in an array to their minimum value.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced final scalar value.
ok: an optional boolean for error handling.
all_reduce_prod_no_init ¶
all_reduce_prod_no_init :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (accum: $T, ok: bool) #optional_ok {…}
Reduce all elements in an array to their produce. takes no initial value.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced final scalar value.
ok: an optional boolean for error handling.
Related Procedure Groups
all_reduce_prod_with_init ¶
all_reduce_prod_with_init :: proc(mdarray: MdArray($T, $Nd), initial: $T, location := #caller_location) -> (accum: $T, ok: bool) #optional_ok {…}
Reduce all elements in an array to their produce. takes an initial value.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
mdarray: a multidimensional array.
initial: the initial value to reduce over.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced final scalar value.
ok: an optional boolean for error handling.
Related Procedure Groups
all_reduce_sum_no_init ¶
all_reduce_sum_no_init :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (accum: $T, ok: bool) #optional_ok {…}
Reduce all elements in an array to their sum value. takes no initial value.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced final scalar value.
ok: an optional boolean for error handling.
Related Procedure Groups
all_reduce_sum_with_init ¶
all_reduce_sum_with_init :: proc(mdarray: MdArray($T, $Nd), initial: $T, location := #caller_location) -> (accum: $T, ok: bool) #optional_ok {…}
Reduce all elements in an array to their sum value. takes an initial value.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
mdarray: a multidimensional array.
initial: the initial value to reduce over.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced final scalar value.
ok: an optional boolean for error handling.
Related Procedure Groups
any ¶
any :: proc(mdarray: MdArray($T=bool, $Nd), location := #caller_location) -> (accum: bool, ok: bool) #optional_ok {…}
Verify that at least one element in a boolean array are set to true.
Inputs:
mdarray: a multidimensional boolean array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: a boolean representing that any element is set to true.
ok: an optional boolean for error handling.
atan2_arrays ¶
atan2_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise arctan2 operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
atan2_arrays_scalar ¶
atan2_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise atan2 operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
atan2_scalar_array ¶
atan2_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise atan2 operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
bitwise_and_arrays ¶
bitwise_and_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise and operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
bitwise_and_arrays_scalar ¶
bitwise_and_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise and operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
bitwise_and_scalar_array ¶
bitwise_and_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise and operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
bitwise_andnot_arrays ¶
bitwise_andnot_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise 'and not' operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
bitwise_andnot_arrays_scalar ¶
bitwise_andnot_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise 'and not' operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
bitwise_andnot_scalar_array ¶
bitwise_andnot_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise 'and not' operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
bitwise_or_arrays ¶
bitwise_or_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise or operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
bitwise_or_arrays_scalar ¶
bitwise_or_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise or operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
bitwise_or_scalar_array ¶
bitwise_or_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise or operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
bitwise_xor_arrays ¶
bitwise_xor_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise exclusive or operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
bitwise_xor_arrays_scalar ¶
bitwise_xor_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise exclusive or operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
bitwise_xor_scalar_array ¶
bitwise_xor_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise exclusive or operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
broadcast_map ¶
broadcast_map :: proc( a: MdArray($T, $Nd), b: MdArray($T, $Nd), f: proc($T, $T, .. ..$S) -> $R, .. args: ..$S, allocator := context.allocator, location := #caller_location, ) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform custom binary operations on two arrays with broadcastable shapes (e.g. a.shape=(2, 1, 4) and b.shape=(2, 3, 1) => result.shape= (2, 3, 4)). This avoids any intermidate allocations that result from broadcasting arrays a and b before applying the binary operator.
Inputs:
a: a multidimensional array broadcastable to the shape of a.
b: a multidimensional array broadcastable to the shape of b.
f: a binary operator with arguments.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
broadcast_shape ¶
broadcast_shape :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), location := #caller_location) -> (result: [0]untyped integer, ok: bool) #optional_ok {…}
reconsile find the broadcasted shape of two copatible arrays. (e.g. a.shape=(2, 1, 4) and b.shape=(2, 3, 1) => result= (2, 3, 4)).
Inputs:
a: a multidimensional array broadcastable to the shape of a.
b: a multidimensional array broadcastable to the shape of b.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant shape.
ok: an optional boolean for error handling.
broadcast_to ¶
broadcast_to :: proc(mdarray: MdArray($T, $Nd), shape: [0]untyped integer, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Broadcasts an array by repeating elements across dimensions of size 1 based on a provided shape value. For instance, this procedure can broadcast an array of shape (2, 1, 4) to (2, 4, 4), by repeating all elements 4 times across the second dimension.
NOTE: It is possible to broadcast to a shape with higher dimensions, given that the lower dimensions in the provided shape are still compatible (e.g. (2, 4) -> (2, 2, 4)).
Inputs:
mdarray: the source multidimensional array.
shape: the broadcasted shape.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant broadcasted array.
ok: an optional boolean for error handling.
cast_array ¶
cast_array :: proc(source: MdArray($T, $Nd), $to_type: typeid, allocator := context.allocator, location := #caller_location) -> (mdarray: MdArray($T=typeid, $Nd), ok: bool) #optional_ok {…}
Casts the internal type of the array to a different type.
Inputs:
source: the source multidimensional array.
to_type: the destination type.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
mdarray: The resultant casted copy.
ok: an optional boolean for error handling.
cflatten ¶
cflatten :: flatten_copy
Create a flattened (collapse dimensions into one) copy of an array.
Inputs:
Nd: the number of dimensions before the expansion.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant reshaped copy.
ok: an optional boolean for error handling.
compute_strides ¶
compute_strides :: proc(shape: [0]untyped integer) -> (strides: [0]untyped integer) {…}
concat ¶
concat :: proc(mdarrays: []MdArray($T, $Nd), axis: untyped integer = 0, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Concatenate several arrays together along a certain axis. All dimensions must be identical except for the dimension along which concatenation occurs.
Inputs:
mdarrays: a slice that contains the arrays to concatenate.
axis: the axis to concatenate along.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant concatenated array.
ok: an optional boolean for error handling.
copy_array ¶
copy_array :: proc(source: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (mdarray: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Make a copy of an array.
Inputs:
source: the source multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
mdarray: The resultant copy.
ok: an optional boolean for error handling.
cpermute_dims ¶
cpermute_dims :: permute_dims_copy
Create a permuted copy of the provided array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
value: the value based on which the array will be filled
indices: the permutation indices.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant copy.
ok: an optional boolean for error handling.
Related Procedure Groups
creshape ¶
creshape :: reshape_copy
Create a copy of an array with a differnt shape.
Inputs:
mdarray: the source multidimensional array.
shape: the shape of the destination array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: The resultant reshaped copy.
ok: an optional boolean for error handling.
cswap_axes ¶
cswap_axes :: swap_axes_copy
Create a permuted copy of the provided array by swapping two axes.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
value: the value based on which the array will be filled
indices: the permutation indices.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant copy.
ok: an optional boolean for error handling.
dim_reduce_avg ¶
dim_reduce_avg :: proc($Nd := , mdarray: MdArray($T, $Nd), axis: untyped integer, allocator := context.allocator, location := #caller_location) -> (accum: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Reduce all elements along a certain dimension to their average value.
Inputs:
Nd: the inital number of dimension for the provided array.
mdarray: a multidimensional array.
axis: the axis along which reduction occurs.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced array.
ok: an optional boolean for error handling.
dim_reduce_map ¶
dim_reduce_map :: proc( $Nd := , mdarray: MdArray($T, $Nd), axis: untyped integer, f: proc($T, $T, .. ..$T) -> $T, initial: $T, .. args: ..$T, allocator := context.allocator, location := #caller_location, ) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Reduce all elements along a certain dimension according a custom binary operator.
Inputs:
Nd: the inital number of dimension for the provided array.
mdarray: a multidimensional array.
axis: the axis along which reduction occurs.
f: a binary procedure with arguments.
initial: the initial value to reduce over.
args: the aguments to be provided to the binary operator f.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the reduced reduced array.
ok: an optional boolean for error handling.
dim_reduce_max ¶
dim_reduce_max :: proc($Nd := , mdarray: MdArray($T, $Nd), axis: untyped integer, allocator := context.allocator, location := #caller_location) -> (accum: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Reduce all elements along a certain dimension to their maximum value.
Inputs:
Nd: the inital number of dimension for the provided array.
mdarray: a multidimensional array.
axis: the axis along which reduction occurs.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced array.
ok: an optional boolean for error handling.
dim_reduce_min ¶
dim_reduce_min :: proc($Nd := , mdarray: MdArray($T, $Nd), axis: untyped integer, allocator := context.allocator, location := #caller_location) -> (accum: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Reduce all elements along a certain dimension to their minimum value.
Inputs:
Nd: the inital number of dimension for the provided array.
mdarray: a multidimensional array.
axis: the axis along which reduction occurs.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced array.
ok: an optional boolean for error handling.
dim_reduce_prod_no_init ¶
dim_reduce_prod_no_init :: proc($Nd := , mdarray: MdArray($T, $Nd), axis: untyped integer, allocator := context.allocator, location := #caller_location) -> (accum: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Reduce all elements along a certain dimension to their produce. Takes no inital value.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
Nd: the inital number of dimension for the provided array.
mdarray: a multidimensional array.
axis: the axis along which reduction occurs.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced array.
ok: an optional boolean for error handling.
Related Procedure Groups
dim_reduce_prod_with_init ¶
dim_reduce_prod_with_init :: proc( $Nd := , mdarray: MdArray($T, $Nd), axis: untyped integer, initial: $T, allocator := context.allocator, location := #caller_location, ) -> (accum: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Reduce all elements along a certain dimension to their sum value. Takes an inital value.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
Nd: the inital number of dimension for the provided array.
mdarray: a multidimensional array.
axis: the axis along which reduction occurs.
initial: the initail value to reduce over.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced array.
ok: an optional boolean for error handling.
Related Procedure Groups
dim_reduce_sum_no_init ¶
dim_reduce_sum_no_init :: proc($Nd := , mdarray: MdArray($T, $Nd), axis: untyped integer, allocator := context.allocator, location := #caller_location) -> (accum: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Reduce all elements along a certain dimension to their sum value. Takes no inital value.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
Nd: the inital number of dimension for the provided array.
mdarray: a multidimensional array.
axis: the axis along which reduction occurs.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced array.
ok: an optional boolean for error handling.
Related Procedure Groups
dim_reduce_sum_with_init ¶
dim_reduce_sum_with_init :: proc( $Nd := , mdarray: MdArray($T, $Nd), axis: untyped integer, initial: $T, allocator := context.allocator, location := #caller_location, ) -> (accum: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Reduce all elements along a certain dimension to their sum value. Takes an inital value.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
Nd: the inital number of dimension for the provided array.
mdarray: a multidimensional array.
axis: the axis along which reduction occurs.
initial: the initail value to reduce over.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced array.
ok: an optional boolean for error handling.
Related Procedure Groups
div_arrays ¶
div_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise division operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
div_arrays_scalar ¶
div_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise division operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
div_scalar_array ¶
div_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise division operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
element_wise_map ¶
element_wise_map :: proc( a: MdArray($T, $Nd), b: MdArray($T, $Nd), f: proc($T, $T, .. ..$S) -> $R, .. args: ..$S, allocator := context.allocator, location := #caller_location, force_threaded: bool = false, ) -> (result: MdArray($T, $Nd), ok: bool) {…}
Perform a custom element-wise binary operation on two different arrays.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
f: a binary procedure with arguments.
args: arguments to be passed to the passed procedure.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
force_threaded(experimental): force this procedure to use threading, it will be ignored if the size of the arrays is smaller than the number of configured threads.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
eprintln ¶
eprintln :: proc(mdarray: MdArray($T, $Nd)) {…}
equal_arrays ¶
equal_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise equal operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
equal_arrays_scalar ¶
equal_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise equal operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
equal_scalar_array ¶
equal_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise equal operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
expand_dim_copy ¶
expand_dim_copy :: proc($Nd := , mdarray: MdArray($T, $Nd), axis: untyped integer, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Create a view of an array with an additional dimension. The dimension is specified based on the axis value.
Inputs:
Nd: the number of dimensions before the expansion.
mdarray: the source multidimensional array.
axis: the position in the shape, where the additional dimension is placed.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant reshaped copy.
ok: an optional boolean for error handling.
expand_dim_view ¶
expand_dim_view :: proc($Nd := , mdarray: MdArray($T, $Nd), axis: untyped integer, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Create a view of an array with an additional dimension. The dimension is specified based on the axis value.
Inputs:
Nd: the number of dimensions before the expansion.
mdarray: the source multidimensional array.
axis: the position in the shape, where the additional dimension is placed.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: The resultant reshaped view.
ok: an optional boolean for error handling.
extract_linear_array ¶
extract_linear_array :: proc(mdarray: MdArray($T, $Nd), result: []$T, idx: untyped integer, axis: untyped integer, location := #caller_location) -> (ok: bool) {…}
Extract a contingent slice a long a certain axis based on the argument "idx" which indexes the elements of the axis dimension.
Inputs:
mdarray: a multidimensional array.
result: the output slice to copy values to.
idx: the index of the axis dimension sigments.
axis: the selected axis dimension.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
eye ¶
eye :: proc( $T: typeid, n_rows: u64, n_cols: u64 = 0, diag_idx: untyped integer = 0, allocator := context.allocator, location := #caller_location, ) -> (mdarray: MdArray($T=typeid, $Nd=2), ok: bool) #optional_ok {…}
Create a matrix(an array with two dimensions) with ones at its diagonal and zeros
otherwise. the position of the diagonal can be shifted based on the value of
diag_idx (supports negative values).
Inputs:
T: the type of created array.
n_rows: number of rows.
n_cols: number of columns.
diag_idx: position of the diagonal line.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
mdarray: The resultant eye matrix.
ok: an optional boolean for error handling.
fills ¶
fills :: proc(value: $T, shape: [0]untyped integer, allocator := context.allocator, location := #caller_location) -> (mdarray: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Create a multi-dimensional array based on the provided shape, whose elements are filled with the provided value.
NOTE: the internal type of the array corresponds to the type of the provided value.
Inputs:
value: the value based on which the array will be filled
shape: the shape of the multi-dimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
mdarray: a multidimsional array filled with the provided value.
ok: an optional boolean for error handling.
fills_like ¶
fills_like :: proc(value: $T, source: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (mdarray: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Create a multi-dimensional array with an identical shape to another array, whose elements are filled with the provided value.
Inputs:
value: the value based on which the array will be filled
source: the array based on which the shape of the created array is decided. Its internal
type doesn't matter. The created array will follow the type of the provided value instead.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
mdarray: a multidimsional array filled with the provided value.
ok: an optional boolean for error handling.
flatten_copy ¶
flatten_copy :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd=1), ok: bool) #optional_ok {…}
Create a flattened (collapse dimensions into one) copy of an array.
Inputs:
Nd: the number of dimensions before the expansion.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant reshaped copy.
ok: an optional boolean for error handling.
flatten_view ¶
flatten_view :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (result: MdArray($T, $Nd=1), ok: bool) #optional_ok {…}
Create a flattened (collapse dimensions into one) view of an array.
Inputs:
Nd: the number of dimensions before the expansion.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant reshaped view.
ok: an optional boolean for error handling.
free_mdarray ¶
free_mdarray :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> runtime.Allocator_Error {…}
Frees the internal memory of the array. The provided array will become empty. You sould no longer use a freed array.
NOTE: This procedure will skip a view array. A warning will be logged as a reminder.
Inputs:
mdarray: a multidimsional array of any internal type.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
allocation error value. .None implies that no error has occured.
from_range ¶
from_range :: proc( $T: typeid, end: untyped integer, begin: untyped integer = 0, step: untyped integer = 1, allocator := context.allocator, location := #caller_location, ) -> (mdarray: MdArray($T=typeid, $Nd=1), ok: bool) #optional_ok {…}
Create a vector(an array with one dimension), based on range specified by the begin,
step and end values provided.
Inputs:
T: the type of created array.
end: the last value in the range (non-exclusive).
begin: the first value in the range.
step: the size of the step taken between values within the range.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
mdarray: The resultant range vector.
ok: an optional boolean for error handling.
from_slice ¶
from_slice :: proc(sl: []$T, shape: [0]untyped integer, allocator := context.allocator, location := #caller_location) -> (mdarray: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Create a multi-dimensional array from an Odin slice. The size of the array and the shape provided have to be compatible. In other words the total size of the array should be equal to the multiple of all dimensions in the shape.
NOTE: this procedure will create a copy of the provided slice. It does not create a view.
Inputs:
sl: the slice from which the array will be created.
shape: the shape of the multi-dimensional array. Must be compatible with the size of the slice.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
mdarray: a multidimsional array with same type as the provided slice.
ok: an optional boolean for error handling.
gcd_arrays ¶
gcd_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise greatest common denominator operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
gcd_arrays_scalar ¶
gcd_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise greatest common denominator operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
gcd_scalar_array ¶
gcd_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise greatest common denominator operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
get ¶
get :: proc(mdarray: MdArray($T, $Nd), pos: [0]untyped integer, location := #caller_location) -> (val: $T, ok: bool) #optional_ok {…}
get a copy to the element at provided position.
Inputs:
mdarray: a multidimensional array.
pos: the position at which the element is placed.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
val: a copy to the selected element.
ok: an optional boolean for error handling.
get_default_tol ¶
Get the default tolerance values set by Nuod
Inputs:
T: first multidimensional array.
Returns:
rtol: the default relative tolerance.
atol: the default absolute tolerance.
ok: an optional boolean for error handling.
get_linear ¶
get_linear :: proc(mdarray: MdArray($T, $Nd), idx: untyped integer, location := #caller_location) -> (val: $T) {…}
get a copy to the element at the linear index.
Inputs:
mdarray: a multidimensional array.
idx: the linear index of an element.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
val: a copy to the selected element.
get_linear_ref ¶
get_linear_ref :: proc(mdarray: MdArray($T, $Nd), idx: untyped integer, location := #caller_location) -> (val: ^$T) {…}
get a reference to the element at the linear index.
Inputs:
mdarray: a multidimensional array.
idx: the linear index of an element.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
val: a reference to the selected element.
get_reduced_pos ¶
get_reduced_pos :: proc(shape: [0]untyped integer, idx: untyped integer, axis: untyped integer) -> (pos: [0]untyped integer) {…}
Reduce a one of the dimensions in the provided arrays to 1 and find the corresponding position, based on a linear index.
Inputs:
shape: shape to reduce.
idx: the linear buffer index.
axis: the dimension to be reduced.
Returns:
pos: computed position.
get_ref ¶
get_ref :: proc(mdarray: MdArray($T, $Nd), pos: [0]untyped integer, location := #caller_location) -> (val: ^$T, ok: bool) #optional_ok {…}
get a reference to the element at provided position.
Inputs:
mdarray: a multidimensional array.
pos: the position at which the element is placed.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
val: a reference to the selected element.
ok: an optional boolean for error handling.
get_type ¶
Retrives the internal type of the array.
Inputs:
mdarray: a multidimsional array of any internal type.
Returns:
the array's internal type.
greater_arrays ¶
greater_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise greater than operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
greater_arrays_scalar ¶
greater_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise greater than operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
greater_equal_arrays ¶
greater_equal_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise greater than or equal operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
greater_equal_arrays_scalar ¶
greater_equal_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise greater than or equal operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
greater_equal_scalar_array ¶
greater_equal_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise greater than or equal operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
greater_scalar_array ¶
greater_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise greater than operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
heaviside_arrays ¶
heaviside_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise Heaviside step operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
heaviside_arrays_scalar ¶
heaviside_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise Heaviside step operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
heaviside_scalar_array ¶
heaviside_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise Heaviside step operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
hstack ¶
hstack :: proc(mdarrays: []MdArray($T, $Nd=1), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd=1), ok: bool) #optional_ok {…}
Stack several vector arrays horizontally.
Inputs:
mdarrays: a slice that contains the arrays to stack.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant stack array.
ok: an optional boolean for error handling.
hypot_arrays ¶
hypot_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Find the element-wise hypotenuse operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
hypot_arrays_scalar ¶
hypot_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Find the element-wise hypotenuse operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
hypot_scalar_array ¶
hypot_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Find the element-wise hypotenuse operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
i_abs ¶
i_abs :: inplace_abs
Apply the absolute operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_acos ¶
i_acos :: inplace_acos
Apply the arccosine operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_acosh ¶
i_acosh :: inplace_acosh
Apply the hyperpolic arccosine operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_asin ¶
i_asin :: inplace_asin
Apply the arcsine operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_asinh ¶
i_asinh :: inplace_asinh
Apply the hyperpolic arcsine operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_atan ¶
i_atan :: inplace_atan
Apply the arctan operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_atanh ¶
i_atanh :: inplace_atanh
Apply the hyperpolic arctan operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_bitwise_comp ¶
i_bitwise_comp :: inplace_bitwise_comp
Apply the bitwise complement operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_cbrt ¶
i_cbrt :: inplace_cbrt
Apply the cube root operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_conj ¶
i_conj :: inplace_conj
Apply the conjugate operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_cos ¶
i_cos :: inplace_cos
Apply the cosine operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_cosh ¶
i_cosh :: inplace_cosh
Apply the hyperpolic cosine operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_deg2rad ¶
i_deg2rad :: inplace_radians
Convert all elements in the array from degrees to radian in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_degrees ¶
i_degrees :: inplace_degrees
Convert all elements in the array from radian to degress in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_degs ¶
i_degs :: inplace_degrees
Convert all elements in the array from radian to degress in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_exp ¶
i_exp :: inplace_exp
Apply the exponential operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_exp2 ¶
i_exp2 :: inplace_exp2
Apply the exponential operator (base of 2) to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_ln ¶
i_ln :: inplace_ln
Apply the natural logarithm operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_log10 ¶
i_log10 :: inplace_log10
Apply the logarithm operator (base of 10) to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_log1p ¶
i_log1p :: inplace_log1p
Apply the natural logarithm operator with one plus to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_log2 ¶
i_log2 :: inplace_log2
Apply the logarithm operator (base of 2) to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_neg ¶
i_neg :: inplace_neg
Apply the negating operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_rad2deg ¶
i_rad2deg :: inplace_degrees
Convert all elements in the array from radian to degress in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_radians ¶
i_radians :: inplace_radians
Convert all elements in the array from degrees to radian in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_rads ¶
i_rads :: inplace_radians
Convert all elements in the array from degrees to radian in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_reciprocal ¶
i_reciprocal :: inplace_reciprocal
Apply the reciprocal operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_sign ¶
i_sign :: inplace_sign
Apply the sign operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_sin ¶
i_sin :: inplace_sin
Apply the sine operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_sinc ¶
i_sinc :: inplace_sinc
Apply the sine cardinal operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_sinh ¶
i_sinh :: inplace_sinh
Apply the hyperpolic sine operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_sq ¶
i_sq :: inplace_sq
Apply the square operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_sqrt ¶
i_sqrt :: inplace_sqrt
Apply the square root operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_tan ¶
i_tan :: inplace_tan
Apply the tan operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
i_tanh ¶
i_tanh :: inplace_tanh
Apply the hyperpolic tan operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
identity ¶
identity :: proc($T: typeid, n: u64, allocator := context.allocator, location := #caller_location) -> (mdarray: MdArray($T=typeid, $Nd=2), ok: bool) #optional_ok {…}
Create a square identity matrix(an array with two dimensions).
Inputs:
T: the type of created array.
n: the number of rows or columns in the matrix.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
mdarray: The resultant identity matrix.
ok: an optional boolean for error handling.
inplace_abs ¶
inplace_abs :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the absolute operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_acos ¶
inplace_acos :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the arccosine operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_acosh ¶
inplace_acosh :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the hyperpolic arccosine operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_asin ¶
inplace_asin :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the arcsine operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_asinh ¶
inplace_asinh :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the hyperpolic arcsine operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_atan ¶
inplace_atan :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the arctan operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_atanh ¶
inplace_atanh :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the hyperpolic arctan operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_bitwise_comp ¶
inplace_bitwise_comp :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the bitwise complement operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_cbrt ¶
inplace_cbrt :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the cube root operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_conj ¶
inplace_conj :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the conjugate operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_cos ¶
inplace_cos :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the cosine operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_cosh ¶
inplace_cosh :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the hyperpolic cosine operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_degrees ¶
inplace_degrees :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Convert all elements in the array from radian to degress in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_exp ¶
inplace_exp :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the exponential operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_exp2 ¶
inplace_exp2 :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the exponential operator (base of 2) to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_ln ¶
inplace_ln :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the natural logarithm operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_log10 ¶
inplace_log10 :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the logarithm operator (base of 10) to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_log1p ¶
inplace_log1p :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the natural logarithm operator with one plus to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_log2 ¶
inplace_log2 :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the logarithm operator (base of 2) to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_neg ¶
inplace_neg :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the negating operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_radians ¶
inplace_radians :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Convert all elements in the array from degrees to radian in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_reciprocal ¶
inplace_reciprocal :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the reciprocal operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_sign ¶
inplace_sign :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the sign operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_sin ¶
inplace_sin :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the sine operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_sinc ¶
inplace_sinc :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the sine cardinal operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_sinh ¶
inplace_sinh :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the hyperpolic sine operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_sq ¶
inplace_sq :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the square operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_sqrt ¶
inplace_sqrt :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the square root operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_tan ¶
inplace_tan :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the tan operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_tanh ¶
inplace_tanh :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (ok: bool) {…}
Apply the hyperpolic tan operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
inplace_unary_map ¶
inplace_unary_map :: proc(mdarray: MdArray($T, $Nd), f: proc(^$T), location := #caller_location, force_threaded: bool = false) -> (ok: bool) {…}
Apply a custom unary operator to all elements in the array in place.
Inputs:
mdarray: a multidimensional array.
f: a unary procedure.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
is_close_default ¶
is_close_default :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Verify in an element-wise manner that the elements in two different arrays are close to each other based on the defualt tolerances.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
is_close_with_args ¶
is_close_with_args :: proc( a: MdArray($T, $Nd), b: MdArray($T, $Nd), rtol: f64, atol: f64, allocator := context.allocator, location := #caller_location, ) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Verify in an element-wise manner that the elements in two different arrays are close to each other based on custom tolerance values provided by the user.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
rtol: the relative tolerance.
atol: the absolute tolerance.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
is_empty ¶
is_empty :: is_none
keepdim_reduce_avg ¶
keepdim_reduce_avg :: proc(mdarray: MdArray($T, $Nd), axis: untyped integer, allocator := context.allocator, location := #caller_location) -> (accum: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Reduce all elements along a certain dimension to their average value while keeping the dimension.
Inputs:
mdarray: a multidimensional array.
axis: the axis along which reduction occurs.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced array.
ok: an optional boolean for error handling.
keepdim_reduce_map ¶
keepdim_reduce_map :: proc( $Nd := , mdarray: MdArray($T, $Nd), axis: untyped integer, f: proc($T, $T, .. ..$T) -> $T, initial: $T, .. args: ..$T, allocator := context.allocator, location := #caller_location, ) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Reduce all elements along a certain dimension according a custom binary operator. Insures the reduce dimension is not discarded.
Inputs:
Nd: the inital number of dimension for the provided array.
mdarray: a multidimensional array.
axis: the axis along which reduction occurs.
f: a binary procedure with arguments.
initial: the initial value to reduce over.
args: the aguments to be provided to the binary operator f.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the reduced reduced array.
ok: an optional boolean for error handling.
keepdim_reduce_max ¶
keepdim_reduce_max :: proc(mdarray: MdArray($T, $Nd), axis: untyped integer, allocator := context.allocator, location := #caller_location) -> (accum: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Reduce all elements along a certain dimension to their maximum value while keeping the dimension.
Inputs:
mdarray: a multidimensional array.
axis: the axis along which reduction occurs.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced array.
ok: an optional boolean for error handling.
keepdim_reduce_min ¶
keepdim_reduce_min :: proc(mdarray: MdArray($T, $Nd), axis: untyped integer, allocator := context.allocator, location := #caller_location) -> (accum: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Reduce all elements along a certain dimension to their minimum value while keeping the dimension.
Inputs:
mdarray: a multidimensional array.
axis: the axis along which reduction occurs.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced array.
ok: an optional boolean for error handling.
keepdim_reduce_prod_no_init ¶
keepdim_reduce_prod_no_init :: proc(mdarray: MdArray($T, $Nd), axis: untyped integer, allocator := context.allocator, location := #caller_location) -> (accum: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Reduce all elements along a certain dimension to their produce while keeping the dimension. Takes no inital value.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
mdarray: a multidimensional array.
axis: the axis along which reduction occurs.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced array.
ok: an optional boolean for error handling.
Related Procedure Groups
keepdim_reduce_prod_with_init ¶
keepdim_reduce_prod_with_init :: proc(mdarray: MdArray($T, $Nd), axis: untyped integer, initial: $T, allocator := context.allocator, location := #caller_location) -> (accum: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Reduce all elements along a certain dimension to their product while keeping the dimension. Takes an inital value.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
mdarray: a multidimensional array.
axis: the axis along which reduction occurs.
initial: the initial value to reduce over.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the reduced reduced array.
ok: an optional boolean for error handling.
Related Procedure Groups
keepdim_reduce_sum_no_init ¶
keepdim_reduce_sum_no_init :: proc(mdarray: MdArray($T, $Nd), axis: untyped integer, allocator := context.allocator, location := #caller_location) -> (accum: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Reduce all elements along a certain dimension to their sum while keeping the dimension. Takes no inital value.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
mdarray: a multidimensional array.
axis: the axis along which reduction occurs.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
accum: the reduced array.
ok: an optional boolean for error handling.
Related Procedure Groups
keepdim_reduce_sum_with_init ¶
keepdim_reduce_sum_with_init :: proc(mdarray: MdArray($T, $Nd), axis: untyped integer, initial: $T, allocator := context.allocator, location := #caller_location) -> (accum: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Reduce all elements along a certain dimension to their sum while keeping the dimension. Takes an inital value.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
mdarray: a multidimensional array.
axis: the axis along which reduction occurs.
initial: the initial value to reduce over.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the reduced reduced array.
ok: an optional boolean for error handling.
Related Procedure Groups
lcm_arrays ¶
lcm_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise least common multiple operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
lcm_arrays_scalar ¶
lcm_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise least common multiple operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
lcm_scalar_array ¶
lcm_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise least common multiple operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
left_shift_arrays ¶
left_shift_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise left shift operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
left_shift_arrays_scalar ¶
left_shift_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise left shift operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
left_shift_scalar_array ¶
left_shift_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise left shift operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
less_arrays ¶
less_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise less than operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
less_arrays_scalar ¶
less_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise less than operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
less_equal_arrays ¶
less_equal_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise less than or equal operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
less_equal_arrays_scalar ¶
less_equal_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise less than or equal operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
less_equal_scalar_array ¶
less_equal_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise less than or equal operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
less_scalar_array ¶
less_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise less than operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
linspace ¶
linspace :: proc( $T: typeid, begin: typeid, end: typeid, n: untyped integer, endpoint: bool = true, allocator := context.allocator, location := #caller_location, ) -> (mdarray: MdArray($T=typeid, $Nd=1), ok: bool) #optional_ok {…}
Create a vector(an array with one dimension) that hosts a linear space of size n.
NOTE: this procedure is restricted to only float and complex values.
Inputs:
T: the type of created array.
begin: the first value in the space.
end: the last value in the space.
n: the size fo the linear space.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
mdarray: The resultant vector array.
ok: an optional boolean for error handling.
logaddexp_arrays ¶
logaddexp_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise logarithmic sum of exponentials operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
logaddexp_arrays_scalar ¶
logaddexp_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise logarithmic sum of exponentials operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
logaddexp_scalar_array ¶
logaddexp_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise logarithmic sum of exponentials operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
logical_and_arrays ¶
logical_and_arrays :: proc(a: MdArray($T=bool, $Nd), b: MdArray($T=bool, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise logical and operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
logical_and_arrays_scalar ¶
logical_and_arrays_scalar :: proc(a: MdArray($T=bool, $Nd), b: bool, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise logical and operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
logical_and_scalar_array ¶
logical_and_scalar_array :: proc(a: bool, b: MdArray($T=bool, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise logical and operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
logical_or_arrays ¶
logical_or_arrays :: proc(a: MdArray($T=bool, $Nd), b: MdArray($T=bool, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise logical or operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
logical_or_arrays_scalar ¶
logical_or_arrays_scalar :: proc(a: MdArray($T=bool, $Nd), b: bool, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise logical or operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
logical_or_scalar_array ¶
logical_or_scalar_array :: proc(a: bool, b: MdArray($T=bool, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise logical or operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
logspace ¶
logspace :: proc( $T: typeid, begin: typeid, end: typeid, n: untyped integer, base: f64 = 10.0, endpoint: bool = true, allocator := context.allocator, location := #caller_location, ) -> (mdarray: MdArray($T=typeid, $Nd=1), ok: bool) #optional_ok {…}
Create a vector(an array with one dimension) that hosts a logrithmic space of size n.
NOTE: this procedure is restricted to only float values.
Inputs:
T: the type of created array.
begin: the first value in the space.
end: the last value in the space.
n: the size fo the linear space.
base: base of logirthmic space (defaults to 10)
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
mdarray: The resultant vector array.
ok: an optional boolean for error handling.
make_mdarray ¶
make_mdarray :: proc($T: typeid, shape: [0]untyped integer, allocator := context.allocator, location := #caller_location) -> (mdarray: MdArray($T=typeid, $Nd), ok: bool) #optional_ok {…}
Properly creates an instance of a multi-dimensional array based on the provided type and shape. The values are not assigned and will therefore follow the zero-value of the provided type.
Inputs:
T: the type of the array to be created.
shape: an Odin array that holds the shape of the created multi-dimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
mdarray: The created multi-dimensional array.
ok: an optional boolean for error handling.
max_arrays ¶
max_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise maximum operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
max_arrays_scalar ¶
max_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise maximum operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
max_scalar_array ¶
max_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise maximum operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
min_arrays ¶
min_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise minimum operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
min_arrays_scalar ¶
min_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise minimum operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
min_scalar_array ¶
min_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise minimum operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
mod_arrays ¶
mod_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise modulus operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
mod_arrays_scalar ¶
mod_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise modulus operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
mod_scalar_array ¶
mod_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise modulus operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
mul_arrays ¶
mul_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise multiplication operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
mul_arrays_scalar ¶
mul_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise multiplication operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
mul_scalar_array ¶
mul_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise multiplication operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
narrow ¶
narrow :: proc(mdarray: MdArray($T, $Nd), axis: untyped integer, begin: untyped integer = 0, end: untyped integer = -1, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
find a narrow view of an array by reducing the size of a specific dimension.
Inputs:
mdarray: a multidimensional array.
axis: the axis dimension to narrow along.
begin: the start of the narrowed view.
end: the end of the narrowed view.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant view.
ok: an optional boolean for error handling.
ndim ¶
ndim :: proc(mdarray: MdArray($T, $Nd)) -> untyped integer {…}
Retrives the number of dimensions of the array.
Inputs:
mdarray: a multidimsional array of any internal type.
Returns:
number of dimensions.
not_equal_arrays ¶
not_equal_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise not equal operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
not_equal_arrays_scalar ¶
not_equal_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise not equal operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
not_equal_scalar_array ¶
not_equal_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T=bool, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise not equal operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
o_abs ¶
o_abs :: outplace_abs
Apply the absolute operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_acos ¶
o_acos :: outplace_acos
Apply the arccosine operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_acosh ¶
o_acosh :: outplace_acosh
Apply the hyperpolic arccosine operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_asin ¶
o_asin :: outplace_asin
Apply the arcsine operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_asinh ¶
o_asinh :: outplace_asinh
Apply the hyperpolic arcsine operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_atan ¶
o_atan :: outplace_atan
Apply the arctan operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_atanh ¶
o_atanh :: outplace_atanh
Apply the hyperpolic arctan operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_bitwise_comp ¶
o_bitwise_comp :: outplace_bitwise_comp
Apply the bitwise complement operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_cbrt ¶
o_cbrt :: outplace_cbrt
Apply the cube root operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_conj ¶
o_conj :: outplace_conj
Apply the conjugate operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_cos ¶
o_cos :: outplace_cos
Apply the cosine operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_cosh ¶
o_cosh :: outplace_cosh
Apply the hyperpolic cosine operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_deg2rad ¶
o_deg2rad :: outplace_radians
Convert all elements in the array from degrees to radian out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_degrees ¶
o_degrees :: outplace_degrees
Convert all elements in the array from radian to degress out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_degs ¶
o_degs :: outplace_degrees
Convert all elements in the array from radian to degress out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_exp ¶
o_exp :: outplace_exp
Apply the exponential operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_exp2 ¶
o_exp2 :: outplace_exp2
Apply the exponential operator (base of 2) to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_ln ¶
o_ln :: outplace_ln
Apply the natural logarithm operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_log10 ¶
o_log10 :: outplace_log10
Apply the logarithm operator (base of 10) to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_log1p ¶
o_log1p :: outplace_log1p
Apply the natural logarithm operator with one plus to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_log2 ¶
o_log2 :: outplace_log2
Apply the logarithm operator (base of 2) to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_neg ¶
o_neg :: outplace_neg
Apply the negating operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_rad2deg ¶
o_rad2deg :: outplace_degrees
Convert all elements in the array from radian to degress out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_radians ¶
o_radians :: outplace_radians
Convert all elements in the array from degrees to radian out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_rads ¶
o_rads :: outplace_radians
Convert all elements in the array from degrees to radian out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_reciprocal ¶
o_reciprocal :: outplace_reciprocal
Apply the reciprocal operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_sign ¶
o_sign :: outplace_sign
Apply the sign operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_sin ¶
o_sin :: outplace_sin
Apply the sine operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_sinc ¶
o_sinc :: outplace_sinc
Apply the sine cardinal operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_sinh ¶
o_sinh :: outplace_sinh
Apply the hyperpolic sine operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_sq ¶
o_sq :: outplace_sq
Apply the square operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_sqrt ¶
o_sqrt :: outplace_sqrt
Apply the square root operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_tan ¶
o_tan :: outplace_tan
Apply the tan operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
o_tanh ¶
o_tanh :: outplace_tanh
Apply the hyperpolic tan operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
ones ¶
ones :: proc($T: typeid, shape: [0]untyped integer, allocator := context.allocator, location := #caller_location) -> (mdarray: MdArray($T=typeid, $Nd), ok: bool) #optional_ok {…}
Create a multi-dimensional array based on the provided shape, whose elements are all ones.
Inputs:
T: the type of created array.
shape: the shape of the multi-dimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
mdarray: a multidimsional array filled with ones.
ok: an optional boolean for error handling.
ones_like ¶
ones_like :: proc($T: typeid, source: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (mdarray: MdArray($T=typeid, $Nd), ok: bool) #optional_ok {…}
Create a multi-dimensional array with an identical shape to another array, whose elements are all with ones.
Inputs:
T: the type of created array.
source: the array based on which the shape of the created array is decided. Its internal
type doesn't matter. The created array will follow the type above.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
mdarray: a multidimsional array filled with ones.
ok: an optional boolean for error handling.
outplace_abs ¶
outplace_abs :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the absolute operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_acos ¶
outplace_acos :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the arccosine operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_acosh ¶
outplace_acosh :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the hyperpolic arccosine operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_asin ¶
outplace_asin :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the arcsine operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_asinh ¶
outplace_asinh :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the hyperpolic arcsine operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_atan ¶
outplace_atan :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the arctan operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_atanh ¶
outplace_atanh :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the hyperpolic arctan operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_bitwise_comp ¶
outplace_bitwise_comp :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the bitwise complement operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_cbrt ¶
outplace_cbrt :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the cube root operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_conj ¶
outplace_conj :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the conjugate operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_cos ¶
outplace_cos :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the cosine operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_cosh ¶
outplace_cosh :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the hyperpolic cosine operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_degrees ¶
outplace_degrees :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Convert all elements in the array from radian to degress out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_exp ¶
outplace_exp :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the exponential operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_exp2 ¶
outplace_exp2 :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the exponential operator (base of 2) to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_ln ¶
outplace_ln :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the natural logarithm operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_log10 ¶
outplace_log10 :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the logarithm operator (base of 10) to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_log1p ¶
outplace_log1p :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the natural logarithm operator with one plus to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_log2 ¶
outplace_log2 :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the logarithm operator (base of 2) to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_neg ¶
outplace_neg :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the negating operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_radians ¶
outplace_radians :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Convert all elements in the array from degrees to radian out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_reciprocal ¶
outplace_reciprocal :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the reciprocal operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_sign ¶
outplace_sign :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the sign operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_sin ¶
outplace_sin :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the sine operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_sinc ¶
outplace_sinc :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the sine cardinal operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_sinh ¶
outplace_sinh :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the hyperpolic sine operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_sq ¶
outplace_sq :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the square operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_sqrt ¶
outplace_sqrt :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the square root operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_tan ¶
outplace_tan :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the tan operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_tanh ¶
outplace_tanh :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply the hyperpolic tan operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
outplace_unary_map ¶
outplace_unary_map :: proc(mdarray: MdArray($T, $Nd), f: proc(^$T), allocator := context.allocator, location := #caller_location, force_threaded: bool = false) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Apply a custom unary operator to all elements in the array out of place.
Inputs:
mdarray: a multidimensional array.
f: a unary procedure.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
permute_default_copy ¶
permute_default_copy :: proc(mdarray: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Create a permuted copy of the provided array. This will use the default permutation of reversing the order of the dimensions.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
value: the value based on which the array will be filled
indices: the permutation indices.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant copy.
ok: an optional boolean for error handling.
Related Procedure Groups
permute_default_view ¶
permute_default_view :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Create a permuted view of the provided array. This will use the default permutation of reversing the order of the dimensions.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
value: the value based on which the array will be filled
indices: the permutation indices.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant view.
ok: an optional boolean for error handling.
Related Procedure Groups
permute_dims_copy ¶
permute_dims_copy :: proc(mdarray: MdArray($T, $Nd), indices: [0]untyped integer, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Create a permuted copy of the provided array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
value: the value based on which the array will be filled
indices: the permutation indices.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant copy.
ok: an optional boolean for error handling.
Related Procedure Groups
permute_dims_view ¶
permute_dims_view :: proc(mdarray: MdArray($T, $Nd), indices: [0]untyped integer, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Create a permuted view of the provided array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
value: the value based on which the array will be filled
indices: the permutation indices.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant view.
ok: an optional boolean for error handling.
Related Procedure Groups
placein_linear_array ¶
placein_linear_array :: proc(mdarray: MdArray($T, $Nd), arr: []$T, idx: untyped integer, axis: untyped integer, location := #caller_location) -> (ok: bool) {…}
place a contingent slice a long a certain axis based on the argument "idx" which indexes the elements of the axis dimension.
Inputs:
mdarray: a multidimensional array.
arr: the input slice to place a copy of into mdarray.
idx: the index of the axis dimension sigments.
axis: the selected axis dimension.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
ok: an optional boolean for error handling.
reshape_copy ¶
reshape_copy :: proc(mdarray: MdArray($T, $Nd), shape: [0]untyped integer, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Create a copy of an array with a differnt shape.
Inputs:
mdarray: the source multidimensional array.
shape: the shape of the destination array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: The resultant reshaped copy.
ok: an optional boolean for error handling.
reshape_view ¶
reshape_view :: proc(mdarray: MdArray($T, $Nd), shape: [0]untyped integer, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Create a view of an array with a differnt shape.
Inputs:
mdarray: the source multidimensional array.
shape: the shape of the destination array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: The resultant reshaped view.
ok: an optional boolean for error handling.
reshaped_range ¶
reshaped_range :: proc( $T: typeid, shape: [0]untyped integer, begin: untyped integer = 0, step: untyped integer = 1, allocator := context.allocator, location := #caller_location, ) -> (mdarray: MdArray($T=typeid, $Nd), ok: bool) #optional_ok {…}
Create a multidimensional array reshaped from a range of values specified by the begin
and step values provided.
NOTE: the end value is unnecessary in this function, since it is inferred from the shape.
Inputs:
T: the type of created array.
shape: the shape of the resultant array.
begin: the first value in the range.
step: the size of the step taken between values within the range.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
mdarray: The resultant multidimensional array.
ok: an optional boolean for error handling.
right_shift_arrays ¶
right_shift_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise right shift operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
right_shift_arrays_scalar ¶
right_shift_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise right shift operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
right_shift_scalar_array ¶
right_shift_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise bitwise right shift operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
scalar_map ¶
scalar_map :: proc( a: MdArray($T, $Nd), b: $T, f: proc($T, $T, .. ..$S) -> $R, .. args: ..$S, flip: bool = false, allocator := context.allocator, location := #caller_location, force_threaded: bool = false, ) -> (result: MdArray($T, $Nd), ok: bool) {…}
Perform a custom element-wise binary operation on an arrays and a scalar.
Inputs:
a: a multidimensional array.
b: a scalar value.
f: a binary procedure with arguments.
args: arguments to be passed to the passed procedure.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
force_threaded(experimental): force this procedure to use threading, it will be ignored if the size of the arrays is smaller than the number of configured threads.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
size ¶
size :: proc(mdarray: MdArray($T, $Nd)) -> untyped integer {…}
Retrives the total number of elements in the array. If the array is a view, it will only retrive the number of viewed elements only.
Inputs:
mdarray: a multidimsional array of any internal type.
Returns:
number of elements.
slice_view ¶
slice_view :: proc($Nd := , mdarray: MdArray($T, $Nd), index: untyped integer, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Create a view of a singular subarray base on the index of the first dimension.
Inputs:
mdarray: a multidimensional array.
axis: the axis dimension to narrow along.
begin: the start of the narrowed view.
end: the end of the narrowed view.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant view.
ok: an optional boolean for error handling.
stack ¶
stack :: proc($Nd := , mdarrays: []MdArray($T, $Nd), axis: untyped integer = 0, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Stack several arrays of similar dimensions along a certain axis/dimension.
Inputs:
Nd: the number of dimensions of the original arrays.
mdarrays: a slice that contains the arrays to stack.
axis: the axis along with the arrays are stacked.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant stack array.
ok: an optional boolean for error handling.
subtract_arrays ¶
subtract_arrays :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise subtraction operation on two different arrays.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: first multidimensional array.
b: second multidimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
subtract_arrays_scalar ¶
subtract_arrays_scalar :: proc(a: MdArray($T, $Nd), b: $T, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise subtraction operation on an arrays and a scalar.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
subtract_scalar_array ¶
subtract_scalar_array :: proc(a: $T, b: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Perform an element-wise subtraction operation on a scalar and an array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
a: a multidimensional array.
b: a scalar value.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant array.
ok: an optional boolean for error handling.
Related Procedure Groups
swap_axes_copy ¶
swap_axes_copy :: proc(mdarray: MdArray($T, $Nd), axis1: untyped integer, axis2: untyped integer, allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Create a permuted copy of the provided array by swapping two axes.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
value: the value based on which the array will be filled
indices: the permutation indices.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant copy.
ok: an optional boolean for error handling.
swap_axes_view ¶
swap_axes_view :: proc(mdarray: MdArray($T, $Nd), axis1: untyped integer, axis2: untyped integer, location := #caller_location) -> (result: MdArray($T, $Nd), ok: bool) #optional_ok {…}
Create a permuted view of the provided array by swapping two axes.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
value: the value based on which the array will be filled
indices: the permutation indices.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant view.
ok: an optional boolean for error handling.
validate_axes ¶
validate_axes :: proc($Nd := , axes: [0]untyped integer, location := #caller_location) -> bool {…}
validate_axis ¶
validate_axis :: proc(ndims: untyped integer, axis: untyped integer, location := #caller_location) -> bool {…}
validate_initialized ¶
validate_initialized :: proc(mdarray: MdArray($T, $Nd), location := #caller_location) -> bool {…}
validate_pos_within_shape ¶
validate_pos_within_shape :: proc(pos: [0]untyped integer, shape: [0]untyped integer, location := #caller_location) -> bool {…}
validate_positive_shape ¶
validate_positive_shape :: proc(shape: [0]untyped integer, location := #caller_location) -> bool {…}
validate_shape_and_get_size ¶
validate_shape_and_get_size :: proc(shape: [0]untyped integer, location := #caller_location) -> (size: untyped integer, ok: bool) {…}
validate_shape_match ¶
validate_shape_match :: proc(a: MdArray($T, $Nd), b: MdArray($T, $Nd), location := #caller_location) -> bool {…}
vflatten ¶
vflatten :: flatten_view
Create a flattened (collapse dimensions into one) view of an array.
Inputs:
Nd: the number of dimensions before the expansion.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant reshaped view.
ok: an optional boolean for error handling.
vpermute_dims ¶
vpermute_dims :: permute_dims_view
Create a permuted view of the provided array.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
value: the value based on which the array will be filled
indices: the permutation indices.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant view.
ok: an optional boolean for error handling.
Related Procedure Groups
vreshape ¶
vreshape :: reshape_view
Create a view of an array with a differnt shape.
Inputs:
mdarray: the source multidimensional array.
shape: the shape of the destination array.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: The resultant reshaped view.
ok: an optional boolean for error handling.
vstack ¶
vstack :: proc(mdarrays: []MdArray($T, $Nd=1), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd=2), ok: bool) #optional_ok {…}
Stack several vector arrays vertically.
Inputs:
mdarrays: a slice that contains the arrays to stack.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant stack array.
ok: an optional boolean for error handling.
vswap_axes ¶
vswap_axes :: swap_axes_view
Create a permuted view of the provided array by swapping two axes.
NOTE: Use of this procedure is discourged. Please use the procedure group instead.
Inputs:
value: the value based on which the array will be filled
indices: the permutation indices.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant view.
ok: an optional boolean for error handling.
where_cond ¶
where_cond :: proc(mdarray: MdArray($T, $Nd), where_array: MdArray($T=bool, $Nd), allocator := context.allocator, location := #caller_location) -> (result: MdArray($T, $Nd=1), ok: bool) #optional_ok {…}
Returns a vector of all elements that corresponed to the true values in the provided boolean array.
Inputs:
mdarray: a multidimensional array.
where_array: a multidimensional boolean array according to which the elements of mdarray
are selected.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
result: the resultant vector.
ok: an optional boolean for error handling.
zeros ¶
zeros :: proc($T: typeid, shape: [0]untyped integer, allocator := context.allocator, location := #caller_location) -> (mdarray: MdArray($T=typeid, $Nd), ok: bool) #optional_ok {…}
Create a multi-dimensional array based on the provided shape, whose elements are all zero.
Inputs:
T: the type of created array.
shape: the shape of the multi-dimensional array.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
mdarray: a multidimsional array filled with zeros.
ok: an optional boolean for error handling.
zeros_like ¶
zeros_like :: proc($T: typeid, source: MdArray($T, $Nd), allocator := context.allocator, location := #caller_location) -> (mdarray: MdArray($T=typeid, $Nd), ok: bool) #optional_ok {…}
Create a multi-dimensional array with an identical shape to another array, whose elements are all with zeros.
Inputs:
T: the type of created array.
source: the array based on which the shape of the created array is decided. Its internal
type doesn't matter. The created array will follow the type above.
allocator: the allocator used internally.
location: a debugging variable used to trace the location of the calling procedure.
Returns:
mdarray: a multidimsional array filled with zeros.
ok: an optional boolean for error handling.
Procedure Groups
add ¶
add :: proc{ add_arrays, add_arrays_scalar, add_scalar_array, }
all_close ¶
all_close :: proc{ all_close_default, all_close_with_args, }
all_reduce_prod ¶
all_reduce_prod :: proc{ all_reduce_prod_no_init, all_reduce_prod_with_init, }
all_reduce_sum ¶
all_reduce_sum :: proc{ all_reduce_sum_no_init, all_reduce_sum_with_init, }
atan2 ¶
atan2 :: proc{ atan2_arrays, atan2_arrays_scalar, atan2_scalar_array, }
bitwise_and ¶
bitwise_and :: proc{ bitwise_and_arrays, bitwise_and_arrays_scalar, bitwise_and_scalar_array, }
bitwise_andnot ¶
bitwise_andnot :: proc{ bitwise_andnot_arrays, bitwise_andnot_arrays_scalar, bitwise_andnot_scalar_array, }
bitwise_or ¶
bitwise_or :: proc{ bitwise_or_arrays, bitwise_or_arrays_scalar, bitwise_or_scalar_array, }
bitwise_xor ¶
bitwise_xor :: proc{ bitwise_xor_arrays, bitwise_xor_arrays_scalar, bitwise_xor_scalar_array, }
ctranspose ¶
ctranspose :: proc{ permute_dims_copy, permute_default_copy, }
dim_reduce_prod ¶
dim_reduce_prod :: proc{ dim_reduce_prod_no_init, dim_reduce_prod_with_init, }
dim_reduce_sum ¶
dim_reduce_sum :: proc{ dim_reduce_sum_no_init, dim_reduce_sum_with_init, }
div ¶
div :: proc{ div_arrays, div_arrays_scalar, div_scalar_array, }
equal ¶
equal :: proc{ equal_arrays, equal_arrays_scalar, equal_scalar_array, }
gcd ¶
gcd :: proc{ gcd_arrays, gcd_arrays_scalar, gcd_scalar_array, }
greater ¶
greater :: proc{ greater_arrays, greater_arrays_scalar, greater_scalar_array, }
greater_equal ¶
greater_equal :: proc{ greater_equal_arrays, greater_equal_arrays_scalar, greater_equal_scalar_array, }
heaviside ¶
heaviside :: proc{ heaviside_arrays, heaviside_arrays_scalar, heaviside_scalar_array, }
hypot ¶
hypot :: proc{ hypot_arrays, hypot_arrays_scalar, hypot_scalar_array, }
is_close ¶
is_close :: proc{ is_close_default, is_close_with_args, }
keepdim_reduce_prod ¶
keepdim_reduce_prod :: proc{ keepdim_reduce_prod_no_init, keepdim_reduce_prod_with_init, }
keepdim_reduce_sum ¶
keepdim_reduce_sum :: proc{ keepdim_reduce_sum_no_init, keepdim_reduce_sum_with_init, }
lcm ¶
lcm :: proc{ lcm_arrays, lcm_arrays_scalar, lcm_scalar_array, }
left_shift ¶
left_shift :: proc{ left_shift_arrays, left_shift_arrays_scalar, left_shift_scalar_array, }
less ¶
less :: proc{ less_arrays, less_arrays_scalar, less_scalar_array, }
less_equal ¶
less_equal :: proc{ less_equal_arrays, less_equal_arrays_scalar, less_equal_scalar_array, }
logaddexp ¶
logaddexp :: proc{ logaddexp_arrays, logaddexp_arrays_scalar, logaddexp_scalar_array, }
logical_and ¶
logical_and :: proc{ logical_and_arrays, logical_and_arrays_scalar, logical_and_scalar_array, }
logical_or ¶
logical_or :: proc{ logical_or_arrays, logical_or_arrays_scalar, logical_or_scalar_array, }
maximum ¶
maximum :: proc{ max_arrays, max_arrays_scalar, max_scalar_array, }
minimum ¶
minimum :: proc{ min_arrays, min_arrays_scalar, min_scalar_array, }
mod ¶
mod :: proc{ mod_arrays, mod_arrays_scalar, mod_scalar_array, }
mul ¶
mul :: proc{ mul_arrays, mul_arrays_scalar, mul_scalar_array, }
not_equal ¶
not_equal :: proc{ not_equal_arrays, not_equal_arrays_scalar, not_equal_scalar_array, }
right_shift ¶
right_shift :: proc{ right_shift_arrays, right_shift_arrays_scalar, right_shift_scalar_array, }
subtract ¶
subtract :: proc{ subtract_arrays, subtract_arrays_scalar, subtract_scalar_array, }
transpose_copy ¶
transpose_copy :: proc{ permute_dims_copy, permute_default_copy, }
transpose_view ¶
transpose_view :: proc{ permute_dims_view, permute_default_view, }
vtranspose ¶
vtranspose :: proc{ permute_dims_view, permute_default_view, }
Source Files
- bitwise.odin
- compare.odin
- element_wise.odin
- logical.odin
- mdarray.odin
- permutations.odin
- print.odin
- reduce.odin
- unary.odin
- utils.odin
- view.odin
Generation Information
Generated with odin version dev-2025-11 (vendor "odin") Linux_amd64 @ 2025-11-15 02:28:15.950599215 +0000 UTC