Fix missing parentheses in previous commit

--- include/geometry/accurate_intersections.hpp
+++ include/geometry/accurate_intersections.hpp
@@ -379,362 +379,347 @@
           return fptype(-1.0);
         }
       }
-      /* Now use the central difference and the sides being
-       * used for the roots to determine the case we're
-       * solving
-       */
-      bool centralDiffNeg =
-          MathFuncs::MathFuncs<mpfr::mpreal>::signbit(
-              centralDiff);
-      bool intNeg = MathFuncs::MathFuncs<fptype>::signbit(
-          intPos - otherIntPos);
-      bool otherIntNeg =
-          MathFuncs::MathFuncs<fptype>::signbit(
-              i.intPos - i.otherIntPos);
-      if(centralDiffNeg != (intNeg && otherIntNeg)) {
-        /* This case is obvious with a picture */
-        if(centralDiffNeg) {
-          return fptype(-1.0);
-        } else {
-          return fptype(1.0);
-        }
-      }
-      const mpfr::mpreal resultant = resultantDet(i);
-      if(mpfr::iszero(resultant)) {
-        return fptype(0.0);
-      }
-      bool resultantNeg =
-          MathFuncs::MathFuncs<mpfr::mpreal>::signbit(
-              resultant);
-
-      return fptype(NAN);
-    }
-
-    fptype accurateCompare(
-        const IntersectionBase<dim, fptype, true> &i)
-        const {
-      /* Keep track of the number of precision increases
-       * required for statistics
-       */
-      numIP++;
-      /* First determine which root is more likely */
-      if(getDiscriminant() > i.getDiscriminant()) {
-        return -i.accurateCompare(*this);
-      }
-      if(getDiscriminant() == i.getDiscriminant()) {
-        return accurateCompare_EqualDiscs(i);
-      }
-      if(mpfr::iszero(getDiscriminant())) {
-        if(mpfr::iszero(i.getDiscriminant())) {
-          return accurateCompare_TwoRepeated(i);
-        } else {
-          return accurateCompare_OneRepeated(i);
-        }
-      }
-      if(isUndetermined(intPos, i.otherIntPos) ||
-         isUndetermined(otherIntPos, i.intPos) ||
-         isUndetermined(otherIntPos, i.otherIntPos)) {
-        accurateCompare_Multi(i);
+    }
+    /* Now use the central difference and the sides being
+     * used for the roots to determine the case we're
+     * solving
+     */
+    bool centralDiffNeg =
+        MathFuncs::MathFuncs<mpfr::mpreal>::signbit(
+            centralDiff);
+    bool intNeg = MathFuncs::MathFuncs<fptype>::signbit(
+        intPos - otherIntPos);
+    bool otherIntNeg =
+        MathFuncs::MathFuncs<fptype>::signbit(
+            i.intPos - i.otherIntPos);
+    if(centralDiffNeg != (intNeg && otherIntNeg)) {
+      /* This case is obvious with a picture */
+      if(centralDiffNeg) {
+        return fptype(-1.0);
       } else {
-        return accurateCompare_One(i);
-      }
-      return fptype(NAN);
-    }
-
-    fptype compare(
-        const IntersectionBase<dim, fptype, true> &i)
-        const {
-      fptype delta = intPos - i.intPos;
-      if(MathFuncs::MathFuncs<fptype>::fabs(delta) <
-             absErrMargin &&
-         i.q != q &&
-         !MathFuncs::MathFuncs<fptype>::isnan(
-             otherIntPos) &&
-         !MathFuncs::MathFuncs<fptype>::isnan(
-             i.otherIntPos)) {
-        fptype cmp = accurateCompare(i);
-        if(cmp == 0.0)
-          return delta;
-        else
-          return cmp;
-      } else
+        return fptype(1.0);
+      }
+    }
+    const mpfr::mpreal resultant = resultantDet(i);
+    if(mpfr::iszero(resultant)) {
+      return fptype(0.0);
+    }
+    bool resultantNeg =
+        MathFuncs::MathFuncs<mpfr::mpreal>::signbit(
+            resultant);
+
+    return fptype(NAN);
+  }
+
+  fptype accurateCompare(
+      const IntersectionBase<dim, fptype, true> &i) const {
+    /* Keep track of the number of precision increases
+     * required for statistics
+     */
+    numIP++;
+    /* First determine which root is more likely */
+    if(getDiscriminant() > i.getDiscriminant()) {
+      return -i.accurateCompare(*this);
+    }
+    if(getDiscriminant() == i.getDiscriminant()) {
+      return accurateCompare_EqualDiscs(i);
+    }
+    if(mpfr::iszero(getDiscriminant())) {
+      if(mpfr::iszero(i.getDiscriminant())) {
+        return accurateCompare_TwoRepeated(i);
+      } else {
+        return accurateCompare_OneRepeated(i);
+      }
+    }
+    if(isUndetermined(intPos, i.otherIntPos) ||
+       isUndetermined(otherIntPos, i.intPos) ||
+       isUndetermined(otherIntPos, i.otherIntPos)) {
+      accurateCompare_Multi(i);
+    } else {
+      return accurateCompare_One(i);
+    }
+    return fptype(NAN);
+  }
+
+  fptype compare(
+      const IntersectionBase<dim, fptype, true> &i) const {
+    fptype delta = intPos - i.intPos;
+    if(MathFuncs::MathFuncs<fptype>::fabs(delta) <
+           absErrMargin &&
+       i.q != q &&
+       !MathFuncs::MathFuncs<fptype>::isnan(otherIntPos) &&
+       !MathFuncs::MathFuncs<fptype>::isnan(
+           i.otherIntPos)) {
+      fptype cmp = accurateCompare(i);
+      if(cmp == 0.0)
         return delta;
-    }
-
-    int incPrecCount() const { return numIP; }
-
-    static bool cmp(
-        const IntersectionBase<dim, fptype, true> &lhs,
-        const IntersectionBase<dim, fptype, true> &rhs) {
-      fptype diff = lhs.compare(rhs);
-      if(diff < 0) return true;
-      return false;
-    }
+      else
+        return cmp;
+    } else
+      return delta;
+  }
+
+  int incPrecCount() const { return numIP; }
+
+  static bool cmp(
+      const IntersectionBase<dim, fptype, true> &lhs,
+      const IntersectionBase<dim, fptype, true> &rhs) {
+    fptype diff = lhs.compare(rhs);
+    if(diff < 0) return true;
+    return false;
+  }
+};
+
+template <int dim, typename fptype>
+class IntersectionBase<dim, fptype, false> {
+ public:
+  Quadric<dim, fptype> q;
+  Line<dim, fptype> l;
+  fptype intPos, otherIntPos;
+  fptype absErrMargin;
+  mutable int numIP;
+
+  IntersectionBase() {}
+
+  IntersectionBase(const Quadric<dim, fptype> &quad,
+                   const Line<dim, fptype> &line,
+                   fptype intPos = NAN,
+                   fptype otherIntPos = NAN,
+                   fptype absErrMargin = defAbsPrecision)
+      : q(quad),
+        l(line),
+        intPos(intPos),
+        otherIntPos(otherIntPos),
+        absErrMargin(absErrMargin),
+        numIP(0) {}
+
+  IntersectionBase(
+      const IntersectionBase<dim, fptype, false> &i)
+      : q(i.q),
+        l(i.l),
+        intPos(i.intPos),
+        otherIntPos(i.otherIntPos),
+        absErrMargin(i.absErrMargin),
+        numIP(i.numIP) {}
+
+  IntersectionBase<dim, fptype, false> operator=(
+      const IntersectionBase<dim, fptype, false> &i) {
+    q = i.q;
+    l = i.l;
+    intPos = i.intPos;
+    otherIntPos = i.otherIntPos;
+    absErrMargin = i.absErrMargin;
+    numIP = i.numIP;
+    return *this;
+  }
+
+  fptype compare(
+      const IntersectionBase<dim, fptype, false> &i) const {
+    numIP++;
+    fptype delta = intPos - i.intPos;
+    return delta;
+  }
+
+  int incPrecCount() const { return numIP; }
+
+  static bool cmp(
+      const IntersectionBase<dim, fptype, false> &lhs,
+      const IntersectionBase<dim, fptype, false> &rhs) {
+    fptype diff = lhs.compare(rhs);
+    if(diff < 0) return true;
+    return false;
+  }
+};
+
+template <int dim, typename fptype>
+class Intersection
+    : public IntersectionBase<
+          dim, fptype,
+          !std::is_same<fptype, mpfr::mpreal>::value> {
+ public:
+  struct IntersectionData {
+    typename Quadric<dim, fptype>::QuadricData quad;
+    typename Line<dim, fptype>::LineData line;
+    fptype intPos;
+    fptype otherIntPos;
+    fptype absErrMargin;
   };
-
-  template <int dim, typename fptype>
-  class IntersectionBase<dim, fptype, false> {
-   public:
-    Quadric<dim, fptype> q;
-    Line<dim, fptype> l;
-    fptype intPos, otherIntPos;
-    fptype absErrMargin;
-    mutable int numIP;
-
-    IntersectionBase() {}
-
-    IntersectionBase(const Quadric<dim, fptype> &quad,
-                     const Line<dim, fptype> &line,
-                     fptype intPos = NAN,
-                     fptype otherIntPos = NAN,
-                     fptype absErrMargin = defAbsPrecision)
-        : q(quad),
-          l(line),
-          intPos(intPos),
-          otherIntPos(otherIntPos),
-          absErrMargin(absErrMargin),
-          numIP(0) {}
-
-    IntersectionBase(
-        const IntersectionBase<dim, fptype, false> &i)
-        : q(i.q),
-          l(i.l),
-          intPos(i.intPos),
-          otherIntPos(i.otherIntPos),
-          absErrMargin(i.absErrMargin),
-          numIP(i.numIP) {}
-
-    IntersectionBase<dim, fptype, false> operator=(
-        const IntersectionBase<dim, fptype, false> &i) {
-      q = i.q;
-      l = i.l;
-      intPos = i.intPos;
-      otherIntPos = i.otherIntPos;
-      absErrMargin = i.absErrMargin;
-      numIP = i.numIP;
-      return *this;
-    }
-
-    fptype compare(const IntersectionBase<dim, fptype,
-                                          false> &i) const {
-      numIP++;
-      fptype delta = intPos - i.intPos;
-      return delta;
-    }
-
-    int incPrecCount() const { return numIP; }
-
-    static bool cmp(
-        const IntersectionBase<dim, fptype, false> &lhs,
-        const IntersectionBase<dim, fptype, false> &rhs) {
-      fptype diff = lhs.compare(rhs);
-      if(diff < 0) return true;
-      return false;
-    }
-  };
-
-  template <int dim, typename fptype>
-  class Intersection
-      : public IntersectionBase<
+  Intersection()
+      : IntersectionBase<
             dim, fptype,
-            !std::is_same<fptype, mpfr::mpreal>::value> {
-   public:
-    struct IntersectionData {
-      typename Quadric<dim, fptype>::QuadricData quad;
-      typename Line<dim, fptype>::LineData line;
-      fptype intPos;
-      fptype otherIntPos;
-      fptype absErrMargin;
-    };
-    Intersection()
-        : IntersectionBase<
-              dim, fptype,
-              !std::is_same<fptype,
-                            mpfr::mpreal>::value>() {}
-
-    Intersection(const Quadric<dim, fptype> &quad,
-                 const Line<dim, fptype> &line,
-                 fptype intPos = NAN,
-                 fptype otherIntPos = NAN,
-                 fptype absErrMargin = defAbsPrecision)
-        : IntersectionBase<
-              dim, fptype,
-              !std::is_same<fptype, mpfr::mpreal>::value>(
-              quad, line, intPos, otherIntPos,
-              absErrMargin) {}
-
-    Intersection(
-        const IntersectionBase<
+            !std::is_same<fptype, mpfr::mpreal>::value>() {}
+
+  Intersection(const Quadric<dim, fptype> &quad,
+               const Line<dim, fptype> &line,
+               fptype intPos = NAN,
+               fptype otherIntPos = NAN,
+               fptype absErrMargin = defAbsPrecision)
+      : IntersectionBase<
             dim, fptype,
-            !std::is_same<fptype, mpfr::mpreal>::value> &i)
-        : IntersectionBase<
-              dim, fptype,
-              !std::is_same<fptype, mpfr::mpreal>::value>(
-              i) {}
-
-    Intersection(const Intersection<dim, fptype> &i)
-        : IntersectionBase<
-              dim, fptype,
-              !std::is_same<fptype, mpfr::mpreal>::value>(
-              static_cast<IntersectionBase<
-                  dim, fptype,
-                  !std::is_same<fptype,
-                                mpfr::mpreal>::value>>(i)) {
-    }
+            !std::is_same<fptype, mpfr::mpreal>::value>(
+            quad, line, intPos, otherIntPos, absErrMargin) {
+  }
+
+  Intersection(
+      const IntersectionBase<
+          dim, fptype,
+          !std::is_same<fptype, mpfr::mpreal>::value> &i)
+      : IntersectionBase<
+            dim, fptype,
+            !std::is_same<fptype, mpfr::mpreal>::value>(i) {
+  }
+
+  Intersection(const Intersection<dim, fptype> &i)
+      : IntersectionBase<
+            dim, fptype,
+            !std::is_same<fptype, mpfr::mpreal>::value>(
+            static_cast<IntersectionBase<
+                dim, fptype,
+                !std::is_same<fptype,
+                              mpfr::mpreal>::value>>(i)) {}

 #ifdef __CUDACC__
-    std::shared_ptr<IntersectionData> cudaCopy() const {
-      IntersectionData *cudaMem = NULL;
-      cudaError_t err =
-          cudaMalloc(&cudaMem, sizeof(*cudaMem));
-      auto safeMem = std::shared_ptr<IntersectionData>(
-          cudaMem, cudaFree);
-      err = cudaCopy(cudaMem);
-      return safeMem;
-    }
-
-    cudaError_t cudaCopy(
-        std::shared_ptr<IntersectionData> cudaMem) const {
-      cudaError_t err = cudaMemcpy(
-          &cudaMem->intPos, &this->intPos,
-          sizeof(this->intPos), cudaMemcpyHostToDevice);
-      err = cudaMemcpy(&cudaMem->otherIntPos,
-                       &this->otherIntPos,
-                       sizeof(this->otherIntPos),
-                       cudaMemcpyHostToDevice);
-      err = cudaMemcpy(&cudaMem->absErrMargin,
-                       &this->otherIntPos,
-                       sizeof(this->absErrMargin),
-                       cudaMemcpyHostToDevice);
-      err = this->q.cudaCopy(&cudaMem->quad);
-      err = this->l.cudaCopy(&cudaMem->line);
-      return err;
-    }
-
-    cudaError_t cudaCopy(IntersectionData *cudaMem) const {
-      cudaError_t err = cudaMemcpy(
-          &cudaMem->intPos, &this->intPos,
-          sizeof(this->intPos), cudaMemcpyHostToDevice);
-      err = cudaMemcpy(&cudaMem->otherIntPos,
-                       &this->otherIntPos,
-                       sizeof(this->otherIntPos),
-                       cudaMemcpyHostToDevice);
-      err = cudaMemcpy(&cudaMem->absErrMargin,
-                       &this->absErrMargin,
-                       sizeof(this->absErrMargin),
-                       cudaMemcpyHostToDevice);
-      err = this->q.cudaCopy(&cudaMem->quad);
-      err = this->l.cudaCopy(&cudaMem->line);
-      return err;
-    }
-
-    cudaError_t cudaRetrieve(
-        std::shared_ptr<IntersectionData> cudaMem) {
-      cudaError_t err = cudaMemcpy(
-          &this->intPos, &cudaMem->intPos,
-          sizeof(this->intPos), cudaMemcpyDeviceToHost);
-      err = cudaMemcpy(&this->otherIntPos,
-                       &cudaMem->otherIntPos,
-                       sizeof(this->otherIntPos),
-                       cudaMemcpyDeviceToHost);
-      err = cudaMemcpy(&this->absErrMargin,
-                       &cudaMem->absErrMargin,
-                       sizeof(this->absErrMargin),
-                       cudaMemcpyDeviceToHost);
-      err = this->q.cudaRetrieve(&cudaMem->quad);
-      err = this->l.cudaRetrieve(&cudaMem->line);
-      return err;
-    }
-
-    cudaError_t cudaRetrieve(IntersectionData *cudaMem) {
-      cudaError_t err = cudaMemcpy(
-          &this->intPos, &cudaMem->intPos,
-          sizeof(this->intPos), cudaMemcpyDeviceToHost);
-      err = cudaMemcpy(&this->otherIntPos,
-                       &cudaMem->otherIntPos,
-                       sizeof(this->otherIntPos),
-                       cudaMemcpyDeviceToHost);
-      err = cudaMemcpy(&this->absErrMargin,
-                       &cudaMem->absErrMargin,
-                       sizeof(this->absErrMargin),
-                       cudaMemcpyDeviceToHost);
-      err = this->q.cudaRetrieve(&cudaMem->quad);
-      err = this->l.cudaRetrieve(&cudaMem->line);
-      return err;
-    }
+  std::shared_ptr<IntersectionData> cudaCopy() const {
+    IntersectionData *cudaMem = NULL;
+    cudaError_t err =
+        cudaMalloc(&cudaMem, sizeof(*cudaMem));
+    auto safeMem = std::shared_ptr<IntersectionData>(
+        cudaMem, cudaFree);
+    err = cudaCopy(cudaMem);
+    return safeMem;
+  }
+
+  cudaError_t cudaCopy(
+      std::shared_ptr<IntersectionData> cudaMem) const {
+    cudaError_t err = cudaMemcpy(
+        &cudaMem->intPos, &this->intPos,
+        sizeof(this->intPos), cudaMemcpyHostToDevice);
+    err = cudaMemcpy(
+        &cudaMem->otherIntPos, &this->otherIntPos,
+        sizeof(this->otherIntPos), cudaMemcpyHostToDevice);
+    err = cudaMemcpy(
+        &cudaMem->absErrMargin, &this->otherIntPos,
+        sizeof(this->absErrMargin), cudaMemcpyHostToDevice);
+    err = this->q.cudaCopy(&cudaMem->quad);
+    err = this->l.cudaCopy(&cudaMem->line);
+    return err;
+  }
+
+  cudaError_t cudaCopy(IntersectionData *cudaMem) const {
+    cudaError_t err = cudaMemcpy(
+        &cudaMem->intPos, &this->intPos,
+        sizeof(this->intPos), cudaMemcpyHostToDevice);
+    err = cudaMemcpy(
+        &cudaMem->otherIntPos, &this->otherIntPos,
+        sizeof(this->otherIntPos), cudaMemcpyHostToDevice);
+    err = cudaMemcpy(
+        &cudaMem->absErrMargin, &this->absErrMargin,
+        sizeof(this->absErrMargin), cudaMemcpyHostToDevice);
+    err = this->q.cudaCopy(&cudaMem->quad);
+    err = this->l.cudaCopy(&cudaMem->line);
+    return err;
+  }
+
+  cudaError_t cudaRetrieve(
+      std::shared_ptr<IntersectionData> cudaMem) {
+    cudaError_t err = cudaMemcpy(
+        &this->intPos, &cudaMem->intPos,
+        sizeof(this->intPos), cudaMemcpyDeviceToHost);
+    err = cudaMemcpy(
+        &this->otherIntPos, &cudaMem->otherIntPos,
+        sizeof(this->otherIntPos), cudaMemcpyDeviceToHost);
+    err = cudaMemcpy(
+        &this->absErrMargin, &cudaMem->absErrMargin,
+        sizeof(this->absErrMargin), cudaMemcpyDeviceToHost);
+    err = this->q.cudaRetrieve(&cudaMem->quad);
+    err = this->l.cudaRetrieve(&cudaMem->line);
+    return err;
+  }
+
+  cudaError_t cudaRetrieve(IntersectionData *cudaMem) {
+    cudaError_t err = cudaMemcpy(
+        &this->intPos, &cudaMem->intPos,
+        sizeof(this->intPos), cudaMemcpyDeviceToHost);
+    err = cudaMemcpy(
+        &this->otherIntPos, &cudaMem->otherIntPos,
+        sizeof(this->otherIntPos), cudaMemcpyDeviceToHost);
+    err = cudaMemcpy(
+        &this->absErrMargin, &cudaMem->absErrMargin,
+        sizeof(this->absErrMargin), cudaMemcpyDeviceToHost);
+    err = this->q.cudaRetrieve(&cudaMem->quad);
+    err = this->l.cudaRetrieve(&cudaMem->line);
+    return err;
+  }
 #endif

-    friend std::ostream &operator<<(
-        std::ostream &os,
-        const Intersection<dim, fptype> &i) {
-      os << i.q << "\n" << i.l << "\n(" << i.intPos << ", "
-         << i.otherIntPos << ")";
-      return os;
-    }
-
-   private:
-    static constexpr const bool isMPFR =
-        std::is_same<fptype, mpfr::mpreal>::value;
-  };
-
-  template <typename Iter>
-  void quicksortInt(Iter start, Iter end) {
-    const auto pivot = *start;
-    Iter bot = start, top = end;
-    bool prevPivot = false;
-    /* First rearrange the elements [start, end)
-     * into lesser and greater parts, [start, p), [p+1, end)
-     */
-    for(; bot != top;) {
-      if(!prevPivot)
-        bot++;
-      else
-        top--;
-      prevPivot = !prevPivot;
-      for(; pivot.compare(*bot) < 0.0 && bot != top;
-          bot++) {
-      }
-      for(; pivot.compare(*top) > 0.0 && bot != top;
-          top--) {
-      }
-      if(bot == top) break;
-      std::iter_swap(bot, top);
-    }
-    if(bot != end) {
-      /* Now rearrange the part larger than the pivot */
-      quicksortInt(bot, end);
-    }
-    /* Put the pivot into the correct place,
-     * and then rearrange the part smaller than the pivot */
-    bot--;
-    std::iter_swap(start, bot);
-    if(start != bot) quicksortInt(start, bot);
-  }
-
-  template <int dim, typename fptype>
-  std::shared_ptr<std::list<Intersection<dim, fptype>>>
-  sortIntersections(const Line<dim, fptype> &line,
-                    std::list<Quadric<dim, fptype>> &quads,
-                    fptype absErrMargin = defAbsPrecision) {
-    using IP = Intersection<dim, fptype>;
-    std::shared_ptr<std::list<IP>> inter(new std::list<IP>);
-    for(auto q : quads) {
-      auto intPos = q.calcLineDistToIntersect(line);
-      for(int k = 0; k < 2; k++) {
-        if(!MathFuncs::MathFuncs<fptype>::isnan(
-               intPos[k])) {
-          Intersection<dim, fptype> i(q, line, intPos[k],
-                                      intPos[1 - k],
-                                      absErrMargin);
-          inter->push_back(i);
-        }
-      }
-    }
-    inter->sort([](IP &lhs, IP &rhs) {
-      return lhs.compare(rhs) < 0.0;
-    });
-    /* TODO: Fix this */
-    // quicksortInt(inter->begin(), inter->end());
-    return inter;
-  }
+  friend std::ostream &operator<<(
+      std::ostream &os,
+      const Intersection<dim, fptype> &i) {
+    os << i.q << "\n" << i.l << "\n(" << i.intPos << ", "
+       << i.otherIntPos << ")";
+    return os;
+  }
+
+ private:
+  static constexpr const bool isMPFR =
+      std::is_same<fptype, mpfr::mpreal>::value;
+};
+
+template <typename Iter>
+void quicksortInt(Iter start, Iter end) {
+  const auto pivot = *start;
+  Iter bot = start, top = end;
+  bool prevPivot = false;
+  /* First rearrange the elements [start, end)
+   * into lesser and greater parts, [start, p), [p+1, end)
+   */
+  for(; bot != top;) {
+    if(!prevPivot)
+      bot++;
+    else
+      top--;
+    prevPivot = !prevPivot;
+    for(; pivot.compare(*bot) < 0.0 && bot != top; bot++) {
+    }
+    for(; pivot.compare(*top) > 0.0 && bot != top; top--) {
+    }
+    if(bot == top) break;
+    std::iter_swap(bot, top);
+  }
+  if(bot != end) {
+    /* Now rearrange the part larger than the pivot */
+    quicksortInt(bot, end);
+  }
+  /* Put the pivot into the correct place,
+   * and then rearrange the part smaller than the pivot */
+  bot--;
+  std::iter_swap(start, bot);
+  if(start != bot) quicksortInt(start, bot);
 }
