48 {
49 LOG_UNIT_TEST;
50
53
55
57
59
60
61 for (
const auto i :
make_range(beginning_index, end_index))
62 for (const auto j :
make_range(beginning_index, end_index))
63 {
64 const Real sgn = j % 2 ? 1 : -1;
66 gold_values[i - beginning_index] += j;
67 }
68
70
71 for (
const auto i :
make_range(beginning_index, end_index))
72 for (const auto j :
make_range(beginning_index, end_index))
73 {
74 if (i != j)
76 else
77 LIBMESH_ASSERT_NUMBERS_EQUAL(gold_values[i - beginning_index], (*
_matrix)(i, i),
_tolerance);
78 }
79
80
81 for (
const auto i :
make_range(beginning_index, end_index))
82 {
83 const Real sgn = i % 2 ? 1 : -1;
84 _matrix->set(i, i, sgn * gold_values[i - beginning_index]);
85 }
86
88
89 for (
const auto i :
make_range(beginning_index, end_index))
90 LIBMESH_ASSERT_NUMBERS_EQUAL(gold_values[i - beginning_index], (*
_matrix)(i, i),
_tolerance);
91
92
94
95 CPPUNIT_ASSERT_EQUAL(copy->m(),
_matrix->m());
96 CPPUNIT_ASSERT_EQUAL(copy->n(),
_matrix->n());
97 CPPUNIT_ASSERT_EQUAL(copy->local_m(),
_matrix->local_m());
98 CPPUNIT_ASSERT_EQUAL(copy->row_start(),
_matrix->row_start());
99 CPPUNIT_ASSERT_EQUAL(copy->row_stop(),
_matrix->row_stop());
100
101 for (
const auto i :
make_range(beginning_index, end_index))
102 for (const auto j :
make_range(beginning_index, end_index))
104
105
106 auto zero_copy =
_matrix->zero_clone();
107
108 CPPUNIT_ASSERT_EQUAL(zero_copy->m(),
_matrix->m());
109 CPPUNIT_ASSERT_EQUAL(zero_copy->n(),
_matrix->n());
110 CPPUNIT_ASSERT_EQUAL(zero_copy->local_m(),
_matrix->local_m());
111 CPPUNIT_ASSERT_EQUAL(zero_copy->row_start(),
_matrix->row_start());
112 CPPUNIT_ASSERT_EQUAL(zero_copy->row_stop(),
_matrix->row_stop());
113
114 for (
const auto i :
make_range(beginning_index, end_index))
115 for (const auto j :
make_range(beginning_index, end_index))
116 LIBMESH_ASSERT_NUMBERS_EQUAL(0, (*zero_copy)(i, j),
_tolerance);
117 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...