23 class MatrixTest :
public ::testing::Test {
25 void SetUp()
override {
26 std::locale::global(std::locale(
""));
38 src_.Resize(1, kInputSize_, 0);
39 for (
int i = 0; i < kInputSize_; ++i) {
42 for (
int i = 0; i < kNumDims_; ++i) dims_[i] = 5 - i;
45 static const int kNumDims_ = 4;
47 static const int kInputSize_ = 120;
57 TEST_F(MatrixTest, RotatingTranspose_3_1) {
65 EXPECT_EQ(0, m(0, 0));
66 EXPECT_EQ(2, m(0, 1));
67 EXPECT_EQ(4, m(0, 2));
68 EXPECT_EQ(6, m(1, 0));
69 EXPECT_EQ(1, m(4, 0));
70 EXPECT_EQ(24, m(8, 0));
71 EXPECT_EQ(26, m(8, 1));
72 EXPECT_EQ(25, m(12, 0));
76 TEST_F(MatrixTest, RotatingTranspose_2_0) {
87 EXPECT_EQ(0, m(0, 0));
88 EXPECT_EQ(1, m(0, 1));
89 EXPECT_EQ(6, m(1, 0));
90 EXPECT_EQ(7, m(1, 1));
91 EXPECT_EQ(24, m(4, 0));
92 EXPECT_EQ(25, m(4, 1));
93 EXPECT_EQ(30, m(5, 0));
94 EXPECT_EQ(2, m(20, 0));
98 TEST_F(MatrixTest, RotatingTranspose_1_3) {
107 EXPECT_EQ(0, m(0, 0));
108 EXPECT_EQ(6, m(0, 1));
109 EXPECT_EQ(1, m(1, 0));
110 EXPECT_EQ(2, m(2, 0));
111 EXPECT_EQ(3, m(3, 0));
112 EXPECT_EQ(4, m(4, 0));
113 EXPECT_EQ(5, m(5, 0));
114 EXPECT_EQ(24, m(6, 0));
115 EXPECT_EQ(30, m(6, 1));
119 TEST_F(MatrixTest, RotatingTranspose_0_2) {
128 EXPECT_EQ(0, m(0, 0));
129 EXPECT_EQ(1, m(0, 1));
130 EXPECT_EQ(24, m(1, 0));
131 EXPECT_EQ(25, m(1, 1));
132 EXPECT_EQ(96, m(4, 0));
133 EXPECT_EQ(97, m(4, 1));
134 EXPECT_EQ(2, m(5, 0));
135 EXPECT_EQ(6, m(15, 0));