diff --git a/src/limbo/model/gp.hpp b/src/limbo/model/gp.hpp index cc8bac8f87c7c27f3dd29f8a65464ca625d078f4..3bfa4db5df90cd13e9c9ead24de2a7ffdc060524 100644 --- a/src/limbo/model/gp.hpp +++ b/src/limbo/model/gp.hpp @@ -408,14 +408,31 @@ namespace limbo { void set_log_loo_cv(double log_loo_cv) { _log_loo_cv = log_loo_cv; } /// LLT matrix (from Cholesky decomposition) - //const Eigen::LLT& llt() const { return _llt; } const Eigen::MatrixXd& matrixL() const { return _matrixL; } const Eigen::MatrixXd& alpha() const { return _alpha; } - /// return the list of samples that have been tested so far + /// return the list of samples const std::vector& samples() const { return _samples; } + /// return the list of observations + std::vector observations() const + { + std::vector observations; + for (int i = 0; i < _observations.rows(); i++) { + observations.push_back(_observations.row(i)); + } + + return observations; + } + + /// return the observations (in matrix form) + /// (NxD), where N is the number of points and D is the dimension output + const Eigen::MatrixXd& observations_matrix() const + { + return _observations; + } + bool inv_kernel_computed() { return _inv_kernel_updated; } /// save the parameters and the data for the GP to the archive (text or binary) diff --git a/src/limbo/model/multi_gp.hpp b/src/limbo/model/multi_gp.hpp index 2f074e3d1370b61a65831a092cacda764cda9f16..2b822a9310f29ab4ae4ba7444a41a4af222ce473 100644 --- a/src/limbo/model/multi_gp.hpp +++ b/src/limbo/model/multi_gp.hpp @@ -265,13 +265,32 @@ namespace limbo { }); } - /// return the list of samples that have been tested so far + /// return the list of samples const std::vector& samples() const { assert(_gp_models.size()); return _gp_models[0].samples(); } + /// return the list of observations + const std::vector& observations() const + { + return _observations; + } + + /// return the observations (in matrix form) + /// (NxD), where N is the number of points and D is the dimension output + Eigen::MatrixXd observations_matrix() const + { + assert(_dim_out > 0); + Eigen::MatrixXd observations(_observations.size(), _dim_out); + for (int i = 0; i < _observations.size(); i++) { + observations.row(i) = _observations[i]; + } + + return observations; + } + /// return the mean observation Eigen::VectorXd mean_observation() const {