summaryrefslogtreecommitdiff
path: root/test/matrix.t.c
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-11-15 14:16:15 -0700
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-11-15 14:16:15 -0700
commit1a6b95273628d898226eb448c8b671dc33f3c495 (patch)
tree08ebde756da3214142acaaa15ef45a1eea7e9970 /test/matrix.t.c
parent3f1f18b149788fe69180dc2a348fd32425bb9a3f (diff)
downloadcmath-1a6b95273628d898226eb448c8b671dc33f3c495.tar.gz
cmath-1a6b95273628d898226eb448c8b671dc33f3c495.zip
compute dominant eigenvalue
Diffstat (limited to 'test/matrix.t.c')
-rw-r--r--test/matrix.t.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/matrix.t.c b/test/matrix.t.c
index 1c72b85..597d6e0 100644
--- a/test/matrix.t.c
+++ b/test/matrix.t.c
@@ -230,3 +230,18 @@ UTEST(matrix, m_dot_m) {
free_matrix(b);
free_matrix(prod);
}
+
+UTEST(matrix, transpose) {
+ Matrix_double *a = InitMatrixWithSize(double, 1, 3, 12.0);
+ a->data[0]->data[1] = 13.0;
+ Matrix_double *b = InitMatrixWithSize(double, 3, 1, 12.0);
+ b->data[1]->data[0] = 13.0;
+
+ Matrix_double *a_t = transpose(a);
+
+ EXPECT_TRUE(matrix_equal(a_t, b));
+
+ free_matrix(a_t);
+ free_matrix(a);
+ free_matrix(b);
+}