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::OP::Matrix - Matrix Operations

Description

R::OP::Matrix class in SPVM has methods for operations for n-dimension arrays R::NDArray representing matrices.

Usage

  use R::OP::Matrix;

Related Modules

Class Methods

cbind

static method cbind : R::NDArray ($x_ndarray : R::NDArray, $y_ndarray : R::NDArray);

Creates a new R::NDArray of the same type as the n-dimension array $x_ndarray, adds all columns of $x_ndarray and all columns of $y_ndarray are added to the new n-dimensional array in order, and returns the new n-dimensional array.

Exceptions:

The n-dimention array $x_ndarray must be defined. Otherwise, an exception is thrown.

The n-dimention array $x_ndarray must be a matrix. Otherwise, an exception is thrown.

The n-dimention array $y_ndarray must be defined. Otherwise, an exception is thrown.

The n-dimention array $y_ndarray must be a matrix. Otherwise, an exception is thrown.

The type of the n-dimention array $x_ndarray must be eqaul to the type of the n-dimention array $y_ndarray. Otherwise, an exception is thrown.

The row numbers of the n-dimention array $x_ndarray must be equal to the row numbers of the n-dimention array $y_ndarray. Otherwise, an exception is thrown.

rbind

static method rbind : R::NDArray ($x_ndarray : R::NDArray, $y_ndarray : R::NDArray);

Creates a new R::NDArray of the same type as the n-dimension array $x_ndarray, adds all rows of $x_ndarray and all rows of $y_ndarray are added to the new n-dimensional array in order, and returns the new n-dimensional array.

Exceptions:

The n-dimention array $x_ndarray must be defined. Otherwise, an exception is thrown.

The n-dimention array $x_ndarray must be a matrix. Otherwise, an exception is thrown.

The n-dimention array $y_ndarray must be defined. Otherwise, an exception is thrown.

The n-dimention array $y_ndarray must be a matrix. Otherwise, an exception is thrown.

The type of the n-dimention array $x_ndarray must be eqaul to the type of the n-dimention array $y_ndarray. Otherwise, an exception is thrown.

The column numbers of the n-dimention array $x_ndarray must be equal to the column numbers of the n-dimention array $y_ndarray. Otherwise, an exception is thrown.

See Also

Copyright & License

Copyright (c) 2024 Yuki Kimoto

MIT License