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

Vector type is limited to 1D #1786

Open
MaxBeaud opened this issue Jan 6, 2025 · 4 comments
Open

Vector type is limited to 1D #1786

MaxBeaud opened this issue Jan 6, 2025 · 4 comments
Labels
Discussion needed This feature needs discussion to iron out details Enhancement Request New feature or request

Comments

@MaxBeaud
Copy link

MaxBeaud commented Jan 6, 2025

Currently it seems that vectors are limited to only one dimensions. Where I would expect: int[<*>][<*>] foo = {{1,2},{3,4}}; to be possible, as well as int[<2>][<2>] bar = {{1,2},{3,4}}; while also being able to do operations like *, +, -, ^ on these vectors e.g.:

 int[<2>][<2>] a = foo * bar;
 int[<2>][<2>] a = foo + bar;
...

Or is there perhaps a specific matrix type in the works?

@Book-reader
Copy link
Contributor

Book-reader commented Jan 6, 2025

in the initial SIMD vector issue #56,int[<2, 2>] was one of the possible syntaxes, but it seems at some point possibly outside of github it was decided to make them 1d.

@lerno lerno added Enhancement Request New feature or request Discussion needed This feature needs discussion to iron out details labels Jan 6, 2025
@lerno
Copy link
Collaborator

lerno commented Jan 6, 2025

What you're requesting is matrices. You can of course do a list of simd vectors, like int[<2>][2] x but then you don't get direct addition. Maybe the matrix types could work for you?

@MaxBeaud
Copy link
Author

MaxBeaud commented Jan 6, 2025

C3 has builtin matrix types?

@Book-reader
Copy link
Contributor

it has 2x2, 3x3, and 4x4 matrices in lib/std/math/math_matrix.c3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion needed This feature needs discussion to iron out details Enhancement Request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants