Skip to content

Commit

Permalink
124
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Oct 23, 2024
1 parent 682a4d0 commit dcc93b8
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 59 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= 0.11 release (wip)
= 0.11 release (2024-10-23)

* Maintenance

Expand Down
8 changes: 1 addition & 7 deletions distro/rpm/otagrum.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,11 @@
%endif

%define __cmake %{_bindir}/cmake
%define _cmake_lib_suffix64 -DLIB_SUFFIX=64
%define cmake \
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
%__cmake \\\
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\
%if "%{?_lib}" == "lib64" \
%{?_cmake_lib_suffix64} \\\
%endif \
-DBUILD_SHARED_LIBS:BOOL=ON
%__cmake -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix}

Name: otagrum
Version: 0.11
Expand Down
11 changes: 5 additions & 6 deletions lib/src/ContinuousBayesianNetwork.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ namespace OTAGRUM

CLASSNAMEINIT(ContinuousBayesianNetwork)

static const Factory<ContinuousBayesianNetwork>
Factory_ContinuousBayesianNetwork;
static const Factory<ContinuousBayesianNetwork> Factory_ContinuousBayesianNetwork;

/* Default constructor */
ContinuousBayesianNetwork::ContinuousBayesianNetwork()
: ContinuousDistribution()
: DistributionImplementation()
, dag_()
, marginals_(0)
, copulas_(0)
Expand All @@ -56,7 +55,7 @@ ContinuousBayesianNetwork::ContinuousBayesianNetwork()
ContinuousBayesianNetwork::ContinuousBayesianNetwork(const NamedDAG &dag,
const DistributionCollection & marginals,
const DistributionCollection & copulas)
: ContinuousDistribution()
: DistributionImplementation()
, dag_(dag)
, marginals_(0)
, copulas_(0)
Expand Down Expand Up @@ -321,7 +320,7 @@ ContinuousBayesianNetwork::getCopulas() const
/* Method save() stores the object through the StorageManager */
void ContinuousBayesianNetwork::save(Advocate &adv) const
{
ContinuousDistribution::save(adv);
DistributionImplementation::save(adv);
adv.saveAttribute("dag_", dag_);
adv.saveAttribute("marginals_", marginals_);
adv.saveAttribute("copulas_", copulas_);
Expand All @@ -330,7 +329,7 @@ void ContinuousBayesianNetwork::save(Advocate &adv) const
/* Method load() reloads the object from the StorageManager */
void ContinuousBayesianNetwork::load(Advocate &adv)
{
ContinuousDistribution::load(adv);
DistributionImplementation::load(adv);
adv.loadAttribute("dag_", dag_);
adv.loadAttribute("marginals_", marginals_);
adv.loadAttribute("copulas_", copulas_);
Expand Down
10 changes: 5 additions & 5 deletions lib/src/JunctionTreeBernsteinCopula.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static const Factory<JunctionTreeBernsteinCopula> Factory_JunctionTreeBernsteinC

/* Default constructor */
JunctionTreeBernsteinCopula::JunctionTreeBernsteinCopula()
: ContinuousDistribution()
: DistributionImplementation()
, junctionTree_()
, cliquesCollection_(0)
, separatorsCollection_(0)
Expand All @@ -60,7 +60,7 @@ JunctionTreeBernsteinCopula::JunctionTreeBernsteinCopula(const NamedJunctionTree
const Sample & copulaSample,
const UnsignedInteger binNumber,
const Bool isCopulaSample)
: ContinuousDistribution()
: DistributionImplementation()
, junctionTree_(junctionTree)
, cliquesCollection_(0)
, separatorsCollection_(junctionTree.getSeparatorsCollection())
Expand All @@ -80,7 +80,7 @@ JunctionTreeBernsteinCopula::JunctionTreeBernsteinCopula(const NamedJunctionTree
const Sample & copulaSample,
const UnsignedInteger binNumber,
const Bool isCopulaSample)
: ContinuousDistribution()
: DistributionImplementation()
, junctionTree_(junctionTree)
, cliquesCollection_(0)
, separatorsCollection_(junctionTree.getSeparatorsCollection())
Expand Down Expand Up @@ -375,7 +375,7 @@ Distribution JunctionTreeBernsteinCopula::getMarginal(const Indices & indices) c
/* Method save() stores the object through the StorageManager */
void JunctionTreeBernsteinCopula::save(Advocate & adv) const
{
ContinuousDistribution::save(adv);
DistributionImplementation::save(adv);
adv.saveAttribute( "cliquesCollection_", cliquesCollection_ );
adv.saveAttribute( "separatorsCollection_", separatorsCollection_ );
adv.saveAttribute( "copulaSample_", copulaSample_ );
Expand All @@ -387,7 +387,7 @@ void JunctionTreeBernsteinCopula::save(Advocate & adv) const
/* Method load() reloads the object from the StorageManager */
void JunctionTreeBernsteinCopula::load(Advocate & adv)
{
ContinuousDistribution::load(adv);
DistributionImplementation::load(adv);
adv.loadAttribute( "cliquesCollection_", cliquesCollection_ );
adv.loadAttribute( "separatorsCollection_", separatorsCollection_ );
adv.loadAttribute( "copulaSample_", copulaSample_ );
Expand Down
17 changes: 6 additions & 11 deletions lib/src/otagrum/ContinuousBayesianNetwork.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@
#define OTAGRUM_CONTINUOUSBAYESIANNETWORK_HXX

#include <openturns/Distribution.hxx>

#if OPENTURNS_VERSION < 102400
#include <openturns/ContinuousDistribution.hxx>
#else
#define ContinuousDistribution DistributionImplementation
#endif
#include <openturns/DistributionImplementation.hxx>

#include "otagrum/NamedDAG.hxx"
#include "otagrum/otagrumprivate.hxx"
Expand All @@ -41,7 +36,7 @@ namespace OTAGRUM
* The ContinuousBayesianNetwork distribution.
*/
class OTAGRUM_API ContinuousBayesianNetwork
: public OT::ContinuousDistribution
: public OT::DistributionImplementation
{
CLASSNAME
public:
Expand All @@ -59,7 +54,7 @@ public:

public:
/** Comparison operator */
using OT::ContinuousDistribution::operator ==;
using OT::DistributionImplementation::operator ==;
OT::Bool operator ==(const ContinuousBayesianNetwork & other) const;
protected:
OT::Bool equals(const OT::DistributionImplementation & other) const override;
Expand All @@ -80,11 +75,11 @@ public:
OT::Point getRealization() const override;

/** Get the PDF of the distribution, i.e. P(point < X < point+dx) = PDF(point)dx + o(dx) */
using OT::ContinuousDistribution::computePDF;
using OT::DistributionImplementation::computePDF;
OT::Scalar computePDF(const OT::Point & point) const override;

/** Get the log-PDF of the distribution */
using OT::ContinuousDistribution::computeLogPDF;
using OT::DistributionImplementation::computeLogPDF;
OT::Scalar computeLogPDF(const OT::Point & point) const override;

/** DAG, marginals and copulas accessor */
Expand All @@ -99,7 +94,7 @@ public:
/** One copula per inner node */
DistributionCollection getCopulas() const;

using OT::ContinuousDistribution::getMarginal;
using OT::DistributionImplementation::getMarginal;
OT::Distribution getMarginal(const OT::UnsignedInteger i) const override;

OT::Distribution getCopulaAtNode(const OT::UnsignedInteger i) const;
Expand Down
13 changes: 4 additions & 9 deletions lib/src/otagrum/JunctionTreeBernsteinCopula.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@

#include <openturns/Distribution.hxx>
#include <openturns/Sample.hxx>

#if OPENTURNS_VERSION < 102400
#include <openturns/ContinuousDistribution.hxx>
#else
#define ContinuousDistribution DistributionImplementation
#endif
#include <openturns/DistributionImplementation.hxx>

#include "NamedJunctionTree.hxx"
#include "otagrum/otagrumprivate.hxx"
Expand All @@ -42,7 +37,7 @@ namespace OTAGRUM
* The JunctionTreeBernsteinCopula distribution.
*/
class OTAGRUM_API JunctionTreeBernsteinCopula
: public OT::ContinuousDistribution
: public OT::DistributionImplementation
{
CLASSNAME
public:
Expand All @@ -67,7 +62,7 @@ public:

public:
/** Comparison operator */
using OT::ContinuousDistribution::operator ==;
using OT::DistributionImplementation::operator ==;
OT::Bool operator ==(const JunctionTreeBernsteinCopula & other) const;
protected:
OT::Bool equals(const OT::DistributionImplementation & other) const override;
Expand All @@ -88,7 +83,7 @@ public:
OT::Point getRealization() const override;

/** Get the PDF of the distribution, i.e. P(point < X < point+dx) = PDF(point)dx + o(dx) */
using OT::ContinuousDistribution::computePDF;
using OT::DistributionImplementation::computePDF;
OT::Scalar computePDF(const OT::Point & point) const override;

/** Copula sample accessor */
Expand Down
21 changes: 1 addition & 20 deletions python/src/METADATA.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,10 @@ Keywords: probability reliability sensitivity metamodel
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Requires-Dist: openturns (>=1.16)
Requires-Dist: openturns (>=1.23)

OT/aGrUM module for OpenTURNS
Distributions/graphical models features

0 comments on commit dcc93b8

Please sign in to comment.