Skip to content

Commit a9e0d64

Browse files
committed
Review fix on #351: comment rationale + repair a rebase-seam brace
Updates the set_symmetric no-op comment (the MinorMajor early-return it cited is gone; the rank gate is the actual reason at rank 4) and repairs a conflict-resolution artifact that glued a test's closing brace into a trailing comment, leaving the test namespace open. Signed-off-by: petlenz <peterlenz89.pl@gmail.com>
1 parent 018329a commit a9e0d64

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

include/numsim_cas/tensor/identity_tensor.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,9 @@ class identity_tensor final : public tensor_node_base_t<identity_tensor> {
106106
a.insert(positive_semidefinite{}); // PD ⇒ PSD, mirrors
107107
// assume_positive_definite()
108108
// PD ⇒ symmetric, via the same helper assume_positive_definite()
109-
// uses. Mechanically a no-op today because space_for_rank above
110-
// already wrote a qualifying space tag at both supported ranks
111-
// (rank-2 Symmetric ⇒ ProjKind::Sym early-return; rank-4
112-
// MinorMajor ⇒ holds_alternative early-return). The call exists
109+
// uses. Mechanically a no-op today: rank-2 already carries
110+
// Symmetric, and the helper's rank()!=2 gate skips rank 4 (whose
111+
// tag is Major since #351). The call exists
113112
// so that any future drift in detail::set_symmetric_unless_more_specific
114113
// (e.g. it grows a sibling-field write that we'd otherwise miss)
115114
// tracks automatically. Pairs with the helper in tensor_assume.h.

tests/CoreBugFixTest.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,8 @@ TEST(Rank4IdentityTag, InvOfNegatedIdentity) {
17861786
auto r = ev.apply(inv(-I4));
17871787
// (0,1,0,1) flattens to ((0*3+1)*3+0)*3+1 = 10
17881788
EXPECT_NEAR(r->raw_data()[10], -1.0, 1e-12);
1789-
EXPECT_NEAR(r->raw_data()[0], -1.0, 1e-12); // (0,0,0,0)}
1789+
EXPECT_NEAR(r->raw_data()[0], -1.0, 1e-12); // (0,0,0,0)
1790+
}
17901791

17911792
} // namespace numsim::cas
17921793

0 commit comments

Comments
 (0)