The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Name

SPVM::R::NDArray::FloatComplex - N-Dimensional Array of Float Complex Type.

Description

R::NDArray::FloatComplex class in SPVM represents n-dimensional array of float complex Complex_2f type.

Usage

  use R::NDArray::FloatComplex;
  use Math;
  
  my $data = [
    Math->complexf(1, 0),
    Math->complexf(2, 0),
    Math->complexf(3, 0),
    Math->complexf(4, 0),
    Math->complexf(5, 0),
    Math->complexf(6, 0)
  ];
  
  my $ndarray = R::NDArray::FloatComplex->new({data => $data, dim => [3, 2]});

Super Class

R::NDArray

Field

data

method data : Complex_2f[] ();

Same as R::NDArray#data method, but the return type is different.

Class Methods

static method new : R::NDArray::FloatComplex ($options : object[] = undef);

Creates a new R::NDArray::FloatComplex and returns it.

This method calls R::NDArray#init method given the options $options.

Instance Methods

create_default_data

method create_default_data : Complex_2f[] ($length : int = 0);

Creates a default data given the length $length and returns it.

elem_to_string

method elem_to_string : string ($data : Complex_2f[], $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 : Complex_2f[], $dist_data_index : int, $src_data : Complex_2f[], $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 : Complex_2f[], $dist_data_index : int, $src_data : Complex_2f[], $src_data_index : int);

Copies the element $src_data at index $src_data_indext to the element $dist_data at index $dist_data_index.

clone

method clone : R::NDArray::FloatComplex ($shallow : int = 0);

Same as R::NDArray#clone method, but the return type is different.

slice

method slice : R::NDArray::FloatComplex ($asix_indexes_product : R::NDArray::Int[]);

Same as R::NDArray#slice method, but the return type is different.

to_double_complex_ndarray

method to_double_complex_ndarray : R::NDArray::DoubleComplex ();

Converts this n-dimensional array to a n-dimensional array of R::NDArray::DoubleComplex and returns it.

Copyright & License

Copyright (c) 2024 Yuki Kimoto

MIT License