From be01607041d2ded41e5bf39a0a8e17ffb9bcc296 Mon Sep 17 00:00:00 2001 From: y-jan137 Date: Sun, 15 Mar 2026 11:16:49 +0300 Subject: Add QR iteration and cleanup --- experiments/hilbert_qr.cpp | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'experiments/hilbert_qr.cpp') diff --git a/experiments/hilbert_qr.cpp b/experiments/hilbert_qr.cpp index 9209a30..218b35c 100644 --- a/experiments/hilbert_qr.cpp +++ b/experiments/hilbert_qr.cpp @@ -1,9 +1,3 @@ -// Experiment: QR methods on Hilbert matrices -// -// The Hilbert matrix H[i][j] = 1/(i+j+1) is the canonical ill-conditioned -// dense matrix. Its condition number grows roughly as (3.5 * e)^n / sqrt(n), -// reaching ~10^13 at n=10 and ~10^18 at n=14. -// // We compare classical GS, modified GS, and Householder QR on: // - reconstruction error ||A - QR||_F // - orthogonality error ||Q^T Q - I||_F @@ -68,9 +62,6 @@ double orthogonality_error(const QRResult& qr) { return std::sqrt(err); } -// --------------------------------------------------------------------------- -// Timing -// --------------------------------------------------------------------------- using Clock = std::chrono::high_resolution_clock; using Seconds = std::chrono::duration; @@ -88,10 +79,6 @@ double min_time(Fn fn, int trials = 5) { return best; } -// --------------------------------------------------------------------------- -// Run one method on one size, return {recon, ortho, time} or nullopt on failure -// --------------------------------------------------------------------------- - using QRFn = std::function; struct Result { double recon, ortho, time_s; }; @@ -110,10 +97,6 @@ std::optional measure(const Matrix& A, QRFn fn) { } } -// --------------------------------------------------------------------------- -// Pretty printing -// --------------------------------------------------------------------------- - void print_row(const std::string& method, std::optional r) { std::cout << std::left << std::setw(16) << method; if (!r) { -- cgit v1.2.3