Skip to content

Fixes some logical issues in matrix and vector code#51

Open
microbuilder wants to merge 2 commits intozephyrproject-rtos:masterfrom
microbuilder:fixes_rc
Open

Fixes some logical issues in matrix and vector code#51
microbuilder wants to merge 2 commits intozephyrproject-rtos:masterfrom
microbuilder:fixes_rc

Conversation

@microbuilder
Copy link
Member

Address some small logical and code problems identified in the issues below:

Fixes #46
Fixes #47
Fixes #48

Adds missing `break` statements in `zsl_mtx_binary_op`.

Signed-off-by: Kevin Townsend <kevin@ktownsend.com>
Fixes two small logical errors in `zsl_vec_sort` and
`zsl_vec_zte`.

Signed-off-by: Kevin Townsend <kevin@ktownsend.com>
@microbuilder microbuilder requested a review from uLipe May 28, 2023 20:00
@microbuilder microbuilder self-assigned this May 28, 2023
@microbuilder
Copy link
Member Author

microbuilder commented May 28, 2023

@uLipe When you have a few minutes, do you mind doing a quick check of these and approve if you're happy with the changes? I completely missed the issues that were raised in January (thanks @ruehlchris).

for (size_t g = 0; g < v->sz; g++) {
if ((v->data[g - x] >= 0.0 && v->data[g - x] < epsilon) ||
(v->data[g - x] <= 0.0 && v->data[g - x] > epsilon)) {
(v->data[g - x] <= 0.0 && v->data[g - x] > -epsilon)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: It seems this is a saturation operation, if so I would not use less/greater and equal, since we only want to wrap around to a desired value when the variable surpasses it.

Copy link
Member

@uLipe uLipe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a minor, not blocking, comment.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vectors: if statement always true matrises: missing break in zsl_mtx_binary_op() vectors: function zsl_vec_zte, missing (-) in if statement

2 participants