| 612 | //- Return the inverse of a tensor given the determinant |
| 613 | template<class Cmpt> |
| 614 | inline Tensor<Cmpt> inv(const Tensor<Cmpt>& t, const Cmpt dett) |
| 615 | { |
| 616 | return Tensor<Cmpt> |
| 617 | ( |
| 618 | t.yy()*t.zz() - t.zy()*t.yz(), |
| 619 | t.xz()*t.zy() - t.xy()*t.zz(), |
| 620 | t.xy()*t.yz() - t.xz()*t.yy(), |
| 621 | |
| 622 | t.zx()*t.yz() - t.yx()*t.zz(), |
| 623 | t.xx()*t.zz() - t.xz()*t.zx(), |
| 624 | t.yx()*t.xz() - t.xx()*t.yz(), |
| 625 | |
| 626 | t.yx()*t.zy() - t.yy()*t.zx(), |
| 627 | t.xy()*t.zx() - t.xx()*t.zy(), |
| 628 | t.xx()*t.yy() - t.yx()*t.xy() |
| 629 | )/dett; |
| 630 | } |
| 631 | |
| 632 | |
| 633 | //- Return the inverse of a tensor |