Skip to content

Commit 5083fea

Browse files
authored
Merge pull request #463 from mgage/PG-2.15
Pg 2.15 -- hotfix
2 parents 998fcc3 + b028362 commit 5083fea

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

macros/PGmatrixmacros.pl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,12 +768,15 @@ =head2 convert_to_array_ref {
768768

769769
sub convert_to_array_ref {
770770
my $input = shift;
771-
if (Value::classMatch($input,"Matrix")) {
772-
$input = [$input->value];
771+
if (Value::isValue($input) and Value::classMatch($input,"Matrix")) {
772+
# handles Value::Matrix (MathObject matrices)
773+
$input = [$input->value]; # convert an array to an array_ref (see POD comment above)
773774
} elsif (ref($input) eq 'Matrix' ) {
775+
# handles wwMatrix objects (old style)
774776
$input = $input->array_ref;
775777
} elsif (ref($input) =~/ARRAY/) {
776778
# no change to input value
779+
# handles raw perl array_ref types
777780
} else {
778781
WARN_MESSAGE("This does not appear to be a matrix ");
779782
}

0 commit comments

Comments
 (0)