# HG changeset patch # User Rik # Date 1515443144 28800 # Node ID 06e22134d81ac70dc120155f396822d78adb7ccc # Parent 2245b9183bc5b3c46148082b1f80985a49ef3250# Parent 1c1adf6ab75d0673d0b7087f4543b7278d2fce54 maint: Merge stable to default. diff -r 2245b9183bc5 -r 06e22134d81a doc/interpreter/geometry.txi --- a/doc/interpreter/geometry.txi Mon Jan 08 20:41:12 2018 +0100 +++ b/doc/interpreter/geometry.txi Mon Jan 08 12:25:44 2018 -0800 @@ -102,7 +102,7 @@ @DOCSTRING(tetramesh) -The difference between @code{triplot}, and @code{trimesh} or @code{triplot}, +The difference between @code{triplot}, and @code{trimesh} or @code{trisurf}, is that the former only plots the 2-dimensional triangulation itself, whereas the second two plot the value of a function @code{f (@var{x}, @var{y})}. An example of the use of the @code{triplot} function is @@ -145,21 +145,20 @@ Cartesian coordinates of the point in a parametric form with respect to the N-simplex. This parametric form is called the Barycentric Coordinates of the point. If the points defining the N-simplex are given -by @code{@var{N} + 1} vectors @var{t}(@var{i},:), then the Barycentric +by @var{N} + 1 vectors @code{@var{t}(@var{i},:)}, then the Barycentric coordinates defining the point @var{p} are given by @example -@var{p} = sum (@var{beta}(1:@var{N}+1) * @var{t}(1:@var{N}+1),:) +@var{p} = @var{beta} * @var{t} @end example @noindent -where there are @code{@var{N} + 1} values @code{@var{beta}(@var{i})} -that together as a vector represent the Barycentric coordinates of the -point @var{p}. To ensure a unique solution for the values of -@code{@var{beta}(@var{i})} an additional criteria of +where @var{beta} contains @var{N} + 1 values that together as a vector +represent the Barycentric coordinates of the point @var{p}. To ensure a unique +solution for the values of @var{beta} an additional criteria of @example -sum (@var{beta}(1:@var{N}+1)) == 1 +sum (@var{beta}) == 1 @end example @noindent @@ -168,7 +167,7 @@ @example @group @var{p} - @var{t}(end, :) = @var{beta}(1:end-1) * (@var{t}(1:end-1, :) - - ones (@var{N}, 1) * @var{t}(end, :) + - ones (@var{N}, 1) * @var{t}(end, :) @end group @end example @@ -177,8 +176,8 @@ @example @group -@var{beta}(1:end-1) = (@var{p} - @var{t}(end, :)) / (@var{t}(1:end-1, :) - - ones (@var{N}, 1) * @var{t}(end, :)) +@var{beta}(1:end-1) = (@var{p} - @var{t}(end, :)) / + (@var{t}(1:end-1, :) - ones (@var{N}, 1) * @var{t}(end, :)) @var{beta}(end) = sum (@var{beta}(1:end-1)) @end group @end example @@ -212,7 +211,7 @@ @group @var{x} = [-1; -1; 1; 1]; @var{y} = [-1; 1; -1; 1]; -@var{tri} = [1, 2, 3; 2, 3, 1]; +@var{tri} = [1, 2, 3; 2, 3, 4]; @end group @end example diff -r 2245b9183bc5 -r 06e22134d81a doc/interpreter/optim.txi --- a/doc/interpreter/optim.txi Mon Jan 08 20:41:12 2018 +0100 +++ b/doc/interpreter/optim.txi Mon Jan 08 12:25:44 2018 -0800 @@ -89,7 +89,7 @@ subject to @tex $$ - Ax = b \qquad lb \leq x \leq ub \qquad A_{lb} \leq A_{in} \leq A_{ub} + A x = b \qquad lb \leq x \leq ub \qquad A_{lb} \leq A_{in} x \leq A_{ub} $$ @end tex @ifnottex diff -r 2245b9183bc5 -r 06e22134d81a scripts/general/interp2.m --- a/scripts/general/interp2.m Mon Jan 08 20:41:12 2018 +0100 +++ b/scripts/general/interp2.m Mon Jan 08 12:25:44 2018 -0800 @@ -71,7 +71,7 @@ ## @end table ## ## @var{extrap} is a scalar number. It replaces values beyond the endpoints -## with @var{extrap}. Note that if @var{extrapval} is used, @var{method} must +## with @var{extrap}. Note that if @var{extrap} is used, @var{method} must ## be specified as well. If @var{extrap} is omitted and the @var{method} is ## @qcode{"spline"}, then the extrapolated values of the @qcode{"spline"} are ## used. Otherwise the default @var{extrap} value for any other @var{method} diff -r 2245b9183bc5 -r 06e22134d81a scripts/geometry/tsearchn.m --- a/scripts/geometry/tsearchn.m Mon Jan 08 20:41:12 2018 +0100 +++ b/scripts/geometry/tsearchn.m Mon Jan 08 12:25:44 2018 -0800 @@ -62,13 +62,13 @@ function Beta = cart2bary (T, P) ## Conversion of Cartesian to Barycentric coordinates. - ## Given a reference simplex in N dimensions represented by a - ## (N+1)-by-(N) matrix, and arbitrary point P in cartesion coordinates, - ## represented by a N-by-1 row vector can be written as + ## Given a reference simplex in N dimensions represented by an + ## N+1-by-N matrix, an arbitrary point P in Cartesian coordinates, + ## represented by an N-by-1 column vector can be written as ## ## P = Beta * T ## - ## Where Beta is a N+1 vector of the barycentric coordinates. A criteria + ## Where Beta is an N+1 vector of the barycentric coordinates. A criteria ## on Beta is that ## ## sum (Beta) == 1 @@ -82,7 +82,7 @@ ## Beta(1:end-1) = (P - T(end,:)) / (T(1:end-1,:) - ones (N,1) * T(end,:)) ## Beta(end) = sum (Beta) ## - ## Note below is generalize for multiple values of P, one per row. + ## Note code below is generalized for multiple values of P, one per row. [M, N] = size (P); Beta = (P - ones (M,1) * T(end,:)) / (T(1:end-1,:) - ones (N,1) * T(end,:)); Beta (:,end+1) = 1 - sum (Beta, 2); diff -r 2245b9183bc5 -r 06e22134d81a scripts/optimization/qp.m --- a/scripts/optimization/qp.m Mon Jan 08 20:41:12 2018 +0100 +++ b/scripts/optimization/qp.m Mon Jan 08 12:25:44 2018 -0800 @@ -45,7 +45,7 @@ ## subject to ## @tex ## $$ -## Ax = b \qquad lb \leq x \leq ub \qquad A_{lb} \leq A_{in} \leq A_{ub} +## A x = b \qquad lb \leq x \leq ub \qquad A_{lb} \leq A_{in} x \leq A_{ub} ## $$ ## @end tex ## @ifnottex @@ -62,9 +62,12 @@ ## @noindent ## using a null-space active-set method. ## -## Any bound (@var{A}, @var{b}, @var{lb}, @var{ub}, @var{A_lb}, @var{A_ub}) -## may be set to the empty matrix (@code{[]}) if not present. If the initial -## guess is feasible the algorithm is faster. +## Any bound (@var{A}, @var{b}, @var{lb}, @var{ub}, @var{A_in}, @var{A_lb}, +## @var{A_ub}) may be set to the empty matrix (@code{[]}) if not present. The +## constraints @var{A} and @var{A_in} are matrices with each row representing +## a single constraint. The other bounds are scalars or vectors depending on +## the number of constraints. The algorithm is faster if the initial guess is +## feasible. ## ## @table @var ## @item options diff -r 2245b9183bc5 -r 06e22134d81a scripts/polynomial/mkpp.m --- a/scripts/polynomial/mkpp.m Mon Jan 08 20:41:12 2018 +0100 +++ b/scripts/polynomial/mkpp.m Mon Jan 08 12:25:44 2018 -0800 @@ -27,7 +27,7 @@ ## intervals is given by @code{@var{ni} = length (@var{breaks}) - 1}. ## ## When @var{m} is the polynomial order @var{coefs} must be of size: -## @var{ni} x @var{m} + 1. +## @w{@var{ni}-by-(@var{m} + 1)}. ## ## The i-th row of @var{coefs}, @code{@var{coefs} (@var{i},:)}, contains the ## coefficients for the polynomial over the @var{i}-th interval, ordered from @@ -35,10 +35,10 @@ ## ## @var{coefs} may also be a multi-dimensional array, specifying a ## vector-valued or array-valued polynomial. In that case the polynomial -## order is defined by the length of the last dimension of @var{coefs}. The -## size of first dimension(s) are given by the scalar or vector @var{d}. If -## @var{d} is not given it is set to @code{1}. In any case @var{coefs} is -## reshaped to a 2-D matrix of size @code{[@var{ni}*prod(@var{d} @var{m})]}. +## order @var{m} is defined by the length of the last dimension of @var{coefs}. +## The size of first dimension(s) are given by the scalar or vector @var{d}. +## If @var{d} is not given it is set to @code{1}. In any case @var{coefs} is +## reshaped to a 2-D matrix of size @code{[@var{ni}*prod(@var{d}) @var{m}]}. ## ## @seealso{unmkpp, ppval, spline, pchip, ppder, ppint, ppjumps} ## @end deftypefn