Skip to content

Commit

Permalink
Add tests for matrix type conversion (finding and fixing a bug in PMC…
Browse files Browse the repository at this point in the history
…Matrix in the process), and add a few stub tests for autoconversion of GEMM arguments
  • Loading branch information
Whiteknight committed Aug 19, 2010
1 parent cb0d9e9 commit eff87db
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/pmc/pmcmatrix2d.pmc
Expand Up @@ -708,7 +708,7 @@ Get a PMCMatrix2D from the current matrix

METHOD convert_to_complex_matrix() {
DECLATTRS(SELF, attrs);
PMC * const d = Parrot_pmc_new(INTERP, __PLA_Type_PMCMatrix2D);
PMC * const d = Parrot_pmc_new(INTERP, __PLA_Type_ComplexMatrix2D);
const INTVAL totalsize = attrs->rows * attrs->cols;
PMC * const meth = VTABLE_find_method(INTERP, d, CONST_STRING(INTERP, "resize"));
INTVAL i;
Expand Down
11 changes: 11 additions & 0 deletions t/pmc/complexmatrix2d.t
Expand Up @@ -193,6 +193,17 @@ method test_METHOD_gemm_aABbC() {
my $Z := $A.'gemm'(self.complex("0.25"), $A, $B, self.complex("0.0"), $C);
}

# Test that we can call GEMM with alpha of various types
method test_METHOD_gemm_ALPHA_TYPE() {
todo("Write this!");
}

# Test that we can call GEMM with beta of various types
method test_METHOD_gemm_BETA_TYPE() {
todo("Write this!");
}


method test_METHOD_conjugate() {
my $m := self.matrix2x2("1+1i", "2+2i", "3+3i", "4+4i");
my $n := self.matrix2x2("1-1i", "2-2i", "3-3i", "4-4i");
Expand Down
12 changes: 12 additions & 0 deletions t/testlib/numericmatrixtest.nqp
Expand Up @@ -385,6 +385,18 @@ class Pla::Matrix::NumericMatrixTest is Pla::Matrix::MatrixTest {
});
}

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!"); }

method test_METHOD_row_combine() {
my $A := self.fancymatrix2x2();
my $val1;
Expand Down

0 comments on commit eff87db

Please sign in to comment.