+
+template <int dim, typename fptype>
+std::shared_ptr<std::list<Intersection<dim, fptype>>>
+sortIntersections(const Line<dim, fptype> &line,
+                  std::list<Quadric<dim, fptype>> &quads,
+                  fptype absErrMargin = defAbsPrecision) {
+  using IP = Intersection<dim, fptype>;
+  std::shared_ptr<std::list<IP>> inter(new std::list<IP>);
+  for(auto q : quads) {
+    auto intPos = q.calcLineDistToIntersect(line);
+    for(int k = 0; k < 2; k++) {
+      if(!MathFuncs::MathFuncs<fptype>::isnan(intPos[k])) {
+        Intersection<dim, fptype> i(q, line, intPos[k],
+                                    intPos[1 - k],
+                                    absErrMargin);
+        inter->push_back(i);
+      }
+    }
+  }
+  inter->sort([](IP &lhs, IP &rhs) {
+    return lhs.compare(rhs) < 0.0;
+  });
+  /* TODO: Fix this */
+  // quicksortInt(inter->begin(), inter->end());
+  return inter;
+}
+}


UI: sinfex.cc: work around bison & flex disagreeing on nullptr vs 0 for YY_NULL

--- ui/sinfex.cc
+++ ui/sinfex.cc
@@ -396,6 +396,7 @@
 #include "sinfex.ygen"
 #undef  yylval
 #undef  yylloc
