Name
SPVM::R::NDArray::Float - N-Dimensional Array of float Type.
Description
R::NDArray::Float class in SPVM represents n-dimensional array of float
type.
Usage
use R::NDArray::Float;
my $ndarray = R::NDArray::Float->new({data => [(float)1, 2, 3, 4, 5, 6], dim => [3, 2]});
Super Class
Field
data
method data : float[] ();
Same as R::NDArray#data method, but the return type is different.
Class Methods
static method new : R::NDArray::Float ($options : object[] = undef);
Creates a new R::NDArray::Float and returns it.
This method calls R::NDArray#init method given the options $options.
Instance Methods
create_default_data
method create_default_data : float[] ($length : int = 0);
Creates a default data given the length $length and returns it.
elem_to_string
method elem_to_string : string ($data : float[], $data_index : int);
Converts an element $data at index $data_index to a string and returns it.
elem_assign
method elem_assign : void ($dist_data : float[], $dist_data_index : int, $src_data : float[], $src_data_index : int);
Assigns the element $src_data at index $src_data_index to the element $dist_data at index $dist_data_index.
elem_clone
method elem_clone : void ($dist_data : float[], $dist_data_index : int, $src_data : float[], $src_data_index : int);
Copies the element $src_data at index $src_data_indext to the element $dist_data at index $dist_data_index.
elem_cmp
method elem_cmp : int ($data : float[], $a_data_index : int, $b_data_index : int);
Compares the element $data at index $a_data_index and the element $data at index $b_data_index and returns the result.
clone
method clone : R::NDArray::Float ($shallow : int = 0);
Same as R::NDArray#clone method, but the return type is different.
slice
method slice : R::NDArray::Float ($asix_indexes_product : R::NDArray::Int[]);
Same as R::NDArray#slice method, but the return type is different.
to_int_ndarray
method to_int_ndarray : R::NDArray::Int ();
Converts this n-dimensional array to a n-dimensional array of R::NDArray::Int and returns it.
to_long_ndarray
method to_long_ndarray : R::NDArray::Long ();
Converts this n-dimensional array to a n-dimensional array of R::NDArray::Long and returns it.
to_double_ndarray
method to_double_ndarray : R::NDArray::Double ();
Converts this n-dimensional array to a n-dimensional array of R::NDArray::Double and returns it.
to_float_complex_ndarray
method to_float_complex_ndarray : R::NDArray::FloatComplex ();
Converts this n-dimensional array to a n-dimensional array of R::NDArray::FloatComplex and returns it.
Copyright & License
Copyright (c) 2024 Yuki Kimoto
MIT License