Protocols

The following protocols are available globally.

  • A type that defines an addition operator and an additive identity.

    See more

    Declaration

    Swift

    public protocol Addable
  • An 2-dimensional NxM list of elements of some type.

    Most mathematical operations are in the MatrixOperationsBase protocol. Although logically, MatrixBase represents a matrix and so should require the operations, in practice the majority of implementations don’t need the full flexibility, so it’s a lot of wasted boilerplate. Classes may conform to MatrixOperationsBase to implement the full spectrum of matrix operations.

    See more

    Declaration

    Swift

    public protocol MatrixBase : Equatable
  • A matrix declaring the full suite of mathematical operations (addition, scalar addition, multiplication, scalar multiplication, etc).

    See more

    Declaration

    Swift

    public protocol MatrixOperationsBase : MatrixBase
  • A type that defines a multiplication operator and multiplicative identity.

    See more

    Declaration

    Swift

    public protocol Multiplicable
  • A vector whose components are signed numerics.

    See more

    Declaration

    Swift

    public protocol SignedVectorBase : VectorBase where Self.ComponentType : SignedNumeric
  • Interface for a mathematical n-component vector, which is a a structure that contains n independent numeric components.

    See more

    Declaration

    Swift

    public protocol VectorBase : Equatable