Remove "atom specific" functions from matrix classes - PR 1 - #120
Merged
Conversation
…, M1) row_gather_alloc(A, map, m_out) / row_gather_fill_values(A, C) replace the atom-named index slots. map[i] in [-1, A->m), -1 = empty output row, repeats allowed; the map is bound to the result at alloc time (bound_iwork on sparse_matrix, generalizing transpose_iwork, and new on permuted_dense). index and transpose atoms migrated; new_permuted_dense checks m0*n0 overflow unconditionally. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012QaXUu4VhNvNyBc2dCzpkp
map[i] must be a valid source row in [0, A->m); the structurally-empty-row case (-1) has no caller until diag_vec migrates in M2 and is deferred there. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Azb8o1AgiFRU4t9aAY7oDr
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Azb8o1AgiFRU4t9aAY7oDr
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Azb8o1AgiFRU4t9aAY7oDr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First PR in a sequence of 3 or 4 where we remove many of the "atom specific" functions from the matrix classes. It is wrong abstraction to let matrix classes keep track of atom specific functions.
Claude below:
Summary
First milestone of lesson 3 (collapse the atom-shaped vtable slots into row-gather and row-reduce; roadmap in
notes/lesson3_roadmap.md).row_gather_alloc(A, map, m_out)/row_gather_fill_values(A, C)replaceindex_alloc/index_fill_values. Contract:map[i]in[0, A->m), repeats allowed, map bound to the result at alloc time so the fill takes no map. (-1= empty output row is deferred to M2, wherediag_vecis its first caller.)sparse_matrix.bound_iwork(renamed fromtranspose_iwork, shared with transpose) and a newpermuted_dense.bound_iworkholding the source dense row per output dense row. stacked_pd needs no new field.indexandtransposeatoms migrated; transpose no longer keeps its commutation map after init.new_permuted_denseexits onm0 * n0overflow unconditionally.