]> gitweb.michael.orlitzky.com - octave.git/blobdiff - tests/random_orthogonal_matrix_tests.m
Add the random_orthogonal_matrix() function and its tests.
[octave.git] / tests / random_orthogonal_matrix_tests.m
diff --git a/tests/random_orthogonal_matrix_tests.m b/tests/random_orthogonal_matrix_tests.m
new file mode 100644 (file)
index 0000000..f17e639
--- /dev/null
@@ -0,0 +1,8 @@
+for n = [ 1, 10, 25, 50, 100 ]
+  U = random_orthogonal_matrix(n);
+  actual = norm(U);
+  expected = 1;
+
+  msg = sprintf('random_orthogonal_matrix(%d) has norm 1', n);
+  unit_test_equals(msg, expected, actual);
+end