Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions macros/PGmatrixmacros.pl
Original file line number Diff line number Diff line change
Expand Up @@ -768,12 +768,15 @@ =head2 convert_to_array_ref {

sub convert_to_array_ref {
my $input = shift;
if (Value::classMatch($input,"Matrix")) {
$input = [$input->value];
if (Value::isValue($input) and Value::classMatch($input,"Matrix")) {
# handles Value::Matrix (MathObject matrices)
$input = [$input->value]; # convert an array to an array_ref (see POD comment above)
} elsif (ref($input) eq 'Matrix' ) {
# handles wwMatrix objects (old style)
$input = $input->array_ref;
} elsif (ref($input) =~/ARRAY/) {
# no change to input value
# handles raw perl array_ref types
} else {
WARN_MESSAGE("This does not appear to be a matrix ");
}
Expand Down