+#undef  YY_NULL // work around bison & flex disagreeing on nullptr vs 0

 /* flex generated lexer */
 #include "sinfex.lgen"


Get bp cpp version to work.

Get bp cpp version to work.

--- examples/bp/ref/app.cpp
+++ examples/bp/ref/app.cpp
@@ -23,7 +23,7 @@
  *  SOFTWARE.
  */

-//#include <cmath>
+#include <cmath>
 #include <unistd.h> // for getopt
 #include "common.hpp"

@@ -37,17 +37,18 @@
 class Application
 {
   static const int SEED = 1;
-  static const CL_FP ERROR = 0.0001f;
+  static constexpr CL_FP ERROR = 0.0001f;

 public:

-  Application( int n_in, int n_hidden, int n_out )
-  {
-    BPNN *net = new BPNN( cfg->size, BLOCK_SIZE, 1 ); // ( 16, 1 can not be changed )
+  Application(size_t size, cl_uint device, cl_uint platform, vector<const char*> kernel_names)
+    : input_n(size), hidden_n(BLOCK_SIZE), output_n(1)
+    , cec_(platform, device, "Kernels.cl", kernel_names)
+    , context_(cec_.get_context())
+    , queue_(cec_.get_queue())
+    , kernels_(cec_.get_kernels())
+  {
     srandom(SEED);
-    input_n        = n_in;
-    hidden_n       = n_hidden;
-    output_n       = n_out;
     input_units    = alloc_1d( input_n + 1 );
     input_weights  = alloc_2d( input_n + 1, hidden_n + 1 );
     input_changes  = alloc_2d( input_n + 1, hidden_n + 1 );
@@ -90,16 +91,16 @@
   CL_FP* alloc_1d( int n ) throw ( string )
   {
     CL_FP *new_t = (CL_FP*) malloc( n * sizeof(CL_FP) );
-    if ( NULL == new_t ) throw string( "BPNN::alloc_1d: couldn't allocate FPs" );
+    if ( nullptr == new_t ) throw string( "BPNN::alloc_1d: couldn't allocate FPs" );
     return new_t;
   }

   CL_FP** alloc_2d( int m, int n ) throw ( string )
   {
     CL_FP **new_t = (CL_FP**) malloc( m * sizeof(CL_FP*) );
-    if ( NULL == new_t ) throw string( "BPNN::alloc_2d: couldn't allocate ptrs" );
+    if ( nullptr == new_t ) throw string( "BPNN::alloc_2d: couldn't allocate ptrs" );
     new_t[0] = (CL_FP*) malloc( m * n * sizeof(CL_FP) );
-    if ( NULL == new_t[0] ) throw string( "BPNN::alloc_2d: couldn't allocate FPs" );
+    if ( nullptr == new_t[0] ) throw string( "BPNN::alloc_2d: couldn't allocate FPs" );
     for ( int ii = 1; ii < m; ++ii ) new_t[ii] = new_t[0] + ii * n;
     return new_t;
   }
@@ -209,28 +210,29 @@
   bool train_kernel(CL_FP *eo, CL_FP *eh)
   {
     bool valid = true;
-    cl_mem d_input_units   = cl->createBuffer( CL_MEM_READ_WRITE, ( input_n + 1 )                    * sizeof(CL_FP), NULL );
-    cl_mem d_input_weights = cl->createBuffer( CL_MEM_READ_WRITE, ( input_n + 1 ) * ( hidden_n + 1 ) * sizeof(CL_FP), NULL );
-    cl_mem d_partial_sum   = cl->createBuffer( CL_MEM_READ_WRITE, input_n                            * sizeof(CL_FP), NULL );
-    cl->enqueueWriteBuffer( d_input_units  , CL_TRUE, 0, ( input_n + 1 )                    * sizeof(CL_FP), input_units     , 0, NULL, NULL );
-    cl->enqueueWriteBuffer( d_input_weights, CL_TRUE, 0, ( input_n + 1 ) * ( hidden_n + 1 ) * sizeof(CL_FP), input_weights[0], 0, NULL, NULL );
-    cl->setKernelArg( 0, 0, sizeof(cl_mem)                     , &d_input_units   );
-    cl->setKernelArg( 0, 1, sizeof(cl_mem)                     , &d_input_weights );
-    cl->setKernelArg( 0, 2, sizeof(cl_mem)                     , &d_partial_sum   );
-    cl->setKernelArg( 0, 3, sizeof(CL_FP) * hidden_n           , NULL             );
-    cl->setKernelArg( 0, 4, sizeof(CL_FP) * hidden_n * hidden_n, NULL             );
-    cl->setKernelArg( 0, 5, sizeof(int)                        , &hidden_n        );
+    cl_int status;
+    cl_mem d_input_units   = clCreateBuffer(context_, CL_MEM_READ_WRITE, ( input_n + 1 )                    * sizeof(CL_FP), nullptr, &status);
+    cl_mem d_input_weights = clCreateBuffer(context_, CL_MEM_READ_WRITE, ( input_n + 1 ) * ( hidden_n + 1 ) * sizeof(CL_FP), nullptr, &status);
+    cl_mem d_partial_sum   = clCreateBuffer(context_, CL_MEM_READ_WRITE, input_n                            * sizeof(CL_FP), nullptr, &status);
+    status = clEnqueueWriteBuffer(queue_, d_input_units  , CL_TRUE, 0, ( input_n + 1 )                    * sizeof(CL_FP), input_units     , 0, nullptr, nullptr);
+    status = clEnqueueWriteBuffer(queue_, d_input_weights, CL_TRUE, 0, ( input_n + 1 ) * ( hidden_n + 1 ) * sizeof(CL_FP), input_weights[0], 0, nullptr, nullptr);
+    clSetKernelArg( kernels_[0], 0, sizeof(cl_mem)                     , &d_input_units   );
+    clSetKernelArg( kernels_[0], 1, sizeof(cl_mem)                     , &d_input_weights );
+    clSetKernelArg( kernels_[0], 2, sizeof(cl_mem)                     , &d_partial_sum   );
+    clSetKernelArg( kernels_[0], 3, sizeof(CL_FP) * hidden_n           , nullptr          );
+    clSetKernelArg( kernels_[0], 4, sizeof(CL_FP) * hidden_n * hidden_n, nullptr          );
+    clSetKernelArg( kernels_[0], 5, sizeof(int)                        , &hidden_n        );
     size_t global_work[] = { hidden_n, input_n };
     size_t local_work[]  = { hidden_n, hidden_n };
-    cl->enqueueNDRangeKernel( 0, 2, NULL, global_work, local_work, 0, NULL, NULL );
-    cl->enqueueReadBuffer( d_partial_sum, CL_TRUE, 0, input_n * sizeof(CL_FP), partial_sum, 0, NULL, NULL );
+    status = clEnqueueNDRangeKernel(queue_, kernels_[0], 2, nullptr, global_work, local_work, 0, nullptr, nullptr);
+    status = clEnqueueReadBuffer(queue_, d_partial_sum, CL_TRUE, 0, input_n * sizeof(CL_FP), partial_sum, 0, nullptr, nullptr);
     for ( size_t j = 1; j <= hidden_n; ++j )
     {
       CL_FP sum = input_weights[0][j];
       for ( size_t k = 0; k < num_blocks; ++k ) sum += partial_sum[k * hidden_n + j - 1];
       hidden_units[j] = ONEF / ( ONEF + exp( -sum ) );
     }
-    cl->releaseMemObject( d_partial_sum );
+    clReleaseMemObject( d_partial_sum );
     layerforward( hidden_units, output_units, hidden_weights, hidden_n, output_n );
     output_error( eo );
     hidden_error( eh );
@@ -242,15 +244,15 @@
     layerforward( hidden_units, output_units, hidden_weights, hidden_n, output_n );
     output_error( &h_eo );
     hidden_error( &h_eh );
-    //    if ( fabs( h_eo - *eo ) > Config::ERROR || fabs( h_eh - *eh ) > Config::ERROR )
+    //if (fabs(h_eo - *eo) > ERROR || fabs(h_eh - *eh) > ERROR)
     if ( h_eo != *eo || h_eh != *eh )
     {
       printf( "%.12f %.12f\n%.12f %.12f\n", *eo, *eh, h_eo, h_eh );
       valid = false;
     }
     for ( size_t ii = 0; ii <= hidden_n; ++ii )
-      //      if ( fabs( backup_hidden_units[ii] - hidden_units[ii] ) > Config::ERROR )
-      if ( backup_hidden_units[ii] != hidden_units[ii] )
+      if (fabs(backup_hidden_units[ii] - hidden_units[ii]) > ERROR)
+        //if ( backup_hidden_units[ii] != hidden_units[ii] )
       {
         printf( "%2lu %.12f %.12f\n", ii, backup_hidden_units[ii], hidden_units[ii] );
         valid = false;
@@ -265,20 +267,20 @@
         backup_input_weights[i][j] = input_weights[i][j];
     // VALIDATION BLOCK END
     adjust_weights( output_deltas, output_n, hidden_units, hidden_n, hidden_weights, hidden_changes );
-    cl_mem d_hidden_deltas = cl->createBuffer( CL_MEM_READ_WRITE, ( hidden_n + 1 )                   * sizeof(CL_FP), NULL );
-    cl_mem d_input_changes = cl->createBuffer( CL_MEM_READ_WRITE, ( input_n + 1 ) * ( hidden_n + 1 ) * sizeof(CL_FP), NULL );
-    cl->enqueueWriteBuffer( d_hidden_deltas, CL_TRUE, 0, ( hidden_n + 1 )                   * sizeof(CL_FP), hidden_deltas   , 0, NULL, NULL );
-    cl->enqueueWriteBuffer( d_input_weights, CL_TRUE, 0, ( input_n + 1 ) * ( hidden_n + 1 ) * sizeof(CL_FP), input_weights[0], 0, NULL, NULL );
-    cl->enqueueWriteBuffer( d_input_changes, CL_TRUE, 0, ( input_n + 1 ) * ( hidden_n + 1 ) * sizeof(CL_FP), input_changes[0], 0, NULL, NULL );
-    cl->setKernelArg( 1, 0, sizeof(cl_mem), &d_hidden_deltas );
-    cl->setKernelArg( 1, 1, sizeof(cl_mem), &d_input_units );
-    cl->setKernelArg( 1, 2, sizeof(cl_mem), &d_input_weights );
-    cl->setKernelArg( 1, 3, sizeof(cl_mem), &d_input_changes );
-    cl->enqueueNDRangeKernel( 1, 2, NULL, global_work, NULL, 0, NULL, NULL );
-    cl->enqueueReadBuffer( d_input_weights, CL_TRUE, 0, ( input_n + 1 ) * ( hidden_n + 1 ) * sizeof(CL_FP), input_weights[0], 0, NULL, NULL );
-    cl->enqueueReadBuffer( d_input_changes, CL_TRUE, 0, ( input_n + 1 ) * ( hidden_n + 1 ) * sizeof(CL_FP), input_changes[0], 0, NULL, NULL );
+    cl_mem d_hidden_deltas = clCreateBuffer(context_, CL_MEM_READ_WRITE, ( hidden_n + 1 )                   * sizeof(CL_FP), nullptr, &status);
+    cl_mem d_input_changes = clCreateBuffer(context_, CL_MEM_READ_WRITE, ( input_n + 1 ) * ( hidden_n + 1 ) * sizeof(CL_FP), nullptr, &status);
+    status = clEnqueueWriteBuffer(queue_, d_hidden_deltas, CL_TRUE, 0, ( hidden_n + 1 )                   * sizeof(CL_FP), hidden_deltas   , 0, nullptr, nullptr);
+    status = clEnqueueWriteBuffer(queue_, d_input_weights, CL_TRUE, 0, ( input_n + 1 ) * ( hidden_n + 1 ) * sizeof(CL_FP), input_weights[0], 0, nullptr, nullptr);
+    status = clEnqueueWriteBuffer(queue_, d_input_changes, CL_TRUE, 0, ( input_n + 1 ) * ( hidden_n + 1 ) * sizeof(CL_FP), input_changes[0], 0, nullptr, nullptr);
+    clSetKernelArg( kernels_[1], 0, sizeof(cl_mem), &d_hidden_deltas);
+    clSetKernelArg( kernels_[1], 1, sizeof(cl_mem), &d_input_units);
+    clSetKernelArg( kernels_[1], 2, sizeof(cl_mem), &d_input_weights);
+    clSetKernelArg( kernels_[1], 3, sizeof(cl_mem), &d_input_changes);
+    status = clEnqueueNDRangeKernel(queue_, kernels_[1], 2, nullptr, global_work, nullptr, 0, nullptr, nullptr);
+    status = clEnqueueReadBuffer(queue_, d_input_weights, CL_TRUE, 0, ( input_n + 1 ) * ( hidden_n + 1 ) * sizeof(CL_FP), input_weights[0], 0, nullptr, nullptr);
+    status = clEnqueueReadBuffer(queue_, d_input_changes, CL_TRUE, 0, ( input_n + 1 ) * ( hidden_n + 1 ) * sizeof(CL_FP), input_changes[0], 0, nullptr, nullptr);
     // VALIDATION BLOCK START
-    adjust_weights( hidden_deltas, hidden_n, input_units, input_n, backup_input_weights, backup_input_changes );
+    adjust_weights(hidden_deltas, hidden_n, input_units, input_n, backup_input_weights, backup_input_changes);
     for ( size_t i = 1; i <= input_n; ++i )
       for ( size_t j = 1; j <= hidden_n; ++j )
         //        if ( fabs( backup_input_weights[i][j] - input_weights[i][j] ) > Config::ERROR )
@@ -293,10 +295,10 @@
     free( backup_input_weights );
     free( backup_input_changes );
     // VALIDATION BLOCK END
-    cl->releaseMemObject( d_input_units );
-    cl->releaseMemObject( d_input_weights );
-    cl->releaseMemObject( d_hidden_deltas );
-    cl->releaseMemObject( d_input_changes );
+    clReleaseMemObject( d_input_units );
+    clReleaseMemObject( d_input_weights );
+    clReleaseMemObject( d_hidden_deltas );
+    clReleaseMemObject( d_input_changes );
     return valid;
   }

@@ -328,10 +330,10 @@
   CL_FP *partial_sum;
   size_t num_blocks;

+  clop_examples_common cec_;
   cl_context context_;
   cl_command_queue queue_;
   vector<cl_kernel> kernels_;
-  clop_examples_common cec_;
 }; // Application class

 static void usage(char **argv)
@@ -366,7 +368,7 @@
   }
   if ((size = atoi(argv[0])) % BLOCK_SIZE != 0)
   {
-    fprintf(stderr, "bp: the size (%d) must be divisible by %d\n", size, BLOCK_SIZE);
+    fprintf(stderr, "bp: the size (%zu) must be divisible by %d\n", size, BLOCK_SIZE);
     exit(EXIT_FAILURE);
   }

@@ -378,7 +380,7 @@
   }
   catch (string msg)
   {
-    std::cerr, "bp: " << msg << std::endl;
+    std::cerr << "bp: " << msg << std::endl;
     return EXIT_FAILURE;
   }
   return EXIT_SUCCESS;


[SH2] simplified and improved PS2CameraSpeed

PS2CameraSpeed is no longer framerate dependent.
PS2CameraSpeed has been simplified to two value changes.

--- source/SilentHill2.WidescreenFix/dllmain.cpp
+++ source/SilentHill2.WidescreenFix/dllmain.cpp
@@ -460,30 +460,11 @@

     if (bPS2CameraSpeed)
     {
-        static float f15 = 1.5f; // new value 1.5; restores speed of tilting camera action
-        static float f009 = 0.09f; // new value 0.09; increases speed of all camera actions
-        static float f25 = 2.5f; // new value 2.5; restores speed of auto-panning camera action
-        static float f1 = 1.0f; // new value 1.00; reduces speed of auto-tilting camera action
-
-        pattern = hook::pattern("D8 0D ? ? ? ? 8B 6C 24 5C D9 5C 24 38 D9 43 04 D8 0D ? ? ? ? D9 5C 24 3C E8");
-        injector::WriteMemory(pattern.count(1).get(0).get<uint32_t>(2), &f15, true); //0051CF36
-
-        struct CameraHook
-        {
-            void operator()(injector::reg_pack&)
-            {
-                _asm fld dword ptr[f009]
-            }
-        }; injector::MakeInline<CameraHook>(pattern.count(1).get(0).get<uint32_t>(27)); //0051CF51
-
-        pattern = hook::pattern("D9 05 ? ? ? ? D8 C1 D9 1D ? ? ? ? DD D8 F6 47 08 01");
-        injector::WriteMemory(pattern.count(1).get(0).get<uint32_t>(2), &f25, true); //0051C38C
-
-        pattern = hook::pattern("D8 05 ? ? ? ? D9 1D ? ? ? ? D9 44 24 14 D8 4E 04 D8 0D");
-        injector::WriteMemory(pattern.count(1).get(0).get<uint32_t>(2), &f1, true); //0051C302
-
-        pattern = hook::pattern("74 ? D9 05 ? ? ? ? E8 ? ? ? ? 50 E8");
-        injector::WriteMemory<uint8_t>(pattern.count(1).get(0).get<uint32_t>(0), (uint8_t)0xEBi8, true); //0058C0E3
+        uint32_t* dword_51C262 = hook::pattern("BE ? ? ? ? EB 19 8B 15").count(1).get(0).get<uint32_t>(1);
+        injector::WriteMemory<float>(*dword_51C262 + 0x08, 4.0f, true); //006C94C0 indoor camera pan speed
+
+        uint32_t* dword_51C276 = hook::pattern("BE ? ? ? ? 74 05 BE ? ? ? ? D9 05").count(1).get(0).get<uint32_t>(1);
+        injector::WriteMemory<float>(*dword_51C276 + 0x08, 4.0f, true); //006C94D0 outdoor camera pan speed
     }

     if (bGamepadControlsFix)


example: add license

example: add license

--- examples/ccpipeline.cpp
+++ examples/ccpipeline.cpp
@@ -1,3 +1,32 @@
+/************************************************************************/
+/*                                                                      */
+/*    Copyright 2013 by Thorben Kroeger                                 */
+/*    thorben.kroeger@iwr.uni-heidelberg.de                             */
+/*                                                                      */
+/*    Permission is hereby granted, free of charge, to any person       */
+/*    obtaining a copy of this software and associated documentation    */
+/*    files (the "Software"), to deal in the Software without           */
+/*    restriction, including without limitation the rights to use,      */
+/*    copy, modify, merge, publish, distribute, sublicense, and/or      */
+/*    sell copies of the Software, and to permit persons to whom the    */
+/*    Software is furnished to do so, subject to the following          */
+/*    conditions:                                                       */
+/*                                                                      */
+/*    The above copyright notice and this permission notice shall be    */
+/*    included in all copies or substantial portions of the             */
+/*    Software.                                                         */
+/*                                                                      */
+/*    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND    */
+/*    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES   */
+/*    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND          */
+/*    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT       */
+/*    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,      */
+/*    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING      */
+/*    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR     */
+/*    OTHER DEALINGS IN THE SOFTWARE.                                   */
+/*                                                                      */
+/************************************************************************/
+
 #include <iostream>

 #include <bw/channelselector.h>


Only rewrite along critical path in balancing. (#353)

--- include/mockturtle/algorithms/balancing.hpp
+++ include/mockturtle/algorithms/balancing.hpp
@@ -35,6 +35,7 @@
 #include <cstdint>
 #include <functional>
 #include <limits>
+#include <memory>
 #include <optional>
 #include <utility>
 #include <vector>
@@ -42,9 +43,11 @@
 #include <fmt/format.h>
 #include <kitty/dynamic_truth_table.hpp>

+#include "../utils/cost_functions.hpp"
 #include "../utils/node_map.hpp"
 #include "../utils/progress_bar.hpp"
 #include "../utils/stopwatch.hpp"
+#include "../views/depth_view.hpp"
 #include "../views/topo_view.hpp"
 #include "cleanup.hpp"
 #include "cut_enumeration.hpp"
@@ -58,6 +61,9 @@
 {
   /*! \brief Cut enumeration params. */
   cut_enumeration_params cut_enumeration_ps;
+
+  /*! \brief Optimize only on critical path. */
+  bool only_on_critical_path{false};

   /*! \brief Show progress. */
   bool progress{false};
@@ -112,7 +118,7 @@
 namespace detail
 {

-template<class Ntk>
+template<class Ntk, class CostFn>
 struct balancing_impl
 {
   balancing_impl( Ntk const& ntk, rebalancing_function_t<Ntk> const& rebalancing_fn, balancing_params const& ps, balancing_stats& st )
@@ -138,6 +144,12 @@
       old_to_new[n] = {dest.create_pi(), 0u};
     } );

+    std::shared_ptr<depth_view<Ntk, CostFn>> depth_ntk;
+    if ( ps_.only_on_critical_path )
+    {
+      depth_ntk = std::make_shared<depth_view<Ntk, CostFn>>( ntk_ );
+    }
+
     stopwatch<> t( st_.time_total );
     const auto cuts = cut_enumeration<Ntk, true>( ntk_, ps_.cut_enumeration_ps, &st_.cut_enumeration_st );

@@ -149,6 +161,17 @@

       if ( ntk_.is_constant( n ) || ntk_.is_pi( n ) )
       {
+        return;
+      }
+
+      if ( ps_.only_on_critical_path && !depth_ntk->is_on_critical_path( n ) )
+      {
+        std::vector<signal<Ntk>> children;
+        ntk_.foreach_fanin( n, [&]( auto const& f ) {
+          const auto f_best = old_to_new[f].f;
+          children.push_back( ntk_.is_complemented( f ) ? dest.create_not( f_best ) : f_best );
+        });
+        old_to_new[n] = {dest.clone_node( ntk_, n, children ), depth_ntk->level( n )};
         return;
       }

@@ -199,6 +222,11 @@
  * balancing algorithm.  It returns a new network of the same type and performs
  * generic balancing by providing a rebalancing function.
  *
+ * The template parameter `CostFn` is only used to compute the critical paths,
+ * when the `only_on_critical_path` parameter is assigned true.  Note that the
+ * size for rewriting candidates is computed by the rebalancing function and
+ * may not correspond to the cost given by CostFn.
+ *
    \verbatim embed:rst

    Example
@@ -213,7 +241,7 @@
       const auto balanced_aig = balance( aig, {balance_fn}, ps );
    \endverbatim
  */
-template<class Ntk>
+template<class Ntk, class CostFn = unit_cost<Ntk>>
 Ntk balancing( Ntk const& ntk, rebalancing_function_t<Ntk> const& rebalancing_fn = {}, balancing_params const& ps = {}, balancing_stats* pst = nullptr )
 {
   static_assert( is_network_type_v<Ntk>, "Ntk is not a network type" );
@@ -231,7 +259,7 @@
   static_assert( has_size_v<Ntk>, "Ntk does not implement the size method" );

   balancing_stats st;
-  const auto dest = detail::balancing_impl<Ntk>{ntk, rebalancing_fn, ps, st}.run();
+  const auto dest = detail::balancing_impl<Ntk, CostFn>{ntk, rebalancing_fn, ps, st}.run();

   if ( pst )
   {


Fixing orientation of DoFs on the base of a prism


* Made sure energy and variance is not computed needlessly
* Removed tracking of truncated variance
* Do not write projected state needlessly
* Reset chi_lim properly between subsequent states

Former-commit-id: db5df4b62dfd5e42d4461b5a29d2fbdb6a3300bf

--- source/algorithms/class_algorithm_finite.cpp
+++ source/algorithms/class_algorithm_finite.cpp
@@ -232,10 +232,11 @@
     }
     if(not sector) sector = settings::strategy::target_sector;
     if(not chi_lim) {
-        if(StateType::RANDOMIZE_GIVEN_STATE)
+        if(state_type == StateType::RANDOMIZE_GIVEN_STATE)
             chi_lim = static_cast<long>(std::pow(2, std::floor(std::log2(tensors.state->find_largest_chi())))); // Nearest power of two from below
-        else chi_lim = cfg_chi_lim_init();
-     }
+        else
+            chi_lim = cfg_chi_lim_init();
+    }
     if(not use_eigenspinors) use_eigenspinors = settings::strategy::use_eigenspinors;
     if(not bitfield) bitfield = settings::input::bitfield;
     if(not svd_threshold and state_type == StateType::RANDOMIZE_GIVEN_STATE) svd_threshold = 1e-4;


Tweaked world generation cave factor

Tweaked world generation cave factor

--- Sub-Terra/src/World.cpp
+++ Sub-Terra/src/World.cpp
@@ -18,6 +18,7 @@
 		auto pos = cameraObj->Get<PositionComponent>();
 		if(pos != nullptr) {
 			const unsigned char distance = 6;
+
 			auto chunkSizeF = glm::fvec3(chunkSize);
 			auto keyBase = glm::ivec3(glm::floor(pos->position.To<glm::fvec3>()) / chunkSizeF);
 			auto jobM = engine->systems.Get<JobManager>();
@@ -128,7 +129,7 @@
 					( std::get<1>(keyTuple) + y) * scaleY,
 					(-std::get<2>(keyTuple) + z) * scaleZ
 				);
-				blocks.at(i++) = random > 0.25f;
+				blocks.at(i++) = random > 0.45f;
 			}
 		}
 	}


