feat: Implement Vector type #28

Merged
glen merged 12 commits from vector into main 2025-05-07 00:03:50 +00:00

12 commits

Author SHA1 Message Date
db86b2ecd0 feat: implement invert for vectors and matrices
All checks were successful
/ test (pull_request) Successful in 20s
Here invert returns the pseudoinverse when the input is not invertible.
  To this end, also implements (rudimentary) conversion of Complex to NumberT,
  an identity method that produces identity matrices, determinant, and
  the adjoint operation on matrices (conjugate transpose).
2025-05-06 16:53:11 -07:00
ed66ea7772 feat: vector transpose and multiply 2025-05-04 21:12:38 -07:00
f398454d59 feat: vector negate and subtract 2025-05-03 20:46:21 -07:00
cb3a93dd1c feat: Start adding vector arithmetic
So far, abs, add, norm, normsq, and sum are supported. To get them
  to work, also implements the following:
  * refactor: Use ReturnType function rather than just accessing .returns
  * feat: distinguish marking a function as a behavior from its return type
  * refactor: Rename `NotAType` to `Unknown` because it must be made closer
    to a bona fide type for the sake of inhomogeneous vectors
  * feat: make resolving a TypeDispatcher method on a type vector including
    `Unknown` into a no-op; that simplifies a number of generic behaviors
  * feat: add `haszero` method parallel to `hasnan`
  * feat: track the Vector nesting depth of Vector specializations
2025-05-03 19:59:44 -07:00
ec97b0e20a refactor: rename absquare to normsq and add norm 2025-05-02 21:20:45 -07:00
edfba089e3 feat: Complete relational functions for vectors
Toward its goal, this commit also:
  * Adds a new section of logical functions, and defines `not`, `and`,
    `or` for all current types.
  * Extends `OneOf` choice/union type to allow argument types that are
    themselves `OneOf` types.
  * Adds a readable .toString() method for TypePatterns.
  * Defines negate (as a no-op) and isnan (as always true) for the Undefined
    type
  * Extends comparisons to the Undefined type (to handle comparing vectors
    of different lengths)
2025-05-02 19:03:54 -07:00
c3c2bbbf78 feat: equality on Vector elementwise 2025-05-01 20:00:24 -07:00
7b799f7183 feat: Add vector deepEqual 2025-04-28 21:25:02 -07:00
3b882f3d53 feat: extend all utils to vectors elementwise & fix parameter match grouping 2025-04-28 19:32:12 -07:00
f002310581 feat: Add vector clone 2025-04-28 16:25:03 -07:00
7d150e2860 feat: Add vector constructor/converter 2025-04-28 16:02:26 -07:00
cc4d77f128 feat: add Vector generic type 2025-04-28 14:29:08 -07:00