Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

Commit

Permalink
mat64: comment out failing clever case and note succeeding clever case
Browse files Browse the repository at this point in the history
  • Loading branch information
kortschak committed Dec 12, 2016
1 parent 14afd28 commit 0a5429d
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions mat64/dense_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1646,6 +1646,11 @@ func TestInverse(t *testing.T) {
}).T(),
tol: 1e-14,
},

// This case does not fail, but we do not guarantee that. The success
// is because the receiver and the input are aligned in the call to
// inverse. If there was a misalignment, the result would likely be
// incorrect and no shadowing panic would occur.
{
a: asBasicMatrix(NewDense(3, 3, []float64{
8, 1, 6,
Expand All @@ -1659,19 +1664,25 @@ func TestInverse(t *testing.T) {
}),
tol: 1e-14,
},
{
a: asBasicMatrix(NewDense(3, 3, []float64{
8, 1, 6,
3, 5, 7,
4, 9, 2,
})).T(),
want: NewDense(3, 3, []float64{
0.147222222222222, -0.144444444444444, 0.063888888888889,
-0.061111111111111, 0.022222222222222, 0.105555555555556,
-0.019444444444444, 0.188888888888889, -0.102777777777778,
}).T(),
tol: 1e-14,
},

// The following test will fail since it does not obey the shadowing
// rules. The basicMatrix type allows shadowing of the input data
// without providing the Raw mathod required for detection of shadowing.
//
// {
// a: asBasicMatrix(NewDense(3, 3, []float64{
// 8, 1, 6,
// 3, 5, 7,
// 4, 9, 2,
// })).T(),
// want: NewDense(3, 3, []float64{
// 0.147222222222222, -0.144444444444444, 0.063888888888889,
// -0.061111111111111, 0.022222222222222, 0.105555555555556,
// -0.019444444444444, 0.188888888888889, -0.102777777777778,
// }).T(),
// tol: 1e-14,
// },

{
a: NewDense(4, 4, []float64{
5, 2, 8, 7,
Expand Down

0 comments on commit 0a5429d

Please sign in to comment.