26 #include "libmesh/type_tensor.h" 40 const bool newline)
const 44 out_stream << std::setiosflags(std::ios::showpoint)
45 << (*this)(0,0) <<
" " 46 << (*
this)(0,1) <<
" " 47 << (*
this)(0,2) <<
" ";
51 out_stream << std::setiosflags(std::ios::showpoint)
52 << (*this)(1,0) <<
" " 53 << (*
this)(1,1) <<
" " 54 << (*
this)(1,2) <<
" ";
58 out_stream << std::setiosflags(std::ios::showpoint)
59 << (*this)(2,0) <<
" " 60 << (*
this)(2,1) <<
" " 61 << (*
this)(2,2) <<
" ";
71 const auto & A = *
this;
74 auto A_norm = A.norm();
82 auto abs_tol = rel_tol * A_norm;
86 for (
unsigned int i=0; i<LIBMESH_DIM; i++)
87 for (
unsigned int j=0; j<LIBMESH_DIM; j++)
91 if ((A - A_conjugate_transpose).
norm() > abs_tol)
109 if (
std::real(A(0,0)*A(1,1) - A(0,1)*A(1,0)) < -abs_tol)
126 for (
unsigned int i=0; i<LIBMESH_DIM; i++)
127 for (
unsigned int j=0; j<LIBMESH_DIM; j++)
129 if ((*
this)(i,j) < rhs(i,j))
131 if ((*
this)(i,j) > rhs(i,j))
142 for (
unsigned int i=0; i<LIBMESH_DIM; i++)
143 for (
unsigned int j=0; j<LIBMESH_DIM; j++)
145 if ((*
this)(i,j) > rhs(i,j))
147 if ((*
this)(i,j) < rhs(i,j))
155 #ifdef LIBMESH_USE_COMPLEX_NUMBERS 159 for (
unsigned int i=0; i<LIBMESH_DIM; i++)
160 for (
unsigned int j=0; j<LIBMESH_DIM; j++)
162 if ((*
this)(i,j).
real() < rhs(i,j).
real())
164 if ((*
this)(i,j).
real() > rhs(i,j).
real())
166 if ((*
this)(i,j).
imag() < rhs(i,j).
imag())
168 if ((*
this)(i,j).
imag() > rhs(i,j).
imag())
179 for (
unsigned int i=0; i<LIBMESH_DIM; i++)
180 for (
unsigned int j=0; j<LIBMESH_DIM; j++)
182 if ((*
this)(i,j).
real() > rhs(i,j).
real())
184 if ((*
this)(i,j).
real() < rhs(i,j).
real())
186 if ((*
this)(i,j).
imag() > rhs(i,j).
imag())
188 if ((*
this)(i,j).
imag() < rhs(i,j).
imag())
204 #ifdef LIBMESH_USE_COMPLEX_NUMBERS bool is_hpd(Real rel_tol=TOLERANCE *TOLERANCE) const
Returns true if the TypeTensor is Hermitian (or symmetric, when T==Real) and positive-definite to wit...
boost::multiprecision::float128 real(const boost::multiprecision::float128 in)
bool operator<(const TypeTensor< T > &rhs) const
The libMesh namespace provides an interface to certain functionality in the library.
This class defines a tensor in LIBMESH_DIM dimensional space of type T.
void write_unformatted(std::ostream &out_stream, const bool newline=true) const
Unformatted print to the stream out.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
boost::multiprecision::float128 imag(const boost::multiprecision::float128)
bool operator>(const TypeTensor< T > &rhs) const