Doc: add documentation for Unit-Tests of CompositeTransformation

--- tests/compositeTransformation.cpp
+++ tests/compositeTransformation.cpp
@@ -8,9 +8,17 @@
 #include <boost/filesystem.hpp>
 #include <boost/filesystem/fstream.hpp>

-
-namespace test {
-
+/** \class CompositeTransformation
+ *
+ *  \test CompositeTransformSuite testing creation of linear and tree-like
+ *  CompositeTransformations. Additionally checks correctness of input
+ *  EventTypes and created CompositeTransformers. Finally tests correct merging
+ *  of two CompositeTransformations in ::tests::compTrans
+ **/
+
+namespace tests {
+/** \brief CompositeTransformation Tests **/
+namespace compTrans {
 using namespace std;

 using ::testing::_;
@@ -21,20 +29,33 @@
 using boost::filesystem::current_path;
 using boost::filesystem::path;

-MATCHER(EqPtrContent, "") {
-  return *get<0>(arg)==*get<1>(arg);
-}
+/** \brief Fixture for all CompositeTransformation UnitTests **/
 struct CompositeTransformSuite : public ::testing::Test {

+  /** \brief forward declaration of EventTypes **/
   using EventTypes = Transformer::EventTypes;
+  /** \brief forward declaration of TransPtr **/
   using TransPtr   = Transformation::TransPtr;

+  /** \brief helper function to compare MetaEvents based on their pointers
+   *  \param a first MetaEvent pointer
+   *  \param b second MetaEvent pointer
+   *  \return true if equal according to MetaEvent::operator==, false otherwise
+   **/
   static bool comp(const MetaEvent* const a, const MetaEvent* const b) {
     return *a==*b;
   }

+  /// Mock-Implementation of Unary Transformer
   struct TestTransformer : public Transformer {
+    /// Name of this Mock-Object
     string name;
+    /** \brief Create Mock-Transformer
+     *  \param name Name of this Mock-Object
+     *  \param out Goal EventType
+     *  \param in single elementary vector of input EventTypes
+     *  \param trans Transformer lookup structure to register this instance
+     **/
     TestTransformer(const string& name, const EventType& out, const EventTypes& in,
                     map<string, TestTransformer*>& trans)
       : Transformer(out, in), name(name) {
@@ -46,8 +67,14 @@
     virtual void print(ostream& o) const { o << name; }
   };

+  /// Mock-Implementation of Unary Transformation
   struct TestTransformation : public Transformation {
+    /// Name of this Mock-Object
     string name;
+    /** \brief Create Mock-Transformation
+     *  \param name Name of this Mock-Object
+     *  \param arity Arity of transformation
+     **/
     TestTransformation(const string& name, size_t arity)
       : Transformation(Type::attribute, arity, EventID::any), name(name) { }

@@ -57,23 +84,38 @@
     virtual void print(ostream& o) const { o << name; }
   };

+  /// Lookup structure to map TestTransformation names to instances
   map<string, TestTransformer*> trans;
+  /// Statically allocated unary TestTransformations
   TestTransformation a, c, d;
-  CompositeTransformation compTrans, compTrans2;
+  /// Linear CompositeTransformation containing a and b
+  CompositeTransformation compTrans;
+  /// Tree-like CompositeTransformation containing c, b and d
+  CompositeTransformation compTrans2;
+  /// Dynamically allocated unary TestTransformation
   shared_ptr<const TestTransformation> b;
-  EventType goal, provided, provided2, intermediate, intermediate2;
-
-  struct Test0: public ::id::attribute::Base {
-    static constexpr const ::id::attribute::ID value()  { return 251; }
-  };
-  struct Test1: public ::id::attribute::Base {
-    static constexpr const ::id::attribute::ID value()  { return 252; }
-  };
-
+  /// Final goal EventType: single Attribute Test0 of certain 1x1 float
+  EventType goal;
+  /// Provided EventType: single Attribute Test0 of certain 1x1 int with scale 1/1000
+  EventType provided;
+  /// Provided EventType: single Attribute Test1 of certain 1x1 int with scale 1/1000
+  EventType provided2;
+  /// Intermediate EventType: single Attribute Test0 of certain 1x1 float with scale 1/1000
+  EventType intermediate;
+  /// Intermediate EventType: single Attribute Test1 of certain 1x1 float with scale 1/1000
+  EventType intermediate2;
+
+  /// Definition of non-static AttrID used only testing
+  using Test0 = ::id::attribute::AttrID<251>;
+  /// Definition of non-static AttrID used only testing
+  using Test1 = ::id::attribute::AttrID<252>;
+
+  /// Create four TestTransformations
   CompositeTransformSuite()
     : a("a", 1), c("c", 2), d("d", 1), b(new TestTransformation("b", 1))
   {}

+  /// Create CompositeTransformations compTrans and compTrans2
   void SetUp() {

     ValueType goalVT(id::type::Float::value(), 1, 1, false);
@@ -123,6 +165,7 @@
   }
 };

+/** \brief Unit-Test testing creation of a linear CompositeTransformation **/
 TEST_F(CompositeTransformSuite, linearTest) {
   using Graph = CompositeTransformation::Graph;
   using Vertex = CompositeTransformation::Vertex;
@@ -142,11 +185,13 @@
   EXPECT_EQ(testB, *b);
 }

+/** \brief Unit-Test checking correctness of input EventTypes of a linear CompositeTransformation**/
 TEST_F(CompositeTransformSuite, linearInTest) {
   auto result = compTrans.in();
   EXPECT_EQ(result, EventTypes({provided}));
 }

+/** \brief Unit-Test testing creation of a tree-like CompositeTransformation **/
 TEST_F(CompositeTransformSuite, treeTest) {
   using Graph = CompositeTransformation::Graph;
   using Vertex = CompositeTransformation::Vertex;
@@ -171,12 +216,14 @@
   EXPECT_EQ(testD, d);
 }

+/** \brief Unit-Test checking correctness of input EventTypes of a tree-like CompositeTransformation**/
 TEST_F(CompositeTransformSuite, treeInTest) {
   auto result = compTrans2.in();
   ASSERT_FALSE(result.empty());
   EXPECT_EQ(result, EventTypes({provided, provided2}));
 }

+/** \brief Unit-Test checking correct creation of CompositeTransformer from linear CompositeTransformation **/
 TEST_F(CompositeTransformSuite, linearCreateTest) {
   using Events = Transformer::Events;
   EXPECT_CALL(a, create(goal, EventTypes({intermediate}), _, _))
@@ -206,6 +253,7 @@
   EXPECT_EQ(res0.front(), eC);
 }

+/** \brief Unit-Test checking correct creation of CompositeTransformer from tree-like CompositeTransformation **/
 TEST_F(CompositeTransformSuite, treeCreateTest) {
   using Events = Transformer::Events;
   EXPECT_CALL(c, create(goal, EventTypes({intermediate, intermediate2}), _, _))
@@ -251,6 +299,7 @@
   EXPECT_EQ(res0.front(), eE);
 }

+/** \brief Unit-Test checking correct merging of linear and tree-like CompositeTransformation **/
 TEST_F(CompositeTransformSuite, insertTest) {
   using Vertex = CompositeTransformation::Vertex;
   auto edges = boost::edges(compTrans.graph());
@@ -273,4 +322,4 @@
   EXPECT_THAT(compTrans.in(), UnorderedElementsAre(provided, provided2));
 }

-}
+}}


Add transaction in hybrid scan test when inserting tuples in table.

--- tests/index/hybrid_index_test.cpp
+++ tests/index/hybrid_index_test.cpp
@@ -117,9 +117,9 @@
   /////////////////////////////////////////////////////////

   // Insert tuples into tile_group.
-  //auto &txn_manager = concurrency::TransactionManagerFactory::GetInstance();
+  auto &txn_manager = concurrency::TransactionManagerFactory::GetInstance();
   const bool allocate = true;
-  //auto txn = txn_manager.BeginTransaction();
+  auto txn = txn_manager.BeginTransaction();
   std::unique_ptr<VarlenPool> pool(new VarlenPool(BACKEND_TYPE_MM));

   int rowid;
@@ -136,10 +136,10 @@
     ItemPointer tuple_slot_id = hyadapt_table->InsertTuple(&tuple);
     assert(tuple_slot_id.block != INVALID_OID);
     assert(tuple_slot_id.offset != INVALID_OID);
-    //txn->RecordInsert(tuple_slot_id);
-  }
-
-  //txn_manager.CommitTransaction();
+    txn->RecordInsert(tuple_slot_id);
+  }
+
+  txn_manager.CommitTransaction();
 }

 expression::AbstractExpression *CreatePredicate(const int lower_bound) {


tests: Add more loader alloc tests

tests: Add more loader alloc tests

Add more tests to the loader test which validates intentionally
failing during vkCreateInstance and/or vkCreateDevice.  Originally,
we have relied on the CTS tests to catch these issues, but it
makes it more available for general testing if the loader tests do
it as well.

Change-Id: I9043b1c8c0456996954d20e30acf1e2ab3bdd31b

--- tests/loader_validation_tests.cpp
+++ tests/loader_validation_tests.cpp
@@ -29,6 +29,7 @@
 #ifdef _WIN32
 #include <inttypes.h>  //Needed for PRIxLEAST64
 #endif
+#include <stdint.h> // For UINT32_MAX

 #include <algorithm>
 #include <iostream>
@@ -286,14 +287,26 @@
 // Global vector to track allocations.  This will be resized before each test and emptied after.
 // However, we have to globally define it so the allocation callback functions work properly.
 std::vector<AllocTrack> g_allocated_vector;
+bool g_intentional_fail_enabled = false;
+uint32_t g_intenional_fail_index = 0;
+uint32_t g_intenional_fail_count = 0;

 void FreeAllocTracker() { g_allocated_vector.clear(); }

-void InitAllocTracker(size_t size) {
+void InitAllocTracker(size_t size, uint32_t intentional_fail_index = UINT32_MAX) {
     if (g_allocated_vector.size() > 0) {
         FreeAllocTracker();
     }
     g_allocated_vector.resize(size);
+    if (intentional_fail_index != UINT32_MAX) {
+        g_intentional_fail_enabled = true;
+        g_intenional_fail_index = intentional_fail_index;
+        g_intenional_fail_count = 0;
+    } else {
+        g_intentional_fail_enabled = false;
+        g_intenional_fail_index = 0;
+        g_intenional_fail_count = 0;
+    }
 }

 bool IsAllocTrackerEmpty() {
@@ -315,7 +328,7 @@
             was_allocated = true;
         }
     }
-    if (!was_allocated) {
+    if (!g_intentional_fail_enabled && !was_allocated) {
         printf("No allocations ever generated!");
         success = false;
     }
@@ -324,6 +337,11 @@

 VKAPI_ATTR void *VKAPI_CALL AllocCallbackFunc(void *pUserData, size_t size, size_t alignment,
                                               VkSystemAllocationScope allocationScope) {
+    if (g_intentional_fail_enabled) {
+        if (++g_intenional_fail_count >= g_intenional_fail_index) {
+            return nullptr;
+        }
+    }
     for (uint32_t iii = 0; iii < g_allocated_vector.size(); iii++) {
         if (!g_allocated_vector[iii].active) {
             g_allocated_vector[iii].requested_size_bytes = size;
@@ -1214,6 +1232,200 @@
     FreeAllocTracker();
 }

+// Test failure during vkCreateInstance to make sure we don't leak memory if
+// one of the out-of-memory conditions trigger.
+TEST(Allocation, CreateInstanceItentionalAllocFail) {
+    auto const info = VK::InstanceCreateInfo();
+    VkInstance instance = VK_NULL_HANDLE;
+    VkAllocationCallbacks alloc_callbacks = {};
+    alloc_callbacks.pfnAllocation = AllocCallbackFunc;
+    alloc_callbacks.pfnReallocation = ReallocCallbackFunc;
+    alloc_callbacks.pfnFree = FreeCallbackFunc;
+
+    VkResult result;
+    uint32_t fail_index = 1;
+    do {
+        InitAllocTracker(9999, fail_index);
+
+        result = vkCreateInstance(info, &alloc_callbacks, &instance);
+        if (result == VK_ERROR_OUT_OF_HOST_MEMORY) {
+            if (!IsAllocTrackerEmpty()) {
+                std::cout << "Failed on index " << fail_index << '\n';
+                ASSERT_EQ(true, IsAllocTrackerEmpty());
+            }
+        }
+        fail_index++;
+        // Make sure we don't overrun the memory
+        ASSERT_LT(fail_index, 9999u);
+
+        FreeAllocTracker();
+    } while (result == VK_ERROR_OUT_OF_HOST_MEMORY);
+
+    vkDestroyInstance(instance, NULL);
+}
+
+// Test failure during vkCreateDevice to make sure we don't leak memory if
+// one of the out-of-memory conditions trigger.
+TEST(Allocation, CreateDeviceItentionalAllocFail) {
+    auto const info = VK::InstanceCreateInfo();
+    VkInstance instance = VK_NULL_HANDLE;
+    VkDevice device = VK_NULL_HANDLE;
+    VkAllocationCallbacks alloc_callbacks = {};
+    alloc_callbacks.pfnAllocation = AllocCallbackFunc;
+    alloc_callbacks.pfnReallocation = ReallocCallbackFunc;
+    alloc_callbacks.pfnFree = FreeCallbackFunc;
+
+    VkResult result = vkCreateInstance(info, NULL, &instance);
+    ASSERT_EQ(result, VK_SUCCESS);
+
+    uint32_t physicalCount = 0;
+    result = vkEnumeratePhysicalDevices(instance, &physicalCount, nullptr);
+    ASSERT_EQ(result, VK_SUCCESS);
+    ASSERT_GT(physicalCount, 0u);
+
+    std::unique_ptr<VkPhysicalDevice[]> physical(new VkPhysicalDevice[physicalCount]);
+    result = vkEnumeratePhysicalDevices(instance, &physicalCount, physical.get());
+    ASSERT_EQ(result, VK_SUCCESS);
+    ASSERT_GT(physicalCount, 0u);
+
+    for (uint32_t p = 0; p < physicalCount; ++p) {
+        uint32_t familyCount = 0;
+        vkGetPhysicalDeviceQueueFamilyProperties(physical[p], &familyCount, nullptr);
+        ASSERT_GT(familyCount, 0u);
+
+        std::unique_ptr<VkQueueFamilyProperties[]> family(new VkQueueFamilyProperties[familyCount]);
+        vkGetPhysicalDeviceQueueFamilyProperties(physical[p], &familyCount, family.get());
+        ASSERT_GT(familyCount, 0u);
+
+        for (uint32_t q = 0; q < familyCount; ++q) {
+            if (~family[q].queueFlags & VK_QUEUE_GRAPHICS_BIT) {
+                continue;
+            }
+
+            float const priorities[] = {0.0f};  // Temporary required due to MSVC bug.
+            VkDeviceQueueCreateInfo const queueInfo[1]{
+                VK::DeviceQueueCreateInfo().queueFamilyIndex(q).queueCount(1).pQueuePriorities(priorities)};
+
+            auto const deviceInfo = VK::DeviceCreateInfo().queueCreateInfoCount(1).pQueueCreateInfos(queueInfo);
+
+            uint32_t fail_index = 1;
+            do {
+                InitAllocTracker(9999, fail_index);
+
+                result = vkCreateDevice(physical[p], deviceInfo, &alloc_callbacks, &device);
+                if (result == VK_ERROR_OUT_OF_HOST_MEMORY) {
+                    if (!IsAllocTrackerEmpty()) {
+                        std::cout << "Failed on index " << fail_index << '\n';
+                        ASSERT_EQ(true, IsAllocTrackerEmpty());
+                    }
+                }
+                fail_index++;
+                // Make sure we don't overrun the memory
+                ASSERT_LT(fail_index, 9999u);
+
+                FreeAllocTracker();
+            } while (result == VK_ERROR_OUT_OF_HOST_MEMORY);
+            vkDestroyDevice(device, &alloc_callbacks);
+            break;
+        }
+    }
+
+    vkDestroyInstance(instance, NULL);
+}
+
+// Test failure during vkCreateInstance and vkCreateDevice to make sure we don't
+// leak memory if one of the out-of-memory conditions trigger.
+TEST(Allocation, CreateInstanceDeviceItentionalAllocFail) {
+    auto const info = VK::InstanceCreateInfo();
+    VkInstance instance = VK_NULL_HANDLE;
+    VkDevice device = VK_NULL_HANDLE;
+    VkAllocationCallbacks alloc_callbacks = {};
+    alloc_callbacks.pfnAllocation = AllocCallbackFunc;
+    alloc_callbacks.pfnReallocation = ReallocCallbackFunc;
+    alloc_callbacks.pfnFree = FreeCallbackFunc;
+
+    VkResult result = VK_ERROR_OUT_OF_HOST_MEMORY;
+    uint32_t fail_index = 0;
+    uint32_t physicalCount = 0;
+    while (result == VK_ERROR_OUT_OF_HOST_MEMORY) {
+        InitAllocTracker(9999, ++fail_index);
+        ASSERT_LT(fail_index, 9999u);
+
+        result = vkCreateInstance(info, &alloc_callbacks, &instance);
+        if (result == VK_ERROR_OUT_OF_HOST_MEMORY) {
+            if (!IsAllocTrackerEmpty()) {
+                std::cout << "Failed on index " << fail_index << '\n';
+                ASSERT_EQ(true, IsAllocTrackerEmpty());
+            }
+            FreeAllocTracker();
+            continue;
+        }
+        ASSERT_EQ(result, VK_SUCCESS);
+
+        physicalCount = 0;
+        result = vkEnumeratePhysicalDevices(instance, &physicalCount, nullptr);
+        if (result == VK_ERROR_OUT_OF_HOST_MEMORY) {
+            vkDestroyInstance(instance, NULL);
+            if (!IsAllocTrackerEmpty()) {
+                std::cout << "Failed on index " << fail_index << '\n';
+                ASSERT_EQ(true, IsAllocTrackerEmpty());
+            }
+            FreeAllocTracker();
+            continue;
+        }
+        ASSERT_EQ(result, VK_SUCCESS);
+
+        std::unique_ptr<VkPhysicalDevice[]> physical(new VkPhysicalDevice[physicalCount]);
+        result = vkEnumeratePhysicalDevices(instance, &physicalCount, physical.get());
+        if (result == VK_ERROR_OUT_OF_HOST_MEMORY) {
+            vkDestroyInstance(instance, NULL);
+            if (!IsAllocTrackerEmpty()) {
+                std::cout << "Failed on index " << fail_index << '\n';
+                ASSERT_EQ(true, IsAllocTrackerEmpty());
+            }
+            FreeAllocTracker();
+            continue;
+        }
+        ASSERT_EQ(result, VK_SUCCESS);
+
+        uint32_t familyCount = 0;
+        vkGetPhysicalDeviceQueueFamilyProperties(physical[0], &familyCount, nullptr);
+        ASSERT_GT(familyCount, 0u);
+
+        std::unique_ptr<VkQueueFamilyProperties[]> family(new VkQueueFamilyProperties[familyCount]);
+        vkGetPhysicalDeviceQueueFamilyProperties(physical[0], &familyCount, family.get());
+        ASSERT_GT(familyCount, 0u);
+
+        uint32_t queue_index = 0;
+        for (uint32_t q = 0; q < familyCount; ++q) {
+            if (family[q].queueFlags & VK_QUEUE_GRAPHICS_BIT) {
+                queue_index = q;
+                break;
+            }
+        }
+
+        float const priorities[] = {0.0f};  // Temporary required due to MSVC bug.
+        VkDeviceQueueCreateInfo const queueInfo[1]{
+            VK::DeviceQueueCreateInfo().queueFamilyIndex(queue_index).queueCount(1).pQueuePriorities(priorities)};
+
+        auto const deviceInfo = VK::DeviceCreateInfo().queueCreateInfoCount(1).pQueueCreateInfos(queueInfo);
+
+        result = vkCreateDevice(physical[0], deviceInfo, &alloc_callbacks, &device);
+        if (result == VK_ERROR_OUT_OF_HOST_MEMORY) {
+            vkDestroyInstance(instance, NULL);
+            if (!IsAllocTrackerEmpty()) {
+                std::cout << "Failed on index " << fail_index << '\n';
+                ASSERT_EQ(true, IsAllocTrackerEmpty());
+            }
+            FreeAllocTracker();
+            continue;
+        }
+        vkDestroyDevice(device, &alloc_callbacks);
+        vkDestroyInstance(instance, NULL);
+        FreeAllocTracker();
+    }
+}
+
 int main(int argc, char **argv) {
     int result;


remove unused headers

remove unused headers

--- tests/tests/history_api_tests.cpp
+++ tests/tests/history_api_tests.cpp
@@ -25,16 +25,6 @@
 #include <boost/test/unit_test.hpp>

 #include <graphene/app/api.hpp>
-#include <graphene/chain/database.hpp>
-#include <graphene/chain/exceptions.hpp>
-
-#include <graphene/chain/account_object.hpp>
-#include <graphene/chain/asset_object.hpp>
-#include <graphene/chain/committee_member_object.hpp>
-#include <graphene/chain/proposal_object.hpp>
-#include <graphene/chain/market_object.hpp>
-
-#include <graphene/chain/exceptions.hpp>

 #include <graphene/utilities/tempdir.hpp>


Added non-SIMD test to ZeroCrossings

Added non-SIMD test to ZeroCrossings

Change-Id: I28e0059d9a430235fc68186c939420b199b10f66

--- tests/transforms/zerocrossings.cc
+++ tests/transforms/zerocrossings.cc
@@ -43,6 +43,8 @@
 TEST_F(ZeroCrossingsTest, Do) {
   Do(Input, &Output);
   ASSERT_EQ(Size / 2 + 1, *Output[0]);
+  int slowres = Do(false, Input[0]->Data.get(), Size);
+  ASSERT_EQ(Size / 2 + 1, slowres);
 }

 #define CLASS_NAME ZeroCrossingsTest


Removing unneeded calls to ExchangeFaceNbrData and decreasing parallel mesh sizes

--- tests/unit/fem/test_get_value.cpp
+++ tests/unit/fem/test_get_value.cpp
@@ -1855,7 +1855,6 @@
    {
       Mesh *mesh = new Mesh(n, 2.0);
       ParMesh pmesh(MPI_COMM_WORLD, *mesh);
-      pmesh.ExchangeFaceNbrData();
       delete mesh;

       FunctionCoefficient linCoef(func_1D_lin);
@@ -1869,9 +1868,6 @@

          ParFiniteElementSpace dgv_fespace(&pmesh, &dgv_fec);
          ParFiniteElementSpace dgi_fespace(&pmesh, &dgi_fec);
-
-         dgv_fespace.ExchangeFaceNbrData();
-         dgi_fespace.ExchangeFaceNbrData();

          ParGridFunction dgv_x(&dgv_fespace);
          ParGridFunction dgi_x(&dgi_fespace);
@@ -1959,6 +1955,231 @@
    MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);

    int log = 1;
+   int n = num_procs;
+   int dim = 2;
+   int order = 1;
+   int npts = 0;
+
+   double tol = 1e-6;
+
+   for (int type = (int)Element::TRIANGLE;
+        type <= (int)Element::QUADRILATERAL; type++)
+   {
+      Mesh *mesh = new Mesh(n, n, (Element::Type)type, 1, 2.0, 3.0);
+      ParMesh pmesh(MPI_COMM_WORLD, *mesh);
+      delete mesh;
+
+      FunctionCoefficient linCoef(func_2D_lin);
+
+      SECTION("2D GetValue tests for element type " + std::to_string(type))
+      {
+         DG_FECollection dgv_fec(order, dim, BasisType::GaussLegendre,
+                                 FiniteElement::VALUE);
+         DG_FECollection dgi_fec(order, dim, BasisType::GaussLegendre,
+                                 FiniteElement::INTEGRAL);
+
+         ParFiniteElementSpace dgv_fespace(&pmesh, &dgv_fec);
+         ParFiniteElementSpace dgi_fespace(&pmesh, &dgi_fec);
+
+         ParGridFunction dgv_x(&dgv_fespace);
+         ParGridFunction dgi_x(&dgi_fespace);
+
+         GridFunctionCoefficient dgv_xCoef(&dgv_x);
+         GridFunctionCoefficient dgi_xCoef(&dgi_x);
+
+         dgv_x.ProjectCoefficient(linCoef);
+         dgi_x.ProjectCoefficient(linCoef);
+
+         dgv_x.ExchangeFaceNbrData();
+         dgi_x.ExchangeFaceNbrData();
+
+         SECTION("Shared Face Evaluation 2D")
+         {
+            if (my_rank == 0)
+            {
+               std::cout << "Shared Face Evaluation 2D" << std::endl;
+            }
+            for (int sf = 0; sf < pmesh.GetNSharedFaces(); sf++)
+            {
+               FaceElementTransformations *FET =
+                  pmesh.GetSharedFaceTransformations(sf);
+               ElementTransformation *T = &FET->GetElement2Transformation();
+               int e = FET->Elem2No;
+               const FiniteElement   *fe = dgv_fespace.GetFaceNbrFE(e);
+               const IntegrationRule &ir = IntRules.Get(fe->GetGeomType(),
+                                                        2*order + 2);
+
+               double dgv_err = 0.0;
+               double dgi_err = 0.0;
+
+               double tip_data[dim];
+               Vector tip(tip_data, dim);
+               for (int j=0; j<ir.GetNPoints(); j++)
+               {
+                  npts++;
+                  const IntegrationPoint &ip = ir.IntPoint(j);
+                  T->SetIntPoint(&ip);
+                  T->Transform(ip, tip);
+
+                  double f_val = func_2D_lin(tip);
+
+                  double dgv_gf_val = dgv_xCoef.Eval(*T, ip);
+                  double dgi_gf_val = dgi_xCoef.Eval(*T, ip);
+
+                  dgv_err += fabs(f_val - dgv_gf_val);
+                  dgi_err += fabs(f_val - dgi_gf_val);
+
+                  if (log > 0 && fabs(f_val - dgv_gf_val) > tol)
+                  {
+                     std::cout << e << ":" << j << " dgv " << f_val << " "
+                               << dgv_gf_val << " " << fabs(f_val - dgv_gf_val)
+                               << std::endl;
+                  }
+                  if (log > 0 && fabs(f_val - dgi_gf_val) > tol)
+                  {
+                     std::cout << e << ":" << j << " dgi " << f_val << " "
+                               << dgi_gf_val << " " << fabs(f_val - dgi_gf_val)
+                               << std::endl;
+                  }
+               }
+               dgv_err /= ir.GetNPoints();
+               dgi_err /= ir.GetNPoints();
+
+               REQUIRE(dgv_err == Approx(0.0));
+               REQUIRE(dgi_err == Approx(0.0));
+            }
+         }
+      }
+   }
+   std::cout << my_rank << ": Checked GridFunction::GetValue at "
+             << npts << " 2D points" << std::endl;
+}
+
+TEST_CASE("3D GetValue in Parallel",
+          "[ParGridFunction]"
+          "[GridFunctionCoefficient]"
+          "[Parallel]")
+{
+   int num_procs;
+   MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
+
+   int my_rank;
+   MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
+
+   int log = 1;
+   int n = num_procs;
+   int dim = 3;
+   int order = 1;
+   int npts = 0;
+
+   double tol = 1e-6;
+
+   for (int type = (int)Element::TETRAHEDRON;
+        type <= (int)Element::WEDGE; type++)
+   {
+      Mesh *mesh = new Mesh(n, n, n, (Element::Type)type, 1, 2.0, 3.0, 5.0);
+      ParMesh pmesh(MPI_COMM_WORLD, *mesh);
+      delete mesh;
+
+      FunctionCoefficient linCoef(func_3D_lin);
+
+      SECTION("3D GetValue tests for element type " + std::to_string(type))
+      {
+         DG_FECollection dgv_fec(order, dim, BasisType::GaussLegendre,
+                                 FiniteElement::VALUE);
+         DG_FECollection dgi_fec(order, dim, BasisType::GaussLegendre,
+                                 FiniteElement::INTEGRAL);
+
+         ParFiniteElementSpace dgv_fespace(&pmesh, &dgv_fec);
+         ParFiniteElementSpace dgi_fespace(&pmesh, &dgi_fec);
+
+         ParGridFunction dgv_x(&dgv_fespace);
+         ParGridFunction dgi_x(&dgi_fespace);
+
+         GridFunctionCoefficient dgv_xCoef(&dgv_x);
+         GridFunctionCoefficient dgi_xCoef(&dgi_x);
+
+         dgv_x.ProjectCoefficient(linCoef);
+         dgi_x.ProjectCoefficient(linCoef);
+
+         dgv_x.ExchangeFaceNbrData();
+         dgi_x.ExchangeFaceNbrData();
+
+         SECTION("Shared Face Evaluation 3D")
+         {
+            if (my_rank == 0)
+            {
+               std::cout << "Domain Evaluation 3D" << std::endl;
+            }
+            for (int sf = 0; sf < pmesh.GetNSharedFaces(); sf++)
+            {
+               FaceElementTransformations *FET =
+                  pmesh.GetSharedFaceTransformations(sf);
+               ElementTransformation *T = &FET->GetElement2Transformation();
+               int e = FET->Elem2No;
+               const FiniteElement   *fe = dgv_fespace.GetFE(e);
+               const IntegrationRule &ir = IntRules.Get(fe->GetGeomType(),
+                                                        2*order + 2);
+
+               double h1_err = 0.0;
+               double dgv_err = 0.0;
+               double dgi_err = 0.0;
+
+               double tip_data[dim];
+               Vector tip(tip_data, dim);
+               for (int j=0; j<ir.GetNPoints(); j++)
+               {
+                  npts++;
+                  const IntegrationPoint &ip = ir.IntPoint(j);
+                  T->SetIntPoint(&ip);
+                  T->Transform(ip, tip);
+
+                  double f_val = func_3D_lin(tip);
+
+                  double dgv_gf_val = dgv_xCoef.Eval(*T, ip);
+                  double dgi_gf_val = dgi_xCoef.Eval(*T, ip);
+
+                  dgv_err += fabs(f_val - dgv_gf_val);
+                  dgi_err += fabs(f_val - dgi_gf_val);
+
+                  if (log > 0 && fabs(f_val - dgv_gf_val) > tol)
+                  {
+                     std::cout << e << ":" << j << " dgv " << f_val << " "
+                               << dgv_gf_val << " " << fabs(f_val - dgv_gf_val)
+                               << std::endl;
+                  }
+                  if (log > 0 && fabs(f_val - dgi_gf_val) > tol)
+                  {
+                     std::cout << e << ":" << j << " dgi " << f_val << " "
+                               << dgi_gf_val << " " << fabs(f_val - dgi_gf_val)
+                               << std::endl;
+                  }
+               }
+               dgv_err /= ir.GetNPoints();
+               dgi_err /= ir.GetNPoints();
+
+               REQUIRE(dgv_err == Approx(0.0));
+               REQUIRE(dgi_err == Approx(0.0));
+            }
+         }
+      }
+   }
+   std::cout << my_rank << ": Checked GridFunction::GetValue at "
+             << npts << " 3D points" << std::endl;
+}
+
+TEST_CASE("2D GetVectorValue in Parallel",
+          "[ParGridFunction]"
+          "[VectorGridFunctionCoefficient]"
+          "[Parallel]")
+{
+   int num_procs;
+   MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
+
+   int my_rank;
+   MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
+
+   int log = 1;
    int n = 2 * num_procs;
    int dim = 2;
    int order = 1;
@@ -1974,239 +2195,6 @@
       pmesh.ExchangeFaceNbrData();
       delete mesh;

-      FunctionCoefficient linCoef(func_2D_lin);
-
-      SECTION("2D GetValue tests for element type " + std::to_string(type))
-      {
-         DG_FECollection dgv_fec(order, dim, BasisType::GaussLegendre,
-                                 FiniteElement::VALUE);
-         DG_FECollection dgi_fec(order, dim, BasisType::GaussLegendre,
-                                 FiniteElement::INTEGRAL);
-
-         ParFiniteElementSpace dgv_fespace(&pmesh, &dgv_fec);
-         ParFiniteElementSpace dgi_fespace(&pmesh, &dgi_fec);
-
-         dgv_fespace.ExchangeFaceNbrData();
-         dgi_fespace.ExchangeFaceNbrData();
-
-         ParGridFunction dgv_x(&dgv_fespace);
-         ParGridFunction dgi_x(&dgi_fespace);
-
-         GridFunctionCoefficient dgv_xCoef(&dgv_x);
-         GridFunctionCoefficient dgi_xCoef(&dgi_x);
-
-         dgv_x.ProjectCoefficient(linCoef);
-         dgi_x.ProjectCoefficient(linCoef);
-
-         dgv_x.ExchangeFaceNbrData();
-         dgi_x.ExchangeFaceNbrData();
-
-         SECTION("Shared Face Evaluation 2D")
-         {
-            if (my_rank == 0)
-            {
-               std::cout << "Shared Face Evaluation 2D" << std::endl;
-            }
-            for (int sf = 0; sf < pmesh.GetNSharedFaces(); sf++)
-            {
-               FaceElementTransformations *FET =
-                  pmesh.GetSharedFaceTransformations(sf);
-               ElementTransformation *T = &FET->GetElement2Transformation();
-               int e = FET->Elem2No;
-               const FiniteElement   *fe = dgv_fespace.GetFaceNbrFE(e);
-               const IntegrationRule &ir = IntRules.Get(fe->GetGeomType(),
-                                                        2*order + 2);
-
-               double dgv_err = 0.0;
-               double dgi_err = 0.0;
-
-               double tip_data[dim];
-               Vector tip(tip_data, dim);
-               for (int j=0; j<ir.GetNPoints(); j++)
-               {
-                  npts++;
-                  const IntegrationPoint &ip = ir.IntPoint(j);
-                  T->SetIntPoint(&ip);
-                  T->Transform(ip, tip);
-
-                  double f_val = func_2D_lin(tip);
-
-                  double dgv_gf_val = dgv_xCoef.Eval(*T, ip);
-                  double dgi_gf_val = dgi_xCoef.Eval(*T, ip);
-
-                  dgv_err += fabs(f_val - dgv_gf_val);
-                  dgi_err += fabs(f_val - dgi_gf_val);
-
-                  if (log > 0 && fabs(f_val - dgv_gf_val) > tol)
-                  {
-                     std::cout << e << ":" << j << " dgv " << f_val << " "
-                               << dgv_gf_val << " " << fabs(f_val - dgv_gf_val)
-                               << std::endl;
-                  }
-                  if (log > 0 && fabs(f_val - dgi_gf_val) > tol)
-                  {
-                     std::cout << e << ":" << j << " dgi " << f_val << " "
-                               << dgi_gf_val << " " << fabs(f_val - dgi_gf_val)
-                               << std::endl;
-                  }
-               }
-               dgv_err /= ir.GetNPoints();
-               dgi_err /= ir.GetNPoints();
-
-               REQUIRE(dgv_err == Approx(0.0));
-               REQUIRE(dgi_err == Approx(0.0));
-            }
-         }
-      }
-   }
-   std::cout << my_rank << ": Checked GridFunction::GetValue at "
-             << npts << " 2D points" << std::endl;
-}
-
-TEST_CASE("3D GetValue in Parallel",
-          "[ParGridFunction]"
-          "[GridFunctionCoefficient]"
-          "[Parallel]")
-{
-   int num_procs;
-   MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
-
-   int my_rank;
-   MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
-
-   int log = 1;
-   int n = 2 * num_procs;
-   int dim = 3;
-   int order = 1;
-   int npts = 0;
-
-   double tol = 1e-6;
-
-   for (int type = (int)Element::TETRAHEDRON;
-        type <= (int)Element::WEDGE; type++)
-   {
-      Mesh *mesh = new Mesh(n, n, n, (Element::Type)type, 1, 2.0, 3.0, 5.0);
-      ParMesh pmesh(MPI_COMM_WORLD, *mesh);
-      pmesh.ExchangeFaceNbrData();
-      delete mesh;
-
-      FunctionCoefficient linCoef(func_3D_lin);
-
-      SECTION("3D GetValue tests for element type " + std::to_string(type))
-      {
-         DG_FECollection dgv_fec(order, dim, BasisType::GaussLegendre,
-                                 FiniteElement::VALUE);
-         DG_FECollection dgi_fec(order, dim, BasisType::GaussLegendre,
-                                 FiniteElement::INTEGRAL);
-
-         ParFiniteElementSpace dgv_fespace(&pmesh, &dgv_fec);
-         ParFiniteElementSpace dgi_fespace(&pmesh, &dgi_fec);
-
-         dgv_fespace.ExchangeFaceNbrData();
-         dgi_fespace.ExchangeFaceNbrData();
-
-         ParGridFunction dgv_x(&dgv_fespace);
-         ParGridFunction dgi_x(&dgi_fespace);
-
-         GridFunctionCoefficient dgv_xCoef(&dgv_x);
-         GridFunctionCoefficient dgi_xCoef(&dgi_x);
-
-         dgv_x.ProjectCoefficient(linCoef);
-         dgi_x.ProjectCoefficient(linCoef);
-
-         dgv_x.ExchangeFaceNbrData();
-         dgi_x.ExchangeFaceNbrData();
-
-         SECTION("Shared Face Evaluation 3D")
-         {
-            if (my_rank == 0)
-            {
-               std::cout << "Domain Evaluation 3D" << std::endl;
-            }
-            for (int sf = 0; sf < pmesh.GetNSharedFaces(); sf++)
-            {
-               FaceElementTransformations *FET =
-                  pmesh.GetSharedFaceTransformations(sf);
-               ElementTransformation *T = &FET->GetElement2Transformation();
-               int e = FET->Elem2No;
-               const FiniteElement   *fe = dgv_fespace.GetFE(e);
-               const IntegrationRule &ir = IntRules.Get(fe->GetGeomType(),
-                                                        2*order + 2);
-
-               double h1_err = 0.0;
-               double dgv_err = 0.0;
-               double dgi_err = 0.0;
-
-               double tip_data[dim];
-               Vector tip(tip_data, dim);
-               for (int j=0; j<ir.GetNPoints(); j++)
-               {
-                  npts++;
-                  const IntegrationPoint &ip = ir.IntPoint(j);
-                  T->SetIntPoint(&ip);
-                  T->Transform(ip, tip);
-
-                  double f_val = func_3D_lin(tip);
-
-                  double dgv_gf_val = dgv_xCoef.Eval(*T, ip);
-                  double dgi_gf_val = dgi_xCoef.Eval(*T, ip);
-
-                  dgv_err += fabs(f_val - dgv_gf_val);
-                  dgi_err += fabs(f_val - dgi_gf_val);
-
-                  if (log > 0 && fabs(f_val - dgv_gf_val) > tol)
-                  {
-                     std::cout << e << ":" << j << " dgv " << f_val << " "
-                               << dgv_gf_val << " " << fabs(f_val - dgv_gf_val)
-                               << std::endl;
-                  }
-                  if (log > 0 && fabs(f_val - dgi_gf_val) > tol)
-                  {
-                     std::cout << e << ":" << j << " dgi " << f_val << " "
-                               << dgi_gf_val << " " << fabs(f_val - dgi_gf_val)
-                               << std::endl;
-                  }
-               }
-               dgv_err /= ir.GetNPoints();
-               dgi_err /= ir.GetNPoints();
-
-               REQUIRE(dgv_err == Approx(0.0));
-               REQUIRE(dgi_err == Approx(0.0));
-            }
-         }
-      }
-   }
-   std::cout << my_rank << ": Checked GridFunction::GetValue at "
-             << npts << " 3D points" << std::endl;
-}
-
-TEST_CASE("2D GetVectorValue in Parallel",
-          "[ParGridFunction]"
-          "[VectorGridFunctionCoefficient]"
-          "[Parallel]")
-{
-   int num_procs;
-   MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
-
-   int my_rank;
-   MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
-
-   int log = 1;
-   int n = 2 * num_procs;
-   int dim = 2;
-   int order = 1;
-   int npts = 0;
-
-   double tol = 1e-6;
-
-   for (int type = (int)Element::TRIANGLE;
-        type <= (int)Element::QUADRILATERAL; type++)
-   {
-      Mesh *mesh = new Mesh(n, n, (Element::Type)type, 1, 2.0, 3.0);
-      ParMesh pmesh(MPI_COMM_WORLD, *mesh);
-      pmesh.ExchangeFaceNbrData();
-      delete mesh;
-
       VectorFunctionCoefficient linCoef(dim, Func_2D_lin);

       SECTION("2D GetVectorValue tests for element type " +


Wrong assumptions lead to wrong tests.

Wrong assumptions lead to wrong tests.

Which then also have to be fixed when the wrong assumptions in the code where found and fixed.

part of CURA-9036

--- tests/utils/ExtrusionLineTest.cpp
+++ tests/utils/ExtrusionLineTest.cpp
@@ -8,6 +8,7 @@
 #include <../src/utils/linearAlg2D.h>

 #include <limits>
+#include <numeric>

 namespace cura
 {
@@ -406,7 +407,7 @@
     {
         //Generate a line with several vertices halfway.
         constexpr coord_t spacing = 100;
-        ExtrusionLine colinear_polylines(0, false);;
+        ExtrusionLine colinear_polylines(0, false);
         auto& colinear = colinear_polylines.junctions;
         colinear.emplace_back(Point(0, 0), 200, 0);
         colinear.emplace_back(Point(spacing / 4, 0), 200, 0);
@@ -417,14 +418,13 @@
         colinear_polylines.simplify(25 * 25, 25 * 25, std::numeric_limits<coord_t>::max());

         ASSERT_EQ(colinear_polylines.junctions.size(), 2) << "The degenerate vertices should have been removed.";
-        ASSERT_EQ(colinear[1].w, 500) << "The width of the end-junction should be the average of all removed."; // Since the distances where equal, and they should all have been merged with that one.
     }

     TEST(ExtrusionLineTest, simplifyNoLineWidthVariance)
     {
         //Generate a line with several vertices halfway.
         constexpr coord_t spacing = 100;
-        ExtrusionLine colinear_polylines(0, false);;
+        ExtrusionLine colinear_polylines(0, false);
         auto& colinear = colinear_polylines.junctions;
         colinear.emplace_back(Point(0, 0), 200, 0);
         colinear.emplace_back(Point(spacing / 4, 0), 200, 0);
@@ -432,9 +432,16 @@
         colinear.emplace_back(Point(spacing / 2 + spacing / 4, 0), 600, 0);
         colinear.emplace_back(Point(spacing, 0), 800, 0);

-        colinear_polylines.simplify(25 * 25, 25 * 25, 1);
+        // Get 'before' average width:
+        coord_t averge_width_before = 0;
+        for (size_t i_junction = 0; i_junction < (colinear.size() - 1); ++i_junction)
+        {
+            averge_width_before += ((colinear[i_junction].w + colinear[i_junction + 1].w) / 2) * vSize(colinear[i_junction].p - colinear[i_junction + 1].p);
+        }
+
+        colinear_polylines.simplify(5 * 5, 5 * 5, 5 * 5);

         ASSERT_EQ(colinear_polylines.junctions.size(), 5) << "No junctions should have been removed."; // ... even though they are co-linear!
-        ASSERT_EQ(colinear.back().w, 800) << "The width of the end-junction should not have been changed.";
+        ASSERT_EQ(colinear[0].w + colinear[1].w / 2, averge_width_before) << "The average width of the line should be the same before and after.";
     }
 }


INTEGRATION: CWS warnings01 (1.6.50); FILE MERGED 2005/09/22 22:38:44 sb 1.6.50.2: RESYNC: (1.6-1.7); FILE MERGED 2005/09/14 10:21:53 sb 1.6.50.1: #i53898# Made code warning-free.

--- testshl2/source/versionhelper.cxx
+++ testshl2/source/versionhelper.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: versionhelper.cxx,v $
  *
- *  $Revision: 1.7 $
+ *  $Revision: 1.8 $
  *
- *  last change: $Author: rt $ $Date: 2005-09-09 12:08:39 $
+ *  last change: $Author: hr $ $Date: 2006-06-20 02:28:57 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -45,7 +45,9 @@
          m_pInfo(NULL)
 {
     // try to get the entry pointer
-    FktGetVersionInfoPtr pFunc = (FktGetVersionInfoPtr) m_pModule->getSymbol( rtl::OUString::createFromAscii( "GetVersionInfo" ) );
+    FktGetVersionInfoPtr pFunc = (FktGetVersionInfoPtr)
+        m_pModule->getFunctionSymbol(
+            rtl::OUString::createFromAscii( "GetVersionInfo" ) );

     if (pFunc)
     {


Added support for creating a Future out of a Promise.

git-svn-id: 03d7800a49d8905ef4fbcc296184319e19243493@1132294 13f79535-47bb-0310-9956-ffa450edef68

--- third_party/libprocess/future.hpp
+++ third_party/libprocess/future.hpp
@@ -15,6 +15,7 @@
 {
 public:
   Future();
+  Future(Promise<T>* promise);
   Future(const T& _t);
   Future(const Future<T>& that);
   Future<T>& operator = (const Future<T>& that);
@@ -43,6 +44,19 @@
   t = new T*;
   *t = NULL;
   latch = new Latch();
+}
+
+
+template <typename T>
+Future<T>::Future(Promise<T>* promise)
+{
+  refs = new int;
+  *refs = 1;
+  t = new T*;
+  *t = NULL;
+  latch = new Latch();
+  assert(promise != NULL);
+  promise->associate(*this);
 }


INTEGRATION: CWS changefileheader (1.85.28); FILE MERGED 2008/04/01 16:00:56 thb 1.85.28.3: #i85898# Stripping all external header guards 2008/04/01 12:56:48 thb 1.85.28.2: #i85898# Stripping all external header guards 2008/03/28 15:40:14 rt 1.85.28.1: #i87441# Change license header to LPGL v3.

--- toolkit/source/awt/vclxwindow.cxx
+++ toolkit/source/awt/vclxwindow.cxx
@@ -1,141 +1,68 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  $RCSfile: vclxwindow.cxx,v $
+ * Copyright 2008 by Sun Microsystems, Inc.
  *
- *  $Revision: 1.85 $
+ * OpenOffice.org - a multi-platform office productivity suite
  *
- *  last change: $Author: rt $ $Date: 2008-01-29 15:05:41 $
+ * $RCSfile: vclxwindow.cxx,v $
+ * $Revision: 1.86 $
  *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
+ * This file is part of OpenOffice.org.
  *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
  *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
  *
- *    This library is free software; you can redistribute it and/or
- *    modify it under the terms of the GNU Lesser General Public
- *    License version 2.1, as published by the Free Software Foundation.
- *
- *    This library is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *    Lesser General Public License for more details.
- *
- *    You should have received a copy of the GNU Lesser General Public
- *    License along with this library; if not, write to the Free Software
- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *    MA  02111-1307  USA
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
  *
  ************************************************************************/

 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_toolkit.hxx"
-
-#ifndef _COM_SUN_STAR_AWT_WINDOWEVENT_HPP_
 #include <com/sun/star/awt/WindowEvent.hpp>
-#endif
-#ifndef _COM_SUN_STAR_AWT_KEYEVENT_HPP_
 #include <com/sun/star/awt/KeyEvent.hpp>
-#endif
-#ifndef _COM_SUN_STAR_AWT_KEYMODIFIER_HPP_
 #include <com/sun/star/awt/KeyModifier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_AWT_MOUSEEVENT_HPP_
 #include <com/sun/star/awt/MouseEvent.hpp>
-#endif
-#ifndef _COM_SUN_STAR_AWT_MOUSEBUTTON_HPP_
 #include <com/sun/star/awt/MouseButton.hpp>
-#endif
-#ifndef _COM_SUN_STAR_AWT_XTOPWINDOW_HPP_
 #include <com/sun/star/awt/XTopWindow.hpp>
-#endif
-#ifndef _COM_SUN_STAR_AWT_STYLE_HPP_
 #include <com/sun/star/awt/Style.hpp>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HPP_
 #include <com/sun/star/accessibility/AccessibleRole.hpp>
-#endif
-#ifndef _COM_SUN_STAR_AWT_DOCKINGEVENT_HPP_
 #include <com/sun/star/awt/DockingEvent.hpp>
-#endif
-#ifndef _COM_SUN_STAR_AWT_ENDDOCKINGEVENT_HPP_
 #include <com/sun/star/awt/EndDockingEvent.hpp>
-#endif
-#ifndef _COM_SUN_STAR_AWT_ENDPOPUPMODEEVENT_HPP_
 #include <com/sun/star/awt/EndPopupModeEvent.hpp>
-#endif
-#ifndef _COM_SUN_STAR_AWT_XWINDOWLISTENER2_HPP_
 #include <com/sun/star/awt/XWindowListener2.hpp>
-#endif
-#ifndef _COM_SUN_STAR_STYLE_VERTICALALIGNMENT_HPP_
 #include <com/sun/star/style/VerticalAlignment.hpp>
-#endif
-
-#ifndef _TOOLKIT_AWT_VCLXWINDOW_HXX_
 #include <toolkit/awt/vclxwindow.hxx>
-#endif
-#ifndef _TOOLKIT_AWT_VCLXPOINTER_HXX_
 #include <toolkit/awt/vclxpointer.hxx>
-#endif
-#ifndef _TOOLKIT_HELPER_MACROS_HXX_
 #include <toolkit/helper/macros.hxx>
-#endif
-#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
 #include <toolkit/helper/vclunohelper.hxx>
-#endif
-#ifndef _TOOLKIT_HELPER_CONVERT_HXX_
 #include <toolkit/helper/convert.hxx>
-#endif
-#ifndef _TOOLKIT_HELPER_MACROS_HXX_
 #include <toolkit/helper/macros.hxx>
-#endif
-#ifndef _TOOLKIT_HELPER_PROPERTY_HXX_
 #include <toolkit/helper/property.hxx>
-#endif
-#ifndef TOOLKIT_HELPER_ACCESSIBILITY_CLIENT_HXX
 #include <toolkit/helper/accessibilityclient.hxx>
-#endif
-#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_
 #include <cppuhelper/typeprovider.hxx>
-#endif
-#ifndef _RTL_MEMORY_H_
 #include <rtl/memory.h>
-#endif
-#ifndef _RTL_UUID_H_
 #include <rtl/uuid.h>
-#endif
-#ifndef _RTL_USTRBUF_HXX_
 #include <rtl/ustrbuf.hxx>
-#endif
-
-#ifndef _SV_SVAPP_HXX
 #include <vcl/svapp.hxx>
-#endif
-#ifndef _SV_WINDOW_HXX
 #include <vcl/window.hxx>
-#endif
-#ifndef _TOOLS_COLOR_HXX
 #include <tools/color.hxx>
-#endif
-#ifndef _SV_DOCKWIN_HXX
 #include <vcl/dockwin.hxx>
-#endif
-#ifndef _VCL_PDFEXTOUTDEVDATA_HXX
 #include <vcl/pdfextoutdevdata.hxx>
-#endif
 #include <vcl/tabpage.hxx>
-
-#ifndef COMPHELPER_ASYNCNOTIFICATION_HXX
 #include <comphelper/asyncnotification.hxx>
-#endif
-#ifndef TOOLKIT_INC_TOOLKIT_HELPER_SOLARRELEASE_HXX
 #include <toolkit/helper/solarrelease.hxx>
-#endif

 #include <toolkit/helper/unopropertyarrayhelper.hxx>


Only set the destination resource if we are moving.

This avoids one useless SELECT query per notification message.

--- server/src/storage/notificationcollector.cpp
+++ server/src/storage/notificationcollector.cpp
@@ -170,7 +170,8 @@
   if ( op == NotificationMessage::Remove )
     msg.setItemParts( QSet<QByteArray>() << item.remoteRevision().toUtf8() );

-  msg.setDestinationResource( collectionDest.resource().name().toLatin1() );
+  if ( collectionDest.isValid() ) // only relevant for moves
+    msg.setDestinationResource( collectionDest.resource().name().toLatin1() );

   Collection col = collection;
   if ( !col.isValid() )


fix bug: new created task should be received into ptr, or it may be destroyed before return

--- meta_server/meta_state_service_simple.cpp
+++ meta_server/meta_state_service_simple.cpp
@@ -301,7 +301,7 @@
             const blob& value,
             clientlet* tracker )
         {
-            auto task = tasking::create_late_task(cb_code, cb_create, 0, tracker);
+            task_ptr task = tasking::create_late_task(cb_code, cb_create, 0, tracker);
             write_log(
                 create_node_log::get_log(node, value),
                 [=]{
@@ -319,7 +319,7 @@
             const err_callback& cb_delete,
             clientlet* tracker)
         {
-            auto task = tasking::create_late_task(cb_code, cb_delete, 0, tracker);
+            task_ptr task = tasking::create_late_task(cb_code, cb_delete, 0, tracker);
             write_log(
                 delete_node_log::get_log(node, recursively_delete),
                 [=] {
@@ -392,7 +392,7 @@
             const err_callback& cb_set_data,
             clientlet* tracker)
         {
-            auto task = tasking::create_late_task(cb_code, cb_set_data, 0, tracker);
+            task_ptr task = tasking::create_late_task(cb_code, cb_set_data, 0, tracker);
             write_log(
                 set_data_log::get_log(node, value),
                 [=] {


Update rest_configuration.cpp

Update rest_configuration.cpp

--- rest_configuration.cpp
+++ rest_configuration.cpp
@@ -2157,9 +2157,9 @@
         rsp.list.append(rspItem);
     }

-    if (map.contains("gwDisablePJSecurisation")) // optional
-    {
-        bool v = map["gwDisablePJSecurisation"].toBool();
+    if (map.contains("DisablePJSecurisation")) // optional
+    {
+        bool v = map["DisablePJSecurisation"].toBool();

         if (gwWebSocketNotifyAll != v)
         {
@@ -2169,7 +2169,7 @@
         }
         QVariantMap rspItem;
         QVariantMap rspItemState;
-        rspItemState["/config/gwDisablePJSecurisation"] = v;
+        rspItemState["/config/DisablePJSecurisation"] = v;
         rspItem["success"] = rspItemState;
         rsp.list.append(rspItem);
     }


[kernel] fix bug in EventDriven.cpp.

[kernel] fix bug in EventDriven.cpp.

--- kernel/src/simulationTools/EventDriven.cpp
+++ kernel/src/simulationTools/EventDriven.cpp
@@ -518,9 +518,9 @@
      free(xdottmp);
      */
   // Update the output from level 0 to level 1
-  model()->nonSmoothDynamicalSystem()->updateOutput(0);
-  model()->nonSmoothDynamicalSystem()->updateOutput(1);
-  model()->nonSmoothDynamicalSystem()->updateOutput(2);
+  model()->nonSmoothDynamicalSystem()->updateOutput(t,0);
+  model()->nonSmoothDynamicalSystem()->updateOutput(t,1);
+  model()->nonSmoothDynamicalSystem()->updateOutput(t,2);
   //
   for (std11::tie(ui, uiend) = _indexSet0->vertices(); ui != uiend; ++ui)
   {


Fix crash due to readAliases() being called before fw()->data is set

Noticed on the travis sanitize pass. Weird this didn't break other
things

--- framework/physfs_fs.cpp
+++ framework/physfs_fs.cpp
@@ -294,10 +294,11 @@
 	return result;
 }

-static std::list<UString> recursiveFindFilesInDirectory(UString path, const UString &extension)
+static std::list<UString> recursiveFindFilesInDirectory(const FileSystem &fs, UString path,
+                                                        const UString &extension)
 {
 	std::list<UString> foundFiles;
-	auto list = fw().data->fs.enumerateDirectory(path, "");
+	auto list = fs.enumerateDirectory(path, "");
 	for (auto &entry : list)
 	{
 		if (entry.endsWith(extension))
@@ -306,7 +307,7 @@
 		}
 		else
 		{
-			auto subdirFiles = recursiveFindFilesInDirectory(path + "/" + entry, extension);
+			auto subdirFiles = recursiveFindFilesInDirectory(fs, path + "/" + entry, extension);
 			foundFiles.insert(foundFiles.end(), subdirFiles.begin(), subdirFiles.end());
 		}
 	}
@@ -316,7 +317,7 @@
 std::list<UString> FileSystem::enumerateDirectoryRecursive(const UString &basePath,
                                                            const UString &extension) const
 {
-	return recursiveFindFilesInDirectory(basePath, extension);
+	return recursiveFindFilesInDirectory(*this, basePath, extension);
 }

 } // namespace OpenApoc


Fix error in ClusterMethodAgent unit test.

--- test/lib/IsingTest.cpp
+++ test/lib/IsingTest.cpp
@@ -150,7 +150,7 @@

     Ising::Cell *startingPoint = grid[5];
     MockRandomnessDelegate delegate(true,0);
-    ClusterMethodAgent agent(&delegate,2);
+    ClusterMethodAgent agent(&delegate,1);
     agent.performMethodAtCell(startingPoint);

     std::set<Ising::Cell *> expectedCells;


Fine-tuning

Fine-tuning

svn path=/branches/work/kdab-post-4.0/kdepim/; revision=733494

--- kleopatra/uiserver/decryptverifywizard.cpp
+++ kleopatra/uiserver/decryptverifywizard.cpp
@@ -234,6 +234,7 @@
       operationsPage( q ),
       resultPage( q )
 {
+    q->setOptions( q->options() | NoBackButtonOnStartPage | NoBackButtonOnLastPage );
     q->addPage( &operationsPage );
     q->addPage( &resultPage );
 }
@@ -253,6 +254,7 @@
     setSubTitle( i18n("FIXME Here, you can check and, if needed, override "
                       "the operations Kleopatra detected for the input given.") );
     setCommitPage( true );
+    setButtonText( QWizard::CommitButton, i18n("&Decrypt/Verify") );
 }

 OperationsPage::~OperationsPage() {}


Heavier test coverage of unique_id() reads

Our previous test coverage didn't break for me until the first time I
ran it on a 24 core system, because for most other partitionings, even
though the unique_id values were wrong, they weren't wrong *enough* to
break the Hilbert sorting.

Let's just actually test that the unique_id values are right.

--- tests/mesh/slit_mesh_test.C
+++ tests/mesh/slit_mesh_test.C
@@ -368,6 +368,10 @@
     const std::vector<Point> & xyz = fe->get_xyz();
     fe->get_phi();

+    // While we're in the middle of a unique id based test case, let's
+    // make sure our unique ids were all read in correctly too.
+    UniquePtr<PointLocatorBase> locator = _mesh->sub_point_locator();
+
     MeshBase::const_element_iterator       el     =
       mesh2.active_local_elements_begin();
     const MeshBase::const_element_iterator end_el =
@@ -376,6 +380,22 @@
     for (; el != end_el; ++el)
       {
         const Elem * elem = *el;
+
+        const Elem * mesh1_elem = (*locator)(elem->centroid());
+        if (mesh1_elem)
+          {
+            CPPUNIT_ASSERT_EQUAL( elem->unique_id(),
+                                  mesh1_elem->unique_id() );
+
+            for (unsigned int n=0; n != elem->n_nodes(); ++n)
+              {
+                Node & node       = elem->node_ref(n);
+                Node & mesh1_node = mesh1_elem->node_ref(n);
+                CPPUNIT_ASSERT_EQUAL( node.unique_id(),
+                                      mesh1_node.unique_id() );
+              }
+          }
+
         context.pre_fe_reinit(sys2, elem);
         context.elem_fe_reinit();


Fix test for Metis

Fix test for Metis

--- test/metis_support.cpp
+++ test/metis_support.cpp
@@ -23,11 +23,12 @@
 // Eigen. If not, see <http://www.gnu.org/licenses/>.
 #include "sparse_solver.h"
 #include <Eigen/SparseLU>
+#include <Eigen/MetisSupport>
 #include <unsupported/Eigen/SparseExtra>

 template<typename T> void test_metis_T()
 {
-  SparseLU<SparseMatrix<T, ColMajor>, COLAMDOrdering<int> > sparselu_metis;
+  SparseLU<SparseMatrix<T, ColMajor>, MetisOrdering<int> > sparselu_metis;

   check_sparse_square_solving(sparselu_metis);
 }


Set nco:ContactUid on new contacts. It is compromised on the account ID and the contact ID

i.e gabble/davidedmundson@gmail.com_foo@example.com

REVIEW: 112729

--- kpeople/nepomuk-feeder/nepomuk-storage.cpp
+++ kpeople/nepomuk-feeder/nepomuk-storage.cpp
@@ -604,6 +604,8 @@
     newImAccount.setProperty(NCO::imAccountType(), accountRes.protocol());
     newImAccount.addProperty(NCO::isAccessedBy(), accountUri);

+    newPersonContact.setProperty(NCO::contactUID(), path + QLatin1Char('_') + contact->id());
+
     newPersonContact.addProperty(NCO::hasIMAccount(), newImAccount);
     updateAlias(newPersonContact, newImAccount, contact->alias());
     updateContactGroups(newPersonContact, contact->groups());


SWDEV-244287 - Keep direct dispatch for Linux only

Change-Id: I09333bb40d239cb42c732df5ea16d17eeaeff5e6

--- rocclr/hip_context.cpp
+++ rocclr/hip_context.cpp
@@ -39,7 +39,7 @@
   if (!amd::Runtime::initialized()) {
     amd::IS_HIP = true;
     GPU_NUM_MEM_DEPENDENCY = 0;
-    AMD_DIRECT_DISPATCH = flagIsDefault(AMD_DIRECT_DISPATCH) ? 1 : AMD_DIRECT_DISPATCH;
+    AMD_DIRECT_DISPATCH = flagIsDefault(AMD_DIRECT_DISPATCH) ? IS_LINUX : AMD_DIRECT_DISPATCH;
     amd::Runtime::init();
   }


BUG: Coverity resrouce leak in itkQuadEdgeTest1.

Fix covertity bug reported as: CID 1081081 (#1 of 8): Resource leak
(RESOURCE_LEAK) 8. leaked_storage: Variable "quadEdge1" going out of scope
leaks the storage it points to.

Change-Id: Ieb026e5d4917524396a783d3504c3f893790087e

--- Modules/Core/QuadEdgeMesh/test/itkQuadEdgeTest1.cxx
+++ Modules/Core/QuadEdgeMesh/test/itkQuadEdgeTest1.cxx
@@ -1166,21 +1166,23 @@
     // Tests for the IsIsolated() method
     { // create a local scope for these tests
     QuadEdgeType * quadEdge1 = new QuadEdgeType;
-    QuadEdgeType * quadEdge2 = new QuadEdgeType;
-
     const QuadEdgeType * quadEdge1c = quadEdge1;

     if( quadEdge1c->IsIsolated() != true )
       {
       std::cerr << "Error in IsIsolated() A" << std::endl;
-      return EXIT_FAILURE;
-      }
-
+      delete quadEdge1;
+      return EXIT_FAILURE;
+      }
+
+    QuadEdgeType * quadEdge2 = new QuadEdgeType;
     quadEdge1->SetOnext( quadEdge2 );

     if( quadEdge1c->IsIsolated() != false )
       {
       std::cerr << "Error in IsIsolated() B" << std::endl;
+      delete quadEdge1;
+      delete quadEdge2;
       return EXIT_FAILURE;
       }

@@ -1189,6 +1191,8 @@
     if( quadEdge1c->IsIsolated() != true )
       {
       std::cerr << "Error in IsIsolated() C" << std::endl;
+      delete quadEdge1;
+      delete quadEdge2;
       return EXIT_FAILURE;
       }


#105726# properly EnableEmptyFieldValue (broken in 1.44)

--- extensions/source/propctrlr/formcontroller.cxx
+++ extensions/source/propctrlr/formcontroller.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: formcontroller.cxx,v $
  *
- *  $Revision: 1.51 $
+ *  $Revision: 1.52 $
  *
- *  last change: $Author: fs $ $Date: 2002-10-25 12:49:51 $
+ *  last change: $Author: fs $ $Date: 2002-12-02 13:16:38 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -2074,9 +2074,10 @@
                             }

                             // and allow empty values only for the default value and the value
-                            ((OFormattedNumericControl*)pProperty->pControl)->EnableEmptyField(PROPERTY_ID_DEFAULT_VALUE == nPropId);
-                            ((OFormattedNumericControl*)pProperty->pControl)->EnableEmptyField(PROPERTY_ID_VALUE == nPropId);
-                        }
+                            static_cast< OFormattedNumericControl* >( pProperty->pControl )
+                                ->EnableEmptyField( ( PROPERTY_ID_DEFAULT_VALUE == nPropId )
+                                                ||  ( PROPERTY_ID_VALUE == nPropId ) );
+}
                         else
                         {
                             if ( (nPropId== PROPERTY_ID_HEIGHT || nPropId== PROPERTY_ID_WIDTH || nPropId== PROPERTY_ID_ROWHEIGHT)
@@ -2740,6 +2741,9 @@
 /*************************************************************************
  * history:
  *  $Log: not supported by cvs2svn $
+ *  Revision 1.51  2002/10/25 12:49:51  fs
+ *  #104512# fixed some controls leaking
+ *
  *  Revision 1.50  2002/08/22 10:49:52  oj
  *  #96105# set the modified flag at the model
  *


add article lookup for chest

add article lookup for chest

--- IslandMUD/constants.cpp
+++ IslandMUD/constants.cpp
@@ -213,6 +213,7 @@
 		temp_articles[C::BOARD_ID] =
 			temp_articles[C::BOW_ID] =
 			temp_articles[C::BRANCH_ID] =
+			temp_articles[C::CHEST_ID] =
 			temp_articles[C::FORGE_ID] =
 			temp_articles[C::HAMMER_ID] =
 			temp_articles[C::LIMESTONE_ID] =


#86096# +implGetInt32FontProperty / +implInvalidateItem

--- extensions/source/propctrlr/propcontroller.hxx
+++ extensions/source/propctrlr/propcontroller.hxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: propcontroller.hxx,v $
  *
- *  $Revision: 1.8 $
- *
- *  last change: $Author: fs $ $Date: 2001-05-30 13:41:46 $
+ *  $Revision: 1.9 $
+ *
+ *  last change: $Author: fs $ $Date: 2001-06-06 08:14:28 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -135,6 +135,7 @@
 class SvNumberFormatsSupplierObj;
 class Font;
 class Window;
+class SfxItemSet;

 //............................................................................
 namespace pcr
@@ -364,7 +365,14 @@
         sal_Bool        implGetCheckFontProperty(const ::rtl::OUString& _rPropName, ::com::sun::star::uno::Any& _rValue);
         ::rtl::OUString implGetStringFontProperty(const ::rtl::OUString& _rPropName, const ::rtl::OUString& _rDefault);
         sal_Int16       implGetInt16FontProperty(const ::rtl::OUString& _rPropName, const sal_Int16 _nDefault);
+        sal_Int32       implGetInt32FontProperty(const ::rtl::OUString& _rPropName, const sal_Int32 _nDefault);
         float           implGetFloatFontProperty(const ::rtl::OUString& _rPropName, const float _nDefault);
+
+        void            implInvalidateItem(
+                            const ::rtl::OUString& _rPropName,
+                            sal_uInt16 _nItemId,
+                            SfxItemSet& _rSet,
+                            sal_Bool _bForceInvalidation = sal_False);

         ::rtl::OUString convertSimpleToString(const ::com::sun::star::uno::Any& _rValue);

@@ -383,6 +391,9 @@
 /*************************************************************************
  * history:
  *  $Log: not supported by cvs2svn $
+ *  Revision 1.8  2001/05/30 13:41:46  fs
+ *  #86838# be a focus listener on the container window, forward the focus to the property box
+ *
  *  Revision 1.7  2001/05/29 10:44:32  fs
  *  #87461# +OnImageURLClicked
  *


docs fix

docs fix

git-svn-id: 931ab4487dc05a11552de95f7d42b8249ade56b7@2351 a5045d30-4826-4484-9c7f-6e55a06ddc77

--- Code/GraphMol/Wrap/SDWriter.cpp
+++ Code/GraphMol/Wrap/SDWriter.cpp
@@ -58,9 +58,11 @@
     2) writing to a file-like object: \n\
        >>> import gzip\n\
        >>> outf=gzip.open('out.sdf.gz','w+')\n\
-       >>> writer = ForwardSDMolSupplier(outf)\n\
+       >>> writer = SDWriter(outf)\n\
        >>> for mol in list_of_mols:\n \
        ...   writer.write(mol)\n\
+       >>> writer.close()\n\
+       >>> outf.close()\n\
 \n\
   By default all non-private molecular properties are written to the SD file.\n\
   This can be changed using the SetProps method:\n\


Fix compilatopn error in gcc

Fix compilatopn error in gcc

--- OpenSim/Simulation/OpenSense/OpenSenseUtilities.cpp
+++ OpenSim/Simulation/OpenSense/OpenSenseUtilities.cpp
@@ -120,7 +120,7 @@
     );

     for (size_t i = 0; i < orientationTable.getNumRows(); ++i) {
-        auto& rotationsRow = orientationTable.updRowAtIndex(i);
+        RowVectorView_<SimTK::Rotation>& rotationsRow = orientationTable.updRowAtIndex(i);
         for (int j = 0; j < nc; ++j) {
             rotationsRow[j] = R_HG*rotationsRow[j];
         }


Slimmed down luke's analysis task

Slimmed down luke's analysis task

--- PWG2/SPECTRA/LambdaK0PbPb/AliAnalysisTaskLukeV0.cxx
+++ PWG2/SPECTRA/LambdaK0PbPb/AliAnalysisTaskLukeV0.cxx
@@ -22,6 +22,7 @@
  * Based on tutorial example from offline pages
  * Edited by Arvinder Palaha
  * Adapted by Luke Hanratty
+ * ------------------------*
  *
  */


PWGGA/GammaConv: added INT7 mEMC mult configs for pp 5 TeV


remove unnecessary 'using' lines

remove unnecessary 'using' lines

Change-Id: I7efc18ac16223f83bb9839a76643291f7334ef91

--- rsc/source/rsc/rsc.cxx
+++ rsc/source/rsc/rsc.cxx
@@ -59,10 +59,6 @@
 #include <vector>
 #include <algorithm>

-using ::rtl::OUString;
-using ::rtl::OString;
-using ::rtl::OStringBuffer;
-using ::rtl::OStringToOUString;
 using comphelper::string::getToken;
 using comphelper::string::getTokenCount;


Follow Markdown guidelines for italic and bold text.

--- Comments/src/items/VComment.cpp
+++ Comments/src/items/VComment.cpp
@@ -292,10 +292,10 @@
 	QRegExp rx;

 	rx.setPattern("\\*\\*([^\\*]+)\\*\\*");
+	str.replace(rx, "\\1");
+
+	rx.setPattern("\\*([^\\*]+)\\*");
 	str.replace(rx, "\\1");
-
-	rx.setPattern("\\*([^\\*]+)\\*");
-	str.replace(rx, "\\1");

 	return str;
 }


bugfix add task (changed int into double in task but forgot to update addtask)

--- PWGJE/EMCALJetTasks/macros/AddTaskRhoVnModulation.C
+++ PWGJE/EMCALJetTasks/macros/AddTaskRhoVnModulation.C
@@ -22,7 +22,7 @@
   Bool_t     fillQA             = kTRUE,
   TString    fitOpts            = "WLQI",
   UInt_t     fitType            = AliAnalysisTaskRhoVnModulation::kFourierSeries,
-  TArrayI    *centralities      = 0x0,
+  TArrayD    *centralities      = 0x0,
   TRandom3   *randomizer        = 0x0,
   Double_t   trackptcut         = .15
   )
@@ -87,8 +87,8 @@
   jetTask->SetRandomConeRadius(jetradius);
   // if centralities haven't been specified use defaults
   if(!centralities) {
-     Int_t c[] = {0, 10, 30, 50, 70, 90};
-     jetTask->SetCentralityClasses(new TArrayI(sizeof(c)/sizeof(c[0]), c));
+     Double_t c[] = {0., 10., 30., 50., 70., 90.};
+     jetTask->SetCentralityClasses(new TArrayD(sizeof(c)/sizeof(c[0]), c));
   }
   // if a randomized hasn't specified use a safe default
   if(!randomizer) jetTask->SetRandomSeed(new TRandom3(0));


Removed unnecessary include

Removed unnecessary include

Former-commit-id: 9e9cc52ce55c9e6ec3509b230351faf9584daa53

--- test/opengl/select.cpp
+++ test/opengl/select.cpp
@@ -2,11 +2,7 @@
 #include <stdio.h>
 #include <stdlib.h>

-#include <functional>
-
 using namespace Halide;
-
-

 int test_per_channel_select() {


Delete QUEUES.H

Delete QUEUES.H

--- wiz/wiz/QUEUES.H
+++ wiz/wiz/QUEUES.H
@@ -1,382 +0,0 @@
-#ifndef QUEUES_H_INCLUDED
-#define QUEUES_H_INCLUDED
-
-#include <wiz/global.h>
-#include <wiz/wizardError.h>
-#include <wiz/newarrays.h>
-
-/// #define QUEUES_DEBUG
-
-namespace wiz{
-class QueueEmptyError : public wiz::Error
-{
-public:
-    QueueEmptyError() : wiz::Error( "queueEmptyError" )
-    {
-
-    }
-};
-class QueueFullError : public wiz::Error
-{
-public:
-    QueueFullError() : wiz::Error( "queueFullError" )
-    {
-
-    }
-};
-
-// check array Queue, array stack?
-template <typename T>
-class Queue //: public wizObject
-{
-private:
-    class Element
-    {
-    public:
-        Element* next;
-        T data;
-    public:
-        explicit Element( const T d = T() )
-        {
-            data = d;
-            next =  nullptr;
-        }
-    };
-private:
-    Element* Head; //
-    Element* Rear; //
-public:
-    explicit Queue() : Head( nullptr ), Rear( nullptr ) { Head = new Element(); Rear = Head; }
-
-    virtual ~Queue(){
-        clear();
-        delete Head; Head = Rear = nullptr;
-    }
-    void clear()
-    {
-        while( !isEmpty() ){
-           deleteq();
-        }
-     }
-    bool isEmpty() const
-    {
-        return nullptr == Head->next; /// size == 0, empty..
-    }
-    bool empty() const { return isEmpty(); }
-    //
-    void addq( const T& p ) /// push
-    {
-        Element* temp = new Element(p); //
-        //
-        Rear->next = temp;//
-        temp->next = nullptr;// auto look def of Element
-        Rear = Rear->next; //
-    }//
-    void push( const T& p ) { addq( p ); }
-    T deleteq(){ /// pop
-        if( isEmpty() )
-        {
-            throw QueueEmptyError();
-        }
-        //
-        Element* temp = Head->next;//
-        Head->next = temp->next;
-        //Rear 처리
-        if( nullptr == Head->next )
-            Rear = Head;
-        T returnTemp = temp->data;
-        delete temp;
-        return returnTemp;
-    }
-    T pop() { return deleteq(); }
-    Queue& operator<<( const T& p ){
-        addq( p ); //
-        return *this;
-    }
-private:
-    void copy( const Queue<T>& q )
-    {
-        //this->clear();
-
-        Element* qTemp = q.Head->next;
-
-        while( qTemp != nullptr )
-        {
-            addq( qTemp->data );
-            qTemp = qTemp->next;
-        }
-    }
-public:
-    //
-    Queue( const Queue<T>& q ) : Head( nullptr ), Rear( nullptr )
-    {// clear();
-        Head = new Element(); Rear = Head;
-        copy( q );
-    }
-    Queue& operator=( const Queue<T>& q )
-    {
-        if( Head == q.Head ) { return *this; }
-
-        clear();
-
-        // head, rear reser..!!
-        copy( q );
-
-        return *this;
-    }
-    Queue( Queue<T>&& q )
-    {
-        Head->next = q.Head->next;
-        Rear = q.Rear;
-
-        /// do-empty..
-        q.Head->next = nullptr;
-        q.Rear = q.Head;
-    }
-    Queue<T>& operator=( Queue<T>&& q )
-    {
-        if( Head == q.Head ) { return *this; }
-        this->clear();
-        Head->next = q.Head->next;
-        Rear = q.Rear;
-
-q.Head->next = nullptr;
-q.Rear = q.Head;
-return *this;
-	}
-};
-
-// Queue using Array
-template <class T>
-class ArrayQueue
-{
-public:
-	ArrayQueue(const ArrayQueue<T>& aq)
-		:que(aq.que), start(aq.start), num(aq.num)
-	{
-		//
-	}
-	ArrayQueue(ArrayQueue<T>&& aq)
-	{
-		que = std::move(aq.que);
-		start = aq.start;
-		num = aq.num;
-
-		aq.que = Array<T>(2);
-		aq.start = 0;
-		aq.num = 0;
-	}
-	ArrayQueue<T>& operator=(ArrayQueue<T>&& aq)
-	{
-		if (que == aq.que) { return *this; }
-		this->que.DoEmpty();
-		que = std::move(aq.que);
-		start = aq.start;
-		num = aq.num;
-
-		aq.que = Array<T>(2);
-		aq.start = 0;
-		aq.num = 0;
-		return *this;
-	}
-	ArrayQueue<T>& operator=(const ArrayQueue<T>& aq)
-	{
-		if (que == aq.que) { return *this; }
-		que.DoEmpty();
-		this->que = aq.que;
-		this->start = aq.start;
-		this->num = aq.num;
-		return *this;
-	}
-private:
-	Array<T> que;
-	int start;
-	int num;
-public:
-	explicit ArrayQueue(const int max = 2) : start(0), num(0)
-	{
-#ifdef QUEUES_DEBUG
-		// max > 0
-		wiz::checkUnderError(0, max, 1);
-#endif
-		que = Array<T>(max);
-	}
-	virtual ~ArrayQueue()
-	{
-	}
-public:
-	const T& operator[](const int idx) const
-	{
-		return que[(start + idx) & (que.size() - 1)];
-	}
-	T& operator[](const int idx)
-	{
-		return que[(start + idx) & (que.size() - 1)];
-	}
-public:
-	void push(const ArrayQueue<T>& val) {
-		if (val.empty()) { return; }
-		int newSize = this->que.size();
-
-		while (newSize - num < val.size()) {
-			newSize = newSize * 2;
-		}
-		if (newSize != this->que.size()) {
-			// expand array queue.
-			ArrayQueue<T> temp(newSize);
-			temp.start = 0;
-			//
-			for (int i = 0; i < this->size(); ++i) {
-				temp[i] = std::move((*this)[i]);
-			}
-
-			const int iend = val.num;
-			for (int i = 0; i < iend; ++i) {
-				temp[i + this->num] = val[i];
-			}
-
-			temp.num = this->num + val.num;
-			*this = std::move(temp);
-		}
-		else {
-			for (int i = 0; i < val.size(); ++i) {
-				this->push(val.que[i]);
-			}
-		}
-	}
-	void push(ArrayQueue<T>&& val) { // chk..
-		if (val.empty()) { return; }
-		int newSize = this->que.size();
-
-		while (newSize - num < val.size()) {
-			newSize = newSize * 2;
-		}
-		if (newSize != this->que.size()) {
-			// expand array queue.
-			ArrayQueue temp(newSize);
-			temp.start = 0;
-			//
-			for (int i = 0; i < this->size(); ++i) {
-				temp[i] = std::move((*this)[i]);
-			}
-
-			const int iend = val.num;
-			for (int i = 0; i < iend; ++i) {
-				temp[i + this->num] = std::move(val[i]);
-			}
-
-			temp.num = this->num + val.num;
-			*this = std::move(temp);
-		}
-		else {
-			for (int i = 0; i < val.size(); ++i) {
-				this->push(std::move(val[i]));
-			}
-		}
-	}
-    void push( const T& val )
-    {
-        if( isFull() )
-        {
-            // expand array queue.
-            ArrayQueue temp( que.size() * 2 );
-            //
-			for (int i = 0; i < que.size(); ++i) {
-				temp[i] = std::move(que[(start + i) & (que.size()-1)]);
-			}
-			temp.start = 0;
-			temp.num = que.size();
-
-            *this = std::move( temp );
-        }
-        que[(start+num) & (que.size()-1)] = val;
-        num++;
-    }
-
-	void push(T&& val)
-	{
-		if (isFull())
-		{
-			// expand array queue.
-			ArrayQueue temp(que.size() * 2);
-			//
-			for (int i = 0; i < que.size(); ++i) {
-				temp[i] = std::move(que[(start + i) & (que.size()-1)]);
-			}
-			temp.start = 0;
-			temp.num = que.size();
-
-			*this = std::move(temp);
-		}
-		que[(start + num) & (que.size()-1)] = std::move(val);
-		num++;
-	}
-
-	void pop(T* t = nullptr) {
-		if (isEmpty()) { throw QueueEmptyError(); }
-
-		T temp = std::move(que[start]);
-
-		//que[start] = T();
-
-		start = (start + 1) & (que.size() - 1); // % que.size(), 2^n.
-		num--;
-
-		if (nullptr != t) {
-			*t = move(temp);
-		}
-	}
-
-	T pop_back()
-	{
-		if (isEmpty()) { throw QueueEmptyError(); }
-		T temp = std::move((*this)[num - 1]);
-
-		//(*this)[num - 1] = T();
-
-		num--;
-
-		return temp;
-	}
-
-    bool isFull()const
-    {
-        return num >= ( que.size() );
-    }
-
-    bool isEmpty()const
-    {
-        return 0 == num;
-    }
-    int size()const{ return num; }
-    bool empty()const { return isEmpty(); }
-    int getNumMax()const { return que.size(); }
-    int getNum()const { return num; }
-    Array<T> toArray()const
-    {
-        Array<T> temp;
-
-        if( num > 0 )
-        {
-            temp = Array<T>( num );
-            int count=0;
-
-            for( int i=0; i < num; i++ )
-            {
-                temp[i] = que[ ( start + i ) % (que.size()) ];
-            }
-        }
-
-        return temp;
-    }
-
-    ArrayQueue<T>& operator<<( const T& data )
-    {
-        push( data );
-
-        return *this;
-    }
-};
-
-}
-#endif // QUEUES_H_INCLUDED


(CPlusPlusImport::print) : Fix a bug.

(CPlusPlusImport::print) : Fix a bug.

--- esidl/src/cplusplus.cpp
+++ esidl/src/cplusplus.cpp
@@ -833,16 +833,15 @@

     void print()
     {
-        if (importSet.empty())
-        {
-            return;
-        }
+        bool newline = false;
+
         for (std::set<std::string>::iterator i = importSet.begin();
              i != importSet.end();
              ++i)
         {
             size_t pos = ns->enter(*i);
             writeln("class %s;", (*i).substr(pos).c_str());
+            newline = true;
         }

         for (std::list<Member*>::iterator i = typedefList.begin();
@@ -855,10 +854,14 @@
                 size_t pos = ns->enter(name);
                 CPlusPlusInterface cplusplusInterface(source, this);
                 cplusplusInterface.at(*i);
-            }
-        }
-
-        write("\n");
+                newline = true;
+            }
+        }
+
+        if (newline)
+        {
+            write("\n");
+        }
     }
 };


Bug 591999: Fixed the logic for rememberedStackTop (r=fklockii)

CL@1082377

--- MMgc/GC.cpp
+++ MMgc/GC.cpp
@@ -1550,10 +1550,18 @@
     {
         GC* gc = (GC*)arg;
         char* stackBase = (char*)gc->GetStackTop();
-
-        // this is where we will clear to when CleanStack is called
-        if(gc->rememberedStackTop < stackPointer)
+        // The logic for maintaining rememberedStackTop assumes that
+        // the stack grows "downwards" (i.e., from higher to lower
+        // addresses). Let's check that this is the case. If it's not,
+        // we'll have to slightly tweak the logic below.
+        GCAssert((uintptr_t) stackPointer <= AVMPI_getThreadStackBase());
+
+        // We will clear up to rememberedStackTop when CleanStack is
+        // called. We assume that the stack grows "downwards", so we
+        // keep track of the lowest address we observe stackPointer to reach.
+        if (gc->rememberedStackTop == NULL || stackPointer < gc->rememberedStackTop) {
             gc->rememberedStackTop = stackPointer;
+        }

         // Push the stack onto the mark stack and then mark synchronously until
         // everything reachable from the stack has been marked.


refs #5842 fix allocation bug

refs #5842 fix allocation bug

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@52267 c7de825b-a66e-492c-adef-691d508d4ae1

--- ft/ft_node-serialize.cc
+++ ft/ft_node-serialize.cc
@@ -2961,7 +2961,7 @@
     if (0) printf("Deserializing Block %" PRId64 "\n", blocknum.b);

     DISKOFF size_aligned = roundup_to_multiple(512, size);
-    uint8_t *XMALLOC_N_ALIGNED(512, size, raw_block);
+    uint8_t *XMALLOC_N_ALIGNED(512, size_aligned, raw_block);
     {
         // read the (partially compressed) block
         ssize_t rlen = toku_os_pread(fd, raw_block, size_aligned, offset);


disable use of lockf on FreeBSD.

disable use of lockf on FreeBSD.

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@9088 27541ba8-7e3a-0410-8455-c3a389f83636

--- utils/src/rlibmap.cxx
+++ utils/src/rlibmap.cxx
@@ -1,4 +1,4 @@
-// @(#)root/utils:$Name:  $:$Id: rlibmap.cxx,v 1.12 2004/05/17 17:40:00 rdm Exp $
+// @(#)root/utils:$Name:  $:$Id: rlibmap.cxx,v 1.13 2004/05/19 16:12:58 rdm Exp $
 // Author: Fons Rademakers   05/12/2003

 /*************************************************************************
@@ -341,7 +341,7 @@
    }

    if (replace) {
-#if !defined(WIN32) && !defined(__CYGWIN__)
+#if !defined(WIN32) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
       // lock file
       if (lockf(fileno(fp), F_LOCK, (off_t)1) == -1) {
          fprintf(stderr, "rlibmap: error locking output file\n");
@@ -357,7 +357,7 @@
    LibMap(solib, solibdeps, linkdefs, fullpath, fp);

    if (replace) {
-#if !defined(WIN32) && !defined(__CYGWIN__)
+#if !defined(WIN32) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
       // remove lock
       lseek(fileno(fp), 0, SEEK_SET);
       if (lockf(fileno(fp), F_ULOCK, (off_t)1) == -1) {


set to bypass on MPUREG_INT_PIN_CFG for AK8963

Stock library could not detect my AK8963.  As suggested by https://github.com/kriswiner/MPU-9250/issues/62, I changed to 0x22 and it worked.  Using recommended 0x12 which works as well.

--- MPU9250.cpp
+++ MPU9250.cpp
@@ -83,7 +83,7 @@
         {BITS_FS_250DPS, MPUREG_GYRO_CONFIG},    // +-250dps
         {BITS_FS_2G, MPUREG_ACCEL_CONFIG},       // +-2G
         {my_low_pass_filter_acc, MPUREG_ACCEL_CONFIG_2}, // Set Acc Data Rates, Enable Acc LPF , Bandwidth 184Hz
-        {0x30, MPUREG_INT_PIN_CFG},      //
+        {0x12, MPUREG_INT_PIN_CFG},      //
         //{0x40, MPUREG_I2C_MST_CTRL},   // I2C Speed 348 kHz
         //{0x20, MPUREG_USER_CTRL},      // Enable AUX
         {0x30, MPUREG_USER_CTRL},        // I2C Master mode and set I2C_IF_DIS to disable slave mode I2C bus
@@ -587,4 +587,4 @@
     digitalWrite(my_cs, HIGH);
 #endif
     SPI.endTransaction();
-}+}


bool improvements

bool improvements

Change-Id: I6df7ec9669452a025fbac55199927347ef84c6b9


return value on main

return value on main

--- worldgen/main.cc
+++ worldgen/main.cc
@@ -77,8 +77,10 @@
   debug::MemoryChunkToFile(drawer.image.Write(ImageWriteFormat::PNG), "maze.png");
 }

-void main()
+int main()
 {
   // maze();
   cell();
+
+  return 0;
 }


Fix build breakage.

Fix build breakage.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org//23658019

git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@27135 260f80e4-7a28-3924-810f-c04153c831b5

--- runtime/lib/mirrors.cc
+++ runtime/lib/mirrors.cc
@@ -779,21 +779,23 @@
     const Function& function,
     const String& target_name,
     const Array& args,
-    const Array& args_descriptor) {
+    const Array& args_descriptor_array) {
   // Note "args" is already the internal arguments with the receiver as the
   // first element.
   Object& result = Object::Handle();
+
+  ArgumentsDescriptor args_descriptor(args_descriptor_array);
   if (function.IsNull() ||
       !function.is_visible() ||
-      !function.AreValidArguments(ArgumentsDescriptor(args_descriptor), NULL)) {
+      !function.AreValidArguments(args_descriptor, NULL)) {
     result = DartEntry::InvokeNoSuchMethod(receiver,
                                            target_name,
                                            args,
-                                           args_descriptor);
+                                           args_descriptor_array);
   } else {
     result = DartEntry::InvokeFunction(function,
                                        args,
-                                       args_descriptor);
+                                       args_descriptor_array);
   }

   if (result.IsError()) {
@@ -961,14 +963,16 @@
   GET_NON_NULL_NATIVE_ARGUMENT(Array, args, arguments->NativeArgAt(3));
   GET_NON_NULL_NATIVE_ARGUMENT(Array, arg_names, arguments->NativeArgAt(4));

-  const Array& args_descriptor =
+  const Array& args_descriptor_array =
       Array::Handle(ArgumentsDescriptor::New(args.Length(), arg_names));

   const Function& function = Function::Handle(
       klass.LookupStaticFunctionAllowPrivate(function_name));

+
+  ArgumentsDescriptor args_descriptor(args_descriptor_array);
   if (function.IsNull() ||
-      !function.AreValidArguments(ArgumentsDescriptor(args_descriptor), NULL) ||
+      !function.AreValidArguments(args_descriptor, NULL) ||
       !function.is_visible()) {
     ThrowNoSuchMethod(AbstractType::Handle(RawTypeOfClass(klass)),
                       function_name,
@@ -979,7 +983,7 @@
   }

   Object& result = Object::Handle(
-      DartEntry::InvokeFunction(function, args, args_descriptor));
+      DartEntry::InvokeFunction(function, args, args_descriptor_array));
   if (result.IsError()) {
     ThrowInvokeError(Error::Cast(result));
     UNREACHABLE();
@@ -1140,12 +1144,12 @@
     args.SetAt(i + num_implicit_args, explicit_argument);
   }

-  const Array& args_descriptor =
+  const Array& args_descriptor_array =
       Array::Handle(ArgumentsDescriptor::New(args.Length(),
                                              arg_names));

-  if (!redirected_constructor.AreValidArguments(
-          ArgumentsDescriptor(args_descriptor), NULL) ||
+  ArgumentsDescriptor args_descriptor(args_descriptor_array);
+  if (!redirected_constructor.AreValidArguments(args_descriptor, NULL) ||
       !redirected_constructor.is_visible()) {
     // Pretend we didn't find the constructor at all when the arity is wrong
     // so as to produce the same NoSuchMethodError as the non-reflective case.
@@ -1177,7 +1181,7 @@
   const Object& result =
       Object::Handle(DartEntry::InvokeFunction(redirected_constructor,
                                                args,
-                                               args_descriptor));
+                                               args_descriptor_array));
   if (result.IsError()) {
     return result.raw();
   }
@@ -1204,7 +1208,7 @@
   GET_NON_NULL_NATIVE_ARGUMENT(Array, args, arguments->NativeArgAt(3));
   GET_NON_NULL_NATIVE_ARGUMENT(Array, arg_names, arguments->NativeArgAt(4));

-  const Array& args_descriptor =
+  const Array& args_descriptor_array =
       Array::Handle(ArgumentsDescriptor::New(args.Length(), arg_names));

   String& ambiguity_error_msg = String::Handle(isolate);
@@ -1216,8 +1220,9 @@
     UNREACHABLE();
   }

+  ArgumentsDescriptor args_descriptor(args_descriptor_array);
   if (function.IsNull() ||
-      !function.AreValidArguments(ArgumentsDescriptor(args_descriptor), NULL) ||
+      !function.AreValidArguments(args_descriptor, NULL) ||
       !function.is_visible()) {
     ThrowNoSuchMethod(Instance::null_instance(),
                       function_name,
@@ -1228,7 +1233,7 @@
   }

   const Object& result = Object::Handle(
-      DartEntry::InvokeFunction(function, args, args_descriptor));
+      DartEntry::InvokeFunction(function, args, args_descriptor_array));
   if (result.IsError()) {
     ThrowInvokeError(Error::Cast(result));
     UNREACHABLE();


Return correct ActivationFrameAlignment for iOS simulator variants

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1432603002 .

--- runtime/vm/os_macos.cc
+++ runtime/vm/os_macos.cc
@@ -149,6 +149,12 @@
   return 8;
 #elif TARGET_ARCH_ARM64
   return 16;
+#elif TARGET_ARCH_IA32
+  return 16;  // iOS simulator
+#elif TARGET_ARCH_X64
+  return 16;  // iOS simulator
+#else
+#error Unimplemented
 #endif
 #else  // TARGET_OS_IOS
   // OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI


Use of logging is more uniform

Use of logging is more uniform

--- Cpp/Simulation/ODESimulator.cpp
+++ Cpp/Simulation/ODESimulator.cpp
@@ -20,7 +20,7 @@

 DEFINE_LOGGER(ODESimulator)

-#define TEST_READ_WRITE_STATE 0
+#define TEST_READ_WRITE_STATE 1
 #define DO_TIMING 0

 const static size_t gMaxKMeansSize = 5000;
@@ -380,7 +380,7 @@
       string id1=sim->ObjectName(collpair.first),id2=sim->ObjectName(collpair.second);
       for(size_t j=0;j<i->contacts.size();j++)
         depth = Max(depth,(double)i->contacts[j].depth);
-      //printf("ODESimulation: normal penetration depth between bodies %s and %s is %g/%g\n",id1.c_str(),id2.c_str(),depth,margin);
+      //printf("normal penetration depth between bodies %s and %s is %g/%g\n",id1.c_str(),id2.c_str(),depth,margin);
       double oldmargin = (sim->lastMarginsRemaining.count(collpair) == 0 ? margin : sim->lastMarginsRemaining[collpair]);
       if((margin - depth) < gRollbackPenetrationFraction*oldmargin) {
         //if there was some previous collision margin, we should do a rollback if the margins were reduced even further
@@ -562,7 +562,7 @@
           if(marginsRemaining[collpair] == 0) {
             if(!didRollback) {
               string id1=ObjectName(collpair.first),id2=ObjectName(collpair.second);
-              LOG4CXX_INFO(GET_LOGGER(ODESimulator),"ODESimulation: rolling back due to new penetration between bodies "<<id1<<" and "<<id2);
+              LOG4CXX_INFO(GET_LOGGER(ODESimulator),"rolling back due to new penetration between bodies "<<id1<<" and "<<id2);
               if(lastMarginsRemaining.count(collpair) == 0) {
                 LOG4CXX_INFO(GET_LOGGER(ODESimulator),"  no previous contact");
               }
@@ -575,7 +575,7 @@
           else {
             if(true || !didRollback) {
               string id1=ObjectName(collpair.first),id2=ObjectName(collpair.second);
-              LOG4CXX_INFO(GET_LOGGER(ODESimulator),"ODESimulation: rolling back due to increasing penetration between bodies "<<id1<<" and "<<id2);
+              LOG4CXX_INFO(GET_LOGGER(ODESimulator),"rolling back due to increasing penetration between bodies "<<id1<<" and "<<id2);
               if(lastMarginsRemaining.count(collpair) == 0) {
                 LOG4CXX_INFO(GET_LOGGER(ODESimulator),"  margin shrank from no-contact to "<<marginsRemaining[collpair]);
               }
@@ -586,12 +586,12 @@
           }
         }
   		  if(rollback && !lastState.IsOpen()) {
-          LOG4CXX_INFO(GET_LOGGER(ODESimulator),"ODESimulation: Rollback rejected because last state not saved");
+          LOG4CXX_INFO(GET_LOGGER(ODESimulator),"Rollback rejected because last state not saved");
           //getchar();
           rollback = false;
   		  }
   		  if(rollback && timestep < settings.minimumAdaptiveTimeStep) {
-  		    LOG4CXX_INFO(GET_LOGGER(ODESimulator),"ODESimulation: Rollback rejected because timestep "<<timestep<<" below minimum threshold "<<settings.minimumAdaptiveTimeStep);
+  		    LOG4CXX_INFO(GET_LOGGER(ODESimulator),"Rollback rejected because timestep "<<timestep<<" below minimum threshold "<<settings.minimumAdaptiveTimeStep);
           //getchar();

           //TODO: DEBUG THIS PRINTOUT STUFF -- it changes the state of the adaptive time stepper
@@ -648,7 +648,7 @@
   		  }

   		  if(rollback) {
-          LOG4CXX_INFO(GET_LOGGER(ODESimulator),"ODESimulation: Rolling back at time "<<simTime<<" time step halved to "<<timestep*0.5);
+          LOG4CXX_INFO(GET_LOGGER(ODESimulator),"Rolling back at time "<<simTime<<" time step halved to "<<timestep*0.5);
           status = StatusAdaptiveTimeStepping;
           //PrintStatus(this,concernedObjects,"Backing up colliding objects","from");

@@ -667,7 +667,7 @@
           GetCurrentCollisionStatus(this,marginsRemaining,newConcernedObjects);
           /*
           if(marginsRemaining != lastMarginsRemaining) {
-            printf("ODESimulation: Warning, difference between rolled-back re-detected margins and previous margins?\n");
+            printf("Warning, difference between rolled-back re-detected margins and previous margins?\n");
             printf("Press enter to continue\n");
             getchar();
           }
@@ -682,18 +682,18 @@
           WriteState_Internal(lastState);
           for(size_t i=0;i<concernedObjects.size();i++) {
             if(marginsRemaining.count(concernedObjects[i]) == 0) {
-              printf("ODESimulation: collision %s - %s erased entirely\n",ObjectName(concernedObjects[i].first).c_str(),ObjectName(concernedObjects[i].second).c_str());
+              LOG4CXX_INFO(GET_LOGGER(ODESimulator),"collision %s - %s erased entirely",ObjectName(concernedObjects[i].first).c_str(),ObjectName(concernedObjects[i].second).c_str());
             }
             else {
               double d=marginsRemaining[concernedObjects[i]];
               if(lastMarginsRemaining.count(concernedObjects[i]))
-                printf("ODESimulation: collision %s - %s changed from no contact to margin %g\n",ObjectName(concernedObjects[i].first).c_str(),ObjectName(concernedObjects[i].second).c_str(),d);
+                LOG4CXX_INFO(GET_LOGGER(ODESimulator),"collision %s - %s changed from no contact to margin %g",ObjectName(concernedObjects[i].first).c_str(),ObjectName(concernedObjects[i].second).c_str(),d);
               else
-                printf("ODESimulation: collision %s - %s changed from depth %g to margin %g\n",ObjectName(concernedObjects[i].first).c_str(),ObjectName(concernedObjects[i].second).c_str(),lastMarginsRemaining[concernedObjects[i]],d);
+                LOG4CXX_INFO(GET_LOGGER(ODESimulator),"collision %s - %s changed from depth %g to margin %g",ObjectName(concernedObjects[i].first).c_str(),ObjectName(concernedObjects[i].second).c_str(),lastMarginsRemaining[concernedObjects[i]],d);
             }
           }
           if(didRollback) {
-            printf("ODESimulation: Adaptive sub-step of size %g is valid, arriving at time %g.\n",timestep,simTime);
+            LOG4CXX_INFO(GET_LOGGER(ODESimulator),"Adaptive sub-step of size %g is valid, arriving at time %g.",timestep,simTime);
             //now restore prior forces applied to all objects
             int k=0;
             for(size_t i=0;i<robots.size();i++) {
@@ -743,7 +743,7 @@
         //PrintStatus(this,concernedObjects,"Colliding objects","post-step");
   		}
   		if(didAnyRollback) {
-  		  LOG4CXX_INFO(GET_LOGGER(ODESimulator),"ODESimulation: Adaptive time step done, arrived at time "<<simTime);
+  		  LOG4CXX_INFO(GET_LOGGER(ODESimulator),"Adaptive time step done, arrived at time "<<simTime);
   		}
   	}
   	else {
@@ -776,12 +776,12 @@
         }
   		}
   		if(rollback) {
-  			LOG4CXX_WARN(GET_LOGGER(ODESimulator),"ODESimulation: Warning, initial state has underlying meshes overlapping");
+  			LOG4CXX_WARN(GET_LOGGER(ODESimulator),"Warning, initial state has underlying meshes overlapping");
   			for(map<CollisionPair,double>::const_iterator i=marginsRemaining.begin();i!=marginsRemaining.end();i++) {
           if(i->second <= 0) {
     			  CollisionPair collpair = i->first;
             string id1=ObjectName(collpair.first),id2=ObjectName(collpair.second);
-            printf("  %s - %s\n",id1.c_str(),id2.c_str());
+            LOG4CXX_WARN(GET_LOGGER(ODESimulator),"  %s - %s",id1.c_str(),id2.c_str());
           }
   			}
   			//printf("Press enter to continue...\n");
@@ -853,7 +853,7 @@
 	cl.forces.push_back(temp);
 	/*
 	if(!cl.points.back().isValidForce(-temp)) {
-	  printf("ODESimulator: Warning, solved contact force %d %d is invalid\n",k,i);
+	  printf("Warning, solved contact force %d %d is invalid\n",k,i);
 	  cout<<"  Force: "<<-temp<<", normal "<<cl.points.back().n<<" kFriction "<<cl.points.back().kFriction<<endl;
 	}
 	*/
@@ -1059,7 +1059,7 @@

     Real len = Vector3(contacts[i].normal[0],contacts[i].normal[1],contacts[i].normal[2]).length();
     if(FuzzyZero(len) || !IsFinite(len)) {
-      LOG4CXX_WARN(GET_LOGGER(ODESimulator),"ODESimulator: Warning, clustered normal became zero/infinite");
+      LOG4CXX_WARN(GET_LOGGER(ODESimulator),"Warning, clustered normal became zero/infinite");
       int found = inds[0];
       contacts[i].pos[0] = pts[found][0];
       contacts[i].pos[1] = pts[found][1];
@@ -1116,7 +1116,7 @@
     contacts[i].depth = kmeans.centers[i][6];
     Real len = Vector3(contacts[i].normal[0],contacts[i].normal[1],contacts[i].normal[2]).length();
     if(FuzzyZero(len) || !IsFinite(len)) {
-      LOG4CXX_WARN(GET_LOGGER(ODESimulator),"ODESimulator: Warning, clustered normal became zero/infinite");
+      LOG4CXX_WARN(GET_LOGGER(ODESimulator),"Warning, clustered normal became zero/infinite");
       //pick any in the cluster
       int found = -1;
       for(size_t k=0;k<kmeans.labels.size();k++) {
@@ -1246,7 +1246,7 @@
   int numOk = 0;
   for(int i=0;i<num;i++) {
     if(gContactTemp[i].g1 == o2 && gContactTemp[i].g2 == o1) {
-      printf("Swapping contact\n");
+      LOG4CXX_INFO(GET_LOGGER(ODESimulator),"Swapping contact... should this be reached?");
       std::swap(gContactTemp[i].g1,gContactTemp[i].g2);
       for(int k=0;k<3;k++) gContactTemp[i].normal[k]*=-1.0;
       std::swap(gContactTemp[i].side1,gContactTemp[i].side2);
@@ -1301,7 +1301,7 @@
   int numOk = 0;
   for(int i=0;i<num;i++) {
     if(gContactTemp[i].g1 == o2 && gContactTemp[i].g2 == o1) {
-      printf("Swapping contact... shouldn't be here?\n");
+      LOG4CXX_INFO(GET_LOGGER(ODESimulator),"Swapping contact... shouldn't be here?");
       std::swap(gContactTemp[i].g1,gContactTemp[i].g2);
       for(int k=0;k<3;k++) gContactTemp[i].normal[k]*=-1.0;
       std::swap(gContactTemp[i].side1,gContactTemp[i].side2);
@@ -1824,7 +1824,7 @@
     {
       double stepThreshold = energies[id]*settings.instabilityLinearEnergyThreshold + settings.instabilityConstantEnergyThreshold*objects[i]->obj.mass;
       if(!(ke < stepThreshold)) {
-        //printf("ODESimulator: Rigid object %s energy %g exceeds linear threshold %g*%g + %g\n",objects[i]->obj.name.c_str(),ke,energies[id],settings.instabilityLinearEnergyThreshold,settings.instabilityConstantEnergyThreshold);
+        //printf("Rigid object %s energy %g exceeds linear threshold %g*%g + %g\n",objects[i]->obj.name.c_str(),ke,energies[id],settings.instabilityLinearEnergyThreshold,settings.instabilityConstantEnergyThreshold);
         unstable = true;
         if(stepThreshold < threshold)
           threshold = stepThreshold;
@@ -1832,11 +1832,11 @@
     }
     if(unstable) {
       if(!IsFinite(ke)) {
-        LOG4CXX_WARN(GET_LOGGER(ODESimulator),"ODESimulator: Rigid object "<<objects[i]->obj.name<<" has non-finite energy, setting to 0");
+        LOG4CXX_WARN(GET_LOGGER(ODESimulator),"Rigid object "<<objects[i]->obj.name<<" has non-finite energy, setting to 0");
         objects[i]->SetVelocity(Vector3(0.0),Vector3(0.0));
       }
       else {
-        LOG4CXX_INFO(GET_LOGGER(ODESimulator),"ODESimulator: Rigid object "<<objects[i]->obj.name<<" energy "<<ke<<" exceeds threshold "<<threshold);
+        LOG4CXX_INFO(GET_LOGGER(ODESimulator),"Rigid object "<<objects[i]->obj.name<<" energy "<<ke<<" exceeds threshold "<<threshold);
         Assert(ke > 0);
         Real newValue = 0;
         if(settings.instabilityPostCorrectionEnergy < 0)
@@ -1869,12 +1869,12 @@
     }
     if(unstable) {
       if(!IsFinite(ke)) {
-        LOG4CXX_WARN(GET_LOGGER(ODESimulator),"ODESimulator: Robot "<<robots[i]->robot.name<<" has non-finite energy, setting to 0");
+        LOG4CXX_WARN(GET_LOGGER(ODESimulator),"Robot "<<robots[i]->robot.name<<" has non-finite energy, setting to 0");
         Vector zero(robots[i]->robot.q.n,0.0);
         robots[i]->SetVelocities(zero);
       }
       else {
-        LOG4CXX_INFO(GET_LOGGER(ODESimulator),"ODESimulator: Robot"<<robots[i]->robot.name<<" energy "<<ke<<" exceeds threshold "<<threshold);
+        LOG4CXX_INFO(GET_LOGGER(ODESimulator),"Robot"<<robots[i]->robot.name<<" energy "<<ke<<" exceeds threshold "<<threshold);
         Assert(ke > 0);
         Real newValue = 0;
         if(settings.instabilityPostCorrectionEnergy < 0)


sal: fix build with clang and --enable-crashdump

Change-Id: I148005489e4ef31b55886c1dd3076650d3a2ec17


Created routine to produce matrix of possible prices for each instrument

--- CreditMetrics/CreditMetrics.cpp
+++ CreditMetrics/CreditMetrics.cpp
@@ -13,7 +13,9 @@
 #include <functional>
 #include <cctype>
 #include <locale>
+#include <random>
 #include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/io.hpp>
 using namespace std;

 static inline string& trim(string& s) {
@@ -278,6 +280,10 @@
 {
 	try
 	{
+		random_device rd;
+		mt19937 gen(rd());
+		uniform_real_distribution<> dis(0, 1);
+
 		IssuerData issuerData;
 		// cout << issuerData.toString();
 		PortfolioData portfolioData;
@@ -290,8 +296,27 @@
 		MatrixRow row{ 0,0,0,0,0,0,0,1 };
 		transitionMatrix.push_back(row);
 		// cout << transitionMatrix.toString();
-		cout << portfolioData.getReportedValue() << "\n";
-		cout << portfolioData.getTheorValue();
+		cout << portfolioData.getReportedValue() << endl;
+		cout << portfolioData.getTheorValue() << endl;
+
+		boost::numeric::ublas::matrix<double> m(portfolioData.size(), 8);
+		for (size_t i = 0, n1 = m.size1(); i < n1; i++)
+		{
+			PortfolioEntry& row = portfolioData.at(i);
+			// To do: clean this up?
+			if (row.instrumentType == "CDS")
+			{
+				for (size_t j = 0, n2 = m.size2() - 1; j < n2; j++)
+					m(i, j) = dis(gen);
+			}
+			else
+			{
+				for (size_t j = 0, n2 = m.size2() - 1; j < n2; j++)
+					m(i, j) = row.cleanPrice;
+			}
+			m(i, m.size2() - 1) = row.exprr * 100;
+		}
+		cout << m << endl;
 	}
 	catch (const exception &e)
 	{