Skip to content

Commit

Permalink
Improved UserDefined
Browse files Browse the repository at this point in the history
Now it implements getSupport() and getProbabilities()
  • Loading branch information
regislebrun committed Apr 3, 2024
1 parent 46cb6b9 commit 9facd30
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/src/Uncertainty/Distribution/UserDefined.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,18 @@ Sample UserDefined::getSupport(const Interval & interval) const
return result;
}

/* Get the support on the whole range */
Sample UserDefined::getSupport() const
{
return points_;
}

/* Get the discrete probability levels */
Point UserDefined::getProbabilities() const
{
return probabilities_;
}

/* Tell if the distribution is integer valued */
Bool UserDefined::isIntegral() const
{
Expand Down
5 changes: 5 additions & 0 deletions lib/src/Uncertainty/Distribution/openturns/UserDefined.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,13 @@ public:

/** Get the support of a discrete distribution that intersect a given interval */
using DistributionImplementation::getSupport;
Sample getSupport() const override;
Sample getSupport(const Interval & interval) const override;

/** Get the discrete probability levels */
using DistributionImplementation::getProbabilities;
Point getProbabilities() const override;

/** Tell if the distribution is integer valued */
Bool isIntegral() const override;

Expand Down

0 comments on commit 9facd30

Please sign in to comment.