]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
linear congruent method is applied for random numbers
authorasl <asl@opencascade.com>
Mon, 19 Oct 2015 05:28:22 +0000 (08:28 +0300)
committerasl <asl@opencascade.com>
Mon, 19 Oct 2015 05:28:22 +0000 (08:28 +0300)
24 files changed:
src/HYDRO_tests/TestViewer.cxx
src/HYDRO_tests/random.cxx
src/HYDRO_tests/reference_data/LandCoverMap_Add_2_Objects.png
src/HYDRO_tests/reference_data/LandCoverMap_Merge_1.png
src/HYDRO_tests/reference_data/LandCoverMap_Remove_1.png
src/HYDRO_tests/reference_data/LandCoverMap_Split_1.png
src/HYDRO_tests/reference_data/LandCoverMap_Split_2.png
src/HYDRO_tests/reference_data/_cs13.png
src/HYDRO_tests/reference_data/_cs23.png
src/HYDRO_tests/reference_data/cs11.png
src/HYDRO_tests/reference_data/cs11_c.png
src/HYDRO_tests/reference_data/cs12.png
src/HYDRO_tests/reference_data/cs12_c.png
src/HYDRO_tests/reference_data/cs13.png
src/HYDRO_tests/reference_data/cs14.png
src/HYDRO_tests/reference_data/cs14_c.png
src/HYDRO_tests/reference_data/cs21.png
src/HYDRO_tests/reference_data/cs21_c.png
src/HYDRO_tests/reference_data/cs22.png
src/HYDRO_tests/reference_data/cs22_c.png
src/HYDRO_tests/reference_data/cs23.png
src/HYDRO_tests/reference_data/cs24.png
src/HYDRO_tests/reference_data/cs24_c.png
src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx

index 1a5e0bf983efc645354aa5aa12cafc2bec062280..0d9a66680f6d0371c4d5ebf1b93d56b8176af5c6 100644 (file)
@@ -67,7 +67,8 @@ Handle(AIS_InteractiveContext) context()
 
 QColor randomColor()
 {
-  int aHue = rand()%255;
+  int r = test_rand();
+  int aHue = r%255;
   QColor aColor = QColor::fromHsl( aHue, 255, 128 );
   return aColor;
 }
@@ -95,7 +96,7 @@ void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll,
   context()->EraseAll();
   
   myKey = theKey;