Fix clang build

Fix clang build

--- source/compilation/builtins/ArrayMethods.cpp
+++ source/compilation/builtins/ArrayMethods.cpp
@@ -265,12 +265,12 @@
                     context.addDiag(diag::AssociativeWildcardNotAllowed, range) << name;
                     return comp.getErrorType();
                 }
-                return *comp.emplace<QueueType>(*indexType, 0);
-            }
-            return *comp.emplace<QueueType>(comp.getIntType(), 0);
-        }
-
-        return *comp.emplace<QueueType>(*arrayType->getArrayElementType(), 0);
+                return *comp.emplace<QueueType>(*indexType, 0u);
+            }
+            return *comp.emplace<QueueType>(comp.getIntType(), 0u);
+        }
+
+        return *comp.emplace<QueueType>(*arrayType->getArrayElementType(), 0u);
     }

     ConstantValue eval(EvalContext& context, const Args& args,
@@ -374,7 +374,7 @@
             return comp.getErrorType();
         }

-        return *comp.emplace<QueueType>(*elemType, 0);
+        return *comp.emplace<QueueType>(*elemType, 0u);
     }

     ConstantValue eval(EvalContext& context, const Args& args,
@@ -460,12 +460,12 @@
                     context.addDiag(diag::AssociativeWildcardNotAllowed, range) << name;
                     return comp.getErrorType();
                 }
