Understanding MtxVec Overload Structure

MtxVec methods have systematic overloads governed by three orthogonal axes:

Axis 1: Indexed vs Non-Indexed

  • Non-indexed: operates on the full array. E.g. Sin(X)
  • Indexed: operates on a subrange (explicit span). E.g. Sin(X, XIndex, Len, DstIndex)
  • Index parameters are always appended to the end of the parameter list, after the "real" operands.
  • Rule: Ignore indexed variants unless the user explicitly needs subrange operations.

Axis 2: Real vs Complex scalars

  • Methods accepting scalar arguments have both Double and TCplx overloads.
  • Selection is type-driven (match the data type), not a choice.

Axis 3: Operand permutations

  • Multi-operand methods like AddAndMul(A,B,C) have variants where each operand can be a vector or scalar.
  • Each variant is a distinct mathematical operation: (vec + scalar)*vec vs (vec + vec)*scalar.

Example: AddAndMul with 50 overloads on one type

  • 25 non-indexed + 25 indexed (Axis 1)
  • Of the 25 non-indexed: ~12 real + ~13 complex (Axis 2)
  • The ~12 real variants are the distinct operand permutations (Axis 3)
  • Effective decision space: ~12 distinct operations, not 50.

Selection strategy: Pick non-indexed first. Match scalar types to your data. Choose the operand permutation matching your formula.