Mercurial > forge
comparison extra/nurbs/src/nrb_srf_basisfun__.cc @ 12672:59e8aae64812 octave-forge
prepare for release
author | cdf |
---|---|
date | Mon, 17 Aug 2015 10:23:44 +0000 |
parents | 27ae5ff9ec05 |
children |
comparison
equal
deleted
inserted
replaced
12671:20e8aca47b2c | 12672:59e8aae64812 |
---|---|
44 const NDArray u(points.index (idx).squeeze ()); // u = points(1,:); | 44 const NDArray u(points.index (idx).squeeze ()); // u = points(1,:); |
45 | 45 |
46 idx(0) = 1; | 46 idx(0) = 1; |
47 const NDArray v(points.index (idx).squeeze ()); // v = points(2,:); | 47 const NDArray v(points.index (idx).squeeze ()); // v = points(2,:); |
48 | 48 |
49 octave_idx_type npt = u.length (); // npt = length(u); | 49 octave_idx_type npt = u.numel (); // npt = length(u); |
50 RowVector M(p+1, 0.0), N (q+1, 0.0); | 50 RowVector M(p+1, 0.0), N (q+1, 0.0); |
51 Matrix RIkJk(npt, (p+1)*(q+1), 0.0); | 51 Matrix RIkJk(npt, (p+1)*(q+1), 0.0); |
52 Matrix indIkJk(npt, (p+1)*(q+1), 0.0); | 52 Matrix indIkJk(npt, (p+1)*(q+1), 0.0); |
53 RowVector denom(npt, 0.0); | 53 RowVector denom(npt, 0.0); |
54 | 54 |
67 | 67 |
68 newargs(3) = U; newargs(2) = p; newargs(1) = u; newargs(0) = spu; | 68 newargs(3) = U; newargs(2) = p; newargs(1) = u; newargs(0) = spu; |
69 Matrix Ik = feval (std::string("numbasisfun"), newargs, 1)(0).matrix_value (); // Ik = numbasisfun (spu, u, p, U); | 69 Matrix Ik = feval (std::string("numbasisfun"), newargs, 1)(0).matrix_value (); // Ik = numbasisfun (spu, u, p, U); |
70 | 70 |
71 RowVector spv(v); | 71 RowVector spv(v); |
72 for (octave_idx_type ii(0); ii < v.length(); ii++) | 72 for (octave_idx_type ii(0); ii < v.numel (); ii++) |
73 { | 73 { |
74 spv(ii) = findspan(n, q, v(ii), V); | 74 spv(ii) = findspan(n, q, v(ii), V); |
75 } // spv = findspan (n, q, v, V); | 75 } // spv = findspan (n, q, v, V); |
76 | 76 |
77 newargs(3) = V; newargs(2) = q; newargs(1) = v; newargs(0) = spv; | 77 newargs(3) = V; newargs(2) = q; newargs(1) = v; newargs(0) = spv; |
82 { | 82 { |
83 basisfun (int(spu(ii)), u(ii), p, U, M); | 83 basisfun (int(spu(ii)), u(ii), p, U, M); |
84 NuIkuk.insert (M, ii, 0); | 84 NuIkuk.insert (M, ii, 0); |
85 } // NuIkuk = basisfun (spu, u, p, U); | 85 } // NuIkuk = basisfun (spu, u, p, U); |
86 | 86 |
87 Matrix NvJkvk(v.length (), q+1, 0.0); | 87 Matrix NvJkvk(v.numel (), q+1, 0.0); |
88 for (octave_idx_type ii(0); ii < npt; ii++) | 88 for (octave_idx_type ii(0); ii < npt; ii++) |
89 { | 89 { |
90 basisfun(int(spv(ii)), v(ii), q, V, N); | 90 basisfun(int(spv(ii)), v(ii), q, V, N); |
91 NvJkvk.insert (N, ii, 0); | 91 NvJkvk.insert (N, ii, 0); |
92 } // NvJkvk = basisfun (spv, v, q, V); | 92 } // NvJkvk = basisfun (spv, v, q, V); |