Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a first version of the multiply method. Tests are still missing…
… but there is an example in examples/. Also fixed some bugs (mostly typos and syntax errors). get and set methods do not respect the transposed flag yet.
- Loading branch information
Markus Mayr
committed
Oct 29, 2009
1 parent
b96e385
commit 1b3b5f7
Showing
3 changed files
with
126 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
.sub main :main | ||
.local pmc lib | ||
|
||
lib = loadlib "linalg_group" | ||
unless lib goto not_loaded | ||
say "library loaded successfully." | ||
|
||
$P0 = new 'NumMatrix2D' | ||
$P0.'resize'(2,2) | ||
$P0[0;0] = 1 | ||
$P0[1;0] = 2 | ||
$P0[0;1] = 1 | ||
$P0[1;1] = 3 | ||
|
||
$P1 = new 'NumMatrix2D' | ||
$P1.'resize'(2,2) | ||
$P1[0;0] = 3 | ||
$P1[1;1] = 4 | ||
|
||
say $P0 | ||
say $P1 | ||
|
||
$P2 = $P0 * $P1 | ||
$P0.'transpose'() | ||
$P3 = $P1 * $P0 | ||
$P3.'transpose'() | ||
|
||
say $P2 | ||
say $P3 | ||
|
||
end | ||
|
||
not_loaded: | ||
say "Could not load library" | ||
.end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters