Add generic Vector type #27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
Add generic Array typeto Add generic Vector typeResolved by merging #28.