Merge branch 'main' of ssh://gitea.rmontanana.es:8022/rmontanana/BayesNet

This commit is contained in:
2023-07-02 16:32:00 +02:00
3 changed files with 80 additions and 0 deletions

View File

@@ -2,6 +2,12 @@
namespace bayesnet {
Network::Network() : laplaceSmoothing(1), root(nullptr), features(vector<string>()), className("") {}
Network::Network(int smoothing) : laplaceSmoothing(smoothing), root(nullptr), features(vector<string>()), className("") {}
Network::Network(Network& other) : laplaceSmoothing(other.laplaceSmoothing), root(other.root), features(other.features), className(other.className)
{
for (auto& pair : other.nodes) {
nodes[pair.first] = new Node(*pair.second);
}
}
Network::~Network()
{
for (auto& pair : nodes) {

View File

@@ -20,6 +20,7 @@ namespace bayesnet {
public:
Network();
Network(int);
Network(Network&);
~Network();
void addNode(string, int);
void addEdge(const string, const string);