Name

SPVM::R::NDArray - N-Dimensional Array Base Class

Description

The R::NDArray class in SPVM represetns n-dimensional array and it is the base class of classes that represents typed n-dimensional arrays.

Usage

use R::NDArray;

Details

R::NDArray is column major.

Fields

data

has data : protected ro object;

An array of numeric type, multi-numeric type, or object type.

dim

has dim : int[];

Dimensions.

method dim : int[] ();

Creates a new array, copies the elements of this field, and returns the array.

method set_dim : void ($dim : int[]);

The dimensions $dim is normalized by R::Util#normalize_dim method, checks the normalized dim by R::Util#check_length method, and sets this field to the normalized dim.

Exceptions:

set_dim Method:

If "is_dim_read_only" is a true value, an exception is thrown.

Exceptions thrown by R::Util#normalize_dim method could be thrown.

Exceptions thrown by R::Util#check_length method could be thrown.

is_dim_read_only

has is_dim_read_only : ro byte;

If this field is a true value, it indicates "dim" field is read only, otherwise writable.

Class Methods

new

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

Instance Methods

Well Known Child Classes

Copyright & License

Copyright (c) 2024 Yuki Kimoto

MIT License