diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2024-04-21 19:27:40 +0200 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2024-04-21 19:27:40 +0200 |
commit | 0bcd4de77521203444812eeb34862d2833256453 (patch) | |
tree | 9015222ff57d1a171331f406246f7a4399c211b7 | |
parent | 5d014d68d8e56519d8c07f8acaf09195ff3da861 (diff) | |
download | code-0bcd4de77521203444812eeb34862d2833256453.tar.gz code-0bcd4de77521203444812eeb34862d2833256453.tar.bz2 code-0bcd4de77521203444812eeb34862d2833256453.zip |
Set higher precision for output.
-rw-r--r-- | least_squares.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/least_squares.cpp b/least_squares.cpp index 827ede0..36bb1c3 100644 --- a/least_squares.cpp +++ b/least_squares.cpp @@ -2,6 +2,7 @@ #include <eigen3/unsupported/Eigen/CXX11/Tensor> #include <eigen3/unsupported/Eigen/CXX11/TensorSymmetry> #include <getopt.h> +#include <iomanip> #include "pcg-cpp/include/pcg_random.hpp" #include "randutils/randutils.hpp" @@ -224,6 +225,8 @@ int main(int argc, char* argv[]) { Vector x = Vector::Zero(N); x(0) = sqrt(N); + std::cout << std::setprecision(15); + for (unsigned sample = 0; sample < samples; sample++) { QuadraticModel* ls = new QuadraticModel(N, M, r, σ², μA, μJ); Vector xGD = gradientAscent(*ls, x); |