Skip to content

Conversation

@pasabanov
Copy link
Member

@pasabanov pasabanov commented Feb 3, 2025

Types of changes

  • Feature
  • Documentation
  • Testing

Related: #19 ALFI-lib/test_data#4

Description

  1. Declared QUADRATIC and CUBIC in alfi::dist::Type.
  2. Added quadratic and cubic functions in alfi::dist.
  3. Documented new functions.
  4. Integrated into examples.
  5. Covered with unit tests.

The "quadratic" distribution is given by:

$$ \mathrm{quadratic}(x) = \begin{cases} (x+1)^2 - 1, & x \leq 0 \\ -(x-1)^2 + 1, & x > 0 \end{cases} $$

The "cubic" distribution is given by:

$$ \mathrm{cubic}(x) = -0.5x^3 + 1.5x $$

The distribution of points is generated by applying these functions to the uniformly distributed points on the $[-1, 1]$ segment.

You can interact with these distributions on this Desmos graph: https://www.desmos.com/calculator/qdse58hzhp.

@pasabanov pasabanov added docs Improvements or additions to documentation feature New feature or request tests Adding or changing tests labels Feb 3, 2025
@pasabanov pasabanov added this to the First Release Version milestone Feb 3, 2025
@pasabanov pasabanov self-assigned this Feb 3, 2025
1. Declared `QUADRATIC` and `CUBIC` in `alfi::dist::Type`.
2. Added `quadratic` and `cubic` functions in `alfi::dist`.
3. Documented new functions.
4. Integrated into examples.
5. Covered with unit tests.
@pasabanov pasabanov merged commit 3e586fa into main Feb 3, 2025
5 checks passed
@pasabanov pasabanov deleted the dist branch February 3, 2025 09:01
@pasabanov pasabanov mentioned this pull request Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation feature New feature or request tests Adding or changing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants