Index: src/libbn/tests/bn_mat.c
===================================================================
--- src/libbn/tests/bn_mat.c	(revision 0)
+++ src/libbn/tests/bn_mat.c	(revision 0)
@@ -0,0 +1,276 @@
+/*                      B N _ M A T . C
+ * BRL-CAD
+ *
+ * Copyright (c) 2013 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+
+#include "common.h"
+
+#include <math.h>
+#include <string.h>
+#include "bio.h"
+
+#include "bu.h"
+#include "vmath.h"
+#include "bn.h"
+
+static int
+mat_equal(const mat_t a, const mat_t b)
+{
+    int i;
+    for (i = 0; i < 16; i++) {
+	if (!NEAR_EQUAL(a[i], b[i], BN_TOL_DIST)) return 0;
+    }
+    return 1;
+}
+
+static void
+scan_mat_args(char *argv[], int argnum, mat_t *mat)
+{
+    sscanf(argv[argnum], "%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg", &(*mat)[0], &(*mat)[1], &(*mat)[2], &(*mat)[3], &(*mat)[4], &(*mat)[5], &(*mat)[6], &(*mat)[7], &(*mat)[8], &(*mat)[9], &(*mat)[10], &(*mat)[11], &(*mat)[12], &(*mat)[13], &(*mat)[14], &(*mat)[15]);
+}
+
+static int
+test_bn_mat_mul(int argc, char *argv[])
+{
+    mat_t m1, m2, expected, actual;
+
+    if (argc != 5) {
+	bu_exit(1, "<args> format: M1 M2 <expected_result> [%s]\n", argv[0]);
+    }
+
+    scan_mat_args(argv, 2, &m1);
+    scan_mat_args(argv, 3, &m2);
+    scan_mat_args(argv, 4, &expected);
+
+    bn_mat_mul(actual, m1, m2);
+    return !mat_equal(expected, actual);
+}
+
+static int
+test_bn_mat_mul3(int argc, char *argv[])
+{
+    mat_t m1, m2, m3, expected, actual;
+
+    if (argc != 6) {
+	bu_exit(1, "<args> format: M1 M2 M3 <expected_result> [%s]\n", argv[0]);
+    }
+
+    scan_mat_args(argv, 2, &m1);
+    scan_mat_args(argv, 3, &m2);
+    scan_mat_args(argv, 4, &m3);
+    scan_mat_args(argv, 5, &expected);
+
+    bn_mat_mul3(actual, m1, m2, m3);
+    return !mat_equal(expected, actual);
+}
+
+static int
+test_bn_mat_mul4(int argc, char *argv[])
+{
+    mat_t m1, m2, m3, m4, expected, actual;
+
+    if (argc != 7) {
+	bu_exit(1, "<args> format: M1 M2 M3 M4 <expected_result> [%s]\n", argv[0]);
+    }
+
+    scan_mat_args(argv, 2, &m1);
+    scan_mat_args(argv, 3, &m2);
+    scan_mat_args(argv, 4, &m3);
+    scan_mat_args(argv, 5, &m4);
+    scan_mat_args(argv, 6, &expected);
+
+    bn_mat_mul4(actual, m1, m2, m3, m4);
+    return !mat_equal(expected, actual);
+}
+
+static int
+test_bn_matXvec(int argc, char *argv[])
+{
+    mat_t m;
+    hvect_t v, expected, actual;
+
+    if (argc != 5) {
+	bu_exit(1, "<args> format: M V <expected_result> [%s]\n", argv[0]);
+    }
+
+    scan_mat_args(argv, 2, &m);
+    sscanf(argv[3], "%lg,%lg,%lg,%lg", &v[0], &v[1], &v[2], &v[3]);
+    sscanf(argv[4], "%lg,%lg,%lg,%lg", &expected[0], &expected[1], &expected[2], &expected[3]);
+
+    bn_matXvec(actual, m, v);
+    return !HNEAR_EQUAL(expected, actual, BN_TOL_DIST);
+}
+
+static int
+test_bn_mat_inverse(int argc, char *argv[])
+{
+    mat_t m, expected, actual;
+    int singular;
+
+    sscanf(argv[2], "%d", &singular);
+    if ((argc == 4 && !singular) || (argc != 4 && argc != 5)) {
+	bu_exit(1, "<args> format: 0|1 M [expected_result] [%s]\n", argv[0]);
+    }
+
+    scan_mat_args(argv, 3, &m);
+    if (!singular) {
+	scan_mat_args(argv, 4, &expected);
+    }
+
+    if (!bn_mat_inverse(actual, m)) {
+	return !singular;
+    }
+
+    return !mat_equal(expected, actual);
+}
+
+static int
+test_bn_mat_trn(int argc, char *argv[])
+{
+    mat_t m, expected, actual;
+
+    if (argc != 4) {
+	bu_exit(1, "<args> format: M <expected_result> [%s]\n", argv[0]);
+    }
+
+    scan_mat_args(argv, 2, &m);
+    scan_mat_args(argv, 3, &expected);
+
+    bn_mat_trn(actual, m);
+    return !mat_equal(expected, actual);
+}
+
+static int
+test_bn_mat_is_identity(int argc, char *argv[])
+{
+    mat_t m;
+    int expected;
+
+    if (argc != 4) {
+	bu_exit(1, "<args> format: M <expected_result> [%s]\n", argv[0]);
+    }
+
+    scan_mat_args(argv, 2, &m);
+    sscanf(argv[3], "%d", &expected);
+
+    return !(bn_mat_is_identity(m) == expected);
+}
+
+static int
+test_bn_mat_det3(int argc, char *argv[])
+{
+    mat_t m;
+    fastf_t expected, actual;
+
+    if (argc != 4) {
+	bu_exit(1, "<args> format: M <expected_result> [%s]\n", argv[0]);
+    }
+
+    scan_mat_args(argv, 2, &m);
+    sscanf(argv[3], "%lg", &expected);
+
+    actual = bn_mat_det3(m);
+    return !NEAR_EQUAL(expected, actual, BN_TOL_DIST);
+}
+
+static int
+test_bn_mat_determinant(int argc, char *argv[])
+{
+    mat_t m = MAT_INIT_ZERO;
+    fastf_t expected = 0.0, actual = 0.0;
+
+    if (argc != 4) {
+	bu_exit(1, "<args> format: M <expected_result> [%s]\n", argv[0]);
+    }
+
+    scan_mat_args(argv, 2, &m);
+    sscanf(argv[3], "%lg", &expected);
+
+    actual = bn_mat_determinant(m);
+    return !NEAR_EQUAL(expected, actual, BN_TOL_DIST);
+}
+
+static int
+test_bn_mat_is_equal(int argc, char *argv[])
+{
+    mat_t m1, m2;
+    int expected;
+    struct bn_tol tol = BN_TOL_INIT_ZERO;
+    tol.dist = BN_TOL_DIST;
+    tol.dist = BN_TOL_DIST * BN_TOL_DIST;
+    tol.perp = BN_TOL_DIST;
+
+    if (argc != 5) {
+	bu_exit(1, "<args> format: M1 M2 <expected_result> [%s]\n", argv[0]);
+    }
+
+    scan_mat_args(argv, 2, &m1);
+    scan_mat_args(argv, 3, &m2);
+    sscanf(argv[4], "%d", &expected);
+
+    return !(bn_mat_is_equal(m1, m2, &tol) == expected);
+}
+
+int
+main(int argc, char *argv[])
+{
+    int function_num = 0;
+
+    if (argc < 3) {
+	bu_exit(1, "Argument format: <function_number> <args> [%s]\n", argv[0]);
+    }
+
+    sscanf(argv[1], "%d", &function_num);
+    if (function_num < 1 || function_num > 10) function_num = 0;
+
+    switch (function_num) {
+    case 1:
+	return test_bn_mat_mul(argc, argv);
+    case 2:
+	return test_bn_mat_mul3(argc, argv);
+    case 3:
+	return test_bn_mat_mul4(argc, argv);
+    case 4:
+	return test_bn_matXvec(argc, argv);
+    case 5:
+	return test_bn_mat_inverse(argc, argv);
+    case 6:
+	return test_bn_mat_trn(argc, argv);
+    case 7:
+	return test_bn_mat_is_identity(argc, argv);
+    case 8:
+	return test_bn_mat_det3(argc, argv);
+    case 9:
+	return test_bn_mat_determinant(argc, argv);
+    case 10:
+	return test_bn_mat_is_equal(argc, argv);
+    }
+
+    bu_log("ERROR: function_num %d is not valid [%s]\n", function_num, argv[0]);
+    return 1;
+}
+
+/*
+ * Local Variables:
+ * mode: C
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */
Index: src/libbn/tests/CMakeLists.txt
===================================================================
--- src/libbn/tests/CMakeLists.txt	(revision 59120)
+++ src/libbn/tests/CMakeLists.txt	(working copy)
@@ -12,6 +12,7 @@
 BRLCAD_ADDEXEC(tester_bn_plane_dist bn_plane_dist.c "libbu;libbn" NO_INSTALL)
 BRLCAD_ADDEXEC(tester_bn_plane_isect bn_plane_isect.c "libbu;libbn" NO_INSTALL)
 BRLCAD_ADDEXEC(tester_bn_complex bn_complex.c "libbu;libbn" NO_INSTALL)
