Skip to content

Ensure Matrix/Tensor data block unique before modification#894

Merged
ZedThree merged 2 commits intonextfrom
matrix_ensure_unique
Feb 23, 2018
Merged

Ensure Matrix/Tensor data block unique before modification#894
ZedThree merged 2 commits intonextfrom
matrix_ensure_unique

Conversation

@d7919
Copy link
Member

@d7919 d7919 commented Feb 22, 2018

Adds unit tests for this feature (thanks @ZedThree )

Adds ASSERT1 checks in constructor to make sure passed sizes are
non-zero
(removed as actually want to allow creating objects with 0 dimension size, just an error to then try to index them).

Note we could ensure the data block is unique in the constructor, but
instead I've currently added this just to the routines which could
change values stored in the data block.

Adds unit tests for this feature

Adds ASSERT1 checks in constructor to make sure passed sizes are
non-zero

Note we could ensure the data block is unique in the constructor, but
instead I've currently added this just to the routines which could
change values stored in the data block.
Whilst we can't index a Matrix/Tensor with a dimension of 0 it can be
helpful to still create such objects (to avoid handling special cases),
it is just an error to then index them.
@ZedThree ZedThree merged commit f20ab9d into next Feb 23, 2018
@ZedThree ZedThree deleted the matrix_ensure_unique branch February 23, 2018 12:58
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