annotate scripts/polynomial/mkpp.m @ 30564:796f54d4ddbf stable

update Octave Project Developers copyright for the new year In files that have the "Octave Project Developers" copyright notice, update for 2021. In all .txi and .texi files except gpl.txi and gpl.texi in the doc/liboctave and doc/interpreter directories, change the copyright to "Octave Project Developers", the same as used for other source files. Update copyright notices for 2022 (not done since 2019). For gpl.txi and gpl.texi, change the copyright notice to be "Free Software Foundation, Inc." and leave the date at 2007 only because this file only contains the text of the GPL, not anything created by the Octave Project Developers. Add Paul Thomas to contributors.in.
author John W. Eaton <jwe@octave.org>
date Tue, 28 Dec 2021 18:22:40 -0500
parents 7854d5752dd2
children 597f3ee61a48
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ########################################################################
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 ##
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
3 ## Copyright (C) 2000-2022 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
4 ##
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 ## See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 ## distribution or <https://octave.org/copyright/>.
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
7 ##
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
8 ## This file is part of Octave.
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
9 ##
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
10 ## Octave is free software: you can redistribute it and/or modify it
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
11 ## under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
12 ## the Free Software Foundation, either version 3 of the License, or
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22323
diff changeset
13 ## (at your option) any later version.
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
14 ##
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
15 ## Octave is distributed in the hope that it will be useful, but
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22323
diff changeset
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22323
diff changeset
18 ## GNU General Public License for more details.
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
19 ##
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
20 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6746
diff changeset
21 ## along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
22 ## <https://www.gnu.org/licenses/>.
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 ##
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ########################################################################
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
25
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
26 ## -*- texinfo -*-
20852
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 20181
diff changeset
27 ## @deftypefn {} {@var{pp} =} mkpp (@var{breaks}, @var{coefs})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 20181
diff changeset
28 ## @deftypefnx {} {@var{pp} =} mkpp (@var{breaks}, @var{coefs}, @var{d})
12608
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
29 ##
14104
614505385171 doc: Overhaul docstrings for polynomial functions.
Rik <octave@nomad.inbox5.com>
parents: 13929
diff changeset
30 ## Construct a piecewise polynomial (pp) structure from sample points
20165
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
31 ## @var{breaks} and coefficients @var{coefs}.
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11536
diff changeset
32 ##
20165
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
33 ## @var{breaks} must be a vector of strictly increasing values. The number of
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
34 ## intervals is given by @code{@var{ni} = length (@var{breaks}) - 1}.
20181
aa36fb998a4d maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents: 20165
diff changeset
35 ##
20165
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
36 ## When @var{m} is the polynomial order @var{coefs} must be of size:
24560
1c1adf6ab75d doc: Fix issues in geometry, polynomial, and interpolation chapters (bug #52835).
Rik <rik@octave.org>
parents: 23219
diff changeset
37 ## @w{@var{ni}-by-(@var{m} + 1)}.
20165
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
38 ##
25876
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
39 ## The i-th row of @var{coefs}, @code{@var{coefs}(@var{i},:)}, contains the
20165
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
40 ## coefficients for the polynomial over the @var{i}-th interval, ordered from
25876
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
41 ## highest (@var{m}) to lowest (@var{0}) degree.
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
42 ##
21546
f7f97d7e9294 doc: Wrap m-file docstrings to 79 characters + newline (80 total).
Rik <rik@octave.org>
parents: 20852
diff changeset
43 ## @var{coefs} may also be a multi-dimensional array, specifying a
f7f97d7e9294 doc: Wrap m-file docstrings to 79 characters + newline (80 total).
Rik <rik@octave.org>
parents: 20852
diff changeset
44 ## vector-valued or array-valued polynomial. In that case the polynomial
24560
1c1adf6ab75d doc: Fix issues in geometry, polynomial, and interpolation chapters (bug #52835).
Rik <rik@octave.org>
parents: 23219
diff changeset
45 ## order @var{m} is defined by the length of the last dimension of @var{coefs}.
1c1adf6ab75d doc: Fix issues in geometry, polynomial, and interpolation chapters (bug #52835).
Rik <rik@octave.org>
parents: 23219
diff changeset
46 ## The size of first dimension(s) are given by the scalar or vector @var{d}.
25880
49734a75561f doc: Wrap long lines in mkpp.m and unmkpp.m.
Rik <rik@octave.org>
parents: 25876
diff changeset
47 ## If @var{d} is not given it is set to @code{1}. In this case
49734a75561f doc: Wrap long lines in mkpp.m and unmkpp.m.
Rik <rik@octave.org>
parents: 25876
diff changeset
48 ## @code{@var{p}(@var{r}, @var{i}, :)} contains the coefficients for the
49734a75561f doc: Wrap long lines in mkpp.m and unmkpp.m.
Rik <rik@octave.org>
parents: 25876
diff changeset
49 ## @var{r}-th polynomial defined on interval @var{i}. In any case @var{coefs}
49734a75561f doc: Wrap long lines in mkpp.m and unmkpp.m.
Rik <rik@octave.org>
parents: 25876
diff changeset
50 ## is reshaped to a 2-D matrix of size @code{[@var{ni}*prod(@var{d}) @var{m}]}.
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
51 ##
26200
33e6ab3e1491 mkpp.m: Document how ppval will calculate values for each piecewise section (patch #9095).
Rik <rik@octave.org>
parents: 25880
diff changeset
52 ## Programming Note: @code{ppval} evaluates polynomials at
33e6ab3e1491 mkpp.m: Document how ppval will calculate values for each piecewise section (patch #9095).
Rik <rik@octave.org>
parents: 25880
diff changeset
53 ## @code{@var{xi} - @var{breaks}(i)}, i.e., it subtracts the lower endpoint of
33e6ab3e1491 mkpp.m: Document how ppval will calculate values for each piecewise section (patch #9095).
Rik <rik@octave.org>
parents: 25880
diff changeset
54 ## the current interval from @var{xi}. This must be taken into account when
33e6ab3e1491 mkpp.m: Document how ppval will calculate values for each piecewise section (patch #9095).
Rik <rik@octave.org>
parents: 25880
diff changeset
55 ## creating piecewise polynomials objects with @code{mkpp}.
14104
614505385171 doc: Overhaul docstrings for polynomial functions.
Rik <octave@nomad.inbox5.com>
parents: 13929
diff changeset
56 ## @seealso{unmkpp, ppval, spline, pchip, ppder, ppint, ppjumps}
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
57 ## @end deftypefn
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
58
28948
36cd3569f702 maint: match names in documentation and input parameters in function.
Rik <rik@octave.org>
parents: 28789
diff changeset
59 function pp = mkpp (breaks, coefs, d)
12608
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
60
28789
28de41192f3c Eliminate unneeded verification of nargin, nargout in m-files.
Rik <rik@octave.org>
parents: 27923
diff changeset
61 if (nargin < 2)
6046
34f96dd5441b [project @ 2006-10-10 16:10:25 by jwe]
jwe
parents: 5824
diff changeset
62 print_usage ();
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
63 endif
12608
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
64
28948
36cd3569f702 maint: match names in documentation and input parameters in function.
Rik <rik@octave.org>
parents: 28789
diff changeset
65 ## Check BREAKS
36cd3569f702 maint: match names in documentation and input parameters in function.
Rik <rik@octave.org>
parents: 28789
diff changeset
66 if (! isvector (breaks))
36cd3569f702 maint: match names in documentation and input parameters in function.
Rik <rik@octave.org>
parents: 28789
diff changeset
67 error ("mkpp: BREAKS must be a vector");
36cd3569f702 maint: match names in documentation and input parameters in function.
Rik <rik@octave.org>
parents: 28789
diff changeset
68 elseif (length (breaks) < 2)
36cd3569f702 maint: match names in documentation and input parameters in function.
Rik <rik@octave.org>
parents: 28789
diff changeset
69 error ("mkpp: BREAKS must have at least one interval");
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
70 endif
12608
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
71
28948
36cd3569f702 maint: match names in documentation and input parameters in function.
Rik <rik@octave.org>
parents: 28789
diff changeset
72 len = length (breaks) - 1;
9768
31900e17b5f5 improve Matlab compatibility & performance of ppval/mkpp and some associated funcs
Jaroslav Hajek <highegg@gmail.com>
parents: 9051
diff changeset
73
12608
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
74 pp = struct ("form", "pp",
28948
36cd3569f702 maint: match names in documentation and input parameters in function.
Rik <rik@octave.org>
parents: 28789
diff changeset
75 "breaks", breaks(:).',
12608
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
76 "coefs", [],
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
77 "pieces", len,
28948
36cd3569f702 maint: match names in documentation and input parameters in function.
Rik <rik@octave.org>
parents: 28789
diff changeset
78 "order", prod (size (coefs)) / len,
12608
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
79 "dim", 1);
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
80
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
81 if (nargin == 3)
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
82 pp.dim = d;
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
83 pp.order /= prod (d);
13141
e81ddf9cacd5 maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 12608
diff changeset
84 endif
12608
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
85
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
86 dim_vec = [pp.pieces * prod(pp.dim), pp.order];
28948
36cd3569f702 maint: match names in documentation and input parameters in function.
Rik <rik@octave.org>
parents: 28789
diff changeset
87 pp.coefs = reshape (coefs, dim_vec);
12608
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
88
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
89 endfunction
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
90
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
91
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
92 %!demo # linear interpolation
25876
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
93 %! x = linspace (0, pi, 5)';
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
94 %! t = [sin(x), cos(x)];
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
95 %! m = diff (t) ./ (x(2)-x(1));
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
96 %! b = t(1:4,:);
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
97 %! pp = mkpp (x, [m(:),b(:)]);
25876
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
98 %! xi = linspace (0, pi, 50);
25880
49734a75561f doc: Wrap long lines in mkpp.m and unmkpp.m.
Rik <rik@octave.org>
parents: 25876
diff changeset
99 %! plot (x, t, "x", xi, ppval (pp,xi));bb4af245dff7
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
100 %! legend ("control", "interp");
12608
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
101
25876
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
102 %!demo # piecewise polynomial shape
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
103 %! breaks = [0 1 2 3];
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
104 %! dim = 2;
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
105 %! coefs = zeros (dim, length (breaks) - 1, 4);
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
106 %! # 1st edge of the shape (x, x^2)
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
107 %! coefs(1,1,:) = [0 0 1 0];
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
108 %! coefs(2,1,:) = [0 1 0 0];
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
109 %! # 2nd edge of the shape (-3x, 1)
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
110 %! coefs(1,2,:) = [0 0 -3 1];
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
111 %! coefs(2,2,:) = [0 0 0 1];
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
112 %! # 3rd edge of the shape (2x - 2, -4(x -1/2)^3 + 1/2)
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
113 %! coefs(1,3,:) = [0 0 2 -2];
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
114 %! coefs(2,3,:) = [-4 6 -3 1];
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
115 %! pp = mkpp (breaks, coefs, dim);
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
116 %! t = linspace (0, 3, 100).';
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
117 %! xy = ppval (pp, t).';
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
118 %! patch (xy(:,1), xy(:,2), 'r');
778a0400586b doc: mkpp.m explain multi-dimensional coefficients and add demo for it
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 25054
diff changeset
119
12608
59e2460acae1 make piecewise polynomial (pp) functions more compatible
Kai Habel <kai.habel@gmx.de>
parents: 11587
diff changeset
120 %!shared b,c,pp
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
121 %! b = 1:3; c = 1:24; pp = mkpp (b,c);
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
122 %!assert (pp.pieces, 2)
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
123 %!assert (pp.order, 12)
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
124 %!assert (pp.dim, 1)
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
125 %!assert (size (pp.coefs), [2,12])
14868
5d3a684236b0 maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents: 14363
diff changeset
126 %! pp = mkpp (b,c,2);
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
127 %!assert (pp.pieces, 2)
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
128 %!assert (pp.order, 6)
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
129 %!assert (pp.dim, 2)
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
130 %!assert (size (pp.coefs), [4,6])
14868
5d3a684236b0 maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents: 14363
diff changeset
131 %! pp = mkpp (b,c,3);
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
132 %!assert (pp.pieces, 2)
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
133 %!assert (pp.order, 4)
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
134 %!assert (pp.dim, 3)
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
135 %!assert (size (pp.coefs), [6,4])
14868
5d3a684236b0 maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents: 14363
diff changeset
136 %! pp = mkpp (b,c,[2,3]);
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
137 %!assert (pp.pieces, 2)
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
138 %!assert (pp.order, 2)
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
139 %!assert (pp.dim, [2,3])
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
140 %!assert (size (pp.coefs), [12,2])