Skip to content

don't try to remove a Matrix's only row (or only column)#1436

Open
Alex-Jordan wants to merge 1 commit into
openwebwork:PG-2.21from
Alex-Jordan:dont-remove-only-row
Open

don't try to remove a Matrix's only row (or only column)#1436
Alex-Jordan wants to merge 1 commit into
openwebwork:PG-2.21from
Alex-Jordan:dont-remove-only-row

Conversation

@Alex-Jordan

Copy link
Copy Markdown
Contributor

Without this PR, you can try to remove the only row of [[1,2,3]], or the only column of [[1],[2],[3]]. It won't work, but the error message will be a bit cryptic, coming from the subMatrix method. It will say "Cannot use empty array reference for indices to keep".

This commit changes it so that removeRow and removeColumn catch that kind of thing earlier and give a direct message about it.

@Alex-Jordan Alex-Jordan force-pushed the dont-remove-only-row branch from 9a07382 to e975885 Compare June 13, 2026 22:45

@somiaj somiaj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gives a nicer error.

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