SPVM::Matrix::ComplexFloat - complex float Matrix
my $values = new SPVM::Complex_2f[10]; my $row = 2; my $col = 3; my $matrix = SPVM::Matrix::ComplexFloat->new($values, $row, $col);
Accessors
my $values = $matrix->values; my $row = $matrix->row; my $col = $matrix->col;
SPVM::Matrix::ComplexFloat is complex float Matrix.
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.
values
2. Row. This value is set to row field.
row
3. Column. This value is set to col field.
col
Return Value:
Matrix object.
Exception:
1. If Values is not defined, a exception occurs.
2. If Values length is different from Row * Column, a exception occurs.
my $values = $matrix->values;
Get values field. Note that get the reference of values field not creating new array which elements is copied from values field.
my $row = $matrix->row;
Get row field.
my $col = $matrix->col;
Get col field.
my $string = $matrix->to_string;
Convert Matrix Content to String. Each column is joined 1 space and Each row is end with \n
1 3 5 2 4 6
values field is alway defined after new matrix object.
The array length of values is always row field * col field.
Matrix is Column-major.
# Matrix # $x11 $x12 $x13 # $x21 $x22 $x23 my $values = [$x11, $x21, $x12, $x22, $x13, $x23]; my $row = 2; my $col = 3; my $matrix = SPVM::Matrix::ComplexFloat->new($values, $row, $col);
The following fields is imutable.
1. values field
2. row field
3. col field
The following thing is mutable.
1. Each value of values field.
# Can set each value of C<values> field. $matrix->values->[0] = $x11;
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.