Skip to content

Generalize Mat×Vec operator* to support mixed scalar types#11

Closed
Copilot wants to merge 1 commit intogeneralize-mat-vecfrom
copilot/sub-pr-9
Closed

Generalize Mat×Vec operator* to support mixed scalar types#11
Copilot wants to merge 1 commit intogeneralize-mat-vecfrom
copilot/sub-pr-9

Conversation

Copy link

Copilot AI commented Mar 20, 2026

The matrix-vector operator* was overly generic, accepting any Vector type, which obscured intent and prevented mixed-type scalar multiplication.

Changes

  • Mat.hpp: Replace unconstrained Vector template parameter with explicit Vec<T2, N>, returning Vec<T1, N> (matrix scalar type). Enables multiplying a Mat<M,N,T1> by a Vec<T2,N> with differing scalar types.
    // Now supported:
    Mat<4, 4, double> m{...};
    Vec<float, 4> v{...};
    auto result = m * v;  // Vec<double, 4>
  • Mat.hpp: Remove spurious trailing semicolon from default constructor.
  • String.hpp: Take structured binding by const& in split() range loop to avoid unnecessary copies.

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI changed the title [WIP] Update and generalize matrix vector operations Generalize Mat×Vec operator* to support mixed scalar types Mar 20, 2026
Copilot AI requested a review from csparker247 March 20, 2026 22:56
@csparker247 csparker247 deleted the copilot/sub-pr-9 branch March 20, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants