From 86bf68da949dcd7b5efcd5f0da24eb2a0e3da645 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 9 Mar 2026 08:59:13 -0400 Subject: [PATCH] **/*.m: load the statistics package for unifrnd The unifrnd() function was moved to the statistics package in Octave 4.4: https://octave.org/NEWS-4.4.html We add "pkg load statistics;" where necessary, and now implicitly depend on the statistics package. --- random_positive_definite_matrix.m | 4 ++++ tests/conjugate_gradient_method_tests.m | 3 +++ tests/preconditioned_conjugate_gradient_method_tests.m | 3 +++ tests/steepest_descent_tests.m | 3 +++ 4 files changed, 13 insertions(+) diff --git a/random_positive_definite_matrix.m b/random_positive_definite_matrix.m index 9b3f0f0..164cb33 100644 --- a/random_positive_definite_matrix.m +++ b/random_positive_definite_matrix.m @@ -19,6 +19,10 @@ function A = random_positive_definite_matrix(integerN, max_entry = realmax) % % - ``A`` -- A symmetric, positive definite matrix. % + + % provides unifrnd() + pkg load statistics; + U = random_orthogonal_matrix(integerN); d = unifrnd(eps, max_entry, 1, integerN); D = diag(d); diff --git a/tests/conjugate_gradient_method_tests.m b/tests/conjugate_gradient_method_tests.m index 3f068ae..bdc34ba 100644 --- a/tests/conjugate_gradient_method_tests.m +++ b/tests/conjugate_gradient_method_tests.m @@ -1,3 +1,6 @@ +## provides unifrnd() +pkg load statistics; + ## Used throughout. The CGM uses the infinity norm as the stopping ## condition, so we had better also. max_iterations = 10000; diff --git a/tests/preconditioned_conjugate_gradient_method_tests.m b/tests/preconditioned_conjugate_gradient_method_tests.m index a27d3e2..d30be5e 100644 --- a/tests/preconditioned_conjugate_gradient_method_tests.m +++ b/tests/preconditioned_conjugate_gradient_method_tests.m @@ -1,3 +1,6 @@ +## provides unifrnd() +pkg load statistics; + ## Used throughout. The PCGM uses the infinity norm as the stopping ## condition, so we had better also. max_iterations = 10000; diff --git a/tests/steepest_descent_tests.m b/tests/steepest_descent_tests.m index d6de1cc..5ded0e0 100644 --- a/tests/steepest_descent_tests.m +++ b/tests/steepest_descent_tests.m @@ -1,3 +1,6 @@ +## provides unifrnd() +pkg load statistics; + ## We can use the steepest descent method to solve Qx=b as in the ## conjugate gradient method. Like we did there, we test that the ## steepest descent method agrees with Octave's PCGM and our CGM. -- 2.51.0