PLaSK library
|
Non-diagonal tensor with all non-diagonal lateral projection. More...
#include <plask/vector/tensor3.hpp>
Public Member Functions | |
T & | tran () |
const T & | lon () const |
T & | lon () |
const T & | tran () const |
T & | vert () |
const T & | vert () const |
Tensor3 () | |
Construct uninitialized Tensor. | |
template<typename OtherT > | |
Tensor3 (const Tensor3< OtherT > &p) | |
Copy constructor from all other 3d tensors. | |
Tensor3 (const T &val) | |
Construct isotropic tensor. | |
Tensor3 (const T &c00, const T &c22) | |
Construct tensor with given diagonal values. | |
Tensor3 (const T &c00, const T &c11, const T &c22) | |
Construct tensors with given diagonal values. | |
Tensor3 (const T &c00, const T &c11, const T &c22, const T &c01) | |
Construct tensors with given lateral Hermitian values. | |
Tensor3 (const T &c00, const T &c11, const T &c22, const T &c01, const T &c10) | |
Construct tensors with given lateral values. | |
Tensor3 (const T &c00, const T &c11, const T &c22, const T &c01, const T &c02, const T &c12) | |
Construct tensors with given Hermitian values. | |
Tensor3 (const T &c00, const T &c11, const T &c22, const T &c01, const T &c10, const T &c02, const T &c20, const T &c12, const T &c21) | |
Construct tensors with given all values. | |
template<typename T0 , typename T1 > | |
Tensor3 (const std::pair< T0, T1 > &comp) | |
Construct tensor components given in std::pair. | |
Tensor3 (const Tensor2< T > &tens) | |
Construct tensor from 2D tensor. | |
Tensor3 (const Vec< 2, T > &vec) | |
Construct tensor from 2D vector. | |
Tensor3 (const Vec< 3, T > &vec) | |
Construct tensor from 3D vector. | |
Tensor3 (const T *data) | |
Construct tensor from data. | |
T & | operator[] (size_t i) |
Get i-th component WARNING This function does not check if it is valid (for efficiency reasons) | |
const T & | operator[] (size_t i) const |
Get i-th component WARNING This function does not check if it is valid (for efficiency reasons) | |
T & | operator() (size_t i, size_t j) |
Get ij component WARNING This function does not check if it is valid (for efficiency reasons) | |
const T & | operator() (size_t i, size_t j) const |
Get ij component WARNING This function does not check if it is valid (for efficiency reasons) | |
operator std::tuple< T, T, T, T, T, T, T, T, T > () const | |
Convert to std::tuple. | |
template<typename OtherT > | |
bool | operator== (const Tensor3< OtherT > &p) const |
Compare two tensors, this and p . | |
template<typename OtherT > | |
constexpr bool | equals (const Tensor3< OtherT > &p) const |
Check if two tensors, this and p are almost equal. | |
template<typename OtherT > | |
bool | operator!= (const Tensor3< OtherT > &p) const |
Compare two tensors, this and p . | |
template<typename OtherT > | |
auto | operator+ (const Tensor3< OtherT > &other) const -> Tensor3< decltype(c00+other.c00)> |
Calculate sum of two tensors, this and other . | |
Tensor3< T > & | operator+= (const Tensor3< T > &other) |
Increase coordinates of this tensor by coordinates of other tensor other . | |
template<typename OtherT > | |
auto | operator- (const Tensor3< OtherT > &other) const -> Tensor3< decltype(c00 - other.c00)> |
Calculate difference of two tensors, this and other . | |
Tensor3< T > & | operator-= (const Tensor3< T > &other) |
Decrease coordinates of this tensor by coordinates of other tensor other . | |
template<typename OtherT > | |
auto | operator* (const OtherT scale) const -> Tensor3< decltype(c00 *scale)> |
Calculate this tensor multiplied by scalar scale . | |
Tensor3< T > & | operator*= (const T scalar) |
Multiple coordinates of this tensor by scalar . | |
Tensor3< T > | operator/ (const T scale) const |
Calculate this tensor divided by scalar scale . | |
Tensor3< T > & | operator/= (const T scalar) |
Divide coordinates of this tensor by scalar . | |
Tensor3< T > | operator- () const |
Calculate tensor opposite to this. | |
Tensor3< T > | sqr () const |
Square each component of tensor. | |
Tensor3< T > | pow (int n) const |
Power of tensor. | |
Tensor3< T > | inv () const |
Inverse of the tensor https://www.wikihow.com/Find-the-Inverse-of-a-3x3-Matrix. | |
Public Attributes | |
T | c00 |
Value of the tensor in LONG direction. | |
T | c01 |
Non-diagonal component LONG-TRAN. | |
T | c02 |
Non-diagonal component LONG-VERT. | |
T | c10 |
Non-diagonal component TRAN-LONG. | |
T | c11 |
Value of the tensor in TRAN direction. | |
T | c12 |
Non-diagonal component TRAN-VERT. | |
T | c20 |
Non-diagonal component VERT-LONG. | |
T | c21 |
Non-diagonal component VERT-TRAN. | |
T | c22 |
Value of the tensor in VERT direction. | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Tensor3< T > &to_print) |
Print tensor to stream using format (where c00 and c11 are tensor components): [c00, c11]. | |
Non-diagonal tensor with all non-diagonal lateral projection.
[ c00 c01 c02 ] [ c10 c11 c12 ] [ c20 c21 c22 ]
Definition at line 36 of file tensor3.hpp.
|
inline |
Construct uninitialized Tensor.
Definition at line 59 of file tensor3.hpp.
|
inline |
Copy constructor from all other 3d tensors.
p | tensor to copy from |
Definition at line 66 of file tensor3.hpp.
|
inline |
|
inline |
Construct tensor with given diagonal values.
c00,c22 | components |
Definition at line 79 of file tensor3.hpp.
|
inline |
Construct tensors with given diagonal values.
c00,c11,c22 | components |
Definition at line 85 of file tensor3.hpp.
|
inline |
Construct tensors with given lateral Hermitian values.
c00,c11,c22,c01 | components |
Definition at line 92 of file tensor3.hpp.
|
inline |
Construct tensors with given lateral values.
c00,c11,c22,c01,c10 | components |
Definition at line 99 of file tensor3.hpp.
|
inline |
Construct tensors with given Hermitian values.
c00,c11,c22,c01 | components |
Definition at line 106 of file tensor3.hpp.
|
inline |
Construct tensors with given all values.
c00,c11,c22,c01,c02,c12 | components |
Definition at line 113 of file tensor3.hpp.
|
inline |
Construct tensor components given in std::pair.
comp | components |
Definition at line 129 of file tensor3.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineconstexpr |
Check if two tensors, this and p
are almost equal.
p | tensors to compare |
true
only if this tensors and p
have almost equals coordinates Definition at line 228 of file tensor3.hpp.
|
inline |
Inverse of the tensor https://www.wikihow.com/Find-the-Inverse-of-a-3x3-Matrix.
Definition at line 424 of file tensor3.hpp.
|
inline |
Definition at line 52 of file tensor3.hpp.
|
inline |
Definition at line 50 of file tensor3.hpp.
|
inline |
Convert to std::tuple.
Definition at line 211 of file tensor3.hpp.
|
inline |
Compare two tensors, this and p
.
p | tensor to compare |
p
don't have equals coordinates Definition at line 238 of file tensor3.hpp.
|
inline |
Get ij component WARNING This function does not check if it is valid (for efficiency reasons)
i,j | coordinates |
Definition at line 194 of file tensor3.hpp.
|
inline |
Get ij component WARNING This function does not check if it is valid (for efficiency reasons)
i,j | coordinates |
Definition at line 205 of file tensor3.hpp.
|
inline |
Calculate this tensor multiplied by scalar scale
.
scale | scalar |
Definition at line 307 of file tensor3.hpp.
|
inline |
Multiple coordinates of this tensor by scalar
.
scalar | scalar |
Definition at line 317 of file tensor3.hpp.
|
inline |
Calculate sum of two tensors, this
and other
.
other | tensor to add, can have different data type (than result type will be found using C++ types promotions rules) |
Definition at line 248 of file tensor3.hpp.
|
inline |
Increase coordinates of this tensor by coordinates of other tensor other
.
other | tensor to add |
Definition at line 259 of file tensor3.hpp.
|
inline |
Calculate tensor opposite to this.
Definition at line 362 of file tensor3.hpp.
|
inline |
Calculate difference of two tensors, this
and other
.
other | tensor to subtract from this, can have different data type (than result type will be found using C++ types promotions rules) |
Definition at line 278 of file tensor3.hpp.
|
inline |
Decrease coordinates of this tensor by coordinates of other tensor other
.
other | tensor to subtract |
Definition at line 289 of file tensor3.hpp.
|
inline |
Calculate this tensor divided by scalar scale
.
scale | scalar |
Definition at line 335 of file tensor3.hpp.
|
inline |
Divide coordinates of this tensor by scalar
.
scalar | scalar |
Definition at line 345 of file tensor3.hpp.
|
inline |
Compare two tensors, this and p
.
p | tensor to compare |
p
have equals coordinates Definition at line 218 of file tensor3.hpp.
|
inline |
Get i-th component WARNING This function does not check if it is valid (for efficiency reasons)
i | number of coordinate |
Definition at line 172 of file tensor3.hpp.
|
inline |
Get i-th component WARNING This function does not check if it is valid (for efficiency reasons)
i | number of coordinate |
Definition at line 183 of file tensor3.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 49 of file tensor3.hpp.
|
inline |
Definition at line 53 of file tensor3.hpp.
|
inline |
Definition at line 55 of file tensor3.hpp.
|
inline |
Definition at line 56 of file tensor3.hpp.
|
friend |
Print tensor to stream using format (where c00 and c11 are tensor components): [c00, c11].
out | print destination, output stream |
to_print | tensor to print |
Definition at line 441 of file tensor3.hpp.
T plask::Tensor3< T >::c00 |
Value of the tensor in LONG direction.
Definition at line 38 of file tensor3.hpp.
T plask::Tensor3< T >::c01 |
Non-diagonal component LONG-TRAN.
Definition at line 39 of file tensor3.hpp.
T plask::Tensor3< T >::c02 |
Non-diagonal component LONG-VERT.
Definition at line 40 of file tensor3.hpp.
T plask::Tensor3< T >::c10 |
Non-diagonal component TRAN-LONG.
Definition at line 41 of file tensor3.hpp.
T plask::Tensor3< T >::c11 |
Value of the tensor in TRAN direction.
Definition at line 42 of file tensor3.hpp.
T plask::Tensor3< T >::c12 |
Non-diagonal component TRAN-VERT.
Definition at line 43 of file tensor3.hpp.
T plask::Tensor3< T >::c20 |
Non-diagonal component VERT-LONG.
Definition at line 44 of file tensor3.hpp.
T plask::Tensor3< T >::c21 |
Non-diagonal component VERT-TRAN.
Definition at line 45 of file tensor3.hpp.
T plask::Tensor3< T >::c22 |
Value of the tensor in VERT direction.
Definition at line 46 of file tensor3.hpp.