MiniTensor Version of the Day
Loading...
Searching...
No Matches
MiniTensor_Tensor3.h
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// MiniTensor Package
4//
5// Copyright 2016 NTESS and the MiniTensor contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#if !defined(MiniTensor_Tensor3_h)
11#define MiniTensor_Tensor3_h
12
13#include <iomanip>
14
15#include "MiniTensor_Tensor.h"
16
17namespace minitensor {
18
21
25template<typename T, Index N>
27
31template<typename T, Index N = DYNAMIC>
32class Tensor3 : public TensorBase<T, tensor3_store<T, N>>
33{
34public:
35
39 static constexpr
40 Index
41 ORDER = 3;
42
46 static constexpr
47 bool
49
54
59 static constexpr
60 Index
62 {
63 return ORDER;
64 }
65
70 explicit
71 Tensor3();
72
77 explicit
79 Tensor3(Index const dimension);
80
85 explicit
87 Tensor3(Filler const value);
88
94 explicit
96 Tensor3(Index const dimension, Filler const value);
97
102 explicit
104 Tensor3(T const * data_ptr);
105
111 explicit
113 Tensor3(Index const dimension, T const * data_ptr);
114
120 Tensor3(Tensor3<T, N> const & A);
121
125 virtual
127 ~Tensor3();
128
136 T const &
137 operator()(Index const i, Index const j, Index const k) const;
138
146 T &
147 operator()(Index const i, Index const j, Index const k);
148
153 Index
154 get_dimension() const;
155
160 void
161 set_dimension(Index const dimension);
162
163};
164
171template<typename S, typename T, Index N>
173Tensor3<typename Promote<S, T>::type, N>
174operator+(Tensor3<S, N> const & A, Tensor3<T, N> const & B);
175
182template<typename S, typename T, Index N>
184Tensor3<typename Promote<S, T>::type, N>
185operator-(Tensor3<S, N> const & A, Tensor3<T, N> const & B);
186
191template<typename T, Index N>
193Tensor3<T, N>
194operator-(Tensor3<T, N> const & A);
195
200template<typename T, Index N>
202bool
203operator==(Tensor3<T, N> const & A, Tensor3<T, N> const & B);
204
209template<typename T, Index N>
211bool
212operator!=(Tensor3<T, N> const & A, Tensor3<T, N> const & B);
213
220template<typename S, typename T, Index N>
222typename lazy_disable_if< order_1234<S>, apply_tensor3< Promote<S,T>, N>>::type
223operator*(S const & s, Tensor3<T, N> const & A);
224
231template<typename S, typename T, Index N>
233typename lazy_disable_if< order_1234<S>, apply_tensor3< Promote<S,T>, N>>::type
234operator*(Tensor3<T, N> const & A, S const & s);
235
242template<typename S, typename T, Index N>
244Tensor3<typename Promote<S, T>::type, N>
245operator/(Tensor3<T, N> const & A, S const & s);
246
253template<typename S, typename T, Index N>
255Tensor3<typename Promote<S, T>::type, N>
256operator/(S const & s, Tensor3<T, N> const & A);
257
264template<typename S, typename T, Index N>
266Vector<typename Promote<S, T>::type, N>
267dotdot(Tensor3<T, N> const & A, Tensor<S, N> const & u);
268
275template<typename S, typename T, Index N>
277Tensor<typename Promote<S, T>::type, N>
278dot(Tensor3<T, N> const & A, Vector<S, N> const & u);
279
286template<typename S, typename T, Index N>
288Tensor<typename Promote<S, T>::type, N>
289dot(Vector<S, N> const & u, Tensor3<T, N> const & A);
290
297template<typename S, typename T, Index N>
299Tensor<typename Promote<S, T>::type, N>
300dot2(Tensor3<T, N> const & A, Vector<S> const & u);
301
308template<typename S, typename T, Index N>
311dot2(Vector<S, N> const & u, Tensor3<T, N> const & A);
312
319template<typename S, typename T, Index N>
322dot(Tensor3<T, N> const & A, Tensor<S, N> const & B);
323
330template<typename S, typename T, Index N>
333dot(Tensor<S, N> const & A, Tensor3<T, N> const & B);
334
341template<typename S, typename T, Index N>
344dot2(Tensor3<T, N> const & A, Tensor<S, N> const & B);
345
352template<typename S, typename T, Index N>
355dot2(Tensor<S, N> const & A, Tensor3<T, N> const & B);
356
360template<typename T, Index N>
362Tensor3<T, N> const
364
365template<typename T>
368levi_civita_3(Index const dimension);
369
370template<typename T, Index N>
372Tensor3<T, N> const
373levi_civita_3(Index const dimension);
374
378template<typename T, Index N>
380Tensor3<T, N> const
382
383template<typename T>
386permutation_3(Index const dimension);
387
388template<typename T, Index N>
390Tensor3<T, N> const
391permutation_3(Index const dimension);
392
396template<typename T, Index N>
398Tensor3<T, N> const
400
401template<typename T>
404alternator_3(Index const dimension);
405
406template<typename T, Index N>
408Tensor3<T, N> const
409alternator_3(Index const dimension);
410
417template<typename T, Index N>
418std::istream &
419operator>>(std::istream & is, Tensor3<T, N> & A);
420
427template<typename T, Index N>
428std::ostream &
429operator<<(std::ostream & os, Tensor3<T, N> const & A);
430
431} // namespace minitensor
432
433namespace minitensor {
434
435//
436// 3rd-order tensor constructor with NaNs
437//
438template<typename T, Index N>
442{
443 set_dimension(N);
444 return;
445}
446
447template<typename T, Index N>
450TensorBase<T, Store>::TensorBase(dimension, ORDER)
451{
452 return;
453}
454
455//
456// 3rd-order tensor constructor with a specified value
457//
458template<typename T, Index N>
461TensorBase<T, Store>::TensorBase(N, ORDER, value)
462{
463 return;
464}
465
466template<typename T, Index N>
468Tensor3<T, N>::Tensor3(Index const dimension, Filler const value) :
469TensorBase<T, Store>::TensorBase(dimension, ORDER, value)
470{
471 return;
472}
473
474//
475// Create 3rd-order tensor from array
476//
477template<typename T, Index N>
479Tensor3<T, N>::Tensor3(T const * data_ptr) :
480TensorBase<T, Store>::TensorBase(N, ORDER, data_ptr)
481{
482 return;
483}
484
485template<typename T, Index N>
487Tensor3<T, N>::Tensor3(Index const dimension, T const * data_ptr) :
488TensorBase<T, Store>::TensorBase(dimension, ORDER, data_ptr)
489{
490 return;
491}
492
493//
494// Copy constructor
495//
496template<typename T, Index N>
500{
501 return;
502}
503
504//
505// 3rd-order tensor simple destructor
506//
507template<typename T, Index N>
510{
511 return;
512}
513
514//
515// Get dimension
516//
517template<typename T, Index N>
519Index
524
525//
526// Set dimension
527//
528template<typename T, Index N>
530void
532{
533 TensorBase<T, Store>::set_dimension(dimension, ORDER);
534 return;
535}
536
537//
538// 3rd-order tensor addition
539//
540template<typename S, typename T, Index N>
544{
546 C(A.get_dimension());
547
548 add(A, B, C);
549
550 return C;
551}
552
553//
554// 3rd-order tensor subtraction
555//
556template<typename S, typename T, Index N>
558Tensor3<typename Promote<S, T>::type, N>
560{
562 C(A.get_dimension());
563
564 subtract(A, B, C);
565
566 return C;
567}
568
569//
570// 3rd-order tensor minus
571//
572template<typename T, Index N>
574Tensor3<T, N>
576{
578 B(A.get_dimension());
579
580 minus(A, B);
581
582 return B;
583}
584
585//
586// 3rd-order tensor equality
587//
588template<typename T, Index N>
590bool
592{
593 return equal(A, B);
594}
595
596//
597// 3rd-order tensor inequality
598//
599template<typename T, Index N>
601bool
603{
604 return not_equal(A, B);
605}
606
607//
608// Scalar 3rd-order tensor product
609//
610template<typename S, typename T, Index N>
612typename lazy_disable_if< order_1234<S>, apply_tensor3< Promote<S,T>, N>>::type
613operator*(S const & s, Tensor3<T, N> const & A)
614{
616 B(A.get_dimension());
617
618 scale(A, s, B);
619
620 return B;
621}
622
623//
624// 3rd-order tensor scalar product
625//
626template<typename S, typename T, Index N>
628typename lazy_disable_if< order_1234<S>, apply_tensor3< Promote<S,T>, N>>::type
629operator*(Tensor3<T, N> const & A, S const & s)
630{
632 B(A.get_dimension());
633
634 scale(A, s, B);
635
636 return B;
637}
638
639//
640// 3rd-order tensor scalar division
641//
642template<typename S, typename T, Index N>
644Tensor3<typename Promote<S, T>::type, N>
645operator/(Tensor3<T, N> const & A, S const & s)
646{
648 B(A.get_dimension());
649
650 divide(A, s, B);
651
652 return B;
653}
654
655//
656// 3rd-order scalar tensor division
657//
658template<typename S, typename T, Index N>
660Tensor3<typename Promote<S, T>::type, N>
661operator/(S const & s, Tensor3<T, N> const & A)
662{
664 B(A.get_dimension());
665
666 split(A, s, B);
667
668 return B;
669}
670
671//
672// Indexing for constant 3rd order tensor
673//
674template<typename T, Index N>
676T const &
677Tensor3<T, N>::operator()(Index const i, Index const j, Index const k) const
678{
679 Tensor3<T, N> const &
680 self = (*this);
681
682 Index const
683 dimension = self.get_dimension();
684
685 return self[(i * dimension + j) * dimension + k];
686}
687
688//
689// 3rd-order tensor indexing
690//
691template<typename T, Index N>
693T &
694Tensor3<T, N>::operator()(Index const i, Index const j, Index const k)
695{
697 self = (*this);
698
699 Index const
700 dimension = self.get_dimension();
701
702 return self[(i * dimension + j) * dimension + k];
703}
704
705// Local utility functions
706namespace {
707
708template<typename T, Index N>
710void ones_in_diagonal(Tensor3<T, N> & A)
711{
712 Index const
713 dimension = A.get_dimension();
714
715 switch (dimension) {
716
717 default:
718 for (Index i = 0; i < dimension; ++i) {
719 A(i, i, i) = 1.0;
720 }
721 break;
722
723 case 3:
724 A(0, 0, 0) = 1.0;
725 A(1, 1, 1) = 1.0;
726 A(2, 2, 2) = 1.0;
727 break;
728
729 case 2:
730 A(0, 0, 0) = 1.0;
731 A(1, 1, 1) = 1.0;
732 break;
733
734 }
735
736 return;
737}
738
739template<typename T, Index N>
741void fill_levi_civita(Tensor3<T, N> & A)
742{
743 Index const
744 dimension = A.get_dimension();
745
746 for (Index i = 0; i < dimension; ++i) {
747 for (Index j = 0; j < dimension; ++j) {
748 for (Index k = 0; k < dimension; ++k) {
749 A(i, j, k) = levi_civita<T>(i, j, k);
750 }
751 }
752 }
753
754 return;
755}
756
757} // anonymous namespace
758
759//
760// Levi-Civita symbol
761//
762template<typename T, Index N>
764Tensor3<T, N> const
766{
768 A(N, Filler::ZEROS);
769
770 fill_levi_civita(A);
771
772 return A;
773}
774
778template<typename T>
780Tensor3<T, DYNAMIC> const
781levi_civita_3(Index const dimension)
782{
784 A(dimension, Filler::ZEROS);
785
786 fill_levi_civita(A);
787
788 return A;
789}
790
794template<typename T, Index N>
796Tensor3<T, N> const
797levi_civita_3(Index const dimension)
798{
799 if (N != DYNAMIC) assert(dimension == N);
800
802 A(dimension, Filler::ZEROS);
803
804 fill_levi_civita(A);
805
806 return A;
807}
808// Permutation symbol
809//
810template<typename T, Index N>
812Tensor3<T, N> const
814{
815 return levi_civita_3<T, N>();
816}
817
821template<typename T>
823Tensor3<T, DYNAMIC> const
824permutation_3(Index const dimension)
825{
826 return levi_civita_3<T>(dimension);
827}
828
832template<typename T, Index N>
834Tensor3<T, N> const
835permutation_3(Index const dimension)
836{
837 return levi_civita_3<T, N>(dimension);
838}
839
840//
841// Alternating symbol
842//
843template<typename T, Index N>
845Tensor3<T, N> const
847{
848 return levi_civita_3<T, N>();
849}
850
854template<typename T>
856Tensor3<T, DYNAMIC> const
857alternator_3(Index const dimension)
858{
859 return levi_civita_3<T>(dimension);
860}
861
865template<typename T, Index N>
867Tensor3<T, N> const
868alternator_3(Index const dimension)
869{
870 return levi_civita_3<T, N>(dimension);
871}
872
873} // namespace minitensor
874namespace minitensor {
875
876//
877// \return \f$ B = A : u := B_i = A_{ijk} u_{jk} \f$
878//
879template<typename S, typename T, Index N>
881Vector<typename Promote<S, T>::type, N>
882dotdot(Tensor3<T, N> const & A, Tensor<S, N> const & u)
883{
884 Index const
885 dimension = A.get_dimension();
886
887 assert(u.get_dimension() == dimension);
888
890 B(dimension);
891
892 for (Index i = 0; i < dimension; ++i) {
893
894 typename Promote<S, T>::type
895 s = 0.0;
896
897 for (Index j = 0; j < dimension; ++j) {
898 for (Index k = 0; k < dimension; ++k) {
899 s += A(i,j,k) * u(j,k);
900 }
901 }
902 B(i) = s;
903 }
904
905 return B;
906}
907
908//
909// \return \f$ B = A \cdot u := B_{ij} = A_{ijp} u_p \f$
910//
911template<typename S, typename T, Index N>
913Tensor<typename Promote<S, T>::type, N>
914dot(Tensor3<T, N> const & A, Vector<S, N> const & u)
915{
916 Index const
917 dimension = A.get_dimension();
918
919 assert(u.get_dimension() == dimension);
920
922 B(N);
923
924 for (Index i = 0; i < dimension; ++i) {
925 for (Index j = 0; j < dimension; ++j) {
926
927 typename Promote<S, T>::type
928 s = 0.0;
929
930 for (Index p = 0; p < dimension; ++p) {
931 s += A(i,j,p) * u(p);
932 }
933 B(i,j) = s;
934 }
935 }
936
937 return B;
938}
939
940//
941// \return \f$ B = u \cdot A := B_{ij} = u_p A{pij} \f$
942//
943template<typename S, typename T, Index N>
945Tensor<typename Promote<S, T>::type, N>
946dot(Vector<S, N> const & u, Tensor3<T, N> const & A)
947{
948 Index const
949 dimension = A.get_dimension();
950
951 assert(u.get_dimension() == dimension);
952
954 B(dimension);
955
956 for (Index i = 0; i < dimension; ++i) {
957 for (Index j = 0; j < dimension; ++j) {
958
959 typename Promote<S, T>::type
960 s = 0.0;
961
962 for (Index p = 0; p < dimension; ++p) {
963 s += u(p) * A(p,i,j);
964 }
965 B(i,j) = s;
966 }
967 }
968
969 return B;
970}
971
972
973//
974// \return \f$ B = A \cdot u := B_{ij} = A_{ipj} u_p \f$
975//
980template<typename S, typename T, Index N>
982Tensor<typename Promote<S, T>::type, N>
983dot2(Tensor3<T, N> const & A, Vector<S, N> const & u)
984{
985 Index const
986 dimension = A.get_dimension();
987
988 assert(u.get_dimension() == dimension);
989
991 B(dimension);
992
993 for (Index i = 0; i < dimension; ++i) {
994 for (Index j = 0; j < dimension; ++j) {
995
996 typename Promote<S, T>::type
997 s = 0.0;
998
999 for (Index p = 0; p < dimension; ++p) {
1000 s += A(i,p,j) * u(p);
1001 }
1002 B(i,j) = s;
1003 }
1004 }
1005
1006 return B;
1007}
1008
1009//
1010// \return \f$ B = u \cdot A := B_{ij} = u_p A_{ipj} \f$
1011//
1012template<typename S, typename T, Index N>
1014Tensor<typename Promote<S, T>::type, N>
1015dot2(Vector<S, N> const & u, Tensor3<T, N> const & A)
1016{
1017 return dot2(A, u);
1018}
1019
1020//
1021// \return \f$ C = A \cdot B := C_{ijk} = A_{ijp} B_{pk} \f$
1022//
1023template<typename S, typename T, Index N>
1025Tensor3<typename Promote<S, T>::type, N>
1026dot(Tensor3<T, N> const & A, Tensor<S, N> const & B)
1027{
1028 Index const
1029 dimension = A.get_dimension();
1030
1031 assert(B.get_dimension() == dimension);
1032
1034 C(dimension);
1035
1036 for (Index i = 0; i < dimension; ++i) {
1037 for (Index k = 0; k < dimension; ++k) {
1038 for (Index j = 0; j < dimension; ++j) {
1039
1040 typename Promote<S, T>::type
1041 s = 0.0;
1042
1043 for (Index p = 0; p < dimension; ++p) {
1044 s += A(i,j,p) * B(p,k);
1045 }
1046 C(i,j,k) = s;
1047 }
1048 }
1049 }
1050
1051 return C;
1052}
1053
1054//
1055// \return \f$ C = A \cdot B := C_{ijk} = A_{ip} B_{pjk} \f$
1056//
1057template<typename S, typename T, Index N>
1059Tensor3<typename Promote<S, T>::type, N>
1060dot(Tensor<S, N> const & A, Tensor3<T, N> const & B)
1061{
1062 Index const
1063 dimension = A.get_dimension();
1064
1065 assert(B.get_dimension() == dimension);
1066
1068 C(dimension);
1069
1070 for (Index i = 0; i < dimension; ++i) {
1071 for (Index k = 0; k < dimension; ++k) {
1072 for (Index j = 0; j < dimension; ++j) {
1073
1074 typename Promote<S, T>::type
1075 s = 0.0;
1076
1077 for (Index p = 0; p < dimension; ++p) {
1078 s += A(i,p) * B(p,j,k);
1079 }
1080 C(i,j,k) = s;
1081 }
1082 }
1083 }
1084
1085 return C;
1086}
1087
1088//
1089// \return \f$ C = A \cdot B := C_{ijk} = A_{ipj} B_{pk} \f$
1090//
1091template<typename S, typename T, Index N>
1093Tensor3<typename Promote<S, T>::type, N>
1094dot2(Tensor3<T, N> const & A, Tensor<S, N> const & B)
1095{
1096 Index const
1097 dimension = A.get_dimension();
1098
1099 assert(B.get_dimension() == dimension);
1100
1102 C(dimension);
1103
1104 for (Index i = 0; i < dimension; ++i) {
1105 for (Index k = 0; k < dimension; ++k) {
1106 for (Index j = 0; j < dimension; ++j) {
1107
1108 typename Promote<S, T>::type
1109 s = 0.0;
1110
1111 for (Index p = 0; p < dimension; ++p) {
1112 s += A(i,p,j) * B(p,k);
1113 }
1114 C(i,j,k) = s;
1115 }
1116 }
1117 }
1118
1119 return C;
1120}
1121
1122
1123//
1124// \return \f$ C = A \cdot B := C_{ijk} = A_{ip} B_{jpk} \f$
1125//
1126template<typename S, typename T, Index N>
1128Tensor3<typename Promote<S, T>::type, N>
1129dot2(Tensor<S, N> const & A, Tensor3<T, N> const & B)
1130{
1131 Index const
1132 dimension = A.get_dimension();
1133
1134 assert(B.get_dimension() == dimension);
1135
1137 C(dimension);
1138
1139 for (Index i = 0; i < dimension; ++i) {
1140 for (Index k = 0; k < dimension; ++k) {
1141 for (Index j = 0; j < dimension; ++j) {
1142
1143 typename Promote<S, T>::type
1144 s = 0.0;
1145
1146 for (Index p = 0; p < dimension; ++p) {
1147 s += A(i,p) * B(j,p,k);
1148 }
1149 C(i,j,k) = s;
1150 }
1151 }
1152 }
1153
1154 return C;
1155}
1156
1157
1158//
1159// 3rd-order tensor input
1160// \param A 3rd-order tensor
1161// \param is input stream
1162// \return is input stream
1163//
1164template<typename T, Index N>
1165std::istream &
1166operator>>(std::istream & is, Tensor3<T, N> & A)
1167{
1168 Index const
1169 dimension = A.get_dimension();
1170
1171 for (Index i = 0; i < dimension; ++i) {
1172 for (Index j = 0; j < dimension; ++j) {
1173 for (Index k = 0; k < dimension; ++k) {
1174 is >> A(i,j,k);
1175 }
1176 }
1177 }
1178
1179 return is;
1180}
1181
1182//
1183// 3rd-order tensor output
1184// \param A 3rd-order tensor
1185// \param os output stream
1186// \return os output stream
1187//
1188template<typename T, Index N>
1189std::ostream &
1190operator<<(std::ostream & os, Tensor3<T, N> const & A)
1191{
1192 Index const
1193 dimension = A.get_dimension();
1194
1195 if (dimension == 0) {
1196 return os;
1197 }
1198
1199 os << std::scientific << std::setprecision(17);
1200
1201 for (Index i = 0; i < dimension; ++i) {
1202
1203 for (Index j = 0; j < dimension; ++j) {
1204
1205 os << std::setw(24) << A(i,j,0);
1206
1207 for (Index k = 1; k < dimension; ++k) {
1208 os << "," << std::setw(24) << A(i,j,k);
1209 }
1210
1211 os << std::endl;
1212
1213 }
1214
1215 os << std::endl;
1216 os << std::endl;
1217
1218 }
1219
1220 return os;
1221}
1222
1224} // namespace minitensor
1225
1226#endif //MiniTensor_Tensor3_h
#define KOKKOS_INLINE_FUNCTION
KOKKOS_INLINE_FUNCTION Matrix< typename Promote< S, T >::type, M, N > operator+(Matrix< S, M, N > const &A, Matrix< T, M, N > const &B)
KOKKOS_INLINE_FUNCTION void minus(TensorBase< T, ST > const &A, TensorBase< T, ST > &B)
KOKKOS_INLINE_FUNCTION Tensor3< T, N > const levi_civita_3()
KOKKOS_INLINE_FUNCTION Matrix< typename Promote< S, T >::type, M, N > operator-(Matrix< S, M, N > const &A, Matrix< T, M, N > const &B)
static KOKKOS_INLINE_FUNCTION constexpr Index get_order()
std::ostream & operator<<(std::ostream &os, Matrix< T, M, N > const &A)
KOKKOS_INLINE_FUNCTION void add(TensorBase< R, SR > const &A, TensorBase< S, SS > const &B, TensorBase< T, ST > &C)
std::istream & operator>>(std::istream &is, Matrix< T, M, N > &A)
static constexpr bool IS_DYNAMIC
static constexpr Index ORDER
KOKKOS_INLINE_FUNCTION Matrix< typename Promote< S, T >::type, M, N > operator/(Matrix< T, M, N > const &A, S const &s)
KOKKOS_INLINE_FUNCTION void set_dimension(Index const dimension)
KOKKOS_INLINE_FUNCTION Vector< typename Promote< S, T >::type, M > operator*(Matrix< T, M, N > const &A, Vector< S, N > const &u)
KOKKOS_INLINE_FUNCTION Tensor3< T, N > const alternator_3()
KOKKOS_INLINE_FUNCTION Promote< S, T >::type dotdot(Matrix< S, M, N > const &A, Matrix< T, M, N > const &B)
KOKKOS_INLINE_FUNCTION Tensor3< T, N > const permutation_3()
KOKKOS_INLINE_FUNCTION Index get_dimension() const
KOKKOS_INLINE_FUNCTION bool equal(TensorBase< T, ST > const &A, TensorBase< T, ST > const &B)
KOKKOS_INLINE_FUNCTION T const & operator()(Index const i, Index const j, Index const k) const
KOKKOS_INLINE_FUNCTION Index get_dimension() const
KOKKOS_INLINE_FUNCTION Index get_dimension(Index const order) const
virtual KOKKOS_INLINE_FUNCTION ~Tensor3()
KOKKOS_INLINE_FUNCTION void scale(TensorBase< R, SR > const &A, S const &s, TensorBase< T, ST > &B)
KOKKOS_INLINE_FUNCTION bool operator!=(Matrix< T, M, N > const &A, Matrix< T, M, N > const &B)
KOKKOS_INLINE_FUNCTION Tensor3()
KOKKOS_INLINE_FUNCTION bool operator==(Matrix< T, M, N > const &A, Matrix< T, M, N > const &B)
KOKKOS_INLINE_FUNCTION Vector< typename Promote< S, T >::type, M > dot(Matrix< T, M, N > const &A, Vector< S, N > const &u)
KOKKOS_INLINE_FUNCTION Index get_dimension() const
KOKKOS_INLINE_FUNCTION void split(TensorBase< R, SR > const &A, S const &s, TensorBase< T, ST > &B)
KOKKOS_INLINE_FUNCTION bool not_equal(TensorBase< T, ST > const &A, TensorBase< T, ST > const &B)
KOKKOS_INLINE_FUNCTION void set_dimension(Index const dimension, Index const order)
KOKKOS_INLINE_FUNCTION void divide(TensorBase< R, SR > const &A, S const &s, TensorBase< T, ST > &B)
KOKKOS_INLINE_FUNCTION Tensor< typename Promote< S, T >::type, N > dot2(Tensor3< T, N > const &A, Vector< S > const &u)
KOKKOS_INLINE_FUNCTION void subtract(TensorBase< R, SR > const &A, TensorBase< S, SS > const &B, TensorBase< T, ST > &C)
uint32_t Index
Indexing type.
constexpr Index DYNAMIC
Indicator for dynamic storage.