Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Check if matrix is nonnegative #557

Open
vprusso opened this issue Apr 20, 2024 · 0 comments
Open

Feature: Check if matrix is nonnegative #557

vprusso opened this issue Apr 20, 2024 · 0 comments
Labels
feature request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@vprusso
Copy link
Owner

vprusso commented Apr 20, 2024

Provide a function that takes in as input a matrix (as a numpy array) and returns True if the matrix is nonnegative and False otherwise.

A function like the following could be written:

import numpy as np


def is_nonnegative(mat: np.ndarray) -> bool:
    """Check if a matrix is nonnegative.

    A matrix is nonnegative if all of the entries in the matrix are >= 0
    """
    return np.all(mat >= 0)

One would also need to provide proper documentation, examples, and unit tests for this function as well.

@vprusso vprusso added help wanted Extra attention is needed good first issue Good for newcomers feature request labels Apr 20, 2024
@vprusso vprusso changed the title Feature: Check if matrix is non-negative Feature: Check if matrix is nonnegative Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant