NAME
SPVM::Matrix::QuatDouble - quat double Matrix
SYNOPSYS
my $values = new SPVM::Quat_4d[10];
my $row = 2;
my $col = 3;
my $matrix = SPVM::Matrix::QuatDouble->new($values, $row, $col);
Accessors
my $values = $matrix->values;
my $row = $matrix->row;
my $col = $matrix->col;
DESCRIPTION
SPVM::Matrix::QuatDouble is quat double Matrix.
METHODS
new : SPVM::Matrix::QuatDouble ($values : ${element_type}[], $row : int, $col : int)
my $values = new SPVM::Quat_4d[10];
my $row = 2;
my $col = 3;
my $matrix = SPVM::Matrix::QuatDouble->new($values, $row, $col);
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.
2. Row. This value is set to row
field.
3. Column. This value is set to col
field.
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.
values : ${element_type}[] ()
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.
row : int ()
my $row = $matrix->row;
Get row
field.
col : int ()
my $col = $matrix->col;
Get col
field.
to_string : string ()
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
Matrix Features
Values is always defined
values
field is alway defined after new matrix object.
Array length of Values is always Row length * Column length
The array length of values
is always row
field * col
field.
Column-major
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::QuatDouble->new($values, $row, $col);
Imutable Things
The following fields is imutable.
1. values
field
2. row
field
3. col
field
Mutable Things
The following thing is mutable.
1. Each value of values
field.
# Can set each value of C<values> field.
$matrix->values->[0] = $x11;