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++)
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++)
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];
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);
@ BLOCK_PLUS_DIAGONAL
one of two dimensions in a matrix; bottom-right part of matrix is diagonal
Defines the Data class, a wrapper around a Kokkos::View that allows data that is constant or repeatin...
Wrapper around a Kokkos::View that allows data that is constant or repeating in various logical dimen...
void storeInPlaceProduct(const Data< DataScalar, DeviceType > &A, const Data< DataScalar, DeviceType > &B)
stores the in-place (entrywise) product, A .* B, into this container.
static Data< DataScalar, DeviceType > allocateMatMatResult(const bool transposeA, const Data< DataScalar, DeviceType > &A_MatData, const bool transposeB, const Data< DataScalar, DeviceType > &B_MatData)
KOKKOS_INLINE_FUNCTION int extent_int(const int &r) const
Returns the logical extent in the specified dimension.
static Data< DataScalar, DeviceType > allocateInPlaceCombinationResult(const Data< DataScalar, DeviceType > &A, const Data< DataScalar, DeviceType > &B)
KOKKOS_INLINE_FUNCTION const Kokkos::Array< DataVariationType, 7 > & getVariationTypes() const
Returns an array with the variation types in each logical dimension.
KOKKOS_INLINE_FUNCTION Kokkos::Array< int, 7 > getExtents() const
Returns an array containing the logical extents in each 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,...
KOKKOS_INLINE_FUNCTION unsigned rank() const
Returns the logical rank of the Data container.