summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2024-04-21 19:27:40 +0200
committerJaron Kent-Dobias <jaron@kent-dobias.com>2024-04-21 19:27:40 +0200
commit0bcd4de77521203444812eeb34862d2833256453 (patch)
tree9015222ff57d1a171331f406246f7a4399c211b7
parent5d014d68d8e56519d8c07f8acaf09195ff3da861 (diff)
downloadcode-0bcd4de77521203444812eeb34862d2833256453.tar.gz
code-0bcd4de77521203444812eeb34862d2833256453.tar.bz2
code-0bcd4de77521203444812eeb34862d2833256453.zip
Set higher precision for output.
-rw-r--r--least_squares.cpp3
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);