New analysis tool to compute the free volume and total volume.
[alexxy/gromacs.git] / src / gromacs / legacyheaders / vec.h
index fd86b8c942c3b878ced68e03fbc534e2d96012aa..85d887754cc05723d91169b1631fa44a256d4dcb 100644 (file)
 #include "physics.h"
 
 #ifdef __cplusplus
+
+static gmx_inline real det(const matrix a)
+{
+    return ( a[XX][XX]*(a[YY][YY]*a[ZZ][ZZ]-a[ZZ][YY]*a[YY][ZZ])
+             -a[YY][XX]*(a[XX][YY]*a[ZZ][ZZ]-a[ZZ][YY]*a[XX][ZZ])
+             +a[ZZ][XX]*(a[XX][YY]*a[YY][ZZ]-a[YY][YY]*a[XX][ZZ]));
+}
+
+static gmx_inline void mvmul(const matrix a, const rvec src, rvec dest)
+{
+    dest[XX] = a[XX][XX]*src[XX]+a[XX][YY]*src[YY]+a[XX][ZZ]*src[ZZ];
+    dest[YY] = a[YY][XX]*src[XX]+a[YY][YY]*src[YY]+a[YY][ZZ]*src[ZZ];
+    dest[ZZ] = a[ZZ][XX]*src[XX]+a[ZZ][YY]*src[YY]+a[ZZ][ZZ]*src[ZZ];
+}
+
 extern "C" {
 #elif 0
 } /* avoid screwing up indentation */
@@ -709,6 +724,7 @@ static gmx_inline real det(matrix a)
              +a[ZZ][XX]*(a[XX][YY]*a[YY][ZZ]-a[YY][YY]*a[XX][ZZ]));
 }
 
+
 static gmx_inline void m_add(matrix a, matrix b, matrix dest)
 {
     dest[XX][XX] = a[XX][XX]+b[XX][XX];
@@ -801,6 +817,7 @@ static gmx_inline void mvmul(matrix a, const rvec src, rvec dest)
     dest[ZZ] = a[ZZ][XX]*src[XX]+a[ZZ][YY]*src[YY]+a[ZZ][ZZ]*src[ZZ];
 }
 
+
 static gmx_inline void mvmul_ur0(matrix a, const rvec src, rvec dest)
 {
     dest[ZZ] = a[ZZ][XX]*src[XX]+a[ZZ][YY]*src[YY]+a[ZZ][ZZ]*src[ZZ];