Skip to content

Commit 5e7403e

Browse files
authored
Merge pull request #1801 from JacquesOlivierLachaud/Fix1797
Fix1797
2 parents b45ac01 + 8874307 commit 5e7403e

File tree

10 files changed

+34
-27
lines changed

10 files changed

+34
-27
lines changed

.github/actions/cmake/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ inputs:
2020
default: ""
2121

2222
test:
23-
description: "Wether to run tests or not. This requires the proper build-config and environment variable TESTBLACKLIST to be set."
23+
description: "Whether to run tests or not. This requires the proper build-config and environment variable TESTBLACKLIST to be set."
2424
type: boolean
2525
default: false
2626

.github/actions/setup-macos/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ runs:
1616

1717
- name: Install macOS deps
1818
shell: bash
19-
run: brew install boost ninja gmp libomp ccache cgal
19+
run: brew install boost ninja libomp ccache cgal

ChangeLog.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
## Changes
44

55
- *IO*
6-
- Polyscope viewer upgraded from 2.4 to 2.5 ((David Coeurjolly, [#1796](https://github.com/DGtal-team/DGtal/pull/1796))
6+
- Polyscope viewer upgraded from 2.4 to 2.5 (David Coeurjolly, [#1796](https://github.com/DGtal-team/DGtal/pull/1796)). Reverting to 2.4 due to build issues (David Coeurjolly, [#1797](https://github.com/DGtal-team/DGtal/pull/1797))
77

88
## Bug fixes
99

10+
- *Arithmetics*
11+
- Fix `testLightSternBrocot` issue on windows with the `rand()` function (Jacques-Olivier Lachaud, [#1801](https://github.com/DGtal-team/DGtal/pull/1801))
12+
13+
- *Geometry*
14+
- Fix issue [#1797](https://github.com/DGtal-team/DGtal/pull/1797), assertions raised in testCellGeometry and testDigitalConvexity because of improper digital space extent (Jacques-Olivier Lachaud, [#1801](https://github.com/DGtal-team/DGtal/pull/1801))
15+
1016
- *Build*
1117
- Replacing the global compilation flags when `DGTAL_WARNINGS_AS_ERRORS` is set, with per target `target_compile_options` to avoid errors on Boost warnings (David Coeurjolly, [#1793](https://github.com/DGtal-team/DGtal/pull/1793))
1218
- Fixing the `make install` command for boost (issue #1794) (Bastien Doignies, [#1793](https://github.com/DGtal-team/DGtal/pull/1793))

cmake/deps/polyscope.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "-w")
77

88
CPMAddPackage(
99
NAME polyscope
10-
VERSION 2.5.0
10+
VERSION 2.4.0
1111
GITHUB_REPOSITORY "nmwsharp/polyscope"
1212
SYSTEM TRUE
1313
)

src/DGtal/images/ConstImageAdapter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class ConstImageAdapter
283283
* @return the point in the source domain
284284
*/
285285

286-
TImageContainer::Point sourceDomainPoint (const Point &aPoint) const
286+
typename TImageContainer::Point sourceDomainPoint (const Point &aPoint) const
287287
{
288288
return myFD->operator()(aPoint);
289289
}

tests/arithmetic/testLightSternBrocot.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ bool testReducedFraction()
7676
typedef typename SB::Fraction Fraction;
7777
unsigned int nbok = 0;
7878
unsigned int nb = 0;
79-
Integer p = rand() / 10000;
80-
Integer q = rand() / 10000;
79+
Integer p = ( rand() % 10000 ) + 1;
80+
Integer q = ( rand() % 10000 ) + 1;
8181
trace.beginBlock ( "Testing block: reduced fraction." );
8282
IntegerComputer<Integer> ic;
8383
Integer g = ic.gcd( p, q );
@@ -127,8 +127,8 @@ bool testInitFraction()
127127
typedef typename SB::Fraction Fraction;
128128
unsigned int nbok = 0;
129129
unsigned int nb = 0;
130-
Integer p = rand() / 10000;
131-
Integer q = rand() / 10000;
130+
Integer p = ( rand() % 10000 ) + 1;
131+
Integer q = ( rand() % 10000 ) + 1;
132132
trace.beginBlock ( "Testing block: init fraction." );
133133
IntegerComputer<Integer> ic;
134134
Integer g = ic.gcd( p, q );
@@ -160,8 +160,8 @@ bool testPattern()
160160
typedef typename MyPattern::Vector2I Vector2I;
161161
unsigned int nbok = 0;
162162
unsigned int nb = 0;
163-
Integer p = rand() / 10000;
164-
Integer q = rand() / 10000;
163+
Integer p = ( rand() % 10000 ) + 1;
164+
Integer q = ( rand() % 10000 ) + 1;
165165
MyPattern pattern( p*6, q*6 );
166166
trace.info() << pattern << endl;
167167

tests/arithmetic/testLighterSternBrocot.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ bool testReducedFraction()
7979
typedef typename SB::Fraction Fraction;
8080
unsigned int nbok = 0;
8181
unsigned int nb = 0;
82-
Integer p = rand() / 10000;
83-
Integer q = rand() / 10000;
82+
Integer p = ( rand() % 10000 ) + 1;
83+
Integer q = ( rand() % 10000 ) + 1;
8484
trace.beginBlock ( "Testing block: reduced fraction." );
8585
IntegerComputer<Integer> ic;
8686
Integer g = ic.gcd( p, q );
@@ -130,9 +130,10 @@ bool testInitFraction()
130130
typedef typename SB::Fraction Fraction;
131131
unsigned int nbok = 0;
132132
unsigned int nb = 0;
133-
Integer p = rand() / 10000;
134-
Integer q = rand() / 10000;
133+
Integer p = ( rand() % 10000 ) + 1;
134+
Integer q = ( rand() % 10000 ) + 1;
135135
trace.beginBlock ( "Testing block: init fraction." );
136+
trace.info() << "Init p / q = " << p << " / " << q << std::endl;
136137
IntegerComputer<Integer> ic;
137138
Integer g = ic.gcd( p, q );
138139
p /= g;
@@ -163,8 +164,8 @@ bool testPattern()
163164
typedef typename MyPattern::Vector2I Vector2I;
164165
unsigned int nbok = 0;
165166
unsigned int nb = 0;
166-
Integer p = rand() / 10000;
167-
Integer q = rand() / 10000;
167+
Integer p = ( rand() % 10000 ) + 1;
168+
Integer q = ( rand() % 10000 ) + 1;
168169
MyPattern pattern( p*6, q*6 );
169170
trace.info() << pattern << endl;
170171

tests/arithmetic/testSternBrocot.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ bool testReducedFraction()
7575
typedef typename SB::Fraction Fraction;
7676
unsigned int nbok = 0;
7777
unsigned int nb = 0;
78-
Integer p = rand() / 10000;
79-
Integer q = rand() / 10000;
78+
Integer p = ( rand() % 10000 ) + 1;
79+
Integer q = ( rand() % 10000 ) + 1;
8080
trace.beginBlock ( "Testing block: reduced fraction." );
8181
IntegerComputer<Integer> ic;
8282
Integer g = ic.gcd( p, q );
@@ -126,8 +126,8 @@ bool testInitFraction()
126126
typedef typename SB::Fraction Fraction;
127127
unsigned int nbok = 0;
128128
unsigned int nb = 0;
129-
Integer p = rand() / 10000;
130-
Integer q = rand() / 10000;
129+
Integer p = ( rand() % 10000 ) + 1;
130+
Integer q = ( rand() % 10000 ) + 1;
131131
trace.beginBlock ( "Testing block: init fraction." );
132132
IntegerComputer<Integer> ic;
133133
Integer g = ic.gcd( p, q );
@@ -159,8 +159,8 @@ bool testPattern()
159159
typedef typename MyPattern::Vector2I Vector2I;
160160
unsigned int nbok = 0;
161161
unsigned int nb = 0;
162-
Integer p = rand() / 10000;
163-
Integer q = rand() / 10000;
162+
Integer p = ( rand() % 10000 ) + 1;
163+
Integer q = ( rand() % 10000 ) + 1;
164164
MyPattern pattern( p*6, q*6 );
165165
trace.info() << pattern << endl;
166166

tests/geometry/volumes/testCellGeometry.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ SCENARIO( "CellGeometry< Z2 > rational intersections",
339339

340340
GIVEN( "A rational simplex P={ Point(0/4,0/4), Point(17/4,8/4), Point(-5/4,15/4) }" ) {
341341
KSpace K;
342-
K.init( Point( -5, -5 ), Point( 10, 10 ), true );
342+
K.init( Point( -50, -50 ), Point( 100, 100 ), true );
343343
std::vector< Point > V = { Point(0,0), Point(17,8), Point(-5,15) };
344344
Polytope P( 4, V.begin(), V.end() );
345345
CGeometry intersected_cover( K, 0, 2, false );
@@ -361,7 +361,7 @@ SCENARIO( "CellGeometry< Z2 > rational intersections",
361361
}
362362
GIVEN( "A thin rational simplex P={ Point(6/4,6/4), Point(17/4,8/4), Point(-5/4,15/4) }" ) {
363363
KSpace K;
364-
K.init( Point( -5, -5 ), Point( 10, 10 ), true );
364+
K.init( Point( -50, -50 ), Point( 100, 100 ), true );
365365
std::vector< Point > V = { Point(6,6), Point(17,8), Point(-5,15) };
366366
Polytope P( 4, V.begin(), V.end() );
367367
CGeometry intersected_cover( K, 0, 2, false );
@@ -395,7 +395,7 @@ SCENARIO( "CellGeometry< Z3 > rational intersections",
395395

396396
GIVEN( "A simplex P={ Point(1/2,0/2,-1/2), Point(7/2,3/2,1/2), Point(-2/2,9/2,3/2), Point(6/2,7/2,10/2) }" ) {
397397
KSpace K;
398-
K.init( Point( -5, -5, -5 ), Point( 10, 10, 10 ), true );
398+
K.init( Point( -50, -50, -50 ), Point( 100, 100, 100 ), true );
399399
CGeometry intersected_cover( K, 0, 3, false );
400400
Polytope P = { Point(2,2,2),
401401
Point(1,0,-1), Point(7,3,1), Point(-2,9,3), Point(6,7,10) };

tests/geometry/volumes/testDigitalConvexity.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ SCENARIO( "DigitalConvexity< Z3 > rational fully convex tetrahedra", "[convex_si
310310
typedef KSpace::Point Point;
311311
typedef DigitalConvexity< KSpace > DConvexity;
312312

313-
DConvexity dconv( Point( -1, -1, -1 ), Point( 10, 10, 10 ) );
313+
DConvexity dconv( Point( -10, -10, -10 ), Point( 100, 100, 100 ) );
314314
WHEN( "Computing many tetrahedra in domain (0,0,0)-(4,4,4)." ) {
315315
const unsigned int nb = 30;
316316
unsigned int nbsimplex= 0;

0 commit comments

Comments
 (0)