-                return *comp.emplace<QueueType>(*indexType, 0);
-            }
-            return *comp.emplace<QueueType>(comp.getIntType(), 0);
-        }
-
-        return *comp.emplace<QueueType>(*arrayType->getArrayElementType(), 0);
+                return *comp.emplace<QueueType>(*indexType, 0u);
+            }
+            return *comp.emplace<QueueType>(comp.getIntType(), 0u);
+        }
+
+        return *comp.emplace<QueueType>(*arrayType->getArrayElementType(), 0u);
     }

     ConstantValue eval(EvalContext& context, const Args& args,


fix merge

fix merge

--- source/core/mining-manager/MiningManager.cpp
+++ source/core/mining-manager/MiningManager.cpp
@@ -2477,13 +2477,4 @@
     if (label_sim_collector_) label_sim_collector_->Flush();
     if (rmDb_) rmDb_->flush();
     if (idManager_) idManager_->flush();
-
-    if (deleted_doc_before_mining_ > 0)
-    {
-        std::ofstream ofs((collectionDataPath_ + "/deleted_doc_before_mining_.data").c_str());
-        if (ofs)
-        {
-            ofs.write((const char*)&deleted_doc_before_mining_, sizeof(deleted_doc_before_mining_));
-        }
-    }
-}
+}


