10 #ifndef Intrepid2_DataTools_h
11 #define Intrepid2_DataTools_h
30 template<
class Scalar,
class DeviceType>
33 const ordinal_type rank = scalarDataIn.
rank();
34 const ordinal_type matrixRank = matrixDataIn.
rank();
37 for (
int r=rank; r<matrixRank; r++)
40 variationTypes[r] = CONSTANT;
43 auto scalarDataInExtended = scalarDataIn.
shallowCopy(matrixRank, extents, variationTypes);
52 template<
class Scalar,
class DeviceType>
55 const ordinal_type rank = scalarDataIn.
rank();
56 const ordinal_type matrixRank = matrixDataIn.
rank();
59 for (
int r=rank; r<matrixRank; r++)
62 variationTypes[r] = CONSTANT;
65 auto scalarDataInExtended = scalarDataIn.
shallowCopy(matrixRank, extents, variationTypes);
69 result.storeInPlaceProduct(matrixDataIn,scalarDataInExtended);
76 template<
class Scalar,
class DeviceType>
82 const ordinal_type rank = matrixDataIn.
rank();
85 const auto D1 = extents[rank-2];
89 variationTypes[rank-2] = BLOCK_PLUS_DIAGONAL;
90 variationTypes[rank-1] = BLOCK_PLUS_DIAGONAL;
92 Kokkos::View<Scalar*,DeviceType> identityUnderlyingView(
"Intrepid2::DataTools::transposeMatrix() - identity view",D1);
93 Kokkos::deep_copy(identityUnderlyingView, 1.0);
97 result.storeMatMat(
true, matrixDataIn,
false, identityData);
static Data< DataScalar, DeviceType > allocateInPlaceCombinationResult(const Data< DataScalar, DeviceType > &A, const Data< DataScalar, DeviceType > &B)
Defines the Data class, a wrapper around a Kokkos::View that allows data that is constant or repeatin...
KOKKOS_INLINE_FUNCTION Kokkos::Array< int, 7 > getExtents() const
Returns an array containing the logical extents in each dimension.
KOKKOS_INLINE_FUNCTION const Kokkos::Array< DataVariationType, 7 > & getVariationTypes() const
Returns an array with the variation types in each logical dimension.
Data shallowCopy(const int rank, const Kokkos::Array< int, 7 > &extents, const Kokkos::Array< DataVariationType, 7 > &variationTypes) const
Creates a new Data object with the same underlying view, but with the specified logical rank...
void storeInPlaceProduct(const Data< DataScalar, DeviceType > &A, const Data< DataScalar, DeviceType > &B)
stores the in-place (entrywise) product, A .* B, into this container.
KOKKOS_INLINE_FUNCTION unsigned rank() const
Returns the logical rank of the Data container.
KOKKOS_INLINE_FUNCTION int extent_int(const int &r) const
Returns the logical extent in the specified dimension.
static Data< DataScalar, DeviceType > allocateMatMatResult(const bool transposeA, const Data< DataScalar, DeviceType > &A_MatData, const bool transposeB, const Data< DataScalar, DeviceType > &B_MatData)