SPVM::Matrix::Util - Matrix Utilities
SPVM::Matrix::Util is matrix utilities. Matirx operation is defined.
Matrix Data Structure is defined in SPVM::Matrix::Float and SPVM::Matrix::Double
sub mat_new : SPVM::Matrix::Double ($values : double[], $rows_length: int, $columns_length : int)
Create new SPVM::Matrix::Double object.
Arguments:
1. Values. this value is set to values field. Note that the reference is set to values field not creating new array which elements is copied from argument array. Elements order is assumed as Column-Major order.
values
2. Row. This value is set to rows_length field.
rows_length
3. Column. This value is set to columns_length field.
columns_length
Return Value:
SPVM::Matrix::Double object.
Exception:
1. If Values is not defined, a exception occurs.
2. If Values length is different from Row * Column, a exception occurs.
sub mat_newf : SPVM::Matrix::Float ($values : float[], $rows_length: int, $columns_length : int)
Create new SPVM::Matrix::Float object.
SPVM::Matrix::Float object.
sub mat_new_zero : SPVM::Matrix::Double ($rows_length: int, $columns_length : int)
Create new SPVM::Matrix::Double object with zero value.
sub mat_new_zerof : SPVM::Matrix::Float ($rows_length: int, $columns_length : int)
Create new SPVM::Matrix::Float object with zero value.
sub mat_new_ident : SPVM::Matrix::Double ($dim : int)
Create new ident <SPVM::Matrix::Double> by specifing the dimention.
sub mat_new_identf : SPVM::Matrix::Float ($dim : int)
Create new ident <SPVM::Matrix::Float> by specifing the dimention.
sub mat_transpose : SPVM::Matrix::Double ($mat : SPVM::Matrix::Double)
Transpose double matrix and return new SPVM::Matrix::Double object.
sub mat_transposef : SPVM::Matrix::Float ($mat : SPVM::Matrix::Float)
Transpose float matrix and return new SPVM::Matrix::Float object.
sub mat_add : SPVM::Matrix::Double ($mat1 : SPVM::Matrix::Double, $mat2 : SPVM::Matrix::Double)
Add two double Matrix and return new SPVM::Matrix::Double object.
sub mat_addf : SPVM::Matrix::Float ($mat1 : SPVM::Matrix::Float, $mat2 : SPVM::Matrix::Float)
Add two float Matrix and return new SPVM::Matrix::Float object.
sub mat_sub : SPVM::Matrix::Double ($mat1 : SPVM::Matrix::Double, $mat2 : SPVM::Matrix::Double)
Subtract two double Matrix and return new SPVM::Matrix::Double object.
sub mat_subf : SPVM::Matrix::Float ($mat1 : SPVM::Matrix::Float, $mat2 : SPVM::Matrix::Float)
Subtract two float Matrix and return new SPVM::Matrix::Float object.
sub mat_scamul : SPVM::Matrix::Double ($scalar : double, $mat1 : SPVM::Matrix::Double)
Scalar multiply float matrix and return new SPVM::Matrix::Double object.
sub mat_scamulf : SPVM::Matrix::Float ($scalar : float, $mat1 : SPVM::Matrix::Float)
Scalar multiply float matrix and return new SPVM::Matrix::Float object.
sub mat_mul : SPVM::Matrix::Double ($mat1 : SPVM::Matrix::Double, $mat2 : SPVM::Matrix::Double)
Multiply two double Matrix and return new SPVM::Matrix::Double object.
sub mat_mulf : SPVM::Matrix::Float ($mat1 : SPVM::Matrix::Float, $mat2 : SPVM::Matrix::Float)
Multiply two float Matrix and return new SPVM::Matrix::Float object.
sub mat_str : string ($mat : SPVM::Matrix::Double)
Convert Matrix Content to String. Each column is joined 1 space and Each row is end with \n
1 3 5 2 4 6
sub mat_strf : string ($mat : SPVM::Matrix::Float)
To install SPVM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SPVM
CPAN shell
perl -MCPAN -e shell install SPVM
For more information on module installation, please visit the detailed CPAN module installation guide.