addToResponse -> writeToResponse.

addToResponse -> writeToResponse.

--- examples/StandaloneModularDevice/Callbacks.cpp
+++ examples/StandaloneModularDevice/Callbacks.cpp
@@ -33,7 +33,7 @@
 void getDspVar1Callback()
 {
   int value = controller.getDspVar1();
-  modular_device.addResultToResponse(value);
+  modular_device.writeResultToResponse(value);
 }

 void setDspVar1Callback()
@@ -45,7 +45,7 @@
 void getIntVar1Callback()
 {
   uint8_t value = controller.getIntVar1();
-  modular_device.addResultToResponse(value);
+  modular_device.writeResultToResponse(value);
 }

 void setIntVar1Callback()
@@ -57,7 +57,7 @@
 void getIntVar2Callback()
 {
   uint8_t value = controller.getIntVar2();
-  modular_device.addResultToResponse(value);
+  modular_device.writeResultToResponse(value);
 }

 void setIntVar2Callback()


Improved source code layout.

Improved source code layout.

--- undistort.cc
+++ undistort.cc
@@ -97,8 +97,8 @@
     std::vector<unsigned char> data;

 private:
-    friend std::istream& operator >>(std::istream &inputStream, Image &other);
-    friend std::ostream& operator <<(std::ostream &outputStream, const Image &other);
+    friend std::istream& operator>>(std::istream &inputStream, Image &other);
+    friend std::ostream& operator<<(std::ostream &outputStream, const Image &other);
     int channel_size; ///< width of one channel in bytes; may be 1 or 2
 };

@@ -171,7 +171,7 @@
     }
 }

-std::istream& operator >>(std::istream &inputStream, Image &other)
+std::istream& operator>>(std::istream &inputStream, Image &other)
 {
     std::string magic_number;
     int maximum_color_value;
@@ -200,7 +200,7 @@
     return inputStream;
 }

-std::ostream& operator <<(std::ostream &outputStream, const Image &other)
+std::ostream& operator<<(std::ostream &outputStream, const Image &other)
 {
     outputStream << (other.channels == 3 ? "P6" : "P5") << "\n"
                  << other.width << " "


silence unused variable warning

silence unused variable warning

--- examples/http_proxy.cpp
+++ examples/http_proxy.cpp
@@ -51,6 +51,7 @@

 			//you can handle the error if you want
 			boost::system::error_code error = Si::asio::write(client, Si::make_memory_range(response), yield);
+			boost::ignore_unused_variable_warning(error);
 		}

 		//ignore shutdown failures, they do not matter here


bug 2208 - Log if the flusher isn't in stopped state at destruct time.

Change-Id: I78927153ff6989002b671120b3346f45d23971dc
Reviewed-on: http://review.northscale.com/2130
Reviewed-by: Sean Lynch <9c3328a4a1f4f8f5c18b2d5b9057163c49b93ff3@literati.org>
Tested-by: Sean Lynch <9c3328a4a1f4f8f5c18b2d5b9057163c49b93ff3@literati.org>

