[Pkg-octave-devel] [OctDev] Status of the Octave-Forge packages in Debian
Rafael Laboissiere
rafael at laboissiere.net
Mon Mar 19 10:47:24 UTC 2012
* c. <carlo.defalco at gmail.com> [2012-03-19 09:09]:
> On 19 Mar 2012, at 00:54, Rafael Laboissiere wrote:
>
> > * c. <carlo.defalco at gmail.com> [2012-03-18 23:20]:
> >>
> >> Does the attached pach improve the situation for you?
> >
> > Yes, it does. However, the first test block in nrbbasisfun still
> > fails randomly, like this:
> >
> > ==========================================================
> > assert (B (:, 3),w (3) * aux (2, :).',1e-6) expected
> > [...]
> > but got
> > [...]
> > maximum absolute error 0.00516136 exceeds tolerance 1e-06
> > ==========================================================
> >
> > Rafael
>
> I don't see the error so I will have to ask for your help again,
> could you please change line 90 of nrbbasisfun from
>
> %! w = rand(1,4);
>
> to
>
> %! w = rand(1,4)
>
> and send the output of
>
> for ii=1:100, test ("nrbbasisfun"), end;
Attached below. Note that I used "format long".
Rafael
-------------- next part --------------
GNU Octave, version 3.6.1
Copyright (C) 2012 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'.
Octave was configured for "i486-pc-linux-gnu".
Additional information about Octave is available at http://www.octave.org.
Please contribute if you find this software useful.
For more information, visit http://www.octave.org/help-wanted.html
Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type `news'.
w =
Columns 1 through 3:
0.3144888713449011 0.0828373404776338 0.0729392438398343
Column 4:
0.1742738478113458
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 1),w (1) * aux (2, :).',1e-6) expected
1.000000000000000
0.971690300004185
0.941108251018408
0.908023795223407
0.872208034729661
0.833446654733399
0.791558957968767
0.746423386189236
0.690669950648706
0.646417337785020
0.591915479439973
0.534981766816783
0.476328691555864
0.416908620256782
0.357886522146020
0.300573868025853
0.246325130194809
0.196409096961134
0.151877084335056
0.113454509531053
0.081478246132639
0.055890550621837
0.036285695829872
0.021993546497519
0.012179011293808
0.005937944392156
0.002376195916388
0.000665827357143
0.000078534152894
0.000000000000000
but got
1.000000000000000
0.971690300004185
0.941108251018408
0.908023795223407
0.872208034729661
0.833446654733399
0.791558957968767
0.746423386189236
0.698009772543844
0.646417337785020
0.591915479439973
0.534981766816783
0.476328691555864
0.416908620256781
0.357886522146020
0.300573868025853
0.246325130194809
0.196409096961134
0.151877084335056
0.113454509531053
0.081478246132639
0.055890550621837
0.036285695829872
0.021993546497519
0.012179011293808
0.005937944392156
0.002376195916388
0.000665827357143
0.000078534152894
0.000000000000000
maximum absolute error 0.00733982 exceeds tolerance 1e-06
w =
Columns 1 through 3:
0.5665659569682475 0.0997500541856565 0.4681769977264424
Column 4:
0.9393382067936681
PASSES 2 out of 2 tests
w =
0.119319208059194 0.957013551528890 0.427785339276440 0.670954515141363
PASSES 2 out of 2 tests
w =
0.537837417944955 0.850863996520726 0.893521989975576 0.441677139165599
PASSES 2 out of 2 tests
w =
0.516850631277215 0.802615887146500 0.390245576292249 0.383776260157031
PASSES 2 out of 2 tests
w =
0.877074366978883 0.488616813472830 0.958892906377018 0.792157764192582
PASSES 2 out of 2 tests
w =
0.855804543505983 0.498408895633975 0.296928294733146 0.318079332606796
PASSES 2 out of 2 tests
w =
0.717761448223423 0.136184329611596 0.356013057098496 0.294241585159630
PASSES 2 out of 2 tests
w =
0.915264141448505 0.246379225000385 0.933856414297777 0.411903647311566
PASSES 2 out of 2 tests
w =
0.620658818111379 0.410857891358681 0.607676889271190 0.617102923351376
PASSES 2 out of 2 tests
w =
0.812480308642067 0.937678042954124 0.990364539738251 0.475336957667049
PASSES 2 out of 2 tests
w =
0.559509248504741 0.522150169460771 0.354176830697144 0.257316608690787
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
1.43524438891780e-01 8.01615670221192e-01 9.59959924966491e-04
Column 4:
2.20054283370015e-01
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 3),w (3) * aux (2, :).',1e-6) expected
0.00000000000000000
0.00001601092974641
0.00004910955515552
0.00009098985715003
0.00013929416344247
0.00019329617690946
0.00025288995148477
0.00031826596414329
0.00038978360849048
0.00046791010918155
0.00055318150602990
0.00064616569446671
0.00074741415266037
0.00085738891915476
0.00097634763610561
0.00110416288509796
0.00124004325742447
0.00138211468209869
0.00152681763375484
0.00166809390364543
0.00179640586633241
0.00189779971429523
0.00195353627992859
0.00194122158350029
0.00183855802735427
0.00164198076273093
0.00131536785742621
0.00091351179795156
0.00046074609565927
0.00000000000000000
but got
0.00000000000000000
0.00001601092974641
0.00004910955515552
0.00009098985715003
0.00013929416344247
0.00019329617690946
0.00025288995148477
0.00031826596414329
0.00038978360849048
0.00046791010918155
0.00055318150602990
0.00064616569446671
0.00074741415266037
0.00085738891915476
0.00097634763610561
0.00110416288509796
0.00124004325742447
0.00138211468209869
0.00152681763375484
0.00166809390364543
0.00179640586633241
0.00189779971429523
0.00195353627992859
0.00194122158350029
0.00183855802735427
0.00163011856826564
0.00131536785742621
0.00091351179795156
0.00046074609565927
0.00000000000000000
maximum absolute error 1.18622e-05 exceeds tolerance 1e-06
w =
0.743372810562549 0.755553927335782 0.826861977814533 0.827202787361066
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.5006464991695031 0.7725049222464643 0.6957296131656866
Column 4:
0.0683466718317012
PASSES 2 out of 2 tests
w =
0.526646649054145 0.900187505228491 0.334278486097793 0.442090265462027
PASSES 2 out of 2 tests
w =
0.621682857931599 0.941934987224530 0.219255085006494 0.127938085449687
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.8596870613410924 0.2330215749892520 0.0783134344782776
Column 4:
0.8336200127104821
PASSES 2 out of 2 tests
w =
0.636396833593877 0.567196037011049 0.853630265858766 0.939312099069135
PASSES 2 out of 2 tests
w =
0.504104727349220 0.226929155022978 0.579128179466528 0.156587819841256
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 4),w (4) * aux (2, :).',1e-6) expected
0.000000000000000
0.000013442574953
0.000112817751660
0.000396925156505
0.000974526382671
0.001959029408089
0.003463112447417
0.005594271425387
0.008452115597948
0.012127901936479
0.016706415369277
0.022269997722014
0.028904387020910
0.036706072641365
0.045791077176713
0.056305407748550
0.013587651352765
0.082436488425035
0.098630782904201
0.117463192766011
0.139535610086834
0.165680810199814
0.197076564646339
0.235435890222715
0.283340334443366
0.344859755181386
0.426793772656098
0.541408002914782
0.713291261365954
1.000000000000000
but got
0.000000000000000
0.000013442574953
0.000112817751660
0.000396925156505
0.000974526382671
0.001959029408089
0.003463112447417
0.005594271425387
0.008452115597948
0.012127901936479
0.016706415369277
0.022269997722014
0.028904387020910
0.036706072641365
0.045791077176713
0.056305407748550
0.068437864561777
0.082436488425035
0.098630782904201
0.117463192766011
0.139535610086834
0.165680810199814
0.197076564646339
0.235435890222715
0.283340334443366
0.344859755181385
0.426793772656098
0.541408002914782
0.713291261365954
1.000000000000000
maximum absolute error 0.0548502 exceeds tolerance 1e-06
w =
0.419200319187372 0.697832005982252 0.325431613191504 0.411340955938203
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 2),w (2) * aux (2, :).',1e-6) expected
0.000000000000000
0.150975114552239
0.177716236204052
0.358187612429071
0.428974382737056
0.483832139654953
0.525593435447294
0.556297642547433
0.577434196750134
0.590102582622510
0.595121752520923
0.593108284965032
0.584535201146047
0.569779134424869
0.549161040294337
0.522984059408606
0.491571043416859
0.455303320609293
0.414661293024198
0.370266245171570
0.322921190916008
0.273646675249459
0.223705345928083
0.174607247048518
0.128086908558957
0.086044395617601
0.050446460925374
0.023191128234646
0.005948512869063
0.000000000000000
but got
0.000000000000000
0.150975114552239
0.267461650456440
0.358187612429071
0.428974382737056
0.483832139654953
0.525593435447294
0.556297642547433
0.577434196750134
0.590102582622510
0.595121752520923
0.593108284965032
0.584535201146047
0.569779134424869
0.549161040294337
0.522984059408606
0.491571043416859
0.455303320609293
0.414661293024198
0.370266245171570
0.322921190916008
0.273646675249459
0.223705345928083
0.174607247048518
0.128086908558957
0.086044395617601
0.050446460925374
0.023191128234646
0.005948512869063
0.000000000000000
maximum absolute error 0.0897454 exceeds tolerance 1e-06
w =
0.146703329726793 0.591162834262970 0.770088367032246 0.584919380075539
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.0193597030015657 0.4555600868753063 0.1755032207944375
Column 4:
0.9091729664902255
PASSES 2 out of 2 tests
w =
0.647248064448997 0.860704955187939 0.978431278353856 0.844625673757197
PASSES 2 out of 2 tests
w =
0.442196747873111 0.285923488162173 0.491618495137113 0.398185930193987
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.3995702232187413 0.0715959987997454 0.6950828861174865
Column 4:
0.9605402566974961
PASSES 2 out of 2 tests
w =
0.133623231079355 0.834323746923459 0.845646028991121 0.117866684253412
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.0866472731587470 0.4503949708828618 0.3597817747859173
Column 4:
0.3920948442066571
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 3),w (3) * aux (2, :).',1e-6) expected
0.000000000000000
0.010100745300319
0.132454313583311
0.055800221923096
0.083208050980381
0.111929607897409
0.141379071729777
0.171146803513739
0.200897049486572
0.248358337880095
0.259099318675241
0.286907096522585
0.313381192679808
0.338122559383019
0.360687561531070
0.380582879134214
0.397261829470754
0.410122331475915
0.418506917175636
0.421705338523239
0.418960425996421
0.409477917423846
0.392440971490534
0.367029982967118
0.332448095633503
0.287952437041174
0.128098990446914
0.166740896511020
0.089155171618916
0.000000000000000
but got
0.000000000000000
0.010100745300319
0.030714831492292
0.055800221923096
0.083208050980381
0.111929607897409
0.141379071729777
0.171146803513739
0.200897049486572
0.230318859595070
0.259099318675241
0.286907096522585
0.313381192679808
0.338122559383019
0.360687561531070
0.380582879134214
0.397261829470754
0.410122331475915
0.418506917175636
0.421705338523239
0.418960425996421
0.409477917423846
0.392440971490534
0.367029982967118
0.332448095633503
0.287952437041174
0.232890561862101
0.166740896511020
0.089155171618916
0.000000000000000
maximum absolute error 0.104792 exceeds tolerance 1e-06
w =
0.314515020466677 0.335352961196518 0.544191124263596 0.396298882616926
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.8797498556297185 0.0371502069647829 0.4985125926362792
Column 4:
0.2500920356796375
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 4),w (4) * aux (2, :).',1e-6) expected
0.000000000000000
0.000012863644585
0.000113406729197
0.000420841075228
0.001093377753069
0.002330995630584
0.004374084313886
0.007496329661566
0.011990990314893
0.018151282204994
0.026247688092616
0.036506923485444
0.049098061071928
0.064130283798689
0.081664077384214
0.101734461908661
0.124382508598328
0.149690831532180
0.177820027673294
0.064901568492351
0.243797194063693
0.282707279984757
0.326675467613537
0.376965386579866
0.435355625115809
0.504385937653333
0.587775068991347
0.691164208141732
0.823520881962602
1.000000000000000
but got
0.000000000000000
0.000012863644585
0.000113406729197
0.000420841075228
0.001093377753069
0.002330995630584
0.004374084313886
0.007496329661566
0.011990990314893
0.018151282204994
0.026247688092616
0.036506923485444
0.049098061071928
0.064130283798689
0.081664077384214
0.101734461908661
0.124382508598328
0.149690831532180
0.177820027673294
0.209045520029585
0.243797194063693
0.282707279984757
0.326675467613537
0.376965386579866
0.435355625115809
0.504385937653333
0.587775068991347
0.691164208141732
0.823520881962602
1.000000000000000
maximum absolute error 0.144144 exceeds tolerance 1e-06
w =
Columns 1 through 3:
0.00269601684465819 0.96004708820225704 0.89704321911713714
Column 4:
0.79611099622291404
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 4),w (4) * aux (2, :).',1e-6) expected
0.000000000000000
0.000332632998114
0.001399964037227
0.003286932480933
0.006087434382348
0.009905556179927
0.014856684556174
0.021068726793309
0.028683449166864
0.055668286960812
0.082053179802344
0.061600835320630
0.076574953077761
0.093924049763720
0.113908086302679
0.136813583682458
0.162955737433608
0.192680475451499
0.226366363510916
0.264426228716138
0.307308328586437
0.355496841404810
0.409511391138849
0.469905247716269
0.537261762063632
0.171639180670317
0.695308522060760
0.787247943305462
0.888619342551694
1.000000000000000
but got
0.000000000000000
0.000332632998114
0.001399964037227
0.003286932480933
0.006087434382348
0.009905556179927
0.014856684556174
0.021068726793309
0.028683449166864
0.037857938929032
0.048766193254355
0.061600835320630
0.076574953077761
0.093924049763720
0.113908086302679
0.136813583682458
0.162955737433608
0.192680475451499
0.226366363510916
0.264426228716138
0.307308328586437
0.355496841404810
0.409511391138849
0.469905247716269
0.537261762063632
0.612188508563025
0.695308522060760
0.787247943305462
0.888619342551694
1.000000000000000
maximum absolute error 0.440549 exceeds tolerance 1e-06
w =
0.809933324574512 0.262298293300300 0.475178903829157 0.965591093322112
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.3092327545019185 0.2623212763933639 0.4589353049730786
Column 4:
0.0468583776359957
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 3),w (3) * aux (2, :).',1e-6) expected
0.000000000000000
0.005178844596508
0.020139942638111
0.043806331654324
0.065902991125397
0.112038213704043
0.153837737561206
0.198974981905516
0.246243230018458
0.294581064122317
0.343083905368720
0.391001550537030
0.437725908855392
0.482772554831956
0.525758809333878
0.566380060129979
0.604385033493127
0.639549715406645
0.671648460897222
0.700419222063145
0.725517150441953
0.746445751873284
0.762444176112139
0.772285173900957
0.773878414194007
0.763407201066004
0.733188931852894
0.665321497539747
0.506673999254188
0.000000000000000
but got
0.000000000000000
0.005178844596508
0.020139942638111
0.043806331654324
0.074898735928873
0.112038213704043
0.153837737561206
0.198974981905516
0.246243230018458
0.294581064122317
0.343083905368720
0.391001550537030
0.437725908855392
0.482772554831956
0.525758809333878
0.566380060129979
0.604385033493127
0.639549715406645
0.671648460897222
0.700419222063145
0.725517150441953
0.746445751873284
0.762444176112139
0.772285173900957
0.773878414194007
0.763407201066004
0.733188931852894
0.665321497539747
0.506673999254188
0.000000000000000
maximum absolute error 0.00899574 exceeds tolerance 1e-06
w =
0.398987925027399 0.605984320872541 0.582652307997756 0.694671660834738
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 4),w (4) * aux (2, :).',1e-6) expected
0.000000000000000
0.012308199445769
0.000519468482392
0.001685611607862
0.003858379183283
0.007304999532288
0.012276939706857
0.019015820757273
0.027757176615670
0.038732664434421
0.052171099573299
0.068298547160731
0.087337616340358
0.109506051962566
0.135014689682168
0.164064827259922
0.196845063186838
0.233527660911346
0.274264511055565
0.319182783441757
0.368380383870548
0.421921355539437
0.479831389591639
0.542093631049455
0.608644982585275
0.679373116427934
0.754114401601399
0.832652937573397
0.914720855043949
1.000000000000000
but got
0.000000000000000
0.000067882148342
0.000519468482392
0.001685611607862
0.003858379183283
0.007304999532288
0.012276939706857
0.019015820757273
0.027757176615670
0.038732664434421
0.052171099573299
0.068298547160731
0.087337616340358
0.109506051962566
0.135014689682168
0.164064827259922
0.196845063186838
0.233527660911346
0.274264511055565
0.319182783441757
0.368380383870548
0.421921355539437
0.479831389591639
0.542093631049455
0.608644982585275
0.679373116427934
0.754114401601399
0.832652937573397
0.914720855043949
1.000000000000000
maximum absolute error 0.0122403 exceeds tolerance 1e-06
w =
Columns 1 through 3:
0.2648673379208760 0.2386838432383383 0.1066074273930563
Column 4:
0.0628582189589495
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 3),w (3) * aux (2, :).',1e-6) expected
0.000000000000000
0.001402560121033
0.005489262987477
0.012101949767293
0.021108177431206
0.032395239818632
0.045864738551165
0.061427371664727
0.078997624880818
0.098488041832022
0.119802716121674
0.142829588388909
0.167431042158909
0.193432168055211
0.220605900485704
0.248654017290550
0.277182725643237
0.021108274408159
0.333431371049050
0.359555874954954
0.382852866674328
0.401763852090939
0.414263431123769
0.417740791431405
0.408867428785808
0.383463862375217
0.336392582573085
0.261527231713123
0.151879486321704
0.000000000000000
but got
0.000000000000000
0.001402560121033
0.005489262987477
0.012101949767293
0.021108177431206
0.032395239818632
0.045864738551165
0.061427371664727
0.078997624880818
0.098488041832022
0.119802716121674
0.142829588388909
0.167431042158909
0.193432168055211
0.220605900485704
0.248654017290550
0.277182725643237
0.305671236767116
0.333431371049050
0.359555874954954
0.382852866674328
0.401763852090939
0.414263431123769
0.417740791431405
0.408867428785808
0.383463862375217
0.336392582573085
0.261527231713123
0.151879486321704
0.000000000000000
maximum absolute error 0.284563 exceeds tolerance 1e-06
w =
0.222984017787955 0.937631138650784 0.608802938900493 0.780391527735310
PASSES 2 out of 2 tests
w =
0.734192790141773 0.169791304219528 0.993338776477579 0.191745930557031
PASSES 2 out of 2 tests
w =
0.553427009209976 0.575776880009958 0.844583615887792 0.634789383637390
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 4),w (4) * aux (2, :).',1e-6) expected
0.000000000000000
0.000046762900234
0.000370943239420
0.001238381044211
0.002897806249463
0.005578158638497
0.009488135417755
0.014817595482834
0.021740404606641
0.030418328545371
0.041005647720756
0.053654256520575
0.068519106765358
0.085763949240892
0.105567415806368
0.128129568405518
0.153679124744818
0.182481660692895
0.214849196637613
0.251151712706546
0.291831324793525
0.337420117029371
0.388563007696946
0.218794413706481
0.510843721722811
0.584156981067200
0.667502041395593
0.762805384593817
0.872552023374120
1.000000000000000
but got
0.000000000000000
0.000046762900234
0.000370943239420
0.001238381044211
0.002897806249463
0.005578158638497
0.009488135417755
0.014817595482834
0.021740404606641
0.030418328545371
0.041005647720756
0.053654256520575
0.068519106765358
0.085763949240892
0.105567415806368
0.128129568405518
0.153679124744818
0.182481660692895
0.214849196637613
0.251151712706546
0.291831324793525
0.337420117029371
0.388563007696946
0.446047588330114
0.510843721722811
0.584156981067200
0.667502041395592
0.762805384593817
0.872552023374120
1.000000000000000
maximum absolute error 0.227253 exceeds tolerance 1e-06
w =
Columns 1 through 3:
0.8639096828716994 0.4412435883632032 0.0630466225345750
Column 4:
0.8383014261235944
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 3),w (3) * aux (2, :).',1e-6) expected
0.0000000000000000
0.0002646835293286
0.0010772956238294
0.0024676613564595
0.0044668448471814
0.0071045992106484
0.0104055639085236
0.0143838278095372
0.0190355023475879
0.0243291115332844
0.0301940024287298
0.0365077165485133
0.0430843893095511
0.0496676334767864
0.0559325511234181
0.0615016330770724
0.0659772876388167
0.0218198802405367
0.0702473153155878
0.0695898514289326
0.0670078477230549
0.0626429068379198
0.0567569926279461
0.0496855056855568
0.0417872296579326
0.0334025569872323
0.0248258744994332
0.0162925153451585
0.0079772334059907
0.0000000000000000
but got
0.0000000000000000
0.0002646835293286
0.0010772956238294
0.0024676613564595
0.0044668448471814
0.0071045992106484
0.0104055639085236
0.0143838278095372
0.0190355023475879
0.0243291115332844
0.0301940024287298
0.0365077165485133
0.0430843893095511
0.0496676334767864
0.0559325511234181
0.0615016330770724
0.0659772876388167
0.0689890663712657
0.0702473153155878
0.0695898514289326
0.0670078477230549
0.0626429068379198
0.0567569926279461
0.0496855056855568
0.0417872296579326
0.0334025569872323
0.0248258744994332
0.0162925153451585
0.0079772334059907
0.0000000000000000
maximum absolute error 0.0471692 exceeds tolerance 1e-06
w =
Columns 1 through 3:
0.00432777052440774 0.11214661777383476 0.88919447058612122
Column 4:
0.46462866337094738
PASSES 2 out of 2 tests
w =
0.855899019015302 0.167441787107117 0.532312332531381 0.201733299791403
PASSES 2 out of 2 tests
w =
0.168415249734155 0.532293515996741 0.184648416962787 0.102385681007767
PASSES 2 out of 2 tests
w =
0.386691214847482 0.708588242892716 0.305021045983661 0.228418932354866
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 3),w (3) * aux (2, :).',1e-6) expected
0.000000000000000
0.002516602305736
0.009141098968196
0.018902545047102
0.031185306788689
0.045580664386545
0.061805087545428
0.079651890555061
0.198149766229340
0.119594842616607
0.141427511311912
0.164325108865468
0.188134868453364
0.212670041319167
0.237693249429541
0.262896613188244
0.287877499842479
0.312108720268309
0.334902071824078
0.355364417764589
0.372346224902609
0.384383984233952
0.389640693692989
0.409769629954669
0.486398233610573
0.339830682492358
0.290946722647663
0.220056787299164
0.123871333560346
0.000000000000000
but got
0.000000000000000
0.002516602305736
0.009141098968196
0.018902545047102
0.031185306788689
0.045580664386545
0.061805087545428
0.079651890555061
0.098960445640618
0.119594842616607
0.141427511311912
0.164325108865468
0.188134868453364
0.212670041319167
0.237693249429541
0.262896613188244
0.287877499842479
0.312108720268309
0.334902071824078
0.355364417764589
0.372346224902609
0.384383984233952
0.389640693692989
0.385853195832037
0.370302225454233
0.339830682492358
0.290946722647663
0.220056787299164
0.123871333560346
0.000000000000000
maximum absolute error 0.116096 exceeds tolerance 1e-06
w =
0.256474513491551 0.948078190273148 0.435510273233538 0.835258903402953
PASSES 2 out of 2 tests
w =
0.828353244239814 0.163321970901158 0.370612170183035 0.282012381700277
PASSES 2 out of 2 tests
w =
0.750356866835985 0.553948902356092 0.653908987696271 0.557871934041145
PASSES 2 out of 2 tests
w =
0.255723499879667 0.832943857189335 0.228371147985550 0.487948957331783
PASSES 2 out of 2 tests
w =
0.635909179454025 0.499919153589875 0.627439367671278 0.993775737176366
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.7032309206686247 0.0367996503695206 0.6004451610934284
Column 4:
0.5838751803490383
PASSES 2 out of 2 tests
w =
0.973982061349899 0.719434358085339 0.815180502982352 0.753316387792322
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 3),w (3) * aux (2, :).',1e-6) expected
0.000000000000000
0.002958888309457
0.011692950064694
0.025907633611883
0.045202723634186
0.069077466053891
0.096938822080369
0.128112411137771
0.161855527545016
0.197371491368080
0.233824530088164
0.270354387121060
0.306089910595856
0.340160979612721
0.371708259736468
0.399890427396426
0.487549572136651
0.442908216390656
0.456177380671458
0.511433038417062
0.462466033441552
0.454008319968323
0.436825081886194
0.410148742496339
0.373172537696438
0.335997201712019
0.264775428369066
0.191348971352979
0.103551255085635
0.000000000000000
but got
0.000000000000000
0.002958888309457
0.011692950064694
0.025907633611883
0.045202723634186
0.069077466053891
0.096938822080369
0.128112411137771
0.161855527545016
0.197371491368080
0.233824530088164
0.270354387121060
0.306089910595857
0.340160979612721
0.371708259736468
0.399890427396426
0.423888647549420
0.442908216390656
0.456177380671458
0.462943410808956
0.462466033441552
0.454008319968323
0.436825081886194
0.410148742496339
0.373172537696438
0.325030743522074
0.264775428369066
0.191348971352979
0.103551255085635
0.000000000000000
maximum absolute error 0.0636609 exceeds tolerance 1e-06
w =
0.298808681921168 0.545770569380605 0.424992751846717 0.952718215986360
PASSES 2 out of 2 tests
w =
0.416751988485649 0.851590335436802 0.280417857657910 0.912575594202743
PASSES 2 out of 2 tests
w =
0.229574563809687 0.166971657365990 0.927808836766072 0.375573591631617
PASSES 2 out of 2 tests
w =
0.496744787821827 0.919202146446691 0.887591900859881 0.361789870109895
PASSES 2 out of 2 tests
w =
0.447933075159182 0.680591339031660 0.937594679735308 0.325910324080922
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 3),w (3) * aux (2, :).',1e-6) expected
0.000000000000000
0.050827500266448
0.025105921528255
0.051905468068559
0.084918329051925
0.122286582355156
0.162525426811698
0.204447626944024
0.247100978208464
0.289716857482720
0.331667881940272
0.372432812781275
0.411567001996355
0.448676827202598
0.483396650746747
0.515366841030928
0.544211266868458
0.569512359575471
0.590781229992739
0.607419245231556
0.618665573472249
0.623521846747613
0.620638985196082
0.608139699276094
0.583327378302277
0.542184288067558
0.478454701051137
0.381846255350769
0.234169087491071
0.000000000000000
but got
0.000000000000000
0.006840866859736
0.025105921528255
0.051905468068559
0.084918329051925
0.122286582355156
0.162525426811698
0.204447626944024
0.247100978208464
0.289716857482720
0.331667881940272
0.372432812781275
0.411567001996355
0.448676827202598
0.483396650746747
0.515366841030928
0.544211266868458
0.569512359575471
0.590781229992739
0.607419245231556
0.618665573472249
0.623521846747613
0.620638985196082
0.608139699276094
0.583327378302277
0.542184288067558
0.478454701051137
0.381846255350769
0.234169087491071
0.000000000000000
maximum absolute error 0.0439866 exceeds tolerance 1e-06
w =
Columns 1 through 3:
0.7787045127981572 0.4857377722891011 0.6570988144403586
Column 4:
0.0248537878261376
PASSES 2 out of 2 tests
w =
0.687290973579764 0.636386476070137 0.362601273825776 0.528065547998367
PASSES 2 out of 2 tests
w =
0.252976292252759 0.605504509578934 0.652868857613024 0.251004704028464
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 4),w (4) * aux (2, :).',1e-6) expected
0.000000000000000
0.000035691725138
0.000256083263023
0.000788469682641
0.001728543898728
0.003158009196755
0.005153944037088
0.007794533590284
0.011163173002886
0.021203790533478
0.020464894633353
0.026621889740920
0.033962723898905
0.042652489164413
0.052888246444557
0.064907706670314
0.079000715545372
0.095524720635495
0.114925977841854
0.137769182322028
0.164779734251945
0.196905429533301
0.235408874712177
0.282010111190596
0.339114457869125
0.410191560664853
0.500437293902727
0.617999747395050
0.776423007091010
1.000000000000000
but got
0.000000000000000
0.000035691725138
0.000256083263023
0.000788469682641
0.001728543898728
0.003158009196755
0.005153944037088
0.007794533590284
0.011163173002886
0.015351925720277
0.020464894633353
0.026621889740920
0.033962723898905
0.042652489164413
0.052888246444557
0.064907706670314
0.079000715545372
0.095524720635495
0.114925977841854
0.137769182322028
0.164779734251945
0.196905429533301
0.235408874712177
0.282010111190596
0.339114457869125
0.410191560664853
0.500437293902727
0.617999747395050
0.776423007091010
1.000000000000000
maximum absolute error 0.00585186 exceeds tolerance 1e-06
w =
0.318175746088040 0.233792159163810 0.495797981098962 0.537059782495654
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.4380425321714604 0.2649682429518188 0.0620953888185089
Column 4:
0.7356963489807666
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 4),w (4) * aux (2, :).',1e-6) expected
0.000000000000000
0.000071809815570
0.000600141812711
0.002118905587829
0.005258920799907
0.010757607229619
0.019460372203347
0.032307975510526
0.046976341477943
0.074446825717234
0.105646123698268
0.144583314613219
0.191569564637091
0.246401962178517
0.308263852575012
0.375708257673248
0.446750825111200
0.519069146927144
0.590270230086886
0.658164079632668
0.720981154459580
0.777494222165452
0.827038062800799
0.869447985790745
0.904951257391189
0.934044513330360
0.957380887809884
0.975679336014620
0.989659518674860
1.000000000000000
but got
0.000000000000000
0.000071809815570
0.000600141812711
0.002118905587829
0.005258920799907
0.010757607229619
0.019460372203347
0.032307975510526
0.050302808531593
0.074446825717234
0.105646123698268
0.144583314613219
0.191569564637091
0.246401962178517
0.308263852575012
0.375708257673248
0.446750825111200
0.519069146927144
0.590270230086887
0.658164079632668
0.720981154459580
0.777494222165452
0.827038062800799
0.869447985790745
0.904951257391189
0.934044513330360
0.957380887809884
0.975679336014620
0.989659518674860
1.000000000000000
maximum absolute error 0.00332647 exceeds tolerance 1e-06
w =
0.382470196174010 0.518381174340920 0.926276169689879 0.152212612336786
PASSES 2 out of 2 tests
w =
0.158840343431438 0.655172833655029 0.499743764736012 0.429975249978619
PASSES 2 out of 2 tests
w =
0.320142136499932 0.724267330765560 0.716525776985402 0.303055064056579
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.3671397487798099 0.8143014955150957 0.6523932175516842
Column 4:
0.0107672397832899
PASSES 2 out of 2 tests
w =
0.162727962797078 0.335909723522649 0.705470946139924 0.820774861347175
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.4697551361253806 0.8564536821290563 0.3808571137878010
Column 4:
0.0231741954882564
PASSES 2 out of 2 tests
w =
0.532298841767076 0.854646525985132 0.328543453034008 0.166944333911461
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 4),w (4) * aux (2, :).',1e-6) expected
0.000000000000000
0.000012165367543
0.000093243857210
0.000304756252215
0.002340681073420
0.001359048472186
0.002331476112089
0.003700448123521
0.005555638140211
0.008003054179236
0.011169458769664
0.015207759674653
0.020303712513217
0.026684356766409
0.034628719383576
0.044481469427786
0.056670396739996
0.071728817243421
0.090324265187315
0.113295078560465
0.141696618937849
0.176858671169247
0.220454585303870
0.274580053670762
0.341833375550390
0.425376696393381
0.528934363173232
0.656644339625888
0.812618457402549
1.000000000000000
but got
0.000000000000000
0.000012165367543
0.000093243857210
0.000304756252215
0.000706084403556
0.001359048472186
0.002331476112089
0.003700448123521
0.005555638140211
0.008003054179236
0.011169458769664
0.015207759674653
0.020303712513217
0.026684356766409
0.034628719383576
0.044481469427786
0.056670396739996
0.071728817243421
0.090324265187315
0.113295078560465
0.141696618937849
0.176858671169247
0.220454585303870
0.274580053670762
0.341833375550390
0.425376696393381
0.528934363173232
0.656644339625888
0.812618457402549
1.000000000000000
maximum absolute error 0.0016346 exceeds tolerance 1e-06
w =
0.996865061117209 0.752881013519564 0.489376700847435 0.402583969672910
PASSES 2 out of 2 tests
w =
0.804210582320268 0.300536410530777 0.652307836348574 0.243325645280865
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.1214127481694201 0.7499852861962919 0.0692938034741138
Column 4:
0.6305787953693857
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 3),w (3) * aux (2, :).',1e-6) expected
0.0000000000000000
0.0013122437898669
0.0039403966327567
0.0071932019726922
0.0108760516639481
0.0149164462913765
0.0192816576118512
0.0239520359527568
0.0289091739183148
0.0341286417983399
0.0395739875921686
0.0451907633487233
0.0575433107303890
0.0565922672383153
0.0621196934616881
0.0672924291986386
0.0718760982362725
0.0755959389717460
0.0781493472726262
0.0792291144669885
0.0785574605170853
0.0759274096519077
0.0712438103506999
0.0645532770700147
0.0560528183398868
0.0460719866811067
0.0350315223362462
0.0135715019071203
0.0115846233581864
0.0000000000000000
but got
0.0000000000000000
0.0013122437898669
0.0039403966327567
0.0071932019726922
0.0108760516639480
0.0149164462913765
0.0192816576118512
0.0239520359527568
0.0289091739183148
0.0341286417983399
0.0395739875921686
0.0451907633487233
0.0509001519572650
0.0565922672383153
0.0621196934616881
0.0672924291986386
0.0718760982362725
0.0755959389717460
0.0781493472726263
0.0792291144669885
0.0785574605170853
0.0759274096519076
0.0712438103506999
0.0645532770700147
0.0560528183398868
0.0460719866811067
0.0350315223362462
0.0233889324875656
0.0115846233581864
0.0000000000000000
maximum absolute error 0.00981743 exceeds tolerance 1e-06
w =
0.265016729488844 0.896459623959370 0.696778716486442 0.212611303861351
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 4),w (4) * aux (2, :).',1e-6) expected
0.000000000000000
0.000026626796524
0.000181624062174
0.000541206150438
0.029400617170635
0.002094316204787
0.003392415417919
0.005114066518359
0.007325150254120
0.010101756939939
0.013532934847808
0.017723976453382
0.022800524210128
0.028913838566641
0.036247689081597
0.045027520473370
0.055532844825451
0.068114283250219
0.083217438668687
0.101417030085874
0.049493954517170
0.150374703621111
0.183518648217272
0.224832923871716
0.277118773134625
0.344589551712098
0.433886105825947
0.556115124765960
0.731355475782002
1.000000000000000
but got
0.000000000000000
0.000026626796524
0.000181624062174
0.000541206150438
0.001161604587634
0.002094316204787
0.003392415417919
0.005114066518359
0.007325150254120
0.010101756939939
0.013532934847808
0.017723976453382
0.022800524210128
0.028913838566641
0.036247689081597
0.045027520473370
0.055532844825451
0.068114283250220
0.083217438668687
0.101417030085874
0.123466835734924
0.150374703621111
0.183518648217272
0.224832923871716
0.277118773134625
0.344589551712098
0.433886105825947
0.556115124765960
0.731355475782002
1.000000000000000
maximum absolute error 0.0739729 exceeds tolerance 1e-06
w =
Columns 1 through 3:
0.0928186856022545 0.2520000712267268 0.7306431709635961
Column 4:
0.8688394384765497
PASSES 2 out of 2 tests
w =
0.246426134715816 0.141214011341364 0.811667102290633 0.105219959818367
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.00210481299562830 0.17330319517492560 0.08250680438626172
Column 4:
0.85025886353795765
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 4),w (4) * aux (2, :).',1e-6) expected
0.000000000000000
0.001842002689087
0.039253977992612
0.019583737549952
0.036617364433489
0.059667920202958
0.088963117972165
0.124507904918308
0.166047582963596
0.213051695898473
0.264724909992487
0.320046915577760
0.377837952674482
0.436841400749725
0.495811554062847
0.553594233322446
0.609190256740481
0.661796054279706
0.710820437482652
0.755880454130816
0.796781635727643
0.833488694794927
0.866092211600907
0.894775611470637
0.919785277476208
0.941405315395308
0.959937461022815
0.975685932365045
0.988946639596348
1.000000000000000
but got
0.000000000000000
0.001842002689087
0.008165834858317
0.019583737549952
0.036617364433489
0.059667920202958
0.088963117972165
0.124507904918308
0.166047582963596
0.213051695898473
0.264724909992487
0.320046915577760
0.377837952674482
0.436841400749725
0.495811554062847
0.553594233322446
0.609190256740481
0.661796054279706
0.710820437482652
0.755880454130816
0.796781635727643
0.833488694794927
0.866092211600907
0.894775611470637
0.919785277476208
0.941405315395308
0.959937461022815
0.975685932365045
0.988946639596349
1.000000000000000
maximum absolute error 0.0310881 exceeds tolerance 1e-06
w =
0.233526632042364 0.118711771433379 0.774604235321471 0.716890186414297
PASSES 2 out of 2 tests
w =
0.607071681079727 0.986964801224560 0.968709354345046 0.978937565006194
PASSES 2 out of 2 tests
w =
0.371610424810491 0.433794597244773 0.967715669527673 0.101074956340854
PASSES 2 out of 2 tests
w =
0.184780138076220 0.808128270717252 0.357009324612866 0.748101877186938
PASSES 2 out of 2 tests
w =
0.341196197160176 0.300501339016643 0.142070208720675 0.380654478427456
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 3),w (3) * aux (2, :).',1e-6) expected
0.000000000000000
0.001453751992820
0.005697415122157
0.054026693640485
0.021913715192919
0.033576036591546
0.047383240545637
0.063134746815111
0.080588540800503
0.099447925361298
0.119348919723468
0.139849516688324
0.160422523589624
0.180454172248765
0.199250936357077
0.216056837685164
0.230082743499168
0.167633661721183
0.246729493646804
0.248021231693208
0.243984126550887
0.234390974488730
0.219251136187254
0.198812624896252
0.173540342952859
0.144073971180413
0.111172474491534
0.075653816605036
0.038338058225143
0.000000000000000
but got
0.000000000000000
0.001453751992820
0.005697415122157
0.012568583440551
0.021913715192919
0.033576036591546
0.047383240545637
0.063134746815111
0.080588540800503
0.099447925361298
0.119348919723468
0.139849516688324
0.160422523589624
0.180454172248765
0.199250936357077
0.216056837685164
0.230082743499168
0.240547622358858
0.246729493646804
0.248021231693208
0.243984126550887
0.234390974488730
0.219251136187254
0.198812624896252
0.173540342952859
0.144073971180413
0.111172474491534
0.075653816605036
0.038338058225143
0.000000000000000
maximum absolute error 0.072914 exceeds tolerance 1e-06
w =
0.699788460750452 0.236170717501105 0.777014254410179 0.414302225678904
PASSES 2 out of 2 tests
w =
0.763382879235352 0.904982564318020 0.883091657725472 0.619070199965627
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 3),w (3) * aux (2, :).',1e-6) expected
0.000000000000000
0.004647907766521
0.014844084034597
0.031694142266909
0.053481386358538
0.079323556214762
0.108418843380517
0.140030300347043
0.173472306193559
0.208098572791832
0.243291259976062
0.278450825281170
0.312986268804854
0.346305449136649
0.377805143068533
0.406860499250926
0.432813491599682
0.540630845653324
0.472534300869485
0.484692191222657
0.490488575456341
0.488851521293124
0.478549182035958
0.458147960043047
0.425958654721646
0.379966116401947
0.317735956222400
0.236288849982259
0.131928273614047
0.000000000000000
but got
0.000000000000000
0.003912204684025
0.014844084034597
0.031694142266909
0.053481386358538
0.079323556214762
0.108418843380517
0.140030300347043
0.173472306193559
0.208098572791832
0.243291259976062
0.278450825281170
0.312986268804854
0.346305449136649
0.377805143068533
0.406860499250926
0.432813491599683
0.454959907462821
0.472534300869485
0.484692191222657
0.490488575456341
0.488851521293124
0.478549182035958
0.458147960043047
0.425958654721646
0.379966116401947
0.317735956222400
0.236288849982259
0.131928273614047
0.000000000000000
maximum absolute error 0.0856709 exceeds tolerance 1e-06
w =
0.723830042824076 0.678563121173550 0.838238363452731 0.805154224608744
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.4323939875179458 0.0159412488751324 0.2275365813268574
Column 4:
0.4767445728539698
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.8298365594276927 0.9554494626708947 0.0691620775049633
Column 4:
0.6622035611071919
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 3),w (3) * aux (2, :).',1e-6) expected
0.0000000000000000
0.0002838075430547
0.0010909421215990
0.0023724770874160
0.0040969876654187
0.0062451926326708
0.0088060093420111
0.0861309569499065
0.0151427573456323
0.0189086262706012
0.0230596976511841
0.0275744011060064
0.0324145571047938
0.0375176003981259
0.0427872923750125
0.0480834435790563
0.0532120241380798
0.0579182968860492
0.0618870946867000
0.0647554873862334
0.0661426990219897
0.0656988165354363
0.0631669113176878
0.0584443716629877
0.0516232958683059
0.0429923658052722
0.0329952623135423
0.0221576037895799
0.0110057009910194
0.0000000000000000
but got
0.0000000000000000
0.0002838075430547
0.0010909421215990
0.0023724770874160
0.0040969876654187
0.0062451926326708
0.0088060093420111
0.0117732946584028
0.0151427573456323
0.0189086262706012
0.0230596976511841
0.0275744011060064
0.0324145571047938
0.0375176003981259
0.0427872923750124
0.0480834435790563
0.0532120241380798
0.0579182968860492
0.0618870946867000
0.0647554873862334
0.0661426990219897
0.0656988165354363
0.0631669113176878
0.0584443716629877
0.0516232958683059
0.0429923658052722
0.0329952623135423
0.0221576037895799
0.0110057009910194
0.0000000000000000
maximum absolute error 0.0743577 exceeds tolerance 1e-06
w =
0.397792733151603 0.227975033420159 0.371660803728723 0.117118512517466
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 2),w (2) * aux (2, :).',1e-6) expected
0.000000000000000
0.057656365415189
0.111436350239694
0.160482765084271
0.204063845387290
0.241609757354467
0.272737375212644
0.297261159604622
0.315189848468285
0.326710474225581
0.332162600400231
0.332006423263086
0.326788479598397
0.317108257578974
0.295849351783483
0.288566451346212
0.267489675409840
0.246075641123260
0.223129848509355
0.199130681519313
0.174513714197361
0.149677858617740
0.124996133850718
0.100832447776352
0.077567815407891
0.055643685342732
0.035639834451242
0.018429421612744
0.005527178732600
0.000000000000000
but got
0.000000000000000
0.057656365415189
0.111436350239694
0.160482765084271
0.204063845387290
0.241609757354467
0.272737375212644
0.297261159604622
0.315189848468285
0.326710474225581
0.332162600400231
0.332006423263086
0.326788479598397
0.317108257578974
0.303588226021049
0.286848894823903
0.267489675409840
0.246075641123260
0.223129848509355
0.199130681519313
0.174513714197361
0.149677858617740
0.124996133850718
0.100832447776352
0.077567815407891
0.055643685342732
0.035639834451242
0.018429421612744
0.005527178732600
0.000000000000000
maximum absolute error 0.00773887 exceeds tolerance 1e-06
w =
0.241063917347678 0.226266277883894 0.655150193154830 0.617912137531347
PASSES 2 out of 2 tests
w =
0.441917190222542 0.504899500117061 0.278986463743575 0.303982347703180
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.1564508847464449 0.0214549838999318 0.3841178743901574
Column 4:
0.4706095585621403
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 3),w (3) * aux (2, :).',1e-6) expected
0.000000000000000
0.009172681343214
0.037696417271737
0.085260473318410
0.148857995337388
0.223152335174984
0.301599104445849
0.377853755305372
0.446884980559128
0.505471881857387
0.552125145207228
0.586678606263835
0.609801084459018
0.622579874610712
0.626227789166493
0.621906125886712
0.610633666370957
0.593250762079287
0.570414548245484
0.542609299246256
0.613256269956642
0.473259720902879
0.431960197876444
0.386204054837259
0.335818325498738
0.280516774227524
0.219894693698082
0.153417864118779
0.080404695119379
0.000000000000000
but got
0.000000000000000
0.009172681343214
0.037696417271737
0.085260473318410
0.148857995337388
0.223152335174984
0.301599104445849
0.377853755305372
0.446884980559128
0.505471881857387
0.552125145207228
0.586678606263835
0.609801084459018
0.622579874610712
0.626227789166493
0.621906125886712
0.610633666370957
0.593250762079287
0.570414548245484
0.542609299246256
0.510162278381751
0.473259720902879
0.431960197876443
0.386204054837259
0.335818325498738
0.280516774227524
0.219894693698082
0.153417864118779
0.080404695119379
0.000000000000000
maximum absolute error 0.103094 exceeds tolerance 1e-06
w =
0.376536993115434 0.325601933112773 0.773251634871305 0.737269362447754
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 3),w (3) * aux (2, :).',1e-6) expected
0.000000000000000
0.007139868012126
0.027555405334899
0.059249084262487
0.099769124065045
0.146472911807991
0.196764315501706
0.248272997613469
0.298964076051470
0.347183066054229
0.391650631389570
0.431424530066096
0.465844416817182
0.494471297347235
0.517029230974390
0.533353334431870
0.543345581389784
0.546938267868539
0.646621530239749
0.534631526481671
0.518503499821750
0.495478442649312
0.465271466705115
0.427494468360848
0.381633303032331
0.327020052592428
0.464381471771269
0.187875276404551
0.100864771107054
0.000000000000000
but got
0.000000000000000
0.007139868012126
0.027555405334899
0.059249084262487
0.099769124065045
0.146472911807991
0.196764315501706
0.248272997613469
0.298964076051470
0.347183066054229
0.391650631389570
0.431424530066096
0.465844416817182
0.494471297347234
0.517029230974390
0.533353334431870
0.543345581389784
0.546938267868539
0.544064110703216
0.534631526481671
0.518503499821750
0.495478442649312
0.465271466705115
0.427494468360848
0.381633303032331
0.327020052592428
0.262797895639680
0.187875276404551
0.100864771107054
0.000000000000000
maximum absolute error 0.201584 exceeds tolerance 1e-06
w =
0.860898946627609 0.390966535848115 0.992943519245866 0.117797118199190
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 4),w (4) * aux (2, :).',1e-6) expected
0.000000000000000
0.000005918997496
0.000049656760430
0.000669943354527
0.000428770567706
0.000862045813036
0.001524584225770
0.002464852991933
0.003728808915753
0.005360025893061
0.007400874448680
0.009894695854769
0.012888884635730
0.016438849982476
0.027415204557607
0.025498825657013
0.031211477155743
0.037904713066649
0.045787380575508
0.055147963139143
0.066393283352587
0.080112199133988
0.097185716595615
0.118988659754159
0.147786116662342
0.187586236517724
0.246207573032032
0.341206723648008
0.521874635386314
1.000000000000000
but got
0.000000000000000
0.000005918997496
0.000049656760430
0.000174657740099
0.000428770567706
0.000862045813036
0.001524584225770
0.002464852991933
0.003728808915753
0.005360025893061
0.007400874448680
0.009894695854769
0.012888884635730
0.016438849982476
0.020612964382545
0.025498825657013
0.031211477155743
0.037904713066649
0.045787380575508
0.055147963139143
0.066393283352587
0.080112199133988
0.097185716595615
0.118988659754159
0.147786116662342
0.187586236517724
0.246207573032032
0.341206723648008
0.521874635386314
1.000000000000000
maximum absolute error 0.00680224 exceeds tolerance 1e-06
w =
0.344331860669923 0.462570952109756 0.447855658881556 0.237267587232599
PASSES 2 out of 2 tests
w =
0.807070685070998 0.801534503655629 0.810971563056440 0.489547631737138
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 4),w (4) * aux (2, :).',1e-6) expected
0.000000000000000
0.000262981699193
0.000199224239408
0.000672861866964
0.001596365736531
0.023138930642462
0.005402722908633
0.008597313542270
0.012868143754223
0.018385140900202
0.025327889527868
0.033888650296669
0.044276016299200
0.056719352097008
0.071474212979689
0.088829012472812
0.109113302794100
0.132708167518068
0.160059415944839
0.191694541975324
0.228244809607414
0.270474421084915
0.319319624205675
0.375942009349379
0.441802454994241
0.518765768261607
0.609252063812073
0.716461272719146
0.844715689243079
1.000000000000000
but got
0.000000000000000
0.000024887229471
0.000199224239408
0.000672861866964
0.001596365736531
0.003121614022358
0.005402722908633
0.008597313542270
0.012868143754223
0.018385140900202
0.025327889527868
0.033888650296669
0.044276016299200
0.056719352097008
0.071474212979689
0.088829012472812
0.109113302794100
0.132708167518068
0.160059415944839
0.191694541975324
0.228244809607414
0.270474421084915
0.319319624205675
0.375942009349379
0.441802454994241
0.518765768261606
0.609252063812073
0.716461272719146
0.844715689243079
1.000000000000000
maximum absolute error 0.0200173 exceeds tolerance 1e-06
w =
Columns 1 through 3:
0.9512693144071073 0.5394070850213528 0.1744216842700039
Column 4:
0.0348124091923401
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 3),w (3) * aux (2, :).',1e-6) expected
0.000000000000000
0.000660997125690
0.018086373797045
0.006084282006759
0.010946583934442
0.017317926925545
0.025261539315806
0.034846258846553
0.046146567008259
0.059242443794854
0.074218940506932
0.091165317077887
0.110173512308377
0.131335594762551
0.154739653116746
0.180463284010799
0.208563348067100
0.000000000000000
0.271910500336631
0.306969904124058
0.343923528010388
0.382178072106730
0.420674946780466
0.457561923879460
0.489590171437773
0.510945889129125
0.510823803993362
0.467902625695547
0.336068404715463
0.000000000000000
but got
0.000000000000000
0.000660997125690
0.002673256768105
0.006084282006759
0.010946583934442
0.017317926925545
0.025261539315806
0.034846258846553
0.046146567008259
0.059242443794854
0.074218940506932
0.091165317077887
0.110173512308377
0.131335594762551
0.154739653116746
0.180463284010799
0.208563348067100
0.239059858417584
0.271910500336631
0.306969904124058
0.343923528010388
0.382178072106730
0.420674946780466
0.457561923879460
0.489590171437773
0.510945889129125
0.510823803993362
0.467902625695547
0.336068404715463
0.000000000000000
maximum absolute error 0.23906 exceeds tolerance 1e-06
w =
0.525326683232430 0.561241200419038 0.494924498888818 0.570458945173994
PASSES 2 out of 2 tests
w =
0.724101895515810 0.583491700955536 0.924162201566522 0.491817628001865
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 4),w (4) * aux (2, :).',1e-6) expected
0.000000000000000
0.000028353408911
0.000332859641472
0.000783943418334
0.001870167794806
0.074734615210297
0.006335434260565
0.010042304330877
0.014935726826289
0.021159390126747
0.028853440232461
0.038159088370041
0.049224297553012
0.062210485837035
0.077300322180302
0.094706860313701
0.114684463264563
0.137542235937041
0.163661042971066
0.193515707888272
0.227704774370094
0.285878175015706
0.312361308773127
0.365105853010405
0.426946522514201
0.500224618664399
0.588201906821106
0.695555490000378
0.829231180749668
1.000000000000000
but got
0.000000000000000
0.000028353408911
0.000229981806297
0.000783943418334
0.001870167794806
0.003664522131710
0.006335434260565
0.010042304330877
0.014935726826289
0.021159390126747
0.028853440232461
0.038159088370041
0.049224297553012
0.062210485837035
0.077300322180302
0.094706860313701
0.114684463264563
0.137542235937041
0.163661042971066
0.193515707888272
0.227704774370094
0.266991444066197
0.312361308773127
0.365105853010405
0.426946522514201
0.500224618664399
0.588201906821106
0.695555490000378
0.829231180749668
1.000000000000000
maximum absolute error 0.0710701 exceeds tolerance 1e-06
w =
0.695862468693127 0.178335190225215 0.480371498735518 0.656522217143150
PASSES 2 out of 2 tests
w =
0.145617237282955 0.642544625850709 0.344287884703859 0.632223003712454
PASSES 2 out of 2 tests
w =
0.724902746484935 0.400899911282862 0.218173126215285 0.363083612474368
PASSES 2 out of 2 tests
w =
0.235383505824929 0.400019839494519 0.485147600993155 0.456042279191449
PASSES 2 out of 2 tests
w =
Columns 1 through 3:
0.6860126355787336 0.0178536920770131 0.8508440734267076
Column 4:
0.6559906793595138
***** test
U = [0 0 0 0 1 1 1 1];
x = [0 1/3 2/3 1] ;
y = [0 0 0 0];
format long
w = rand(1,4)
nrb = nrbmak ([x;y;y;w], U);
u = linspace(0, 1, 30);
B = nrbbasisfun (u, nrb);
xplot = sum(bsxfun(@(x,y) x.*y, B, x),2);
yy = y; yy(1) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).')
assert(B(:,1), w(1)*aux(2,:).', 1e-6)
yy = y; yy(2) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2, u);
%figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).')
assert(B(:,2), w(2)*aux(2,:).', 1e-6)
yy = y; yy(3) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).')
assert(B(:,3), w(3)*aux(2,:).', 1e-6)
yy = y; yy(4) = 1;
nrb2 = nrbmak ([x.*w;yy;y;w], U);
aux = nrbeval(nrb2,u);
%figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).')
assert(B(:,4), w(4)*aux(2,:).', 1e-6)
!!!!! test failed
assert (B (:, 4),w (4) * aux (2, :).',1e-6) expected
0.000000000000000
0.000043232744996
0.000378589026975
0.001385789076901
0.003523325328606
0.007287999685763
0.013154027140926
0.021505296869295
0.032581274343616
0.046454831874433
0.063048636772436
0.082182091905494
0.103631633631720
0.127187220998048
0.152694529793574
0.180080407265703
0.209364753049950
0.240664258865637
0.274193330386772
0.310266410615547
0.349304820344121
0.391850617517110
0.175640226781075
0.490389786276306
0.548351468838982
0.613891874071664
0.688862826353427
0.775732928666324
0.877870625267394
1.000000000000000
but got
0.000000000000000
0.000043232744996
0.000378589026975
0.001385789076901
0.003523325328606
0.007287999685763
0.013154027140926
0.021505296869295
0.032581274343616
0.046454831874433
0.063048636772436
0.082182091905494
0.103631633631720
0.127187220998048
0.152694529793574
0.180080407265703
0.209364753049950
0.240664258865637
0.274193330386772
0.310266410615547
0.349304820344121
0.391850617517110
0.438590026805282
0.490389786276306
0.548351468838981
0.613891874071664
0.688862826353427
0.775732928666324
0.877870625267393
1.000000000000000
maximum absolute error 0.26295 exceeds tolerance 1e-06
More information about the Pkg-octave-devel
mailing list