From c5386d66fc5d5ac7a4f46cb0e8f3ab4294540f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana?= Date: Wed, 12 Jul 2023 03:23:28 +0200 Subject: [PATCH] Fix mistake with references --- src/Metrics.cc | 2 +- src/Metrics.hpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Metrics.cc b/src/Metrics.cc index d782d56..dacc0cb 100644 --- a/src/Metrics.cc +++ b/src/Metrics.cc @@ -8,7 +8,7 @@ namespace bayesnet { , classNumStates(classNumStates) { } - Metrics::Metrics(vector>& vsamples, vector& labels, vector& features, string& className, int classNumStates) + Metrics::Metrics(const vector>& vsamples, const vector& labels, const vector& features, const string& className, const int classNumStates) : features(features) , className(className) , classNumStates(classNumStates) diff --git a/src/Metrics.hpp b/src/Metrics.hpp index 79ba46a..2587d80 100644 --- a/src/Metrics.hpp +++ b/src/Metrics.hpp @@ -8,8 +8,8 @@ namespace bayesnet { class Metrics { private: torch::Tensor samples; - vector& features; - string& className; + vector features; + string className; int classNumStates; vector> doCombinations(const vector&); double entropy(torch::Tensor&); @@ -17,7 +17,7 @@ namespace bayesnet { double mutualInformation(torch::Tensor&, torch::Tensor&); public: Metrics(torch::Tensor&, vector&, string&, int); - Metrics(vector>&, vector&, vector&, string&, int); + Metrics(const vector>&, const vector&, const vector&, const string&, const int); vector conditionalEdgeWeights(); }; }