comparison src/of-nurbs-1-fixes.patch @ 4038:de0b5dfe77f6

of-nurbs: new patch to compile with win32 --enable-64 (Bug #46081) * dist-files.mk: add of-nurbs-1-fixes.patch * src/of-nurbs-1-fixes.patch: new file
author John Donoghue
date Wed, 30 Sep 2015 13:33:24 -0400
parents
children
comparison
equal deleted inserted replaced
4037:85abb6c3ec8b 4038:de0b5dfe77f6
1 # HG changeset patch
2 # User John Donoghue
3 # Date 1443634028 14400
4 # Wed Sep 30 13:27:08 2015 -0400
5 # Node ID 41f9bc725e8fdc8d07efeedd09da84a013bb14c0
6 # Parent fcd14dc97757ba4f3da5dbd4571b38a407235d2a
7 typecast constants to octave_idx_type (Bug #46081)
8
9 * src/low_level_functions.cc: use octave_idx_type(0) for constant to idx_vector
10
11 * src/nrb_srf_basisfun__.cc: use typecase octave_idx_type for constants
12
13 * src/nrb_srf_basisfun_der__.cc: use typecase octave_idx_type for constants
14
15 * src/nrbsurfderiveval.c: use use octave_idx_type(3) for constant to idx_vector
16
17 diff -r fcd14dc97757 -r 41f9bc725e8f src/low_level_functions.cc
18 --- a/src/low_level_functions.cc Mon Sep 14 16:59:10 2015 +0100
19 +++ b/src/low_level_functions.cc Wed Sep 30 13:27:08 2015 -0400
20 @@ -306,7 +306,7 @@
21 octave_idx_type dd = (d-k) <= dv ? (d-k) : dv;
22 Matrix temp (dd <= m ? (dd+1) : (m+1), m+1, 0.0);
23
24 - idxva (0) = idx_vector(k); idxva (1) = idx_vector(0);
25 + idxva (0) = idx_vector(k); idxva (1) = idx_vector(octave_idx_type(0));
26 idxva (2) = idx_vector(i); idxva (3) = idx_vector(':');
27 NDArray temp2 (pkl.index (idxva));
28 curvederivcpts (m, q, V.extract (s1, V.numel () - 1),
29 diff -r fcd14dc97757 -r 41f9bc725e8f src/nrb_srf_basisfun__.cc
30 --- a/src/nrb_srf_basisfun__.cc Mon Sep 14 16:59:10 2015 +0100
31 +++ b/src/nrb_srf_basisfun__.cc Wed Sep 30 13:27:08 2015 -0400
32 @@ -40,10 +40,10 @@
33 octave_idx_type q = static_cast<octave_idx_type> ((nrb.contents("order").vector_value())(1)) - 1; // q = nrb.order(2) -1;
34
35 Array<idx_vector> idx(dim_vector (2, 1), idx_vector(':'));
36 - idx(0) = 0;
37 + idx(0) = octave_idx_type(0);
38 const NDArray u(points.index (idx).squeeze ()); // u = points(1,:);
39
40 - idx(0) = 1;
41 + idx(0) = octave_idx_type(1);
42 const NDArray v(points.index (idx).squeeze ()); // v = points(2,:);
43
44 octave_idx_type npt = u.numel (); // npt = length(u);
45 @@ -56,7 +56,7 @@
46
47 const RowVector V(knots(1).row_vector_value ()); // V = nrb.knots{2};
48
49 - Array<idx_vector> idx2(dim_vector (3, 1), idx_vector(':')); idx2(0) = 3;
50 + Array<idx_vector> idx2(dim_vector (3, 1), idx_vector(':')); idx2(0) = octave_idx_type(3);
51 NDArray w (coefs.index (idx2).squeeze ()); // w = squeeze(nrb.coefs(4,:,:));
52
53 RowVector spu(u);
54 diff -r fcd14dc97757 -r 41f9bc725e8f src/nrb_srf_basisfun_der__.cc
55 --- a/src/nrb_srf_basisfun_der__.cc Mon Sep 14 16:59:10 2015 +0100
56 +++ b/src/nrb_srf_basisfun_der__.cc Wed Sep 30 13:27:08 2015 -0400
57 @@ -40,10 +40,10 @@
58 octave_idx_type q = static_cast<octave_idx_type> ((nrb.contents("order").vector_value())(1)) - 1; // q = nrb.order(2) -1;
59
60 Array<idx_vector> idx(dim_vector (2, 1), idx_vector(':'));
61 - idx(0) = 0;
62 + idx(0) = octave_idx_type(0);
63 const NDArray u(points.index (idx).squeeze ()); // u = points(1,:);
64
65 - idx(0) = 1;
66 + idx(0) = octave_idx_type(1);
67 const NDArray v(points.index (idx).squeeze ()); // v = points(2,:);
68
69 octave_idx_type npt = u.numel (); // npt = length(u);
70 @@ -63,7 +63,7 @@
71
72 const RowVector V(knots(1).row_vector_value ()); // V = nrb.knots{2};
73
74 - Array<idx_vector> idx2(dim_vector (3, 1), idx_vector(':')); idx2(0) = 3;
75 + Array<idx_vector> idx2(dim_vector (3, 1), idx_vector(':')); idx2(0) = octave_idx_type(3);
76 NDArray w (coefs.index (idx2).squeeze ()); // w = squeeze(nrb.coefs(4,:,:));
77
78 RowVector spu(u);
79 diff -r fcd14dc97757 -r 41f9bc725e8f src/nrbsurfderiveval.cc
80 --- a/src/nrbsurfderiveval.cc Mon Sep 14 16:59:10 2015 +0100
81 +++ b/src/nrbsurfderiveval.cc Wed Sep 30 13:27:08 2015 -0400
82 @@ -119,7 +119,7 @@
83 NDArray coefs = srf.contents("coefs").array_value();
84
85 Array<idx_vector> idx(dim_vector (3, 1), idx_vector(':'));
86 - idx (0) = idx_vector (3);
87 + idx (0) = idx_vector (octave_idx_type(3));
88 Matrix weights (NDArray (coefs.index (idx).squeeze ()));
89
90 for (octave_idx_type iu(0); iu<uv.cols (); iu++)