5 | --------------------------------------------------------------------------------
6 | -- Field
7 | --------------------------------------------------------------------------------
10 | ||| An interface synonym for types which form a field, such as `Double`.
16 | ||| An interface for number types which allow for LUP decomposition to be performed.
17 | |||
18 | ||| The function `abslt` is required for the internal decomposition algorithm.
19 | ||| An instance of this interface must satisfy:
20 | ||| * The relation `abslt` is a preorder.
21 | ||| * `0` is a minimum of `abslt`.
25 | ||| Compare the absolute values of two inputs.
29 | export
33 | -- Alternative implementations of `Eq` and `FieldCmp` that compare approximately,
34 | -- useful when working with flating point numbers
36 | export
41 | export
45 | --------------------------------------------------------------------------------
46 | -- Multiplication
47 | --------------------------------------------------------------------------------
52 | ||| A generalized multiplication/application operator. This interface is
53 | ||| necessary since the standard multiplication operator is homogenous.
54 | |||
55 | ||| All instances of this interface must collectively satisfy these axioms:
56 | ||| * If `(x *. y) *. z` is defined, then `x *. (y *. z)` is defined and equal.
57 | ||| * If `x *. (y *. z)` is defined, then `(x *. y) *. z` is defined and equal.
61 | ||| A generalized multiplication/application operator for matrices and
62 | ||| vector transformations.
65 | ||| A synonym for `Mult a a a`, or homogenous multiplication.
71 | ||| An interface for monoids using the `*.` operator.
72 | |||
73 | ||| An instance of this interface must satisfy:
74 | ||| * `x *. identity == x`
75 | ||| * `identity *. x == x`
79 | ||| Construct an identity matrix or transformation.
80 | |||
81 | ||| NOTE: Creating an identity element for an `n`-dimensional transformation
82 | ||| usually requires `n` to be available at runtime.
85 | ||| An interface for groups using the `*.` operator.
86 | |||
87 | ||| An instance of this interface must satisfy:
88 | ||| * `x *. inverse x == identity`
89 | ||| * `inverse x *. x == identity`
93 | ||| Calculate the inverse of the matrix or transformation.
94 | |||
95 | ||| WARNING: This function will not check if an inverse exists for the given
96 | ||| input, and will happily divide by zero or return results containing NaN.
97 | ||| To avoid this, use `tryInverse` instead.
102 | ||| Multiplication forms a semigroup
108 | ||| Multiplication with an identity element forms a monoid
114 | ||| Raise a multiplicative value (e.g. a matrix or a transformation) to a natural
115 | ||| number power.
122 | ||| Raise a multiplicative value (e.g. a matrix or a transformation) to a natural
123 | ||| number power.
124 | |||
125 | ||| This is the operator form of `power`.