-  test_srand( qHash( theKey ) );
+  test_srand( 0 );
   if( theShape.ShapeType()==TopAbs_COMPOUND )
   {
     TopoDS_Iterator anIt( theShape );
index c0f115720016914ad101a2703f33e31579a6eaf9..c829b20adbeb7808f752997f6a9a0acc7f52d05d 100644 (file)
@@ -1,18 +1,15 @@
 
 #include <random.h>
 
-quint32 m_w = 1;
-quint32 m_z = 1;
+quint32 next = 1;
 
 void test_srand( quint32 theValue )
 {
-  m_w = theValue + 1;
-  m_z = theValue / 2;
+  next = theValue + 1;
 }
 
 quint32 test_rand()
 {
-  m_z = 36969 * (m_z & 65535) + (m_z >> 16);
-  m_w = 18000 * (m_w & 65535) + (m_w >> 16);
-  return (m_z << 16) + m_w;  /* 32-bit result */
+  next = next * 1103515245 + 12345;
+  return next % ( 1 << 24 );
 }
index 86bdba3513aeb125bb2f3aa9920b3df1abd2f9c9..f19fb73698cb4fdc4678efa014f1c1fb8f8e4044 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_Add_2_Objects.png and b/src/HYDRO_tests/reference_data/LandCoverMap_Add_2_Objects.png differ
index 8a4f4298365d5816ba499b67258ea5cd6139d2bc..aac1e901ed1026d6837434fda461d1505b2e19fd 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_Merge_1.png and b/src/HYDRO_tests/reference_data/LandCoverMap_Merge_1.png differ
index f8529e511ff5653cafce9dd3f43b898aa706451d..86d933df3ad14f0513673df3909b69162b473f1f 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_Remove_1.png and b/src/HYDRO_tests/reference_data/LandCoverMap_Remove_1.png differ
index 2ed3c2827f62bac13594bf11ce5e130612406e70..4f1b80a87070817fda3b12c14acbe7926a3dc935 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_Split_1.png and b/src/HYDRO_tests/reference_data/LandCoverMap_Split_1.png differ
index 1a2e977bd27ab794db54a32f3a73b702583c4403..42f8dc1ddb5332b369118dea4c63c28af2f26fd8 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_Split_2.png and b/src/HYDRO_tests/reference_data/LandCoverMap_Split_2.png differ
index 4ff74db65a19cdc23e55a1dfefff3aa51e799d0e..c107613d42c7c97cddcd07b518201b9e6aabd40a 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/_cs13.png and b/src/HYDRO_tests/reference_data/_cs13.png differ
index 4ff74db65a19cdc23e55a1dfefff3aa51e799d0e..c107613d42c7c97cddcd07b518201b9e6aabd40a 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/_cs23.png and b/src/HYDRO_tests/reference_data/_cs23.png differ
index 748b4ba6804266b36a819e34e70ce9c4d99c3cf1..9b5b42397352c2972f39df483f46d6ec190527ef 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cs11.png and b/src/HYDRO_tests/reference_data/cs11.png differ
index 37422ebbb8a64e5efbe78e644d4c0109d6320c62..35057305b635822ac4c8fc166fae521be34ac89f 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cs11_c.png and b/src/HYDRO_tests/reference_data/cs11_c.png differ
index 57c99a942c01bec931e876032b625ba494c35aec..eb5de6942d2989c5e191e5d22719fce2a18655fc 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cs12.png and b/src/HYDRO_tests/reference_data/cs12.png differ
index 8358bee8fba9f102e443c0c0d91791e75540332b..26ce53c04307f6cd8a2a04cbac9a71298f602cf1 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cs12_c.png and b/src/HYDRO_tests/reference_data/cs12_c.png differ
index 36ed14260e659ded32611f1d572add94902133f6..90b9e45b0d034d6011ace8bd89aa5e4554609154 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cs13.png and b/src/HYDRO_tests/reference_data/cs13.png differ
index 04cdf6235eae13c6c774492fa27ff2d40f075d6a..51d20cccf234e334479e156d4a6b81c70cff722f 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cs14.png and b/src/HYDRO_tests/reference_data/cs14.png differ
index 4ff74db65a19cdc23e55a1dfefff3aa51e799d0e..c107613d42c7c97cddcd07b518201b9e6aabd40a 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cs14_c.png and b/src/HYDRO_tests/reference_data/cs14_c.png differ
index 748b4ba6804266b36a819e34e70ce9c4d99c3cf1..9b5b42397352c2972f39df483f46d6ec190527ef 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cs21.png and b/src/HYDRO_tests/reference_data/cs21.png differ
index 37422ebbb8a64e5efbe78e644d4c0109d6320c62..35057305b635822ac4c8fc166fae521be34ac89f 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cs21_c.png and b/src/HYDRO_tests/reference_data/cs21_c.png differ
index 57c99a942c01bec931e876032b625ba494c35aec..eb5de6942d2989c5e191e5d22719fce2a18655fc 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cs22.png and b/src/HYDRO_tests/reference_data/cs22.png differ
index 8358bee8fba9f102e443c0c0d91791e75540332b..26ce53c04307f6cd8a2a04cbac9a71298f602cf1 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cs22_c.png and b/src/HYDRO_tests/reference_data/cs22_c.png differ
index 36ed14260e659ded32611f1d572add94902133f6..90b9e45b0d034d6011ace8bd89aa5e4554609154 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cs23.png and b/src/HYDRO_tests/reference_data/cs23.png differ
index 04cdf6235eae13c6c774492fa27ff2d40f075d6a..51d20cccf234e334479e156d4a6b81c70cff722f 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cs24.png and b/src/HYDRO_tests/reference_data/cs24.png differ
index 4ff74db65a19cdc23e55a1dfefff3aa51e799d0e..c107613d42c7c97cddcd07b518201b9e6aabd40a 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cs24_c.png and b/src/HYDRO_tests/reference_data/cs24_c.png differ
index 876f052ffb22c74dcb8a60600ef2cd5bd0da39dd..d9923b80919f992f0715220c8a7e90c4b7c7620c 100644 (file)
@@ -159,7 +159,7 @@ void test_HYDROData_LandCoverMap::test_incomplete_split()
   CPPUNIT_ASSERT_EQUAL( true, aMap->Split( aPolyline ) );
 
   TestViewer::show( aMap->GetShape(), AIS_Shaded, true, "LandCoverMap_Split_2" );
-  TestViewer::show( aWire, 0, true, Qt::blue );
+  TestViewer::show( aWire, 0, true, Qt::green );
   CPPUNIT_ASSERT_IMAGES
 
   HYDROData_LandCoverMap::Iterator anIt( aMap );