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

[math] math::Matrix class size limitation #1005

Open
hshose opened this issue Apr 20, 2023 · 1 comment
Open

[math] math::Matrix class size limitation #1005

hshose opened this issue Apr 20, 2023 · 1 comment

Comments

@hshose
Copy link
Contributor

hshose commented Apr 20, 2023

There are a few places in the matrix_impl.hpp, like here, where the matrix size is limited to 256 elements, if I see correctly. This is a 16 by 16 matrix which is very small - even on a microcontroller.

Is there a reason for having this?

Otherwise changing, e.g.,

	for (uint_fast8_t i = 0; i < getNumberOfElements(); ++i) { element[i] = data[i]; }

to

	for (uint_fast16_t i = 0; i < getNumberOfElements(); ++i) { element[i] = data[i]; }

would make sense?

If not, it would probably be good to explicitly state this limit in the documentation?

Also, maybe change the template from template<typename T, uint8_t ROWS, uint8_t COLUMNS>
to template<typename T, uint16_t ROWS, uint16_t COLUMNS> alltogether, which would probably cover all relevant matrix applications on microcontrollers? (I would see applications where one might want to use a matrix that has more than 256 entries in one dimension...).

@salkinium
Copy link
Member

You can change it as you wish.

However, I don't want to maintain so much custom code over the long term, I would like to externalize this math code by maybe integrating eigen 3.4, which recently supports C++14. It doesn't seem to use C++ exceptions, and it mostly looks quite efficient.

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

No branches or pull requests

2 participants