--- flusher.hh
+++ flusher.hh
@@ -32,8 +32,12 @@
         flushQueue(NULL) {
     }
     ~Flusher() {
-        stop();
-        wait();
+        if (_state != stopped) {
+            getLogger()->log(EXTENSION_LOG_WARN, NULL,
+                             "Flusher being destroyed in state %s\n",
+                             stateName(_state));
+
+        }
     }

     bool stop();


Disable EEPROMex debug mode

Disable EEPROMex debug mode

This reduces memory usage and allows >100 EEPROM writes.


Show the dev option in the help for ola_artnet

--- examples/ola-artnet.cpp
+++ examples/ola-artnet.cpp
@@ -232,6 +232,7 @@
   cout << "Usage: " << opts.command <<
     " -d <dev_id> -n <name> -l <long_name> -s <subnet>\n\n"
     "Configure ArtNet Devices managed by OLA.\n\n"
+    "  -d, --dev       The ArtNet device to configure\n"
     "  -e, --net       Set the net parameter of the ArtNet device\n"
     "  -h, --help      Display this help message and exit.\n"
     "  -l, --long_name Set the long name of the ArtNet device\n"


Added AdjustSphereSegmentCallback to provide '<' and '>' key controls over the azim and elev range of the sphere segment

--- examples/osgspheresegment/osgspheresegment.cpp
+++ examples/osgspheresegment/osgspheresegment.cpp
@@ -354,6 +354,51 @@
 }

+class AdjustSphereSegmentCallback : public osgGA::GUIEventHandler
+{
+public:
+    void scaleSphereSegment(osgSim::SphereSegment* ss, float scale)
+    {
+        if (!ss) return;
+
+
+        osg::Vec3 direction_vec;
+        float azRange, elevRange;
+        ss->getArea(direction_vec, azRange, elevRange);
+
+        OSG_NOTICE<<std::endl<<"AdjustSphereSegmentCallback : scaling azRange"<<azRange<<", scale="<<scale<<std::endl;
+        ss->setArea(direction_vec, azRange*scale, elevRange*scale);
+    }
+
+    virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& /*aa*/, osg::Object* object, osg::NodeVisitor* /*nv*/)
+    {
+        if (ea.getHandled()) return false;
+
+        switch(ea.getEventType())
+        {
+            case(osgGA::GUIEventAdapter::KEYDOWN):
+            {
+                if (ea.getKey()=='>')
+                {
+                    scaleSphereSegment(dynamic_cast<osgSim::SphereSegment*>(object), 1.1f);
+                    return true;
+                }
+                else if (ea.getKey()=='<')
+                {
+                    scaleSphereSegment(dynamic_cast<osgSim::SphereSegment*>(object), 1.0f/1.1f);
+                }
+                break;
+            }
+            default:
+                break;
+        }
+        return false;
+    }
+
+
+};
+
+
 //////////////////////////////////////////////////////////////////////////////
 // MAIN SCENE GRAPH BUILDING FUNCTION
 //////////////////////////////////////////////////////////////////////////////
@@ -605,6 +650,8 @@
                 ss->getParent(0)->addChild(ss->computeIntersectionSubgraph(terrainToSS, terrainGeode.get()));
             }

+            ss->setEventCallback(new AdjustSphereSegmentCallback);
+
         }
     }


Added TexEnv DECAL mode.

Added TexEnv DECAL mode.

git-svn-id: 23b6355f2bb369032457de4eb5f713ee134f73a8@4539 16af8721-9629-0410-8352-f15c8da7e697

--- examples/osgspheresegment/osgspheresegment.cpp
+++ examples/osgspheresegment/osgspheresegment.cpp
@@ -174,7 +174,15 @@
         }

         geom->setVertexArray(vertices);
+
+        osg::Vec4ubArray& color = *(new osg::Vec4ubArray(1));
+        color[0].set(0,0,0,255);
+        geom->setColorArray(&color);
+        geom->setColorBinding(osg::Geometry::BIND_OVERALL);
+
         geom->addPrimitiveSet(new osg::DrawArrays(GL_LINES,0,vertices->getNumElements()));
+
+        geom->getOrCreateStateSet()->setMode(GL_LIGHTING,osg::StateAttribute::OFF);

         osg::Geode* geode = new osg::Geode;
         geode->addDrawable(geom);
@@ -365,6 +373,8 @@

     osgSim::OverlayNode* overlayNode = new osgSim::OverlayNode;
+
+    overlayNode->getOrCreateStateSet()->setTextureAttribute(1, new osg::TexEnv(osg::TexEnv::DECAL));

     const osg::BoundingSphere& bs = terrainGeode->getBound();
     osg::Group* overlaySubgraph = createOverlay(bs.center(), bs.radius()*0.5f);


Do not set default CDB storage in this class, return error if it is not set. (Laurent)

--- MUON/AliMUONCalibrationData.cxx
+++ MUON/AliMUONCalibrationData.cxx
@@ -172,14 +172,10 @@

   AliCDBManager* man = AliCDBManager::Instance();

-  Bool_t undefStorage(kFALSE);
-
   if ( !man->IsDefaultStorageSet() )
   {
-    TString storage("local://$ALICE_ROOT");
-    AliInfoClass(Form("CDB Storage not set. Will use %s for MUON stuff",storage.Data()));
-    man->SetDefaultStorage(storage.Data());
-    undefStorage = kTRUE;
+    AliErrorClass("CDB Storage not set. Must use AliCDBManager::Instance()->SetDefaultStorage() first.");
+    return 0x0;
   }

   Bool_t cacheStatus = man->GetCacheFlag();
@@ -196,11 +192,6 @@
     entry->SetOwner(kFALSE);
     delete entry;
     return object;
-  }
-
-  if ( undefStorage )
-  {
-    man->UnsetDefaultStorage();
   }

   return 0x0;


Adding setting default CDB storage and run number, now required by the framework. (Javier)

--- MUON/MUONGenerateGeometryData.C
+++ MUON/MUONGenerateGeometryData.C
@@ -36,6 +36,7 @@
 #include "AliMUONGeometryTransformer.h"

 #include "AliRun.h"
+#include "AliCDBManager.h"

 #include <Riostream.h>

@@ -49,6 +50,11 @@
 /// \param svmaps          option to generete svmap.dat
 /// \param writeEnvelope   option to include virtual envelopes
 ///                        in the volume paths
+
+  // Default CDB and run number
+  AliCDBManager* man = AliCDBManager::Instance();
+  man->SetDefaultStorage("local://$ALICE_ROOT");
+  man->SetRun(0);

   // Initialize
   gAlice->Init("$ALICE_ROOT/MUON/Config.C");


Fix crash on unexpected abort / VM exit

Fix crash on unexpected abort / VM exit

--- vm/drivers/cli.cpp
+++ vm/drivers/cli.cpp
@@ -130,8 +130,8 @@
       exit_code = 1;
     }

+    env.halt(env.state);
     if(!exit_code) {
-      env.halt(env.state);
       exit_code = env.exit_code(env.state);
     }
   }


Disable accessor inlining for now

Disable accessor inlining for now

--- vm/llvm/inline.hpp
+++ vm/llvm/inline.hpp
@@ -36,6 +36,7 @@
         call_tuple_put();

       // If the cache has only ever had one class, inline!
+      /*
       } else if(cache_->classes_seen() == 1) {
         AccessManagedMemory memguard(ops_.state());
         Executable* meth = cache_->method;
@@ -43,6 +44,7 @@
         if(AccessVariable* acc = try_as<AccessVariable>(meth)) {
           inline_ivar_access(cache_->tracked_class(0), acc);
         }
+        */
       }
     }


add error handler

add error handler

--- codegen.cpp
+++ codegen.cpp
@@ -601,14 +601,13 @@

   func->getBasicBlockList().push_back(bb_merge);
   builder.SetInsertPoint(bb_merge);
-  if(val_then != nullptr && val_else != nullptr &&
-      val_then->getType()->getTypeID() == val_else->getType()->getTypeID()) {
+  if(val_then && val_else && val_then->getType()->getTypeID() == val_else->getType()->getTypeID()) {
     llvm::PHINode *pnode = builder.CreatePHI(val_then->getType(), 2, "if_tmp");

     pnode->addIncoming(val_then, bb_then);
     pnode->addIncoming(val_else, bb_else);
     return pnode;
-  } else if(val_then != nullptr && val_else == nullptr) {
+  } else if(val_then && val_else == nullptr) {
     // only then branch
     return val_then;
   }
@@ -1064,14 +1063,16 @@
     }
     struct_t *strct = f_list.structs.get(ty.get().user_type);
     if(!strct) error("err_index");
-    int a = 0;
     if(dot->member->get_type() != AST_VARIABLE) puts("NG");
