     return ret;
   }
 
-  __device__ T dot(TVector &other) const {
+  TC_FORCE_INLINE __host__ __device__ T dot(TVector &other) const {
     T ret = 0;
     for (int i = 0; i < dim; i++) {
       ret += d[i] * other[i];
+    }
+    return ret;
+  }
+
+  TC_FORCE_INLINE T __host__ __device__ __host__ prod() {
+    T ret = d[0];
+    for (int i = 1; i < dim; i++) {
+      ret *= d[i];
+    }
+    return ret;
+  }
+
+  TC_FORCE_INLINE T __device__ __host__ sum() {
+    T ret = d[0];
+    for (int i = 1; i < dim; i++) {
+      ret += d[i];
     }
     return ret;
   }


  T d[dim];

  TC_FORCE_INLINE __device__ TVector(T *val) {
    for (int i = 0; i < dim; i++) {
      d[i] = val[i];
    }

    return ret;
  }

  TC_FORCE_INLINE __host__ __device__ TVector operator-(const TVector &o) {
    TVector ret;
    for (int i = 0; i < dim; i++) {
      ret[i] = d[i] - o[i];
