42 #ifndef ___MAT_VEC_H__INCLUDED___
43 #define ___MAT_VEC_H__INCLUDED___
57 #define MATVEC_DEBUG 1
59 #define MATVEC_DEBUG 0
63 #if MATVEC_DEBUG == 0 || defined(DEBUG)
64 #define MATVEC_ASSERT(expr) ASSERT(expr)
65 #elif MATVEC_DEBUG > 0
66 #define MATVEC_ASSERT(expr) assert(expr)
73 static const int N = -1;
78 static const int N = 1;
83 static const int N = 3;
88 static const int N = 6;
91 template <
typename T, index_type N_rows, index_type N_cols>
94 template <
typename T, index_type N_rows>
101 template <
typename ScalarBinaryFunction,
typename T,
typename ScalarLhsExpr,
typename ScalarRhsExpr>
113 :
a(ScalarBinaryFunction::f(lhs, rhs)) {
133 return std::numeric_limits<index_type>::max();
141 return std::numeric_limits<index_type>::max();
166 template <
typename ScalarUnaryFunction,
typename T,
typename ScalarExpr>
178 :
a(ScalarUnaryFunction::f(expr)) {
198 return std::numeric_limits<index_type>::max();
206 return std::numeric_limits<index_type>::max();
231 template <
typename ScalarTypeLhs,
typename ScalarTypeRhs>
237 template <index_type N_SIZE>
242 template <index_type N_SIZE>
247 template <index_type N_SIZE>
257 template <
typename T>
262 template <
typename BinFunc,
typename LhsExpr,
typename RhsExpr>
267 template <
typename UnFunc,
typename Expr>
272 template <
typename Expression>
277 template <index_type N_SIZE,
bool ALIAS>
282 template <index_type N_SIZE>
287 template <
typename ScalarBinaryFunction,
typename T,
typename ScalarLhsExpr,
typename ScalarRhsExpr>
292 template <
typename ScalarUnaryFunction,
typename T,
typename ScalarExpr>
297 template <
typename T>
302 template <
typename Expression,
typename Po
interType>
308 template <index_type N_SIZE>
313 template <
typename Expression,
typename Po
interType>
315 for (
const PointerType* p = pFirst; p <= pLast; ++p) {
316 if (g.bHaveReferenceTo(p)) {
325 template <
typename ScalarBinaryFunction,
typename T,
typename ScalarLhsExpr,
typename ScalarRhsExpr>
330 template <
typename ScalarBinaryFunction, index_type N_SIZE,
typename ScalarLhsExpr,
typename ScalarRhsExpr>
335 template <
typename ScalarBinaryFunction, index_type N_SIZE,
typename ScalarLhsExpr>
340 template <
typename ScalarBinaryFunction, index_type N_SIZE,
typename ScalarLhsExpr>
345 template <
typename ScalarBinaryFunction, index_type N_SIZE,
typename ScalarRhsExpr>
350 template <
typename ScalarBinaryFunction, index_type N_SIZE,
typename ScalarRhsExpr>
355 template <
typename ScalarBinaryFunction, index_type N_SIZE>
360 template <
typename ScalarBinaryFunction, index_type N_SIZE>
365 template <
typename ScalarBinaryFunction, index_type N_SIZE>
370 template <
typename ScalarUnaryFunction,
typename T,
typename ScalarExpr>
375 template <
typename ScalarUnaryFunction, index_type N_SIZE,
typename ScalarExpr>
380 template <
typename ScalarUnaryFunction, index_type N_SIZE>
385 template <
typename ScalarBinaryFunction,
typename ScalarLhsExpr,
typename ScalarRhsExpr>
404 template <
typename ScalarUnaryFunction,
typename ScalarExpr>
429 template <
typename ScalarType>
431 const ScalarType* pLastArray1,
432 const ScalarType* pFirstArray2,
433 const ScalarType* pLastArray2) {
437 return (pFirstArray1 >= pFirstArray2 && pFirstArray1 <= pLastArray2)
438 || (pLastArray1 >= pFirstArray2 && pLastArray1 <= pLastArray2)
439 || (pFirstArray2 >= pFirstArray1 && pFirstArray2 <= pLastArray1)
440 || (pLastArray2 >= pFirstArray1 && pLastArray2 <= pLastArray1);
443 template <
typename ScalarType1,
typename ScalarType2>
444 inline bool bArrayOverlap(
const ScalarType1*,
const ScalarType1*,
const ScalarType2*,
const ScalarType2*) {
449 template <
typename T>
495 template <
typename T>
502 static const bool bAlias =
false;
505 template <
typename Expression>
510 template <index_type N_SIZE,
bool ALIAS>
515 template <index_type N_SIZE>
517 static const bool bAlias =
false;
520 template <
typename BinFunc,
typename LhsExpr,
typename RhsExpr>
525 template <
typename UnFunc,
typename Expr>
530 template <
bool bAlias>
535 template <
typename MatrixType,
typename Func,
typename Expression>
537 A.ApplyMatrixFuncNoAlias(B, f);
543 template <
typename MatrixType,
typename Func,
typename Expression>
545 A.ApplyMatrixFuncAlias(B, f);
550 template <
typename T,
typename U>
551 static inline void Eval(T& b,
const U&
a) {
557 template <
typename T,
typename U>
558 static inline void Eval(T& b,
const U&
a) {
564 template <
typename T,
typename U>
565 static inline void Eval(T& b,
const U&
a) {
571 template <
typename T,
typename U>
572 static inline void Eval(T& b,
const U&
a) {
578 template <
typename T,
typename U>
579 static inline void Eval(T& b,
const U&
a) {
585 template <
typename Expression, index_type N_rows>
599 template <
typename Expr>
607 template <
typename LhsExpr,
typename RhsExpr>
615 template <
typename ScalarType>
627 void AssertValid()
const {
634 template <
typename Expression, index_type N_rows, index_type N_cols,
bool CLEAR_ALIAS=false>
637 static const bool bAlias = CLEAR_ALIAS ?
false : Expression::bAlias;
650 template <
typename Expr>
658 template <
typename LhsExpr,
typename RhsExpr>
667 return Expression::iGetNumRows();
670 return Expression::iGetNumCols();
676 void AssertValid()
const {
690 template <
typename ScalarBinFunc,
typename VectorLhsExpr,
typename VectorRhsExpr>
693 static const bool bAlias = VectorLhsExpr::bAlias || VectorRhsExpr::bAlias;
706 return ScalarBinFunc::f(
oU(i),
oV(i));
712 return oU.iGetNumRows();
715 template <
typename ScalarType2>
717 return oU.bHaveReferenceTo(pFirst, pLast) ||
oV.bHaveReferenceTo(pFirst, pLast);
721 const VectorLhsExpr
oU;
722 const VectorRhsExpr
oV;
729 template <
typename ScalarBinFunc,
typename VectorLhsExpr,
typename ScalarRhsExpr>
745 return ScalarBinFunc::f(
oU(i),
oV);
750 return oU.iGetNumRows();
753 template <
typename ScalarType2>
756 return oU.bHaveReferenceTo(pFirst, pLast)
757 || ScalarTraits::bHaveReferenceTo(
oV, pFirst, pLast);
761 const VectorLhsExpr
oU;
762 const ScalarRhsExpr
oV;
769 template <
typename ScalarUnaryFunc,
typename VectorExpr>
772 static const bool bAlias = VectorExpr::bAlias;
785 return ScalarUnaryFunc::f(
oU(i));
790 return oU.iGetNumRows();
793 template <
typename ScalarType2>
795 return oU.bHaveReferenceTo(pFirst, pLast);
802 template <index_type iStartIndex, index_type iEndIndex,
typename VectorExpr>
805 static const bool bAlias = VectorExpr::bAlias;
818 return oU(i + iStartIndex - 1);
826 template <
typename ScalarType2>
828 return oU.bHaveReferenceTo(pFirst, pLast);
838 template <
typename VectorType,
bool ALIAS=false>
858 return oU.iGetNumRows();
861 template <
typename ScalarType2>
863 return oU.bHaveReferenceTo(pFirst, pLast);
867 const VectorType&
oU;
892 template <
typename ScalarType2>
901 template <
typename T, index_type N_rows, index_type N_offset>
919 return *(
pVec + iRow * N_offset);
924 template <
typename ScalarType2>
936 template <
typename T, index_type N_rows>
945 :
pVec(p), iOffset(iOffset) {
954 return *(
pVec + iRow * iOffset);
959 template <
typename ScalarType2>
971 template <
typename T, index_type N_offset>
980 :
pVec(p), iCurrRows(iRows) {
989 return *(
pVec + iRow * N_offset);
994 template <
typename ScalarType2>
1007 template <
typename T>
1016 :
pVec(p), iCurrRows(iRows), iOffset(iOffset) {
1024 return *(
pVec + iRow * iOffset);
1029 template <
typename ScalarType2>
1042 template <
typename MatrixExpr>
1045 static const bool bAlias = MatrixExpr::bAlias;
1058 return A(iRow,
iCol);
1063 template <
typename ScalarType2>
1065 return A.bHaveReferenceTo(pFirst, pLast);
1073 template <
typename MatrixExpr>
1076 static const bool bAlias = MatrixExpr::bAlias;
1089 return A(
iRow, iCol);
1094 template <
typename ScalarType2>
1096 return A.bHaveReferenceTo(pFirst, pLast);
1104 template <
typename MatrixExpr>
1107 static const bool bAlias = MatrixExpr::bAlias;
1131 return A.iGetNumCols();
1136 return A.iGetNumRows();
1142 return A.GetCol(iRow);
1148 return A.GetRow(iCol);
1151 template <
typename ScalarType2>
1153 return A.bHaveReferenceTo(pFirst, pLast);
1164 typename MatrixExpr>
1167 static const bool bAlias = MatrixExpr::bAlias;
1187 return A(i + iRowStart - 1, j + iColStart - 1);
1210 template <
typename ScalarType2>
1212 return A.bHaveReferenceTo(pFirst, pLast);
1225 template <
typename ScalarBinFunc,
typename MatrixLhsExpr,
typename MatrixRhsExpr>
1228 static const bool bAlias = MatrixLhsExpr::bAlias || MatrixRhsExpr::bAlias;
1250 return ScalarBinFunc::f(
oU(i, j),
oV(i, j));
1256 return oU.iGetNumRows();
1262 return oU.iGetNumCols();
1273 template <
typename ScalarType2>
1275 return oU.bHaveReferenceTo(pFirst, pLast) ||
oV.bHaveReferenceTo(pFirst, pLast);
1293 template <
typename ScalarBinFunc,
typename MatrixLhsExpr,
typename ScalarRhsExpr>
1316 return ScalarBinFunc::f(
oU(i, j),
oV);
1321 return oU.iGetNumRows();
1326 return oU.iGetNumCols();
1341 template <
typename ScalarType2>
1344 return oU.bHaveReferenceTo(pFirst, pLast)
1345 || ScalarTraits::bHaveReferenceTo(
oV, pFirst, pLast);
1353 template <
typename ScalarUnaryFunc,
typename MatrixExpr>
1356 static const bool bAlias = MatrixExpr::bAlias;
1375 return ScalarUnaryFunc::f(
oU(i, j));
1380 return oU.iGetNumRows();
1385 return oU.iGetNumCols();
1400 template <
typename ScalarType2>
1402 return oU.bHaveReferenceTo(pFirst, pLast);
1409 template <
typename MatrixType,
bool ALIAS=false>
1436 return A.iGetNumRows();
1441 return A.iGetNumCols();
1447 return A.GetRow(iRow);
1453 return A.GetCol(iCol);
1456 template <
typename ScalarType2>
1458 return A.bHaveReferenceTo(pFirst, pLast);
1462 const MatrixType&
A;
1512 template <
typename ScalarType2>
1553 template <
typename ScalarType2>
1594 template <
typename ScalarType2>
1603 template <
typename InitClass,
typename T, index_type N_rows, index_type N_cols>
1606 template <
typename InitArg>
1612 template <
typename InitArg1,
typename InitArg2>
1619 template <
typename InitClass,
typename T, index_type N_rows>
1622 template <
typename InitArg>
1629 template <
typename T, index_type N_rows>
1644 template <
typename U>
1674 return &
rgData[N_rows - 1];
1681 template <
typename T>
1723 std::vector<T, GradientAllocator<T> >
rgData;
1727 template <
typename T, index_type N_rows, index_type N_cols>
1746 return rgData[i - 1][j - 1];
1752 return rgData[i - 1][j - 1];
1765 return &
rgData[N_rows - 1][N_cols - 1];
1772 template <
typename T>
1777 :iNumRows(iNumRows),
1779 rgData(iNumRows * iNumCols, bZeroInit) {
1788 return rgData[(i - 1) * iNumCols + (j - 1)];
1794 return rgData[(i - 1) * iNumCols + (j - 1)];
1798 if (iRows != iNumRows || iCols != iCols) {
1799 rgData.Resize(iRows * iCols);
1806 return rgData.pGetFirstElem();
1810 return rgData.pGetLastElem();
1817 template <
typename T, index_type N_rows>
1822 :iNumCols(iNumCols),
1823 rgData(N_rows * iNumCols, bZeroInit) {
1833 return rgData[(i - 1) * iNumCols + (j - 1)];
1839 return rgData[(i - 1) * iNumCols + (j - 1)];
1845 if (iCols != iNumCols) {
1846 rgData.Resize(iRows * iCols);
1852 return rgData.pGetFirstElem();
1856 return rgData.pGetLastElem();
1863 template <
typename T, index_type N_cols>
1868 :iNumRows(iNumRows),
1869 rgData(iNumRows * N_cols, bZeroInit) {
1879 return rgData[(i - 1) * N_cols + (j - 1)];
1885 return rgData[(i - 1) * N_cols + (j - 1)];
1891 if (iRows != iNumRows) {
1892 rgData.Resize(iRows * iCols);
1898 return rgData.pGetFirstElem();
1902 return rgData.pGetLastElem();
1909 template <
typename T, index_type N_rows, index_type N_cols>
1930 Matrix(
const T& A11,
const T& A21,
const T& A12,
const T& A22)
1935 (*this)(1, 1) = A11;
1936 (*this)(2, 1) = A21;
1937 (*this)(1, 2) = A12;
1938 (*this)(2, 2) = A22;
1947 template <
typename InitClass>
1950 func.Initialize(*
this);
1953 template <
typename Expression>
1957 using namespace MatVecHelp;
1961 template <
typename T2>
1967 template <
typename T2>
1993 template <
typename Expression>
1998 using namespace MatVecHelp;
2000 ApplyMatrixFunc<Assign>(A);
2005 template <
typename T_Rhs>
2009 using namespace MatVecHelp;
2016 template <
typename T_Rhs>
2021 using namespace MatVecHelp;
2028 template <
typename Expression>
2032 using namespace MatVecHelp;
2034 ApplyMatrixFunc<Add>(A);
2039 template <
typename Expression>
2043 using namespace MatVecHelp;
2045 ApplyMatrixFunc<Sub>(A);
2050 template <
typename T_Rhs>
2052 using namespace MatVecHelp;
2054 ApplyScalarFunc<Mul>(
a);
2059 template <
typename T_Rhs>
2061 using namespace MatVecHelp;
2063 ApplyScalarFunc<Div>(
a);
2068 template <
typename ScalarExpression>
2070 using namespace MatVecHelp;
2077 template <
typename ScalarExpression>
2079 using namespace MatVecHelp;
2093 return rgMat(iRow, iCol);
2101 return rgMat(iRow, iCol);
2122 template <
typename ScalarType2>
2142 template <
typename Func,
typename U>
2146 Func::Eval((*
this)(i, j), a);
2151 template <
typename Func,
typename Expression>
2153 using namespace MatVecHelp;
2155 ApplyAliasHelperMatrix<MatrixExpression<Expression, N_rows, N_cols>::bAlias>
::ApplyMatrixFunc(*
this, A, Func());
2158 template <
typename Func,
typename Expression>
2169 Func::Eval((*
this)(i, j), A(i, j));
2174 template <
typename Func,
typename Expression>
2183 template <
typename T, index_type N_rows, index_type N_cols>
2189 inline MatrixExpression<Mat3x3DirectExpr, 3, 3>
2194 inline MatrixExpression<Mat3xNDirectExpr, 3, DYNAMIC_SIZE>
2199 inline MatrixExpression<MatNxNDirectExpr, DYNAMIC_SIZE, DYNAMIC_SIZE>
2204 template <
typename T, index_type N_rows, index_type N_cols>
2205 inline MatrixExpression<TransposedMatrix<MatrixDirectExpr<Matrix<T, N_rows, N_cols> > >, N_cols, N_rows>
2210 inline MatrixExpression<TransposedMatrix<Mat3xNDirectExpr>,
DYNAMIC_SIZE, 3>
2215 inline MatrixExpression<TransposedMatrix<MatNxNDirectExpr>,
DYNAMIC_SIZE, DYNAMIC_SIZE>
2220 template <
typename MatrixExpr, index_type N_rows, index_type N_cols>
2221 inline MatrixExpression<TransposedMatrix<MatrixExpr>, N_cols, N_rows>
2226 template <
typename T, index_type N_rows, index_type N_cols>
2227 inline MatrixExpression<MatrixDirectExpr<Matrix<T, N_rows, N_cols>,
true>, N_rows, N_cols>
2232 template <
typename T, index_type N_rows, index_type N_cols>
2235 using namespace MatVecHelp;
2237 ApplyMatrixFunc<Assign>(
Direct(A));
2240 template <
typename T, index_type N_rows, index_type N_cols>
2248 using namespace MatVecHelp;
2250 ApplyMatrixFunc<Assign>(
Direct(A));
2255 template <
typename T, index_type N_rows>
2272 :rgVec(oVec.rgVec) {
2283 template <
typename Expr1,
typename Expr2>
2292 Vector(
const T& v1,
const T& v2,
const T& v3)
2301 template <
typename Expr1,
typename Expr2,
typename Expr3>
2313 template <
typename Expression>
2316 using namespace MatVecHelp;
2321 template <
typename InitClass>
2324 func.Initialize(*
this);
2327 template <
typename T2>
2338 template <
typename T2>
2345 template <
typename T2>
2363 rgVec.Resize(iNumRows);
2366 template <
typename Expression>
2370 using namespace MatVecHelp;
2372 ApplyMatrixFunc<Assign>(f);
2377 template <
typename T_Rhs>
2380 using namespace MatVecHelp;
2391 using namespace MatVecHelp;
2398 template <
typename T_Rhs>
2401 using namespace MatVecHelp;
2408 template <
typename Expression>
2411 using namespace MatVecHelp;
2413 ApplyMatrixFunc<Add>(f);
2418 template <
typename Expression>
2421 using namespace MatVecHelp;
2423 ApplyMatrixFunc<Sub>(f);
2428 template <
typename T_Rhs>
2430 using namespace MatVecHelp;
2432 ApplyScalarFunc<Mul>(g);
2437 template <
typename T_Rhs>
2439 using namespace MatVecHelp;
2441 ApplyScalarFunc<Div>(g);
2446 template <
typename ScalarExpression>
2448 using namespace MatVecHelp;
2455 template <
typename ScalarExpression>
2457 using namespace MatVecHelp;
2481 const index_type iRows = rgVec.iGetNumRows();
2483 MATVEC_ASSERT((N_rows == DYNAMIC_SIZE) || (iRows == N_rows));
2491 template <
typename ScalarType2>
2501 return rgVec.pGetFirstElem();
2505 return rgVec.pGetLastElem();
2511 template <
typename Func,
typename U>
2514 Func::Eval((*
this)(i), a);
2518 template <
typename Func,
typename Expression>
2520 using namespace MatVecHelp;
2522 ApplyAliasHelperMatrix<VectorExpression<Expression, N_rows>::bAlias>
::ApplyMatrixFunc(*
this, A, Func());
2525 template <
typename Func,
typename Expression>
2532 Func::Eval((*
this)(i), A(i));
2536 template <
typename Func,
typename Expression>
2545 template <
typename T, index_type N_rows>
2551 inline VectorExpression<Vec3DirectExpr, 3>
2556 template <
typename T, index_type N_rows>
2557 inline VectorExpression<VectorDirectExpr<Vector<T, N_rows>,
true>, N_rows>
2562 template <
typename T, index_type N_rows>
2566 using namespace MatVecHelp;
2570 ApplyMatrixFunc<Assign>(
Direct(v));
2573 template <
typename T, index_type N_rows>
2576 using namespace MatVecHelp;
2578 ApplyMatrixFunc<Assign>(
Direct(v));
2583 template <index_type iStartIndex, index_type iEndIndex,
typename T, index_type N_rows>
2591 template <index_type iStartIndex, index_type iEndIndex,
typename VectorExpr, index_type N_rows>
2592 VectorExpression<SubVectorExpr<iStartIndex, iEndIndex, VectorExpr> , iEndIndex - iStartIndex + 1>
2599 template <index_type iRowStart, index_type iRowEnd, index_type iColStart, index_type iColEnd,
typename T, index_type N_rows, index_type N_cols>
2600 MatrixExpression<SubMatrixExpr<iRowStart, iRowEnd, iColStart, iColEnd, MatrixExpression<MatrixDirectExpr<Matrix<T, N_rows, N_cols> >, N_rows, N_cols> >, iRowEnd - iRowStart + 1, iColEnd - iColStart + 1>
2602 return MatrixExpression<SubMatrixExpr<iRowStart, iRowEnd, iColStart, iColEnd, MatrixExpression<MatrixDirectExpr<Matrix<T, N_rows, N_cols> >, N_rows, N_cols> >, iRowEnd - iRowStart + 1, iColEnd - iColStart + 1>(
Direct(A));
2605 template <index_type iRowStart, index_type iRowEnd, index_type iColStart, index_type iColEnd,
typename MatrixExpr, index_type N_rows, index_type N_cols>
2606 MatrixExpression<SubMatrixExpr<iRowStart, iRowEnd, iColStart, iColEnd, MatrixExpression<MatrixExpr, N_rows, N_cols> >, iRowEnd - iRowStart + 1, iColEnd - iColStart + 1>
2611 template <
typename T,
typename VectorExpr>
2629 A(x, x) = A(y, y) = A(z, z) = d;
2645 template <
typename T,
typename VectorExpr>
2656 const T d = 4. / (4. +
Dot(g, g));
2658 const T tmp1 = -g(3) * g(3);
2659 const T tmp2 = -g(2) * g(2);
2660 const T tmp3 = -g(1) * g(1);
2661 const T tmp4 = g(1) * g(2) * 0.5;
2662 const T tmp5 = g(2) * g(3) * 0.5;
2663 const T tmp6 = g(1) * g(3) * 0.5;
2665 RDelta(1,1) = (tmp1 + tmp2) * d * 0.5 + 1;
2666 RDelta(1,2) = (tmp4 - g(3)) * d;
2667 RDelta(1,3) = (tmp6 + g(2)) * d;
2668 RDelta(2,1) = (g(3) + tmp4) * d;
2669 RDelta(2,2) = (tmp1 + tmp3) * d * 0.5 + 1.;
2670 RDelta(2,3) = (tmp5 - g(1)) * d;
2671 RDelta(3,1) = (tmp6 - g(2)) * d;
2672 RDelta(3,2) = (tmp5 + g(1)) * d;
2673 RDelta(3,3) = (tmp2 + tmp3) * d * 0.5 + 1.;
2683 template <
typename T,
typename VectorExpr>
2697 const T vxvx = v(x) * v(x);
2698 const T vyvy = v(y) * v(y);
2699 const T vzvz = v(z) * v(z);
2700 const T vxvy = v(x) * v(y);
2701 const T vxvz = v(x) * v(z);
2702 const T vyvz = v(y) * v(z);
2704 A(x, x) = -vzvz - vyvy;
2708 A(y, y) = -vzvz - vxvx;
2712 A(z, z) = -vyvy - vxvx;
2721 template <
typename T,
typename VectorExpr>
2740 const T d = (4./(4.+
Dot(g, g)));
2743 G(2, 1) = g(3) * d / 2.;
2744 G(3, 1) = -g(2) * d / 2.;
2745 G(1, 2) = -g(3) * d / 2.;
2747 G(3, 2) = g(1) * d / 2.;
2748 G(1, 3) = g(2) * d / 2.;
2749 G(2, 3) = -g(1) * d / 2.;
2759 template <
typename T>
2765 template <
typename T>
2766 inline MatrixInit<MatCrossInit<T, Vec3DirectExpr>, T, 3, 3>
2771 template <
typename VectorExpr>
2772 inline MatrixInit<MatCrossInit<typename VectorExpr::ScalarType, VectorExpr>,
typename VectorExpr::ScalarType, 3, 3>
2777 template <
typename T>
2778 inline MatrixInit<MatCrossCrossInit<T, VectorDirectExpr<Vector<T, 3> > >, T, 3, 3>
2783 template <
typename VectorExpr>
2784 inline MatrixInit<MatCrossCrossInit<typename VectorExpr::ScalarType, VectorExpr>,
typename VectorExpr::ScalarType, 3, 3>
2789 template <
typename T>
2790 inline MatrixInit<MatGInit<T, VectorDirectExpr<Vector<T, 3> > >, T, 3, 3>
2795 template <
typename VectorExpr>
2796 inline MatrixInit<MatGInit<typename VectorExpr::ScalarType, VectorExpr>,
typename VectorExpr::ScalarType, 3, 3>
2801 template <
typename T>
2802 inline MatrixInit<MatRInit<T, VectorDirectExpr<Vector<T, 3> > >, T, 3, 3>
2807 template <
typename VectorExpr>
2808 inline MatrixInit<MatRInit<typename VectorExpr::ScalarType, VectorExpr>,
typename VectorExpr::ScalarType, 3, 3>
2813 template <
typename T,
typename MatrixExpr>
2836 T cth = (
R(1, 1) +
R(2, 2) +
R(3, 3) - 1.) * 0.5;
2840 sth =
sqrt(1. - cth * cth);
2845 if (
fabs(sth) > puny) {
2847 const T a1 = 0.5 * angle / sth;
2848 Phi(1) = (
R(3, 2) -
R(2, 3)) * a1;
2849 Phi(2) = (
R(1, 3) -
R(3, 1)) * a1;
2850 Phi(3) = (
R(2, 1) -
R(1, 2)) * a1;
2851 }
else if (cth > 0.) {
2857 Matrix<T, 3, 3> scr =
R;
2865 sth =
Dot(scr.GetCol(k), scr.GetCol(k));
2883 Phi(i) = scr(i, j) *
angle;
2900 const T cosphi = 0.5 * (
R(1, 1) +
R(2, 2) +
R(3, 3) - 1.);
2903 unit(1) = 0.5*(
R(3, 2) -
R(2, 3));
2904 unit(2) = 0.5*(
R(1, 3) -
R(3, 1));
2905 unit(3) = 0.5*(
R(2, 1) -
R(1, 2));
2907 const T sinphi2 =
Dot(unit, unit);
2911 sinphi =
sqrt(sinphi2);
2916 const T phi =
atan2(sinphi, cosphi);
2923 eet(1, 1) -= cosphi;
2924 eet(2, 2) -= cosphi;
2925 eet(3, 3) -= cosphi;
2928 if (eet(2, 2) > eet(1, 1)) {
2931 if (eet(3, 3) > eet(maxcol, maxcol)) {
2934 unit = (eet.
GetCol(maxcol)/
sqrt(eet(maxcol, maxcol)*(1. - cosphi)));
2940 unit *=
atan2(sinphi, cosphi);
2945 static void RotCo(
const T& phi, T& cf) {
2957 if (
fabs(phi) < RotCoeff::SerThrsh[0]) {
2961 phip[j] = phip[j - 1] * phi2;
2966 for (
index_type j = 0; j < RotCoeff::SerTrunc[0]; j++) {
2967 cf += phip[j] / RotCoeff::SerCoeff[0][j];
2973 const T pd(
sqrt(phi2));
2982 template <
typename T>
2983 inline VectorInit<VecRotInit<T, MatrixDirectExpr<Matrix<T, 3, 3> > >, T, 3>
2988 template <
typename T, index_type N_rows, index_type N_cols>
2992 :A(A), iColWidth(iColWidth) {
2997 for (
index_type i = 1; i <= A.iGetNumRows(); ++i) {
2998 for (
index_type j = 1; j <= A.iGetNumCols(); ++j) {
2999 os << std::setw(iColWidth) << A(i, j) <<
' ';
3010 template <
typename T, index_type N_rows, index_type N_cols>
3016 template <
typename T, index_type N_rows, index_type N_cols>
3017 inline std::ostream& operator<<(std::ostream& os, const Matrix<T, N_rows, N_cols>& A) {
3018 for (
index_type i = 1; i <= A.iGetNumRows(); ++i) {
3019 for (
index_type j = 1; j <= A.iGetNumCols(); ++j) {
3022 if (i < A.iGetNumRows() || j < A.iGetNumCols())
3030 template <
typename T, index_type N_rows, index_type N_cols>
3031 inline std::ostream& operator<<(std::ostream& os, const TabularMatrixView<T, N_rows, N_cols>& tabA) {
3037 template <
typename T, index_type N_rows>
3038 inline std::ostream& operator<<(std::ostream& os, const Vector<T, N_rows>& x) {
3039 for (
index_type i = 1; i <= x.iGetNumRows(); ++i) {
3042 if (i < x.iGetNumRows())
3049 template <
typename VectorExpressionType, index_type N_rows, index_type N_index>
3063 template <
typename VectorExpressionType, index_type N_rows>
3074 template <
typename VectorExpressionType, index_type N_rows>
3075 inline typename SumTraits<VectorExpressionType, N_rows, N_rows>::ExpressionType
3080 template <
typename T, index_type N_rows>
3081 inline typename SumTraits<VectorDirectExpr<Vector<T, N_rows> >, N_rows, N_rows>
::ExpressionType
3086 template <
typename VectorExprLhs,
typename VectorExprRhs, index_type N_rows, index_type N_index>
3112 template <
typename VectorExprLhs,
typename VectorExprRhs, index_type N_rows>
3131 template <
typename VectorExprLhs,
typename VectorExprRhs, index_type N_rows>
3132 inline typename DotTraits<VectorExprLhs, VectorExprRhs, N_rows, N_rows>::ExpressionType
3137 template <
typename VectorExprLhs,
typename T, index_type N_rows>
3138 inline typename DotTraits<VectorExprLhs, VectorDirectExpr<Vector<T, N_rows> >, N_rows, N_rows>
::ExpressionType
3143 template <
typename T,
typename VectorExprRhs, index_type N_rows>
3144 inline typename DotTraits<VectorDirectExpr<Vector<T, N_rows> >, VectorExprRhs, N_rows, N_rows>
::ExpressionType
3149 template <
typename T_Lhs,
typename T_Rhs, index_type N_rows>
3150 inline typename DotTraits<VectorDirectExpr<Vector<T_Lhs, N_rows> >, VectorDirectExpr<Vector<T_Rhs, N_rows> >, N_rows, N_rows>
::ExpressionType
3155 template <
typename T_Lhs, index_type N_rows>
3156 inline typename DotTraits<VectorDirectExpr<Vector<T_Lhs, N_rows> >, Vec3DirectExpr, N_rows, N_rows>
::ExpressionType
3161 template <
typename VectorExpr, index_type N_rows>
3162 inline typename VectorExpression<VectorExpr, N_rows>::ScalarType
3170 template <
typename T, index_type N_rows>
3176 template <
typename VectorLhsExpr,
typename VectorRhsExpr>
3198 template <
typename VectorLhsExpr,
typename VectorRhsExpr>
3201 static const bool bAlias = VectorLhsExpr::bAlias || VectorRhsExpr::bAlias;
3233 template <
typename ScalarType2>
3235 return oU.bHaveReferenceTo(pFirst, pLast) || oV.bHaveReferenceTo(pFirst, pLast);
3246 template <
typename VectorLhsExpr,
typename VectorRhsExpr>
3252 template <
typename VectorLhsExpr,
typename T_Rhs>
3253 VectorExpression<VectorCrossExpr<VectorLhsExpr, VectorDirectExpr<Vector<T_Rhs, 3> > >, 3>
3258 template <
typename T_Lhs,
typename VectorRhsExpr>
3259 VectorExpression<VectorCrossExpr<VectorDirectExpr<Vector<T_Lhs, 3> >, VectorRhsExpr>, 3>
3264 template <
typename T_Lhs,
typename T_Rhs>
3265 VectorExpression<VectorCrossExpr<VectorDirectExpr<Vector<T_Lhs, 3> >, VectorDirectExpr<Vector<T_Rhs, 3> > >, 3>
3270 template <
typename T_Lhs>
3271 VectorExpression<VectorCrossExpr<VectorDirectExpr<Vector<T_Lhs, 3> >, Vec3DirectExpr>, 3>
3276 template <
typename T>
3278 return A(1, 1) * A(2, 2) - A(1, 2) * A(2, 1);
3281 template <
typename T>
3283 const T detA =
Det(A);
3291 template <index_type N_rows, index_type N_cols,
typename MatrixLhsExpr,
typename VectorRhsExpr>
3294 static const bool bAlias = MatrixLhsExpr::bAlias || VectorRhsExpr::bAlias;
3311 return Dot(A.GetRow(i), x);
3316 return A.iGetNumRows();
3319 template <
typename ScalarType2>
3321 return A.bHaveReferenceTo(pFirst, pLast) || x.bHaveReferenceTo(pFirst, pLast);
3331 const MatrixLhsExpr
A;
3332 const VectorRhsExpr
x;
3335 template <
typename MatrixLhsExpr,
typename VectorRhsExpr>
3338 static const bool bAlias = MatrixLhsExpr::bAlias || VectorRhsExpr::bAlias;
3359 for (
integer j = 1; j <= A.iGetNumCols(); ++j) {
3360 b_i += A(i, j) * x(j);
3367 return A.iGetNumRows();
3370 template <
typename ScalarType2>
3372 return A.bHaveReferenceTo(pFirst, pLast) || x.bHaveReferenceTo(pFirst, pLast);
3376 const MatrixLhsExpr
A;
3377 const VectorRhsExpr
x;
3380 template <index_type N_rows,
typename MatrixLhsExpr,
typename VectorRhsExpr>
3389 template <index_type N_cols,
typename MatrixLhsExpr,
typename VectorRhsExpr>
3398 template <
typename MatrixLhsExpr,
typename MatrixRhsExpr>
3401 static const bool bAlias = MatrixLhsExpr::bAlias || MatrixRhsExpr::bAlias;
3426 return Dot(A.GetRow(i), B.GetCol(j));
3431 return A.iGetNumRows();
3436 return B.iGetNumCols();
3451 template <
typename ScalarType2>
3453 return A.bHaveReferenceTo(pFirst, pLast) || B.bHaveReferenceTo(pFirst, pLast);
3457 const MatrixLhsExpr
A;
3458 const MatrixRhsExpr
B;
3465 template <
typename MatrixLhsExpr, index_type N_rows, index_type N_cols,
typename VectorRhsExpr>
3471 template <
typename T, index_type N_rows, index_type N_cols,
typename VectorRhsExpr>
3472 inline VectorExpression<MatrixVectorProduct<N_rows, N_cols, MatrixExpression<MatrixDirectExpr<Matrix<T, N_rows, N_cols> >, N_rows, N_cols>, VectorExpression<VectorRhsExpr, N_cols> >, N_rows>
3474 return VectorExpression<MatrixVectorProduct<N_rows, N_cols, MatrixExpression<MatrixDirectExpr<Matrix<T, N_rows, N_cols> >, N_rows, N_cols>, VectorExpression<VectorRhsExpr, N_cols> >, N_rows>(
Direct(A), x);
3477 template <
typename MatrixLhsExpr, index_type N_rows, index_type N_cols,
typename T>
3478 inline VectorExpression<MatrixVectorProduct<N_rows, N_cols, MatrixExpression<MatrixLhsExpr, N_rows, N_cols>, VectorExpression<VectorDirectExpr<Vector<T, N_cols> >, N_cols> >, N_rows>
3483 template <
typename T1,
typename T2, index_type N_rows, index_type N_cols>
3484 inline VectorExpression<MatrixVectorProduct<N_rows, N_cols, MatrixExpression<MatrixDirectExpr<Matrix<T1, N_rows, N_cols> >, N_rows, N_cols>, VectorExpression<VectorDirectExpr<Vector<T2, N_cols> >, N_cols> >, N_rows>
3486 return VectorExpression<MatrixVectorProduct<N_rows, N_cols, MatrixExpression<MatrixDirectExpr<Matrix<T1, N_rows, N_cols> >, N_rows, N_cols>, VectorExpression<VectorDirectExpr<Vector<T2, N_cols> >, N_cols> >, N_rows>(
Direct(A),
Direct(x));
3489 template <
typename T, index_type N_rows>
3490 inline VectorExpression<MatrixVectorProduct<N_rows, 3, MatrixExpression<MatrixDirectExpr<Matrix<T, N_rows, 3> >, N_rows, 3>, VectorExpression<Vec3DirectExpr, 3> >, N_rows>
3492 return VectorExpression<MatrixVectorProduct<N_rows, 3, MatrixExpression<MatrixDirectExpr<Matrix<T, N_rows, 3> >, N_rows, 3>, VectorExpression<Vec3DirectExpr, 3> >, N_rows>(
Direct(A),
Direct(x));
3495 template <
typename T>
3496 inline VectorExpression<MatrixVectorProduct<3, 3, MatrixExpression<Mat3x3DirectExpr, 3, 3>, VectorExpression<VectorDirectExpr<Vector<T, 3> >, 3> >, 3>
3501 template <
typename T>
3502 inline VectorExpression<MatrixVectorProduct<DYNAMIC_SIZE, DYNAMIC_SIZE, MatrixExpression<MatNxNDirectExpr, DYNAMIC_SIZE, DYNAMIC_SIZE>,
VectorExpression<VectorDirectExpr<Vector<T, DYNAMIC_SIZE> >, DYNAMIC_SIZE> >, DYNAMIC_SIZE>
operator*(
const MatNxN& A,
const Vector<T, DYNAMIC_SIZE>& x) {
3507 template <
typename T>
3508 inline VectorExpression<MatrixVectorProduct<3, DYNAMIC_SIZE, MatrixExpression<Mat3xNDirectExpr, 3, DYNAMIC_SIZE>, VectorExpression<VectorDirectExpr<Vector<T, DYNAMIC_SIZE> >, DYNAMIC_SIZE> >, 3>
operator*(
const Mat3xN& A,
const Vector<T, DYNAMIC_SIZE>& x) {
3518 template <
typename MatrixLhsExpr, index_type N_rows_Lhs, index_type N_cols_Lhs,
typename MatrixRhsExpr, index_type N_cols_Rhs>
3519 inline MatrixExpression<MatrixMatrixProduct<MatrixExpression<MatrixLhsExpr, N_rows_Lhs, N_cols_Lhs>, MatrixExpression<MatrixRhsExpr, N_cols_Lhs, N_cols_Rhs> >, N_rows_Lhs, N_cols_Rhs>
3524 template <
typename MatrixLhsExpr, index_type N_rows_Lhs, index_type N_cols_Lhs,
typename T, index_type N_cols_Rhs>
3525 inline MatrixExpression<MatrixMatrixProduct<MatrixExpression<MatrixLhsExpr, N_rows_Lhs, N_cols_Lhs>, MatrixDirectExpr<Matrix<T, N_cols_Lhs, N_cols_Rhs> > >, N_rows_Lhs, N_cols_Rhs>
3530 template <
typename T, index_type N_rows_Lhs, index_type N_cols_Lhs,
typename MatrixRhsExpr, index_type N_cols_Rhs>
3531 inline MatrixExpression<MatrixMatrixProduct<MatrixDirectExpr<Matrix<T, N_rows_Lhs, N_cols_Lhs> >, MatrixExpression<MatrixRhsExpr, N_cols_Lhs, N_cols_Rhs> >, N_rows_Lhs, N_cols_Rhs>
3536 template <
typename T_Lhs, index_type N_rows_Lhs, index_type N_cols_Lhs,
typename T_Rhs, index_type N_cols_Rhs>
3537 inline MatrixExpression<MatrixMatrixProduct<MatrixDirectExpr<Matrix<T_Lhs, N_rows_Lhs, N_cols_Lhs> >, MatrixDirectExpr<Matrix<T_Rhs, N_cols_Lhs, N_cols_Rhs> > >, N_rows_Lhs, N_cols_Rhs>
3542 template <
typename T, index_type N_rows_Lhs>
3543 inline MatrixExpression<MatrixMatrixProduct<MatrixDirectExpr<Matrix<T, N_rows_Lhs, 3> >, Mat3x3DirectExpr>, N_rows_Lhs, 3>
3548 template <
typename T, index_type N_cols_Rhs>
3549 inline MatrixExpression<MatrixMatrixProduct<Mat3x3DirectExpr, MatrixDirectExpr<Matrix<T, 3, N_cols_Rhs> > >, 3, N_cols_Rhs>
3554 #define VECTOR_VECTOR_DEFINE_BINARY_FUNCTION(ExpressionName, FunctionName, FunctionClass) \
3555 template <typename VectorLhsExpr, typename VectorRhsExpr, index_type N_rows> \
3556 inline VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename VectorLhsExpr::ExpressionType, typename VectorRhsExpr::ExpressionType>, VectorLhsExpr, VectorRhsExpr>, N_rows> \
3557 FunctionName(const VectorExpression<VectorLhsExpr, N_rows>& u, const VectorExpression<VectorRhsExpr, N_rows>& v) { \
3558 return VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename VectorLhsExpr::ExpressionType, typename VectorRhsExpr::ExpressionType>, VectorLhsExpr, VectorRhsExpr>, N_rows>(u, v); \
3561 template <typename T, index_type N_rows> \
3562 inline VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, typename ScalarTypeTraits<T>::DirectExpressionType>, VectorDirectExpr<Vector<T, N_rows> >, VectorDirectExpr<Vector<T, N_rows> > >, N_rows> \
3563 FunctionName(const Vector<T, N_rows>& u, const Vector<T, N_rows>& v) { \
3564 return VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, typename ScalarTypeTraits<T>::DirectExpressionType>, VectorDirectExpr<Vector<T, N_rows> >, VectorDirectExpr<Vector<T, N_rows> > >, N_rows>(u, v); \
3567 template <typename T1, typename T2, index_type N_rows> \
3568 inline VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T1>::DirectExpressionType, typename ScalarTypeTraits<T2>::DirectExpressionType>, VectorDirectExpr<Vector<T1, N_rows> >, VectorDirectExpr<Vector<T2, N_rows> > >, N_rows> \
3569 FunctionName(const Vector<T1, N_rows>& u, const Vector<T2, N_rows>& v) { \
3570 return VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T1>::DirectExpressionType, typename ScalarTypeTraits<T2>::DirectExpressionType>, VectorDirectExpr<Vector<T1, N_rows> >, VectorDirectExpr<Vector<T2, N_rows> > >, N_rows>(u, v); \
3573 template <typename T1, index_type N_rows> \
3574 inline VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T1>::DirectExpressionType, typename ScalarTypeTraits<doublereal>::DirectExpressionType>, VectorDirectExpr<Vector<T1, N_rows> >, Vec3DirectExpr>, N_rows> \
3575 FunctionName(const Vector<T1, N_rows>& u, const Vec3& v) { \
3576 return VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T1>::DirectExpressionType, typename ScalarTypeTraits<doublereal>::DirectExpressionType>, VectorDirectExpr<Vector<T1, N_rows> >, Vec3DirectExpr>, N_rows>(u, v); \
3579 template <index_type N_rows> \
3580 inline VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, scalar_func_type, scalar_func_type>, VectorDirectExpr<Vector<scalar_func_type, N_rows> >, VectorDirectExpr<Vector<scalar_func_type, N_rows> > >, N_rows> \
3581 FunctionName(const Vector<scalar_func_type, N_rows>& u, const Vector<scalar_func_type, N_rows>& v) { \
3582 return VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, scalar_func_type, scalar_func_type>, VectorDirectExpr<Vector<scalar_func_type, N_rows> >, VectorDirectExpr<Vector<scalar_func_type, N_rows> > >, N_rows>(u, v); \
3585 template <typename VectorLhsExpr, typename T, index_type N_rows> \
3586 inline VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename VectorLhsExpr::ExpressionType, typename ScalarTypeTraits<T>::DirectExpressionType >, VectorLhsExpr, VectorDirectExpr<Vector<T, N_rows> > >, N_rows> \
3587 FunctionName(const VectorExpression<VectorLhsExpr, N_rows>& u, const Vector<T, N_rows>& v) { \
3588 return VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename VectorLhsExpr::ExpressionType, typename ScalarTypeTraits<T>::DirectExpressionType >, VectorLhsExpr, VectorDirectExpr<Vector<T, N_rows> > >, N_rows>(u, v); \
3591 template <typename T, index_type N_rows, typename VectorRhsExpr> \
3592 inline VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, typename VectorRhsExpr::ExpressionType>, VectorDirectExpr<Vector<T, N_rows> >, VectorRhsExpr>, N_rows> \
3593 FunctionName(const Vector<T, N_rows>& u, const VectorExpression<VectorRhsExpr, N_rows>& v) { \
3594 return VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, typename VectorRhsExpr::ExpressionType>, VectorDirectExpr<Vector<T, N_rows> >, VectorRhsExpr>, N_rows>(u, v); \
3597 #define VECTOR_SCALAR_DEFINE_BINARY_FUNCTION(ExpressionName, FunctionName, FunctionClass) \
3598 template <typename VectorLhsExpr, typename ScalarRhsExpr, index_type N_rows> \
3599 inline VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename VectorLhsExpr::ExpressionType, ScalarRhsExpr>, VectorLhsExpr, ScalarRhsExpr>, N_rows> \
3600 FunctionName(const VectorExpression<VectorLhsExpr, N_rows>& u, const GradientExpression<ScalarRhsExpr>& v) { \
3601 return VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename VectorLhsExpr::ExpressionType, ScalarRhsExpr>, VectorLhsExpr, ScalarRhsExpr>, N_rows>(u, v); \
3604 template <typename VectorLhsExpr, index_type N_rows, index_type N_SIZE> \
3605 inline VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename VectorLhsExpr::ExpressionType, DirectExpr<Gradient<N_SIZE> > >, VectorLhsExpr, DirectExpr<Gradient<N_SIZE> > >, N_rows> \
3606 FunctionName(const VectorExpression<VectorLhsExpr, N_rows>& u, const Gradient<N_SIZE>& v) { \
3607 return VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename VectorLhsExpr::ExpressionType, DirectExpr<Gradient<N_SIZE> > >, VectorLhsExpr, DirectExpr<Gradient<N_SIZE> > >, N_rows>(u, v); \
3610 template <typename VectorLhsExpr, index_type N_rows> \
3611 inline VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename VectorLhsExpr::ExpressionType, scalar_func_type>, VectorLhsExpr, scalar_func_type>, N_rows> \
3612 FunctionName(const VectorExpression<VectorLhsExpr, N_rows>& u, scalar_func_type v) { \
3613 return VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename VectorLhsExpr::ExpressionType, scalar_func_type >, VectorLhsExpr, scalar_func_type>, N_rows>(u, v); \
3616 template <typename T, index_type N_rows> \
3617 inline VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, scalar_func_type >, VectorDirectExpr<Vector<T, N_rows> >, scalar_func_type>, N_rows> \
3618 FunctionName(const Vector<T, N_rows>& u, scalar_func_type v) { \
3619 return VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, scalar_func_type >, VectorDirectExpr<Vector<T, N_rows> >, scalar_func_type>, N_rows>(u, v); \
3622 template <typename T, index_type N_rows, index_type N_SIZE> \
3623 inline VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, DirectExpr<Gradient<N_SIZE> > >, VectorDirectExpr<Vector<T, N_rows> >, DirectExpr<Gradient<N_SIZE> > >, N_rows> \
3624 FunctionName(const Vector<T, N_rows>& u, const Gradient<N_SIZE>& v) { \
3625 return VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, DirectExpr<Gradient<N_SIZE> > >, VectorDirectExpr<Vector<T, N_rows> >, DirectExpr<Gradient<N_SIZE> > >, N_rows>(u, v); \
3628 template <typename T, index_type N_rows, typename RhsExpr> \
3629 inline VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, GradientExpression<RhsExpr> >, VectorDirectExpr<Vector<T, N_rows> >, GradientExpression<RhsExpr> >, N_rows> \
3630 FunctionName(const Vector<T, N_rows>& u, const GradientExpression<RhsExpr>& v) { \
3631 return VectorExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, GradientExpression<RhsExpr> >, VectorDirectExpr<Vector<T, N_rows> >, GradientExpression<RhsExpr> >, N_rows>(u, v); \
3634 #define VECTOR_DEFINE_UNARY_FUNCTION(ExpressionName, FunctionName, FunctionClass) \
3635 template <typename VectorExpr, index_type N_rows> \
3636 inline VectorExpression<ExpressionName<ScalarUnaryOperation<FunctionClass, typename VectorExpr::ExpressionType>, VectorExpr>, N_rows> \
3637 FunctionName(const VectorExpression<VectorExpr, N_rows>& u) { \
3638 return VectorExpression<ExpressionName<ScalarUnaryOperation<FunctionClass, typename VectorExpr::ExpressionType>, VectorExpr>, N_rows>(u); \
3641 template <typename T, index_type N_rows> \
3642 inline VectorExpression<ExpressionName<ScalarUnaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType>, VectorDirectExpr<Vector<T, N_rows> > >, N_rows> \
3643 FunctionName(const Vector<T, N_rows>& u) { \
3644 return VectorExpression<ExpressionName<ScalarUnaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType>, VectorDirectExpr<Vector<T, N_rows> > >, N_rows>(u); \
3647 #define MATRIX_DEFINE_UNARY_FUNCTION(ExpressionName, FunctionName, FunctionClass) \
3648 template <typename MatrixExpr, index_type N_rows, index_type N_cols> \
3649 inline MatrixExpression<ExpressionName<ScalarUnaryOperation<FunctionClass, typename MatrixExpr::ExpressionType>, MatrixExpr>, N_rows, N_cols> \
3650 FunctionName(const MatrixExpression<MatrixExpr, N_rows, N_cols>& u) { \
3651 return MatrixExpression<ExpressionName<ScalarUnaryOperation<FunctionClass, typename MatrixExpr::ExpressionType>, MatrixExpr>, N_rows, N_cols>(u); \
3654 template <typename T, index_type N_rows, index_type N_cols> \
3655 inline MatrixExpression<ExpressionName<ScalarUnaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType>, MatrixDirectExpr<Matrix<T, N_rows, N_cols> > >, N_rows, N_cols> \
3656 FunctionName(const Matrix<T, N_rows, N_cols>& u) { \
3657 return MatrixExpression<ExpressionName<ScalarUnaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType>, MatrixDirectExpr<Matrix<T, N_rows, N_cols> > >, N_rows, N_cols>(u); \
3660 #define MATRIX_MATRIX_DEFINE_BINARY_FUNCTION(ExpressionName, FunctionName, FunctionClass) \
3661 template <typename MatrixLhsExpr, typename MatrixRhsExpr, index_type N_rows, index_type N_cols> \
3662 inline MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename MatrixLhsExpr::ExpressionType, typename MatrixRhsExpr::ExpressionType>, MatrixLhsExpr, MatrixRhsExpr>, N_rows, N_cols> \
3663 FunctionName(const MatrixExpression<MatrixLhsExpr, N_rows, N_cols>& u, const MatrixExpression<MatrixRhsExpr, N_rows, N_cols>& v) { \
3664 return MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename MatrixLhsExpr::ExpressionType, typename MatrixRhsExpr::ExpressionType>, MatrixLhsExpr, MatrixRhsExpr>, N_rows, N_cols>(u, v); \
3667 template <typename T, index_type N_rows, index_type N_cols> \
3668 inline MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, typename ScalarTypeTraits<T>::DirectExpressionType>, MatrixDirectExpr<Matrix<T, N_rows, N_cols> >, MatrixDirectExpr<Matrix<T, N_rows, N_cols> > >, N_rows, N_cols> \
3669 FunctionName(const Matrix<T, N_rows, N_cols>& u, const Matrix<T, N_rows, N_cols>& v) { \
3670 return MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, typename ScalarTypeTraits<T>::DirectExpressionType>, MatrixDirectExpr<Matrix<T, N_rows, N_cols> >, MatrixDirectExpr<Matrix<T, N_rows, N_cols> > >, N_rows, N_cols>(u, v); \
3673 template <typename MatrixLhsExpr, typename T, index_type N_rows, index_type N_cols> \
3674 inline MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename MatrixLhsExpr::ExpressionType, typename ScalarTypeTraits<T>::DirectExpressionType >, MatrixLhsExpr, MatrixDirectExpr<Matrix<T, N_rows, N_cols> > >, N_rows, N_cols> \
3675 FunctionName(const MatrixExpression<MatrixLhsExpr, N_rows, N_cols>& u, const Matrix<T, N_rows, N_cols>& v) { \
3676 return MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename MatrixLhsExpr::ExpressionType, typename ScalarTypeTraits<T>::DirectExpressionType >, MatrixLhsExpr, MatrixDirectExpr<Matrix<T, N_rows, N_cols> > >, N_rows, N_cols>(u, v); \
3679 template <typename T, index_type N_rows, index_type N_cols, typename MatrixRhsExpr> \
3680 inline MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, typename MatrixRhsExpr::ExpressionType>, MatrixDirectExpr<Matrix<T, N_rows, N_cols> >, MatrixRhsExpr>, N_rows, N_cols> \
3681 FunctionName(const Matrix<T, N_rows, N_cols>& u, const MatrixExpression<MatrixRhsExpr, N_rows, N_cols>& v) { \
3682 return MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, typename MatrixRhsExpr::ExpressionType>, MatrixDirectExpr<Matrix<T, N_rows, N_cols> >, MatrixRhsExpr>, N_rows, N_cols>(u, v); \
3685 #define MATRIX_SCALAR_DEFINE_BINARY_FUNCTION(ExpressionName, FunctionName, FunctionClass) \
3686 template <typename MatrixLhsExpr, typename ScalarRhsExpr, index_type N_rows, index_type N_cols> \
3687 inline MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename MatrixLhsExpr::ExpressionType, ScalarRhsExpr>, MatrixLhsExpr, ScalarRhsExpr>, N_rows, N_cols> \
3688 FunctionName(const MatrixExpression<MatrixLhsExpr, N_rows, N_cols>& u, const GradientExpression<ScalarRhsExpr>& v) { \
3689 return MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename MatrixLhsExpr::ExpressionType, ScalarRhsExpr>, MatrixLhsExpr, ScalarRhsExpr>, N_rows, N_cols>(u, v); \
3692 template <typename MatrixLhsExpr, index_type N_rows, index_type N_cols, index_type N_SIZE> \
3693 inline MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename MatrixLhsExpr::ExpressionType, DirectExpr<Gradient<N_SIZE> > >, MatrixLhsExpr, DirectExpr<Gradient<N_SIZE> > >, N_rows, N_cols> \
3694 FunctionName(const MatrixExpression<MatrixLhsExpr, N_rows, N_cols>& u, const Gradient<N_SIZE>& v) { \
3695 return MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename MatrixLhsExpr::ExpressionType, DirectExpr<Gradient<N_SIZE> > >, MatrixLhsExpr, DirectExpr<Gradient<N_SIZE> > >, N_rows, N_cols>(u, v); \
3698 template <typename MatrixLhsExpr, index_type N_rows, index_type N_cols> \
3699 inline MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename MatrixLhsExpr::ExpressionType, scalar_func_type>, MatrixLhsExpr, scalar_func_type>, N_rows, N_cols> \
3700 FunctionName(const MatrixExpression<MatrixLhsExpr, N_rows, N_cols>& u, scalar_func_type v) { \
3701 return MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename MatrixLhsExpr::ExpressionType, scalar_func_type >, MatrixLhsExpr, scalar_func_type>, N_rows, N_cols>(u, v); \
3704 template <typename T, index_type N_rows, index_type N_cols> \
3705 inline MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, scalar_func_type >, MatrixDirectExpr<Matrix<T, N_rows, N_cols> >, scalar_func_type>, N_rows, N_cols> \
3706 FunctionName(const Matrix<T, N_rows, N_cols>& u, scalar_func_type v) { \
3707 return MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, scalar_func_type >, MatrixDirectExpr<Matrix<T, N_rows, N_cols> >, scalar_func_type>, N_rows, N_cols>(u, v); \
3710 template <typename T, index_type N_rows, index_type N_cols, index_type N_SIZE> \
3711 inline MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, DirectExpr<Gradient<N_SIZE> > >, MatrixDirectExpr<Matrix<T, N_rows, N_cols> >, DirectExpr<Gradient<N_SIZE> > >, N_rows, N_cols> \
3712 FunctionName(const Matrix<T, N_rows, N_cols>& u, const Gradient<N_SIZE>& v) { \
3713 return MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, DirectExpr<Gradient<N_SIZE> > >, MatrixDirectExpr<Matrix<T, N_rows, N_cols> >, DirectExpr<Gradient<N_SIZE> > >, N_rows, N_cols>(u, v); \
3716 template <typename T, index_type N_rows, index_type N_cols, typename RhsExpr> \
3717 inline MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, GradientExpression<RhsExpr> >, MatrixDirectExpr<Matrix<T, N_rows, N_cols> >, GradientExpression<RhsExpr> >, N_rows, N_cols> \
3718 FunctionName(const Matrix<T, N_rows, N_cols>& u, const GradientExpression<RhsExpr>& v) { \
3719 return MatrixExpression<ExpressionName<ScalarBinaryOperation<FunctionClass, typename ScalarTypeTraits<T>::DirectExpressionType, GradientExpression<RhsExpr> >, MatrixDirectExpr<Matrix<T, N_rows, N_cols> >, GradientExpression<RhsExpr> >, N_rows, N_cols>(u, v); \
3734 #undef VECTOR_VECTOR_DEFINE_BINARY_FUNCTION
3735 #undef VECTOR_SCALAR_DEFINE_BINARY_FUNCTION
3736 #undef VECTOR_DEFINE_UNARY_FUNCTION
3738 #undef MATRIX_MATRIX_DEFINE_BINARY_FUNCTION
3739 #undef MATRIX_SCALAR_DEFINE_BINARY_FUNCTION
3740 #undef MATRIX_DEFINE_UNARY_FUNCTION
static const index_type iNumCols
VectorExpr::ScalarType ScalarType
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
RowVectorType GetRow(index_type iRow) const
CommonScalarType< ScalarTypeLhs, ScalarTypeRhs >::ScalarType ScalarType
static const index_type iNumRows
static int angle(const MathParser::MathArgs &args)
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Vector & operator+=(const VectorExpression< Expression, N_rows > &f)
Expression::ScalarType ScalarType
void Resize(index_type iRows, index_type iCols)
ExpressionType operator()(index_type i) const
Vector(const VectorExpression< Expression, N_rows > &f)
Mat3x3DirectExpr(const Mat3x3 &A)
VectorVectorUnaryExpr(const VectorExpr &u)
VectorData(const VectorData &oVec)
ColumnVectorType GetCol(index_type iCol) const
ExpressionType operator()(index_type iCol) const
ScalarUnaryFunc::ExpressionType ExpressionType
Gradient< N_SIZE > ScalarType
IndexCheck< VectorRhsExpr::iNumRows-3 >::CheckType check_iNumRowsRhs
static const index_type iNumRows
const ScalarType *const pVec
Matrix(index_type iRows, index_type iCols)
const T * pGetLastElem() const
index_type iGetNumRows() const
MatrixExpr::ScalarType ScalarType
VectorExpression< ColumnVectorExpr< MatrixMatrixProduct >, iNumRows > ColumnVectorType
index_type iGetStartIndexLocalVector() const
MatrixVectorProduct(const MatrixLhsExpr &A, const VectorRhsExpr &x)
static const index_type iNumRows
void Resize(index_type iRows, index_type iCols)
void Resize(index_type iRows, index_type iCols)
const T * pGetFirstElem() const
static const index_type iNumCols
DotTraits< MatrixLhsRowVector, VectorRhsExpr, MatrixLhsExpr::iNumCols, MatrixLhsExpr::iNumCols >::ExpressionType ExpressionType
void ApplyScalarFunc(const U &a)
const ScalarType & operator()(index_type i, index_type j) const
scalar_deriv_type dGetDerivativeLocal(index_type iLocalDof) const
index_type iGetNumRows() const
Mat3xNDirectExpr(const Mat3xN &A)
ExpressionType operator()(index_type i) const
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
MatrixExpression< TransposedMatrix< MatrixDirectExpr< Matrix< T, N_rows, N_cols > > >, N_cols, N_rows > Transpose(const Matrix< T, N_rows, N_cols > &A)
ScalarTypeTraits< doublereal >::ScalarType ScalarType
#define MATRIX_SCALAR_DEFINE_BINARY_FUNCTION(ExpressionName, FunctionName, FunctionClass)
GradientExpression< BinaryExpr< ScalarBinaryFunction, ScalarLhsExpr, ScalarRhsExpr > > ExpressionType
VectorExpr::ExpressionType ExpressionType
static ExpressionType Sum(const VectorExpression< VectorExpressionType, N_rows > &v)
index_type iGetNumRows() const
SumTraits< VectorDirectExpr< Vector< T, N_rows > >, N_rows, N_rows >::ExpressionType Sum(const Vector< T, N_rows > &v)
GenericBinaryExpression< ScalarBinaryFunction, T, ScalarLhsExpr, ScalarRhsExpr >::ScalarType ScalarType
static const index_type iNumRows
#define MBDYN_EXCEPT_ARGS
CommonScalarType< ScalarTypeLhs, ScalarTypeRhs >::ScalarType ScalarType
static const index_type DYNAMIC_SIZE
GradientExpression< UnaryExpr< FuncSin, Expr > > sin(const GradientExpression< Expr > &u)
const ScalarType * pGetLastElem() const
const ScalarType & operator()(index_type i) const
void ApplyMatrixFuncAlias(const MatrixExpression< Expression, N_rows, N_cols > &A, const Func &f)
MatNxNDirectExpr(const MatNxN &A)
void ApplyScalarFunc(const U &a)
static const index_type iNumRows
integer iGetNumRows(void) const
VectorExpression< RowVectorExpr< MatrixMatrixProduct >, iNumCols > RowVectorType
ScalarTypeTraits< T >::ScalarType ScalarType
index_type iGetNumCols() const
RowVectorType GetRow(index_type iRow) const
index_type iGetNumRows() const
ScalarTypeTraits< doublereal >::DirectExpressionType ExpressionType
MatrixExpr::ExpressionType ExpressionType
MaxSizeCheck< iNumRows!=DYNAMIC_SIZE >::CheckType check_iNumRows
index_type iGetNumCols() const
GenericBinaryExpression(const ScalarLhsExpr &lhs, const ScalarRhsExpr &rhs)
Vector & operator=(const VectorExpression< Expression, N_rows > &f)
index_type iGetNumRows() const
const ScalarType * pGetFirstElem() const
ExpressionType operator()(index_type i, index_type j) const
bool bHaveReferenceTo(const void *p) const
static const index_type iNumCols
MatrixLhsExpr::ScalarType MatrixLhsScalarExpr
ColumnVectorType GetCol(index_type iCol) const
ScalarBinaryExpressionTraits< FuncMinus, ScalarType, ExprMult, ExprMult >::ExpressionType ExpressionType
Matrix & operator+=(const Matrix< T_Rhs, N_rows, N_cols > &A)
VectorRhsExpr::ScalarType ScalarTypeRhs
GradientExpression< BinaryExpr< ScalarBinaryFunction, ScalarLhsExpr, DirectExpr< Gradient< N_SIZE > > > > ExpressionType
static void Eval(T &b, const U &a)
void Resize(index_type iNumRows)
BasicScalarType< Expr >::ScalarType ScalarType
ScalarTypeTraits< doublereal >::ScalarType ScalarType
integer iGetNumRows(void) const
MatrixRhsExpr::ColumnVectorType MatrixRhsColumnVector
VectorExpression(const Expression &e)
ScalarBinaryExpressionTraits< FuncPlus, ScalarType, typename DotTraits< VectorExprLhs, VectorExprRhs, N_rows, N_index-1 >::ExpressionType, MultExpressionType >::ExpressionType ExpressionType
CommonScalarType< typename BasicScalarType< LhsExpr >::ScalarType, typename BasicScalarType< RhsExpr >::ScalarType >::ScalarType ScalarType
ScalarBinFunc::ScalarType ScalarType
static const index_type iNumRows
MatrixScalarMatrixBinaryExpr(const MatrixLhsExpr &u, const ScalarRhsExpr &v)
IndexCheck< iNumRows-VectorRhsExpr::iNumRows >::CheckType check_VectorRhsExpr
const T * pGetFirstElem() const
RowVectorType GetRow(index_type iRow) const
IndexCheck< N_rows-MatrixLhsExpr::iNumRows >::CheckType check_iNumRowsLhs
VectorExpression< VectorExpressionType, N_rows >::ScalarType ScalarType
ScalarBinFunc::ScalarType ScalarType
const T * pGetFirstElem() const
void Initialize(Vector< T, 3 > &unit) const
index_type iGetNumRows() const
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
VectorExpression< ColumnVectorExpr< MatrixMatrixUnaryExpr >, iNumRows > ColumnVectorType
Matrix(const MatrixInit< InitClass, T, N_rows, N_cols > &func)
index_type iGetNumCols() const
RowVectorType GetRow(index_type iRow) const
BasicScalarType< ScalarLhsExpr >::ScalarType ScalarTypeLhs
VectorData(index_type N, bool bZeroInit)
const ScalarType & operator()(index_type iRow) const
MaxSizeCheck< N_cols!=DYNAMIC_SIZE >::CheckType check_iNumColsDynamic
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
MaxSizeCheck< iEndIndex<=VectorExpr::iNumRows >::CheckType check_iEndIndex;typedef typename MaxSizeCheck< iStartIndex >=1 >::CheckType check_iStartIndex
const ScalarType * pGetVec() const
index_type iGetNumRows() const
Vector(const GradientExpression< Expr1 > &v1, const GradientExpression< Expr2 > &v2)
ExpressionType operator()(index_type iRow) const
Vector & operator-=(const Vector< T_Rhs, N_rows > &v)
index_type iGetNumRows() const
const T * pGetLastElem() const
const ScalarType & operator()(index_type i, index_type j) const
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
Matrix(const MatrixExpression< Expression, N_rows, N_cols > &A)
VectorExpression(const LhsExpr &u, const RhsExpr &v)
#define MATVEC_ASSERT(expr)
index_type iGetNumRows() const
ScalarBinaryExpressionTraits< FuncMult, ScalarType, ExpressionTypeLhs, ExpressionTypeRhs >::ExpressionType ExprMult
Matrix & operator=(const MatrixExpression< Expression, N_rows, N_cols > &A)
ScalarBinFunc::ExpressionType ExpressionType
Matrix(const Matrix< T2, N_rows, N_cols > &A, LocalDofMap *pDofMap)
BasicScalarType< Expression >::ScalarType ScalarType
index_type iGetStartIndexLocal() const
MatrixExpr::RowVectorType ColumnVectorType
GenericUnaryExpression(const ScalarExpr &expr)
index_type iGetNumRows() const
index_type iGetNumRows() const
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
SumTraitsN_minus_1::ExpressionType ExpressionTypeN_minus_1
static const index_type iDimension
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
ScalarUnaryFunc::ExpressionType ExpressionType
static const index_type iDimension
MatRInit(const VectorExpression< VectorExpr, 3 > &g)
TransposedMatrix(const MatrixExpr &A)
Vector & operator-=(const VectorExpression< Expression, N_rows > &f)
MatrixDirectExpr(const MatrixType &A)
index_type iGetNumCols() const
const ScalarType *const pVec
index_type iGetStartIndexLocalVector() const
Vec3 GetCol(unsigned short int i) const
static const index_type iNumRows
const index_type iCurrRows
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
LocalDofMap * pGetDofMap() const
ScalarBinaryExpressionTraits< ScalarBinaryFunction, ScalarType, ScalarLhsExpr, ScalarRhsExpr >::ExpressionType ExpressionType
ExpressionType operator()(index_type i, index_type j) const
MatrixLhsExpr::RowVectorType MatrixLhsRowVector
RowVectorType GetRow(index_type iRow) const
const T * pGetFirstElem() const
MatrixData(index_type iNumRows, index_type iNumCols, bool bZeroInit)
GradientExpression< BinaryExpr< FuncMult, LhsExpr, RhsExpr > > operator*(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
void Initialize(Matrix< T, 3, 3 > &A) const
MatrixLhsExpr::ScalarType MatrixLhsScalarExpr
SliceVector(const ScalarType *p, index_type iRows, index_type iOffset)
MaxSizeCheck< N_offset!=DYNAMIC_SIZE >::CheckType check_iOffset
GenericUnaryExpression< ScalarUnaryFunction, T, ScalarExpr >::ScalarType ScalarType
VectorCrossExpr(const VectorLhsExpr &u, const VectorRhsExpr &v)
IndexCheck< N_cols-VectorRhsExpr::iNumRows >::CheckType check_iNumRowsRhs
index_type iGetEndIndexLocalVector() const
scalar_func_type ScalarType
index_type iGetNumRows() const
static const index_type iNumCols
CrossTraits< VectorLhsExpr, VectorRhsExpr >::ScalarType ScalarType
ScalarTypeTraits< T >::DirectExpressionType ExpressionType
ScalarBinFunc::ScalarType ScalarType
MatrixVectorProduct(const MatrixLhsExpr &A, const VectorRhsExpr &x)
static ExpressionType Dot(const VectorExpression< VectorExprLhs, N_rows > &u, const VectorExpression< VectorExprRhs, N_rows > &v)
VectorInit(const InitArg &R)
index_type iGetNumRows() const
std::vector< T, GradientAllocator< T > > rgData
index_type iGetNumCols() const
CommonScalarType< typename BasicScalarType< MatrixLhsScalarExpr >::ScalarType, typename BasicScalarType< VectorRhsScalarExpr >::ScalarType >::ScalarType ScalarType
#define MATRIX_MATRIX_DEFINE_BINARY_FUNCTION(ExpressionName, FunctionName, FunctionClass)
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
index_type iGetNumRows() const
void ZeroInit< long double >(long double *first, long double *last)
static void Eval(T &b, const U &a)
void Initialize(Matrix< T, 3, 3 > &G) const
Gradient< N_SIZE > ScalarType
const ScalarType & operator()(index_type i) const
Vector(const GradientExpression< Expr1 > &v1, const GradientExpression< Expr2 > &v2, const GradientExpression< Expr3 > &v3)
void ApplyMatrixFuncNoAlias(const VectorExpression< Expression, N_rows > &A, const Func &)
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
index_type iGetNumCols() const
const ScalarType & operator()(index_type iRow) const
index_type iGetNumRows() const
T Det(const Matrix< T, 2, 2 > &A)
index_type iGetNumCols() const
void ApplyMatrixFunc(const MatrixExpression< Expression, N_rows, N_cols > &A)
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
index_type iGetNumCols() const
MatrixInit< MatGInit< T, VectorDirectExpr< Vector< T, 3 > > >, T, 3, 3 > MatGVec(const Vector< T, 3 > &g)
Matrix & operator/=(const T_Rhs &a)
static const index_type iNumRows
const ScalarType * pGetMat() const
void ApplyMatrixFuncAlias(const VectorExpression< Expression, N_rows > &A, const Func &f)
Vector & operator*=(const GradientExpression< ScalarExpression > &f)
void Resize(index_type iNumRows)
void Print(std::ostream &os) const
MatrixExpression< SubMatrixExpr< iRowStart, iRowEnd, iColStart, iColEnd, MatrixExpression< MatrixDirectExpr< Matrix< T, N_rows, N_cols > >, N_rows, N_cols > >, iRowEnd-iRowStart+1, iColEnd-iColStart+1 > SubMatrix(const Matrix< T, N_rows, N_cols > &A)
MaxSizeCheck< N_rows!=DYNAMIC_SIZE >::CheckType check_iNumRowsDynamic
static const index_type iNumRows
MatrixInit< MatRInit< T, VectorDirectExpr< Vector< T, 3 > > >, T, 3, 3 > MatRVec(const Vector< T, 3 > &g)
void Resize(index_type iRows, index_type iCols)
RowVectorType GetRow(index_type iRow) const
index_type iGetNumRows() const
index_type iGetNumRows() const
VectorData< T, DYNAMIC_SIZE > rgData
static const index_type iMaxDerivatives
VectorExpression(const Expr &u)
const ScalarType & operator()(index_type i, index_type j) const
index_type iGetNumRows() const
ColumnVectorType GetCol(index_type iCol) const
SubVectorExpr(const VectorExpr &u)
index_type iGetStartIndexLocal() const
index_type iGetNumRows() const
static ExpressionType f(const ScalarLhsExpr &u, const ScalarRhsExpr &v)
VectorLhsExpr::ExpressionType ExpressionTypeLhs
Expression::ScalarType ScalarType
MatrixExpression(const Expression &e)
GradientExpression< BinaryExpr< ScalarBinaryFunction, DirectExpr< Gradient< N_SIZE > >, ScalarRhsExpr > > ExpressionType
void func(const T &u, const T &v, const T &w, doublereal e, T &f)
MatrixMatrixUnaryExpr(const MatrixExpr &u)
static void RotCo(const T &phi, T &cf)
void Copy(const Matrix< T2, N_rows, N_cols > &A, LocalDofMap *pDofMap)
ScalarBinFunc::ExpressionType ExpressionType
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
ColumnVectorType GetCol(index_type iCol) const
MatrixExpression< MatrixDirectExpr< Matrix< T, N_rows, N_cols > >, N_rows, N_cols > Direct(const Matrix< T, N_rows, N_cols > &A)
bool bArrayOverlap(const ScalarType *pFirstArray1, const ScalarType *pLastArray1, const ScalarType *pFirstArray2, const ScalarType *pLastArray2)
static void ApplyMatrixFunc(MatrixType &A, const Expression &B, const Func &f)
const VectorExpression< VectorExpr, 3 > g
MatrixVectorProduct(const MatrixLhsExpr &A, const VectorRhsExpr &x)
index_type iGetNumRows() const
MaxSizeCheck< N_offset!=DYNAMIC_SIZE >::CheckType check_iOffset
index_type iGetNumRows() const
vector_deriv_type dGetDerivativeLocalVector(index_type iLocalVecDof) const
MatrixExpression(const Expr &u)
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
static const index_type iInitNumCols
vector_deriv_type dGetDerivativeLocalVector(index_type iLocalVecDof) const
index_type iGetEndIndexLocalVector() const
Matrix & operator+=(const MatrixExpression< Expression, N_rows, N_cols > &A)
static const index_type iNumRows
static const index_type iNumRows
VectorExpression< SliceVector< T, N_cols, 1 >, N_cols > RowVectorType
Expression::ExpressionType ExpressionType
ScalarType & operator()(index_type iRow, index_type iCol)
VectorExpression< VectorExprRhs, N_rows >::ScalarType ScalarTypeRhs
VectorData(const VectorData &oData)
void Copy(const Vector< T2, N_rows > &v, LocalDofMap *pDofMap)
index_type iGetNumRows() const
index_type iGetEndIndexLocal() const
static index_type iGetMaxDerivatives()
MaxSizeCheck< iRowEnd<=MatrixExpr::iNumRows >::CheckType check_iRowEnd;typedef typename MaxSizeCheck< iColStart >=1 >::CheckType check_iColStart
static const bool bVectorize
bool bHaveReferenceTo(const void *p) const
MatrixExpr::ScalarType ScalarType
VectorVectorVectorBinaryExpr(const VectorLhsExpr &u, const VectorRhsExpr &v)
ColumnVectorType GetCol(index_type iCol) const
VectorData(index_type N, bool)
static void Eval(T &b, const U &a)
Gradient< N_SIZE > ScalarType
ScalarBinaryExpressionTraits< FuncMult, ScalarType, ScalarExprLhs, ScalarExprRhs >::ExpressionType MultExpressionType
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
Matrix< T, 2, 2 > Inv(const Matrix< T, 2, 2 > &A)
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
void Reset(scalar_func_type &d)
VectorRhsExpr::ExpressionType ExpressionTypeRhs
index_type iGetNumRows() const
MatrixExpr::ExpressionType ExpressionType
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
void Initialize(Matrix< T, 3, 3 > &A) const
static const index_type iNumRows
ScalarBinaryExpressionTraits< FuncMult, ScalarType, ScalarExprLhs, ScalarExprRhs >::ExpressionType ExpressionType
VectorExpression< SubVectorExpr< iStartIndex, iEndIndex, VectorDirectExpr< Vector< T, N_rows > > >, iEndIndex-iStartIndex+1 > SubVector(const Vector< T, N_rows > &v)
BasicScalarType< ScalarExpr >::ScalarType ScalarType
const ScalarType *const pVec
VectorDirectExpr(const VectorType &u)
void Resize(index_type iRows, index_type iCols)
const ScalarType & operator()(index_type iRow) const
index_type iGetNumRows() const
VectorExpression< ColumnVectorExpr< MatrixScalarMatrixBinaryExpr >, iNumRows > ColumnVectorType
ColumnVectorType GetCol(index_type iCol) const
Vector & operator*=(const T_Rhs &g)
MatrixType::RowVectorType RowVectorType
static const bool bVectorize
const ScalarType & operator()(index_type iRow) const
scalar_func_type ScalarType
RowVectorType GetRow(index_type iRow) const
IndexCheck< VectorLhsExpr::iNumRows-3 >::CheckType check_iNumRowsLhs
MatrixExpr::ScalarType ScalarType
void Initialize(Matrix< T, 3, 3 > &RDelta) const
T & operator[](index_type i)
index_type iGetNumRows() const
scalar_func_type dGetValue() const
ExpressionType operator()(index_type i, index_type j) const
ScalarType operator()(index_type i) const
static const index_type iInitNumRows
VectorData(const VectorData< U, N_rows > &oData)
VectorExpression< VectorExprLhs, N_rows >::ExpressionType ScalarExprLhs
ScalarTypeTraits< T >::DirectExpressionType ExpressionType
GenericUnaryExpression< ScalarUnaryFunction, T, ScalarExpr > ExpressionType
VectorData< T, DYNAMIC_SIZE > rgData
VectorExpression< VectorExpressionType, N_rows >::ExpressionType ExpressionType
index_type iGetNumRows() const
static void Eval(T &b, const U &a)
Vector(const T &v1, const T &v2, const T &v3)
SumTraits< VectorExpressionType, N_rows, N_index-1 > SumTraitsN_minus_1
MaxSizeCheck< iNumRows!=DYNAMIC_SIZE >::CheckType check_iNumRows
integer iGetNumCols(void) const
ScalarTypeTraits< T >::DirectExpressionType ExpressionType
#define VECTOR_DEFINE_UNARY_FUNCTION(ExpressionName, FunctionName, FunctionClass)
void Copy(scalar_func_type &d1, const scalar_func_type &d2, LocalDofMap *)
VectorExpression(const ScalarType *pArray, index_type iRows, index_type iOffset)
MatrixLhsExpr::ScalarType MatrixLhsScalarExpr
ScalarTypeTraits< doublereal >::ScalarType ScalarType
static const index_type iNumCols
VectorExpression< RowVectorExpr< MatrixMatrixMatrixBinaryExpr >, iNumCols > RowVectorType
VectorExpression< SliceVector< doublereal, iNumCols, iNumRows >, iNumCols > RowVectorType
ExpressionType operator()(index_type i) const
BasicScalarType< ScalarRhsExpr >::ScalarType ScalarTypeRhs
scalar_deriv_type dGetDerivativeLocal(index_type iLocalDof) const
ScalarTypeTraits< doublereal >::DirectExpressionType ExpressionType
MaxSizeCheck< iNumRows!=DYNAMIC_SIZE >::CheckType check_iNumRows
index_type iGetNumCols() const
MatrixData(index_type iNumRows, index_type iNumCols, bool bZeroInit)
index_type iGetNumRows() const
const ScalarType * pGetFirstElem() const
const ScalarType & operator()(index_type i, index_type j) const
MatGInit(const VectorExpression< VectorExpr, 3 > &g)
integer iGetNumCols(void) const
const ScalarType *const pVec
ScalarTypeTraits< T >::ScalarType ScalarType
DotTraits< VectorExprLhs, VectorExprRhs, N_rows, N_rows >::ExpressionType Dot(const VectorExpression< VectorExprLhs, N_rows > &u, const VectorExpression< VectorExprRhs, N_rows > &v)
CommonScalarType< typename BasicScalarType< MatrixLhsScalarExpr >::ScalarType, typename BasicScalarType< VectorRhsScalarExpr >::ScalarType >::ScalarType ScalarType
static void Eval(T &b, const U &a)
static const index_type iNumCols
ScalarType ExpressionType
const ScalarType * pGetLastElem() const
index_type iGetNumRows() const
ColumnVectorType GetCol(index_type iCol) const
index_type iGetEndIndexLocal() const
index_type iGetNumCols() const
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
ScalarBinFunc::ExpressionType ExpressionType
ColumnVectorExpr(const MatrixExpr &A, index_type iCol)
MatrixData(index_type iNumRows, index_type iNumCols, bool bZeroInit)
MatrixRhsExpr::ScalarType MatrixRhsScalarExpr
CrossTraits< VectorLhsExpr, VectorRhsExpr >::ExprMult ExprMult
index_type iGetNumRows() const
VectorExpression< VectorCrossExpr< VectorLhsExpr, VectorRhsExpr >, 3 > Cross(const VectorExpression< VectorLhsExpr, 3 > &u, const VectorExpression< VectorRhsExpr, 3 > &v)
index_type iGetNumRows() const
static const index_type iNumRows
MatrixExpr::ExpressionType ExpressionType
MatrixVectorProduct(const MatrixLhsExpr &A, const VectorRhsExpr &x)
MatrixInit(const InitArg1 &v1, const InitArg2 &a2)
ScalarUnaryExpressionTraits< ScalarUnaryFunction, ScalarType, ScalarExpr >::ExpressionType ExpressionType
static const index_type iNumRows
index_type iGetNumRows() const
static ExpressionType f(const ScalarExpr &u)
index_type iGetNumCols() const
const ScalarType & operator()(index_type iRow, index_type iCol) const
Vector(const T &v1, const T &v2)
MatrixType::ExpressionType ExpressionType
scalar_func_type dGetValue() const
IndexCheck< iNumRows-Expression::iNumRows >::CheckType check_iNumRows
ScalarType & operator()(index_type iRow)
VectorExpression< SubVectorExpr< iColStart, iColEnd, typename MatrixExpr::RowVectorType >, iNumCols > RowVectorType
VectorData< ScalarType, N_rows > rgVec
IndexCheck< iNumRows-VectorLhsExpr::iNumRows >::CheckType check_VectorLhsExpr
Gradient< N_SIZE > ScalarType
VectorInit< VecRotInit< T, MatrixDirectExpr< Matrix< T, 3, 3 > > >, T, 3 > VecRotMat(const Matrix< T, 3, 3 > &R)
VectorExpression< VectorExprLhs, N_rows >::ScalarType ScalarTypeLhs
#define VECTOR_SCALAR_DEFINE_BINARY_FUNCTION(ExpressionName, FunctionName, FunctionClass)
static bool bHaveReferenceTo(const GradientExpression< Expression > &g, const PointerType *pFirst, const PointerType *pLast)
VectorExpression< RowVectorExpr< MatrixScalarMatrixBinaryExpr >, iNumCols > RowVectorType
static const index_type iNumCols
index_type iGetNumRows() const
MatCrossInit(const VectorExpression< VectorExpr, 3 > &v, doublereal d)
VectorExpression< SliceVector< T, N_rows, N_cols >, N_rows > ColumnVectorType
static const index_type iNumCols
Matrix & operator/=(const GradientExpression< ScalarExpression > &a)
ScalarBinFunc::ExpressionType ExpressionType
static const index_type iNumRows
static index_type iGetMaxDerivatives()
Vector(const Vector< T2, N_rows > &v)
index_type iGetNumRows() const
static const index_type iNumRows
Vector(const VectorInit< InitClass, T, N_rows > &func)
VectorExpression< VectorExpr, N_rows >::ScalarType Norm(const VectorExpression< VectorExpr, N_rows > &u)
RowVectorType GetRow(index_type iRow) const
CommonScalarType< ScalarTypeLhs, ScalarTypeRhs >::ScalarType ScalarType
const index_type iCurrRows
Vector & operator+=(const Vec3 &v)
Matrix & operator*=(const GradientExpression< ScalarExpression > &a)
const ScalarType & operator()(index_type i, index_type j) const
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
RowVectorExpr(const MatrixExpr &A, index_type iRow)
ScalarBinaryExpressionTraits< FuncPlus, ScalarType, ExpressionTypeN_minus_1, ScalarExpressionType >::ExpressionType ExpressionType
ScalarTypeTraits< T >::ScalarType ScalarType
RowVectorType GetRow(index_type iRow) const
ScalarTypeTraits< T >::ScalarType ScalarType
SubMatrixExpr(const MatrixExpr &A)
GradientExpression< DirectExpr< Gradient< N_SIZE >, true > > Alias(const Gradient< N_SIZE > &g)
index_type iGetNumCols() const
ScalarTypeTraits< T >::DirectExpressionType ExpressionType
index_type iGetNumCols() const
VectorExpression< VectorExprRhs, N_rows >::ExpressionType ScalarExprRhs
static const index_type iNumCols
VectorRhsExpr::ScalarType VectorRhsScalarExpr
const doublereal * pGetMat(void) const
static ExpressionType Sum(const VectorExpression< VectorExpressionType, N_rows > &v)
const ScalarType & operator()(index_type iRow) const
index_type iGetNumRows() const
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
IndexCheck< MatrixLhsExpr::iNumCols-MatrixRhsExpr::iNumCols >::CheckType check_iNumCols
const T & operator[](integer i) const
static const index_type iNumCols
ScalarTypeTraits< T >::DirectExpressionType ExpressionType
VectorExpression< VectorExprRhs, N_rows >::ExpressionType ScalarExprRhs
IndexCheck< iNumRows-Expression::iNumRows >::CheckType check_iNumRows
ScalarTypeTraits< T >::DirectExpressionType ExpressionType
SliceVector(const ScalarType *p, index_type iRows, index_type iOffset)
VectorExpression< VectorExprRhs, N_rows >::ScalarType ScalarTypeRhs
VectorData< T, DYNAMIC_SIZE > rgData
#define VECTOR_VECTOR_DEFINE_BINARY_FUNCTION(ExpressionName, FunctionName, FunctionClass)
VectorExpression< VectorExprLhs, N_rows >::ExpressionType ScalarExprLhs
index_type iGetNumRows() const
Gradient< N_SIZE > ScalarType
const ScalarType & operator()(index_type i, index_type j) const
MatrixLhsExpr::RowVectorType MatrixLhsRowVector
const doublereal * pGetVec(void) const
CommonScalarType< ScalarTypeLhs, ScalarTypeRhs >::ScalarType ScalarType
index_type iGetNumCols() const
ScalarUnaryFunc::ScalarType ScalarType
Expression::ExpressionType ExpressionType
const VectorExpression< VectorExpr, 3 > g
const T * pGetFirstElem() const
ColumnVectorType GetCol(index_type iCol) const
ScalarTypeTraits< T >::ScalarType ScalarType
VectorExpression< ColumnVectorExpr< MatrixMatrixMatrixBinaryExpr >, iNumRows > ColumnVectorType
SliceVector(const ScalarType *p, index_type iRows, index_type iOffset)
GradientExpression< UnaryExpr< FuncAcos, Expr > > acos(const GradientExpression< Expr > &u)
TabularMatrixView< T, N_rows, N_cols > Tabular(const Matrix< T, N_rows, N_cols > &A, int iColWidth=10)
ScalarTypeTraits< doublereal >::DirectExpressionType ExpressionType
T & operator()(index_type i, index_type j)
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
const T * pGetLastElem() const
static const index_type iNumCols
MaxSizeCheck< VectorExpr::iNumRows!=DYNAMIC_SIZE >::CheckType check_iStaticSize
VectorExpression< RowVectorExpr< MatrixMatrixUnaryExpr >, iNumCols > RowVectorType
const T & operator[](integer i) const
GradientExpression< UnaryExpr< ScalarUnaryFunction, DirectExpr< Gradient< N_SIZE > > > > ExpressionType
MatrixExpr::ExpressionType ExpressionType
static ExpressionType Dot(const VectorExpression< VectorExprLhs, N_rows > &u, const VectorExpression< VectorExprRhs, N_rows > &v)
ExpressionType operator()(index_type i) const
MatrixType::ColumnVectorType ColumnVectorType
SumTraits< VectorExpressionType, N_rows, N_rows >::ExpressionType Sum(const VectorExpression< VectorExpressionType, N_rows > &v)
index_type iGetNumRows() const
index_type iGetNumCols() const
index_type iGetNumCols() const
static const index_type iMaxDerivatives
index_type iGetNumCols() const
VectorExpression< VectorExprLhs, N_rows >::ScalarType ScalarTypeLhs
GradientExpression< UnaryExpr< FuncCos, Expr > > cos(const GradientExpression< Expr > &u)
MatrixExpr::ColumnVectorType RowVectorType
VecRotInit(const MatrixExpression< MatrixExpr, 3, 3 > &R)
Vector & operator/=(const GradientExpression< ScalarExpression > &f)
DotTraits< MatrixLhsRowVector, MatrixRhsColumnVector, MatrixLhsExpr::iNumCols, MatrixLhsExpr::iNumCols >::ExpressionType ExpressionType
static const doublereal a
static const index_type iNumRows
const T * pGetFirstElem() const
MatrixInit< MatCrossCrossInit< T, VectorDirectExpr< Vector< T, 3 > > >, T, 3, 3 > MatCrossCrossVec(const Vector< T, 3 > &v)
VectorLhsExpr::ScalarType ScalarTypeLhs
Matrix & operator-=(const MatrixExpression< Expression, N_rows, N_cols > &A)
GradientExpression< BinaryExpr< ScalarBinaryFunction, DirectExpr< Gradient< N_SIZE > >, DirectExpr< Gradient< N_SIZE > > > > ExpressionType
Vector(const Vector< T2, N_rows > &v, LocalDofMap *pDofMap)
index_type iGetNumRows() const
Matrix(const T &A11, const T &A21, const T &A12, const T &A22)
doublereal scalar_func_type
GradientExpression< UnaryExpr< ScalarUnaryFunction, ScalarExpr > > ExpressionType
IndexCheck< MatrixLhsExpr::iNumRows-MatrixRhsExpr::iNumRows >::CheckType check_iNumRows
index_type iGetNumRows() const
index_type iGetNumCols() const
void ApplyMatrixFunc(const VectorExpression< Expression, N_rows > &A)
static bool bHaveReferenceTo(const Expression &, const PointerType *, const PointerType *)
T & operator[](index_type i)
void Convert(scalar_func_type &d, const Gradient< N_SIZE > &g)
GradientExpression< BinaryExpr< FuncAtan2, LhsExpr, RhsExpr > > atan2(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
GradientExpression< BinaryExpr< ScalarBinaryFunction, DirectExpr< Gradient< N_SIZE > >, ConstExpr< Gradient< N_SIZE > > > > ExpressionType
GradientExpression< BinaryExpr< ScalarBinaryFunction, ScalarLhsExpr, ConstExpr< Gradient< N_SIZE > > > > ExpressionType
index_type iGetNumCols() const
const T * pGetLastElem() const
ScalarTypeTraits< T >::ScalarType ScalarType
MatrixExpression(const LhsExpr &u, const RhsExpr &v)
Matrix & operator*=(const T_Rhs &a)
index_type iGetNumCols() const
static const index_type iNumRows
MatrixInit< MatCrossInit< T, VectorDirectExpr< Vector< T, 3 > > >, T, 3, 3 > MatCrossVec(const Vector< T, 3 > &v, doublereal d=0.)
void ZeroInit(T *first, T *last)
LocalDofMap * pGetDofMap() const
const VectorExpression< VectorExpr, 3 > v
#define MATRIX_DEFINE_UNARY_FUNCTION(ExpressionName, FunctionName, FunctionClass)
VectorExpression< SliceVector< doublereal, iNumRows, 1 >, iNumRows > ColumnVectorType
GradientExpression< BinaryExpr< ScalarBinaryFunction, ConstExpr< Gradient< N_SIZE > >, ScalarRhsExpr > > ExpressionType
ScalarTypeTraits< doublereal >::DirectExpressionType ExpressionType
CrossTraits< VectorLhsExpr, VectorRhsExpr >::ExpressionType ExpressionType
TabularMatrixView(const Matrix< T, N_rows, N_cols > &A, int iColWidth)
ColumnVectorType GetCol(index_type iCol) const
ScalarTypeTraits< doublereal >::ScalarType ScalarType
MatrixType::ScalarType ScalarType
const Matrix< T, N_rows, N_cols > & A
void Resize(index_type iNumRows)
static void ApplyMatrixFunc(MatrixType &A, const Expression &B, const Func &f)
void ApplyMatrixFuncNoAlias(const MatrixExpression< Expression, N_rows, N_cols > &A, const Func &)
VectorType::ExpressionType ExpressionType
ExpressionType operator()(index_type i) const
ScalarUnaryFunc::ScalarType ScalarType
static const index_type iNumRows
static const index_type iNumRows
IndexCheck< iNumCols-Expression::iNumCols >::CheckType check_iNumCols
CommonScalarType< typename BasicScalarType< MatrixLhsScalarExpr >::ScalarType, typename BasicScalarType< MatrixRhsScalarExpr >::ScalarType >::ScalarType ScalarType
VectorRhsExpr::ScalarType VectorRhsScalarExpr
MatrixMatrixProduct(const MatrixLhsExpr &A, const MatrixRhsExpr &B)
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
MatrixData(index_type iNumRows, index_type iNumCols, bool bZeroInit)
VectorExpression< SubVectorExpr< iRowStart, iRowEnd, typename MatrixExpr::ColumnVectorType >, iNumRows > ColumnVectorType
void array_fill(T *first, T *const last, const T &val)
VectorType::ScalarType ScalarType
void ZeroInit< double >(double *first, double *last)
IndexCheck< N_cols-MatrixLhsExpr::iNumCols >::CheckType check_iNumColsLhs
SliceVector(const ScalarType *p, index_type iRows, index_type iOffset)
index_type iGetNumRows() const
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
ExpressionType operator()(index_type i) const
GradientExpression< BinaryExpr< ScalarBinaryFunction, ConstExpr< Gradient< N_SIZE > >, DirectExpr< Gradient< N_SIZE > > > > ExpressionType
Vector & operator/=(const T_Rhs &g)
Vector(const Vector &oVec)
MatrixMatrixMatrixBinaryExpr(const MatrixLhsExpr &u, const MatrixRhsExpr &v)
Matrix & operator-=(const Matrix< T_Rhs, N_rows, N_cols > &A)
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
static const index_type iNumRows
MatCrossCrossInit(const VectorExpression< VectorExpr, 3 > &v)
ExpressionType operator()(index_type i, index_type j) const
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
GenericBinaryExpression< ScalarBinaryFunction, T, ScalarLhsExpr, ScalarRhsExpr > ExpressionType
VectorExpression< VectorExpressionType, N_rows >::ExpressionType ScalarExpressionType
bool bHaveReferenceTo(const ScalarType2 *pFirst, const ScalarType2 *pLast) const
void ZeroInit< float >(float *first, float *last)
GradientExpression< DirectExpr< Gradient< N_SIZE > > > DirectExpressionType
VectorExpression< VectorExpressionType, N_rows >::ScalarType ScalarType
const T * pGetLastElem() const
VectorScalarVectorBinaryExpr(const VectorLhsExpr &u, const ScalarRhsExpr &v)
MatrixInit(const InitArg &v)
Vector & operator+=(const Vector< T_Rhs, N_rows > &v)
MatrixExpr::ScalarType ScalarType
const T * pGetLastElem() const
index_type iGetNumRows() const
Vec3DirectExpr(const Vec3 &u)
static const index_type iNumRows
const VectorExpression< VectorExpr, 3 > v
ScalarBinFunc::ScalarType ScalarType