-    for(auto it = strct->members.begin(); it != strct->members.end(); ++it){
-      if(it->name == ((VariableAST *)dot->member)->info.name)
-        break;
-      a++;
-    }
-    llvm::Value *memb = builder.CreateConstGEP2_32(parent, 0, a, "gep");
+    int member_count = 0;
+    std::string expect_name = ((VariableAST *)dot->member)->info.name;
+    for(auto m : strct->members) {
+      if(m.name == expect_name) break;
+      member_count++;
+    }
+    if(member_count == strct->members.size())
+      error("not found member '%s' in struct '%s'", expect_name.c_str(), ty.get().user_type.c_str());
+    llvm::Value *memb = builder.CreateConstGEP2_32(parent, 0, member_count, "gep");
     llvm::Value *val = Codegen::expression(f, f_list, src);
     return builder.CreateStore(val, memb);
   } else if(var->get_type() == AST_VARIABLE_INDEX) {
@@ -1251,17 +1252,18 @@
   if(!parent) error("dotopast: error");
   struct_t *strct = f_list.structs.get(ty.get().user_type);
   if(!strct) error("error in DotOpAST");
-  int a = 0;
   ExprType member_ty;
   if(member->get_type() != AST_VARIABLE) puts("error in DotOpAST");
-  for(auto it = strct->members.begin(); it != strct->members.end(); ++it){
-    if(it->name == ((VariableAST *)member)->info.name) {
-      member_ty.change(new ExprType(it->type));
-      break;
-    }
-    a++;
-  }
-  llvm::Value *ret = builder.CreateStructGEP(parent, a);
+  int member_count = 0;
+  std::string expect_name = ((VariableAST *)member)->info.name;
+  for(auto m : strct->members) {
+    if(m.name == expect_name)
+    { member_ty.change(new ExprType(m.type)); break; }
+    member_count++;
+  }
+  if(member_count == strct->members.size())
+    error("not found member '%s' in struct '%s'", expect_name.c_str(), ty.get().user_type.c_str());
+  llvm::Value *ret = builder.CreateStructGEP(parent, member_count);
   ret = builder.CreateLoad(ret, "load_tmp");
   ret_ty->change(new ExprType(member_ty));
   return ret;


Fix more bugs in out-of-band work

Fix more bugs in out-of-band work

--- ext/common/ApplicationPool2/Implementation.cpp
+++ ext/common/ApplicationPool2/Implementation.cpp
@@ -519,16 +519,24 @@
 	assert(process->oobwStatus == Process::OOBW_IN_PROGRESS);

 	if (result == DR_SUCCESS) {
-		P_DEBUG("Process " << process->inspect() << " disabled; proceeding " <<
-			"with out-of-band work");
-		process->oobwStatus = Process::OOBW_REQUESTED;
-		if (shouldInitiateOobw(process)) {
-			initiateOobw(process);
+		if (process->enabled == Process::DISABLED) {
+			P_DEBUG("Process " << process->inspect() << " disabled; proceeding " <<
+				"with out-of-band work");
+			process->oobwStatus = Process::OOBW_REQUESTED;
+			if (shouldInitiateOobw(process)) {
+				initiateOobw(process);
+			} else {
+				// We do not re-enable the process because it's likely that the
+				// administrator has explicitly changed the state.
+				P_DEBUG("Out-of-band work for process " << process->inspect() << " aborted "
+					"because the process no longer requests out-of-band work");
+				process->oobwStatus = Process::OOBW_NOT_ACTIVE;
+			}
 		} else {
 			// We do not re-enable the process because it's likely that the
 			// administrator has explicitly changed the state.
 			P_DEBUG("Out-of-band work for process " << process->inspect() << " aborted "
-				"because the process no longer requests out-of-band work");
+				"because the process was reenabled after disabling");
 			process->oobwStatus = Process::OOBW_NOT_ACTIVE;
 		}
 	} else {


NetKVM: Set AffinityPolicy to IrqPolicySpecifiedProcessors

According to documentation:
To specify an affinity for a particular group, set AffinityPolicy
to IrqPolicySpecifiedProcessors and set Group to the appropriate
group number.

u.Interrupt.TargetedProcessors Specifies a KAFFINITY value that
indicates which processors should handle the device's interrupts.
This value is used only if AffinityPolicy is IrqPolicySpecifiedProcessors.

Signed-off-by: Sameeh Jubran <0a911daba6e3bf1ebda689ee3bdc069f3d45a844@daynix.com>

--- NetKVM/wlh/ParaNdis6-Driver.cpp
+++ NetKVM/wlh/ParaNdis6-Driver.cpp
@@ -732,6 +732,7 @@
                     desc->Flags |= CM_RESOURCE_INTERRUPT_POLICY_INCLUDED;
                     desc->u.Interrupt.Group = procNumber.Group;
                     desc->u.Interrupt.TargetedProcessors = 1i64 << procNumber.Number;
+                    desc->u.Interrupt.AffinityPolicy = IrqPolicySpecifiedProcessors;
                 }
                 else
                 {


 - библиотечные инклюды располагаются в INCLUDES
 - инклюды проекта располагаются SYNOPSIS
 - инклюды проекта указываются от корня сорсов

git-svn-id: 41bd7e47c31e4d43f97241d7529f6785d233c6d8@4315 23f926e6-80f1-49ca-85a0-60d4a27bb3ac

--- rdo/rdo_studio/branches/dev_linux/rdo_common/test/rdo_common_test/main.cpp
+++ rdo/rdo_studio/branches/dev_linux/rdo_common/test/rdo_common_test/main.cpp
@@ -11,17 +11,15 @@
 // ====================================================================== PCH
 // ====================================================================== INCLUDES
 #include <boost/regex.hpp>
+#define BOOST_TEST_MODULE test_rdo_common
+#include <boost/test/included/unit_test.hpp>
 // ====================================================================== SYNOPSIS
 #include "rdo_common/rdocommon.h"
 #include "rdo_common/rdofile.h"
 #include "rdo_common/rdotime.h"
 #include "rdo_common/test/rdo_common_test/resource.h"
-
-#include <config-tiles.h>
+#include "rdo_common/test/rdo_common_test/config-tiles.h"
 // ===============================================================================
-
-#define BOOST_TEST_MODULE test_rdo_common
-#include <boost/test/included/unit_test.hpp>

 BOOST_AUTO_TEST_SUITE(test_rdo_common)


fixed some bugs

fixed some bugs

--- vowpalwabbit/gd.cc
+++ vowpalwabbit/gd.cc
@@ -542,7 +542,6 @@
           else {
             norm = ec->total_sum_feat_sq;
           }
-
           eta_t = all.eta * norm * ld->weight;
           if(!all.adaptive) eta_t *= powf(t,-all.power_t);

@@ -648,9 +647,15 @@

 void save_load_online_state(vw& all, io_buf& model_file, bool read, bool text)
 {
-  char buff[312];
+  char buff[512];
+
   uint32_t text_len = sprintf(buff, "initial_t %f\n", all.initial_t);
   bin_text_read_write_fixed(model_file,(char*)&all.initial_t, sizeof(all.initial_t),
+			    "", read,
+			    buff, text_len, text);
+
+  text_len = sprintf(buff, "norm normalizer %f\n", all.normalized_sum_norm_x);
+  bin_text_read_write_fixed(model_file,(char*)&all.normalized_sum_norm_x, sizeof(all.normalized_sum_norm_x),
 			    "", read,
 			    buff, text_len, text);

@@ -685,7 +690,7 @@
 			    buff, text_len, text);

   text_len = sprintf(buff, "total_features %u\n", (uint32_t)all.sd->total_features);
-  bin_text_read_write_fixed(model_file,(char*)&all.sd->example_number, sizeof(all.sd->total_features),
+  bin_text_read_write_fixed(model_file,(char*)&all.sd->total_features, sizeof(all.sd->total_features),
 			    "", read,
 			    buff, text_len, text);


corrected steps log

corrected steps log

--- fsesci.cpp
+++ fsesci.cpp
@@ -396,7 +396,7 @@
 							iter->_springLength = iter->_springLength + 2* _mP.deltaPeriod;
 							//

-							_kinesinStepsLog.save(std::to_string(_state.currentTime) + "	" + std::to_string(iter->_mountCoordinate)  + "	" + std::to_string(iter->_MTsite))+"\n";
+							_kinesinStepsLog.save(std::to_string(_state.currentTime) + "	" + std::to_string(iter->_mountCoordinate)  + "	" + std::to_string(iter->_MTsite)+"\n");

 							// Count new summ forces
 							 _state.SummKINESINForces =  _state.SummKINESINForces + springForce(_mP.KINESINstiffness, iter->_springLength);
@@ -495,7 +495,7 @@

 	std::string inputparamfile;
 	inputparamfile.append(param_input_filename);
-
+	//inputparamfile = "C:\\Users\\Tolya\\Documents\\Visual Studio 2015\\Projects\\gliding_fsesci\\x64\\Release\\NewConfig.json";

 	// Create and load simulation parameters and configuration, values are taken from json file
 	const auto simulationParameters = load_simulationparams(inputparamfile);


ACT_LIGHT_CASTS_SHADOWS should be defined as type ET_REAL, not ET_INT

--HG--
branch : v1-6
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/branches/v1-6%40126

--- OgreMain/src/OgreGpuProgram.cpp
+++ OgreMain/src/OgreGpuProgram.cpp
@@ -137,7 +137,7 @@
         AutoConstantDefinition(ACT_DERIVED_LIGHT_SPECULAR_COLOUR_ARRAY, "derived_light_specular_colour_array",  4, ET_REAL, ACDT_INT),

         AutoConstantDefinition(ACT_LIGHT_NUMBER,   					  "light_number",  1, ET_REAL, ACDT_INT),
-        AutoConstantDefinition(ACT_LIGHT_CASTS_SHADOWS, 			  "light_casts_shadows",  1, ET_INT, ACDT_INT),
+        AutoConstantDefinition(ACT_LIGHT_CASTS_SHADOWS, 			  "light_casts_shadows",  1, ET_REAL, ACDT_INT),

         AutoConstantDefinition(ACT_SHADOW_EXTRUSION_DISTANCE,     "shadow_extrusion_distance",    1, ET_REAL, ACDT_INT),
         AutoConstantDefinition(ACT_CAMERA_POSITION,               "camera_position",              3, ET_REAL, ACDT_NONE),