+BRLCAD_ADDEXEC(tester_bn_mat bn_mat.c "libbu;libbn" NO_INSTALL)
 CMAKEFILES(bn_chull_test003_bot.asc)
 CMAKEFILES(bn_chull_test004_bot.asc)
 CMAKEFILES(bn_poly_cubic_roots.c bn_poly_quartic_roots.c bn_obr.c)
@@ -377,6 +378,145 @@
 add_test(bn_cx_parts_3           tester_bn_complex 8  2,1 2,1)
 
 
+#
+#  *************** mat.c tests ***************
+#
+# For tester_bn_mat, input is as follows:
+# tester_bn_mat <function_number> <args>
+#
+# Values supplied to the test program were verified using
+# Wolfram Alpha: http://www.wolframalpha.com/
+# and http://www.bluebit.gr/matrix-calculator/
+
+# For function #1 (bn_mat_mul), the <args> format is as follows:
+#
+# M1 M2 <expected_result>
+#
+# where M1 is the first matrix, M2 is the second matrix.
+# A matrix is 16 floating point numbers separated by commas.
+
+add_test(bn_mat_mul_0_1          tester_bn_mat 1 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 1.0,2.1,3.3,4.4,5.5,6.6,7.7,8.8,9.9,10.1,11.11,12.12,13.13,14.14,15.15,16.16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
+add_test(bn_mat_mul_0_2          tester_bn_mat 1 2.8,1.7,3205.555,87.76,55.0,66.0,77.0,0.0,0.0,10.1,46.8,537.999,13.0,14.0,15.0,24382.5373 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
+add_test(bn_mat_mul_id_1         tester_bn_mat 1 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 33.34,28.7135672,44.84,55.85,1,1,0,0,0,7843.4444,11,12,473.232,83.17,75.0,8.417 33.34,28.7135672,44.84,55.85,1,1,0,0,0,7843.4444,11,12,473.232,83.17,75.0,8.417)
+add_test(bn_mat_mul_id_2         tester_bn_mat 1 3688.701794246889,5712.945961512324,8172.282142910184,5109.8260742578495,2697.196099611537,2586.742536023153,5067.2882336104285,1149.9923643570387,6827.968448547921,9548.849169087358,5418.682604729545,9117.6798488191,5478.474626204755,7525.19019682893,3172.945417883698,8609.907811093646 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 3688.701794246889,5712.945961512324,8172.282142910184,5109.8260742578495,2697.196099611537,2586.742536023153,5067.2882336104285,1149.9923643570387,6827.968448547921,9548.849169087358,5418.682604729545,9117.6798488191,5478.474626204755,7525.19019682893,3172.945417883698,8609.907811093646)
+add_test(bn_mat_mul_id_id        tester_bn_mat 1 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)
+add_test(bn_mat_mul_dif_1        tester_bn_mat 1 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1 80,70,60,50,240,214,188,162,400,358,316,274,560,502,444,386)
+add_test(bn_mat_mul_dif_2        tester_bn_mat 1 3.2,62.9,53.0,71.5,98.6,75.4,9.6,89.9,37.7,49.0,60.2,55.2,27.8,40.2,0.5,78.1 37.1,73.1,4.9,72.1,68.2,64.7,75.7,87.4,85.8,45.0,94.5,30.8,95.9,45.9,45.4,49.1 15812.75,9970.4,13031.81,10871.23,18245.43,16644.45,11179.58,18408.79,15199.31,11168.85,12089.01,11565.25,11305.71,8240.41,6772.35,9367.97)
+
+# For function #2 (bn_mat_mul3), the <args> format is as follows:
+#
+# M1 M2 M3 <expected_result>
+#
+# where M1 M2 M3 are the three matrices to be multiplied.
+# A matrix is 16 floating point numbers separated by commas.
+
+add_test(bn_mat_mul3_0_1         tester_bn_mat 2 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
+add_test(bn_mat_mul3_0_id        tester_bn_mat 2 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
+add_test(bn_mat_mul3_id_1        tester_bn_mat 2 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1 80,70,60,50,240,214,188,162,400,358,316,274,560,502,444,386)
+add_test(bn_mat_mul3_dif         tester_bn_mat 2 3.1,4.2,1.9,1.8,2.9,0.3,4.1,4.5,2.9,2.7,0.7,1.7,1.6,0.8,4.5,5.0 1.1,2.1,2.3,3.5,2.7,1.8,2.6,3.8,1.5,0.7,3.0,4.4,2.3,0.3,4.5,4.3 3.2,2.0,2.6,0.0,2.1,4.0,0.5,1.6,4.3,3.1,2.7,4.7,0.9,3.3,2.4,4.7 278.616,347.578,253.473,376.876,304.197,369.044,283.557,434.156,203.015,252.984,183.327,274.048,315.303,376.398,294.975,446.11)
+
+# For function #3 (bn_mat_mul4), the <args> format is as follows:
+#
+# M1 M2 M3 M4 <expected_result>
+#
+# where M1 M2 M3 M4 are the four matrices to be multiplied.
+# A matrix is 16 floating point numbers separated by commas.
+
+add_test(bn_mat_mul4_id_4        tester_bn_mat 3 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)
+add_test(bn_mat_mul4_0_4         tester_bn_mat 3 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
+add_test(bn_mat_mul4_id_0        tester_bn_mat 3 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
+add_test(bn_mat_mul4_same        tester_bn_mat 3 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 113960,129040,144120,159200,263272,298128,332984,367840,412584,467216,521848,576480,561896,636304,710712,785120)
+
+# For function #4 (bn_matXvec), the <args> format is as follows:
+#
+# M V <expected_result>
+#
+# where M is the matrix
+#       V is the (column) vector to which the matrix will be multiplied, MxV.
+# A matrix is 16 floating point numbers separated by commas.
+# A vector is 4 floating point numbers separated by commas.
+
+add_test(bn_matXvec_id           tester_bn_mat 4 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 2.78,3.45,16.7,38.22 2.78,3.45,16.7,38.22)
+add_test(bn_matXvec_0_1          tester_bn_mat 4 18.59,25.82,46.39,16.56,46.13,22.16,29.66,92.89,67.58,79.96,59.47,51.4,55.83,48.5,82.51,73.52 0,0,0,0 0,0,0,0)
+add_test(bn_matXvec_0_2          tester_bn_mat 4 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 1.1,2.2,3.3,4.4 0,0,0,0)
+add_test(bn_matXvec_dif_1        tester_bn_mat 4 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 1,2,3,4 30,70,110,150)
+add_test(bn_matXvec_dif_2        tester_bn_mat 4 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 0,1,2,3 14,38,62,86)
+add_test(bn_matXvec_dif_3        tester_bn_mat 4 18.59,25.82,46.39,16.56,46.13,22.16,29.66,92.89,67.58,79.96,59.47,51.4,55.83,48.5,82.51,73.52 7.31,68.38,65.97,3.26  5015.7984,4112.0027,10052.4745,9407.4072)
+
+# For function #5 (bn_mat_inverse), the <args> format is as follows:
+#
+# 0|1 M [expected_result]
+#
+# where 0 or 1 indicates whether the matrix is singular
+#       M is the matrix to be inverted.
+# A matrix is 16 floating point numbers separated by commas.
+
+add_test(bn_mat_inverse_0        tester_bn_mat 5 1 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
+add_test(bn_mat_inverse_id       tester_bn_mat 5 0 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)
+add_test(bn_mat_inverse_sing_1   tester_bn_mat 5 1 1,2,2,0,1,1,3,4,2,2,1,0,0,0,0,0)
+add_test(bn_mat_inverse_sing_2   tester_bn_mat 5 1 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16)
+add_test(bn_mat_inverse_1        tester_bn_mat 5 0 14.16,71.27,95.53,77.27,91.51,26.83,17.56,6.94,30.11,40.47,38.1,39.27,56.52,90.12,87.96,84.3 0.00836179,0.0114599,0.0844829,-0.0479631,-0.0600379,-0.0107874,-0.349984,0.218954,0.0425546,0.0207413,-0.0527631,-0.0161344,0.0141745,-0.0177931,0.372557,-0.173216)
+
+# For function #6 (bn_mat_trn), the <args> format is as follows:
+#
+# M <expected_result>
+#
+# where M is the matrix to transpose.
+# A matrix is 16 floating point numbers separated by commas.
+
+add_test(bn_mat_trn_id           tester_bn_mat 6 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)
+add_test(bn_mat_trn_same         tester_bn_mat 6 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
+add_test(bn_mat_trn_1            tester_bn_mat 6 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 1,5,9,13,2,6,10,14,3,7,11,15,4,8,12,16)
+add_test(bn_mat_trn_2            tester_bn_mat 6 99.01,41.88,17.07,37.47,38.8,42.89,34.48,82.84,59.97,23.74,6.98,27.81,1.64,86.35,43.57,13.87 99.01,38.8,59.97,1.64,41.88,42.89,23.74,86.35,17.07,34.48,6.98,43.57,37.47,82.84,27.81,13.87)
+
+# For function #7 (bn_mat_is_identity), the <args> format is as follows:
+#
+# M <expected_result>
+#
+# where M is the matrix to test.
+# A matrix is 16 floating point numbers separated by commas.
+
+add_test(bn_mat_is_identity_id   tester_bn_mat 7 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 1)
+add_test(bn_mat_is_identity_0    tester_bn_mat 7 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0)
+add_test(bn_mat_is_identity_1    tester_bn_mat 7 15.58,76.15,18.45,80.55,52.36,28.49,85.75,56.75,76.44,66.57,32.39,52.18,39.21,96.09,98.66,30.95 0)
+add_test(bn_mat_is_identity_2    tester_bn_mat 7 1.001,0,0,0,0,1.001,0,0,0,0,1.001,0,0,0,0,1.001 0)
+
+# For function #8 (bn_mat_det3), the <args> format is as follows:
+#
+# M <expected_result>
+#
+# where M is the matrix to find the upper-left 3x3 determinant of.
+# A matrix is 16 floating point numbers separated by commas.
+
+add_test(bn_mat_det3_id          tester_bn_mat 8 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 1)
+add_test(bn_mat_det3_0           tester_bn_mat 8 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0)
+add_test(bn_mat_det3_1           tester_bn_mat 8 77.64,50.22,46.68,16.35,41.25,71.79,24.01,23.88,37.37,94.83,34.25,4.43,95.01,81.8,1.45,45.57 45601.558488)
+add_test(bn_mat_det3_2           tester_bn_mat 8 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 0)
+
+# For function #9 (bn_mat_determinant), the <args> format is as follows:
+#
+# M <expected_result>
+#
+# where M is the matrix to find the determinant of.
+# A matrix is 16 floating point numbers separated by commas.
+
+add_test(bn_mat_determinant_id   tester_bn_mat 9 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 1)
+add_test(bn_mat_determinant_0    tester_bn_mat 9 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0)
+add_test(bn_mat_determinant_1    tester_bn_mat 9 80.22,28.45,95.46,74.05,53.38,74.98,71.55,24.86,65.01,46.42,64.24,49.13,75.74,79.22,64.61,17.33 2.1004520202541295e6)
+add_test(bn_mat_determinant_2    tester_bn_mat 9 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 0)
+
+# For function #10 (bn_mat_is_equal), the <args> format is as follows:
+#
+# M1 M2 <expected_result>
+#
+# where M1 and M2 are the two matrices to be compared.
+# A matrix is 16 floating point numbers separated by commas.
+
+add_test(bn_mat_is_equal_1       tester_bn_mat 10 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 1)
+add_test(bn_mat_is_equal_2       tester_bn_mat 10 70.46,38.7,1.57,84.19,38.53,52.52,89.28,8.58,89.96,61.36,5.45,63.62,99.98,82.15,65.44,67.46 70.46,38.7,1.57,84.19,38.53,52.52,89.28,8.58,89.96,61.36,5.45,63.62,99.98,82.15,65.44,67.46 1)
+add_test(bn_mat_is_equal_3       tester_bn_mat 10 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0)
+add_test(bn_mat_is_equal_4       tester_bn_mat 10 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 71.53,18.85,47.48,24.56,42.34,98.18,42.1,74.61,30.47,49.18,63.06,2.11,58.31,60.61,0.62,34.23 0)
+
 # Local Variables:
 # tab-width: 8
 # mode: cmake
