Пример #1
0
 // Check the result is as expected
 static bool check(const MatrixType matrix,
                   Teuchos::FancyOStream& out) {
   typedef typename MatrixType::values_type matrix_values_type;
   typename matrix_values_type::HostMirror host_matrix_values =
     Kokkos::create_mirror_view(matrix.values);
   Kokkos::deep_copy(host_matrix_values, matrix.values);
   const ordinal_type nrow = matrix.numRows();
   const ordinal_type pce_size = host_matrix_values.sacado_size();
   bool success = true;
   value_type val_expected(matrix.values.cijk());
   for (ordinal_type row=0; row<nrow; ++row) {
     value_type val;
     if (row == 0)
       val_expected = nrow*(nrow-1)/2;
     else
       val_expected = 0.0;
     bool s = compareVecs(host_matrix_values(row),
                          "matrix_values(row)",
                          val_expected,
                          "val_expected",
                          0.0, 0.0, out);
     success = success && s;
   }
   return success;
 }
 // Check the result is as expected
 static bool check(const MatrixType matrix,
                   Teuchos::FancyOStream& out) {
   typedef typename MatrixType::values_type matrix_values_type;
   typename matrix_values_type::HostMirror host_matrix_values =
     Kokkos::create_mirror_view(matrix.values);
   Kokkos::deep_copy(host_matrix_values, matrix.values);
   const ordinal_type nrow = matrix.numRows();
   const ordinal_type vec_size = host_matrix_values.sacado_size();
   bool success = true;
   for (ordinal_type row=0; row<nrow; ++row) {
     bool s = compareVecs(host_matrix_values(row),
                          "matrix_values(row)",
                          value_type(vec_size, row),
                          "value_type(row)",
                          0.0, 0.0, out);
     success = success && s;
   }
   return success;
 }