Add generic Vector type #27

Closed
opened 2025-04-28 16:37:17 +00:00 by glen · 1 comment
Owner

The last ingredient missing (as far as I know) for implementing polynomialRoot is some form of tuple, to allow all of the roots to be returned. We are going to implement a type Vector for a built-in (1-dimensional) Array of elements. Typically, these will be homogeneous, so an Vector(BooleanT) will be an Array strictly of booleans. However, the twist as compared to Complex is that we definitely need to allow non-homogeneous vectors. Since we want to maintain a strict division between generic and concrete types, we are going to initially try Vector(NotAType) as the type of all inhomogeneous vectors.

We shall typically think of these Vectors as "row" vectors. That way, Vector(Vector(NumberT)) will be naturally interpreted as an ordinary matrix of numbers, stored in "row-major" fashion. We shall arrange the ordinary arithmetic operations on Vector so that, e.g., multiply on two Vector(Vector(NumberT)) will be ordinary matrix multiplication.

The last ingredient missing (as far as I know) for implementing polynomialRoot is some form of tuple, to allow all of the roots to be returned. We are going to implement a type Vector for a built-in (1-dimensional) Array of elements. Typically, these will be homogeneous, so an Vector(BooleanT) will be an Array strictly of booleans. However, the twist as compared to Complex is that we definitely need to allow non-homogeneous vectors. Since we want to maintain a strict division between generic and concrete types, we are going to initially try Vector(NotAType) as the type of all inhomogeneous vectors. We shall typically think of these Vectors as "row" vectors. That way, Vector(Vector(NumberT)) will be naturally interpreted as an ordinary matrix of numbers, stored in "row-major" fashion. We shall arrange the ordinary arithmetic operations on Vector so that, e.g., multiply on two Vector(Vector(NumberT)) will be ordinary matrix multiplication.
glen added the
feature
priority
labels 2025-04-28 16:37:17 +00:00
glen changed title from Add generic Array type to Add generic Vector type 2025-04-28 16:38:42 +00:00
Author
Owner

Resolved by merging #28.

Resolved by merging #28.
glen closed this issue 2025-05-07 00:04:18 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: StudioInfinity/nanomath#27
No description provided.