Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start reworking the test suite to tease some of these methods out int…
…o their own files. This makes things a lot more manageable. Create subtest files for some of the methods on nummatrix2d for now, will add others later
- Loading branch information
1 parent
705a1f8
commit 625b78f
Showing
15 changed files
with
2,141 additions
and
248 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
my $tests := Test::NumMatrix2D::RowCombine.new(); | ||
$tests.suite.run; | ||
|
||
class Test::NumMatrix2D::RowCombine is Pla::Methods::RowCombine { | ||
INIT { | ||
use('UnitTest::Testcase'); | ||
use('UnitTest::Assertions'); | ||
} | ||
|
||
has $!factory; | ||
method factory() { | ||
unless pir::defined__IP($!factory) { | ||
$!factory := Pla::MatrixFactory::NumMatrix2D.new(); | ||
} | ||
return $!factory; | ||
} | ||
} |
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,17 @@ | ||
my $tests := Test::NumMatrix2D::RowScale.new(); | ||
$tests.suite.run; | ||
|
||
class Test::NumMatrix2D::RowScale is Pla::Methods::RowScale { | ||
INIT { | ||
use('UnitTest::Testcase'); | ||
use('UnitTest::Assertions'); | ||
} | ||
|
||
has $!factory; | ||
method factory() { | ||
unless pir::defined__IP($!factory) { | ||
$!factory := Pla::MatrixFactory::NumMatrix2D.new(); | ||
} | ||
return $!factory; | ||
} | ||
} |
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,17 @@ | ||
my $tests := Test::NumMatrix2D::RowSwap.new(); | ||
$tests.suite.run; | ||
|
||
class Test::NumMatrix2D::RowSwap is Pla::Methods::RowSwap { | ||
INIT { | ||
use('UnitTest::Testcase'); | ||
use('UnitTest::Assertions'); | ||
} | ||
|
||
has $!factory; | ||
method factory() { | ||
unless pir::defined__IP($!factory) { | ||
$!factory := Pla::MatrixFactory::NumMatrix2D.new(); | ||
} | ||
return $!factory; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
class Pla::Methods::Gemm is Pla::MatrixTestBase { | ||
|
||
INIT { | ||
use('UnitTest::Testcase'); | ||
use('UnitTest::Assertions'); | ||
} | ||
|
||
method test_METHOD_gemm_aA() { self.factory.RequireOverride("test_METHOD_gemm_aA"); } | ||
method test_METHOD_gemm_AB() { self.RequireOverride("test_METHOD_gemm_AB"); } | ||
method test_METHOD_gemm_aAB() { self.RequireOverride("test_METHOD_gemm_aAB"); } | ||
method test_METHOD_gemm_aABbC() { self.RequireOverride("test_METHOD_gemm_aABbC"); } | ||
|
||
method test_METHOD_gemm_BADTYPE_A() { | ||
assert_throws(Exception::OutOfBounds, "A is bad type", | ||
{ | ||
my $A := "foobar"; | ||
my $B := self.factory.defaultmatrix3x3(); | ||
my $C := self.factory.defaultmatrix3x3(); | ||
$B.gemm(1.0, $A, $B, 1.0, $C); | ||
}); | ||
} | ||
|
||
method test_METHOD_gemm_BADTYPE_B() { | ||
assert_throws(Exception::OutOfBounds, "B is bad type", | ||
{ | ||
my $A := self.factory.defaultmatrix3x3(); | ||
my $B := "foobar"; | ||
my $C := self.factory.defaultmatrix3x3(); | ||
$A.gemm(1.0, $A, $B, 1.0, $C); | ||
}); | ||
} | ||
|
||
method test_METHOD_gemm_BADTYPE_C() { | ||
assert_throws(Exception::OutOfBounds, "C is bad type", | ||
{ | ||
my $A := self.factory.defaultmatrix3x3(); | ||
my $B := self.factory.defaultmatrix3x3(); | ||
my $C := "foobar"; | ||
$A.gemm(1.0, $A, $B, 1.0, $C); | ||
}); | ||
} | ||
|
||
method test_METHOD_gemm_BADSIZE_A() { | ||
assert_throws(Exception::OutOfBounds, "A has incorrect size", | ||
{ | ||
my $A := self.factory.defaultmatrix2x2(); | ||
my $B := self.factory.defaultmatrix3x3(); | ||
my $C := self.factory.defaultmatrix3x3(); | ||
$A.gemm(1.0, $A, $B, 1.0, $C); | ||
}); | ||
} | ||
|
||
method test_METHOD_gemm_BADSIZE_B() { | ||
assert_throws(Exception::OutOfBounds, "B has incorrect size", | ||
{ | ||
my $A := self.factory.defaultmatrix3x3(); | ||
my $B := self.factory.defaultmatrix2x2(); | ||
my $C := self.factory.defaultmatrix3x3(); | ||
$A.gemm(1.0, $A, $B, 1.0, $C); | ||
}); | ||
} | ||
|
||
method test_METHOD_gemm_BADSIZE_C() { | ||
assert_throws(Exception::OutOfBounds, "C has incorrect size", | ||
{ | ||
my $A := self.factory.defaultmatrix3x3(); | ||
my $B := self.factory.defaultmatrix3x3(); | ||
my $C := self.factory.defaultmatrix2x2(); | ||
$A.gemm(1.0, $A, $B, 1.0, $C); | ||
}); | ||
} | ||
|
||
method test_METHOD_gemm_AUTOCONVERT_A_NumMatrix2D() { todo("Write this!"); } | ||
method test_METHOD_gemm_AUTOCONVERT_B_NumMatrix2D() { todo("Write this!"); } | ||
method test_METHOD_gemm_AUTOCONVERT_C_NumMatrix2D() { todo("Write this!"); } | ||
|
||
method test_METHOD_gemm_AUTOCONVERT_A_ComplexMatrix2D() { todo("Write this!"); } | ||
method test_METHOD_gemm_AUTOCONVERT_B_ComplexMatrix2D() { todo("Write this!"); } | ||
method test_METHOD_gemm_AUTOCONVERT_C_ComplexMatrix2D() { todo("Write this!"); } | ||
|
||
method test_METHOD_gemm_AUTOCONVERT_A_PMCMatrix2D() { todo("Write this!"); } | ||
method test_METHOD_gemm_AUTOCONVERT_B_PMCMatrix2D() { todo("Write this!"); } | ||
method test_METHOD_gemm_AUTOCONVERT_C_PMCMatrix2D() { todo("Write this!"); } | ||
|
||
} |
Oops, something went wrong.