Skip to content

Fix#13: Implement covariance function and add tests#20

Open
DjYash007 wants to merge 1 commit into
bsoc-bitbyte:mainfrom
DjYash007:co-variance
Open

Fix#13: Implement covariance function and add tests#20
DjYash007 wants to merge 1 commit into
bsoc-bitbyte:mainfrom
DjYash007:co-variance

Conversation

@DjYash007

Copy link
Copy Markdown
Contributor

Overview

  1. This PR fixes or fixes part of Implement Covariance #13 : Implement covariance.
  2. This PR does the following:
    Implemented covariance in primary/covariance.rs.
    Features:
  • Reuses existing mean() implementation
  • Returns None for empty inputs
  • Returns None for inputs of different lengths
  • Returns None for inputs with fewer than 2 values
  • Added comprehensive test coverage including:
    • empty inputs
    • different lengths
    • single-element inputs
    • smallest valid input
    • multiple values
    • negative values
    • decimal values
    • positive covariance
    • negative covariance

Essential Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • "Allow edits from maintainers" is checked. (See here for instructions on how to enable it.)
  • The PR is made from a branch that's not called "main/master".

Proof that changes are correct

2026-06-12-101158

PR Pointers

  • If you need a review or an answer to a question, and don't have permissions to assign people, leave a comment like the following: "{{Question/comment}} @{{reviewer_username}} PTAL".
  • Never force push. If you do, your PR will be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant