Skip to content

Commit 5ece760

Browse files
committed
Fix -ori
Made simple fix so that orientations do not change when a zero-weight mode is added to the input distribution (test ori_0).
1 parent 0deab59 commit 5ece760

File tree

6 files changed

+570
-6
lines changed

6 files changed

+570
-6
lines changed

VERSIONS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
New in 4.8.2-3 (13 Feb 2024):
1+
New in 4.8.2-4 (20 Feb 2024):
22
- module -T: added -transform "cut(cube)", improved -transform "cut(cubei)",
33
made minor improvements.
44

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import sphinx_rtd_theme
1212

1313
project = u'Neper'
14-
version = u'4.8.2-3'
15-
release = u'4.8.2-3'
14+
version = u'4.8.2-4'
15+
release = u'4.8.2-4'
1616
author = u'Romain Quey'
1717
copyright = u'Romain Quey'
1818
language = 'en'

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if(POLICY CMP0077)
77
cmake_policy(SET CMP0077 NEW)
88
endif()
99

10-
set(NEPER_VERSION \"4.8.2-3\")
10+
set(NEPER_VERSION \"4.8.2-4\")
1111
project(neper)
1212

1313
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8.1)

src/neper_t/net_ori/net_ori1.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ net_ori (struct IN_T In, int level, struct MTESS MTess, struct TESS *Tess,
3434
int i, j, partqty, *qty = NULL;
3535
char **parts = NULL;
3636
struct OL_SET OSet, *OSets = NULL;
37+
int *size = NULL;
3738

3839
net_ori_mtess_params (In, level, MTess, Tess, dtess, dcell, &ori, &orisampling, &orispread, &oricrysym);
3940

@@ -44,6 +45,7 @@ net_ori (struct IN_T In, int level, struct MTESS MTess, struct TESS *Tess,
4445
net_ori_qty (pSSet, parts, partqty, &qty);
4546

4647
OSets = malloc (partqty * sizeof (struct OL_SET));
48+
size = ut_alloc_1d_int (partqty);
4749
for (i = 0; i < partqty; i++)
4850
OSets[i] = ol_set_alloc (qty[i], oricrysym);
4951

@@ -120,9 +122,14 @@ net_ori (struct IN_T In, int level, struct MTESS MTess, struct TESS *Tess,
120122
}
121123

122124
ol_set_cat (OSets, partqty, &OSet);
125+
for (i = 0; i < partqty; i++)
126+
size[i] = OSets[i].size;
127+
128+
printf ("ut_array_1d_int_sum (size, partqty) = %d\n", ut_array_1d_int_sum (size, partqty));
129+
printf ("ut_array_1d_int_max (size, partqty) = %d\n", ut_array_1d_int_max (size, partqty));
123130

124-
if (partqty > 1)
125-
ol_set_shuf (&OSet, (*pSSet).Random);
131+
if (ut_array_1d_int_sum (size, partqty) > ut_array_1d_int_max (size, partqty))
132+
ol_set_shuf (&OSet, (*pSSet).Random);
126133

127134
for (i = 0; i < partqty; i++)
128135
ol_set_free (OSets + i);
@@ -142,6 +149,7 @@ net_ori (struct IN_T In, int level, struct MTESS MTess, struct TESS *Tess,
142149
ut_free_1d_char (&orispread);
143150
ut_free_1d_char (&oricrysym);
144151
ol_set_free (&OSet);
152+
ut_free_1d_int (&size);
145153

146154
return;
147155
}

0 commit comments

Comments
 (0)