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

[ParU] Use unsigned integer types where it makes sense #596

Open
gruenich opened this issue Dec 17, 2023 · 0 comments
Open

[ParU] Use unsigned integer types where it makes sense #596

gruenich opened this issue Dec 17, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@gruenich
Copy link
Contributor

Is your feature request related to a problem? Please describe.
In ParU.hpp many types are defined. They use signed integer int64_t instead of a unsigned integer type. Examples for values that cannot be negative are ParU_Factors->n, ParU_Numeric->sym_m, ParU_Numeric->nf, ParU_Symbolic->snz, ParU_U_singleton->Sub, ParU_Control->mem_chunk, ParU_Control->paru_max_threads.

Describe the solution you'd like
Introduce a new type like size_t to represent non-negative integer numbers. Technically, this is an interface change and should happen before releasing SuiteSparse 7.4.0. This change might cause additional warnings, but would add semantic meaning.

Describe alternatives you've considered
Sticking to the way it is.

Additional context
I tried to fix the following warning. It occurs as std::vector's size is a size_t. If you do not consider this change, a cast would fix this issue.

  SuiteSparse/ParU/Source/paru_factorize.cpp:347:27: Warning: comparison between signed and unsigned integer expressions: »std::vector<long int>::size_type« {aka »long unsigned int«} and »int32_t« {aka »int«} [-Wsign-compare]
  347 |     if (task_Q.size() * 2 > Control->paru_max_threads)
      |         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~

I can help making the transition. But I would ask for a decision first and to get an unsigned type to use.

@DrTimothyAldenDavis DrTimothyAldenDavis self-assigned this Dec 21, 2023
@DrTimothyAldenDavis DrTimothyAldenDavis added the enhancement New feature or request label Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants