Browse Source
git-svn-id: file:///usr/local/svn/util/trunk@4 29942e26-f7dc-dc11-b955-0002b3153201master
leto
17 years ago
2 changed files with 20 additions and 2 deletions
@ -0,0 +1,16 @@ |
|||||
|
#!/usr/bin/perl -w |
||||
|
use strict; |
||||
|
use Math::MatrixReal; |
||||
|
# Example code to show type bound operator overloading |
||||
|
# that returns the same stuff |
||||
|
|
||||
|
my $matrix = Math::MatrixReal->new_from_rows([[3,6,9]]); |
||||
|
my $a = (2/3) * $matrix; |
||||
|
my $b = 2 * $matrix / 3; |
||||
|
|
||||
|
print "\$a is a " . (ref $a) . "\n"; |
||||
|
print "\$b is a " . (ref $b) . "\n"; |
||||
|
print "\$a=\n"; |
||||
|
print $a; |
||||
|
print "\$b=\n"; |
||||
|
print $b; |
Loading…
Reference in new issue