plateform
stringclasses
1 value
repo_name
stringlengths
13
113
name
stringlengths
3
74
ext
stringclasses
1 value
path
stringlengths
12
229
size
int64
23
843k
source_encoding
stringclasses
9 values
md5
stringlengths
32
32
text
stringlengths
23
843k
github
foucart/Basc-master
test_lebesgue.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/misc/test_lebesgue.m
638
utf_8
2f67130901c9fc3f700aa97dc4f54164
% Test file for lebesgue.m. % Based on the test from Chebfun v4. function pass = test_lebesgue(pref) if ( nargin < 1 ) pref = chebfunpref(); end tol = pref.eps; [L, C] = lebesgue(chebpts(3)); pass(1) = abs(C - 5/4) < 10*tol; [L, C] = lebesgue(legpts(3), [-1,1]); pass(2) = abs(C - 7/3) < 11*tol; [L, C] = lebes...
github
foucart/Basc-master
test_jacpoly.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/misc/test_jacpoly.m
628
utf_8
bcf6e03e98131913e8095e5673e0b32b
% Test file for JACPOLY. function pass = test_jacpoly(pref) if ( nargin == 0 ) pref = chebfunpref(); end % TODO: We simply test against some values from V4. This should be improved. tol = 1e-14; J = jacpoly(0:3, .1, -.3); Jx = feval(J, .1).'; v4 = [ 1.000000000000000 0.290000000000000 ...
github
foucart/Basc-master
test_pde15s.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/misc/test_pde15s.m
7,634
utf_8
b98fbfb8bd2859cebff11350747a851b
function pass = test_pde15s(pref, varargin) if ( nargin == 0 ) pref = chebfunpref(); end tol = 1e5*pref.eps; %% Test chebtech1 works (see #910) % Get global prefs: globalPref = chebfunpref(); try % Set 1st kind grids: chebfunpref.setDefaults('tech', @chebtech1); f = chebfun(@(x) sin(pi*x), [-2.5 3]...
github
foucart/Basc-master
test_fov.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/misc/test_fov.m
742
utf_8
7e024d2e4750bacbde3e7ccb0e4c66b0
% Test file for fov.m. % Based on the test from Chebfun v4 written by Rodrigo Platte, Feb. 2009. function pass = test_fov(pref) if ( nargin < 1 ) pref = chebfunpref(); end A = [1 2 ; 3 2i]; F = fov(A); err = abs(max(real(F)) - 3.049509756796393); tol = 10*vscale(F)*epslevel(F); pass(1) = err < tol; B = 7; F = f...
github
foucart/Basc-master
test_ratinterp.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/misc/test_ratinterp.m
4,048
utf_8
3402bb06ad04fe5eaecde9415c68de62
% Test for ratinterp.m. % Based on the Chebfun v4 test written by Pedro Gonnet, Jul. 2011. function pass = test_ratinterp(pref) % Create the input function. f = @(x) (x.^4 - 3)./((x + 0.2).*(x - 2.2)); dom = [0 2]; x = chebfun(@(x) x, dom); cf = f(x); N = 100; % Approximate on different point sets using the anonymou...
github
foucart/Basc-master
test_scribble.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/misc/test_scribble.m
696
utf_8
77c88a9cffe87f06dc96679f56c6a649
% Test file for scribble.m. function pass = test_scribble(pref) if ( nargin < 1 ) pref = chebfunpref(); end % Save the current warning state and then clear it in case scribble() issued a % warning previously. [lastmsg, lastid] = lastwarn(); lastwarn(''); % To pass, this call to scribble() must not crash or gene...
github
foucart/Basc-master
test_legpoly.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/misc/test_legpoly.m
5,008
utf_8
1c563ac302e6e27a57e53edb65ec7c60
% Test file for LEGPOLY. function pass = test_legpoly(pref) if ( nargin == 0 ) pref = chebfunpref(); end %% Test method 1 on [-1 1]: % Test 1 confirms that the elements of the array-valued chebfun p % are Legendre polynomials: p = legpoly(900:1100, [-1 1], 0, 1); xx = linspace(-1, 1, 10); P = legendre(900, xx...
github
foucart/Basc-master
test_parSimp.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/chebgui/test_parSimp.m
3,552
utf_8
de291cfc7e0c9fe0ee992b4a880d3a02
function pass = test_parSimp(varargin) % Copyright 2011 by The University of Oxford and The Chebfun Developers. % See http://www.chebfun.org/ for Chebfun information. S = loadtests; pass = zeros(numel(S), 1); for k = 1:numel(S) str = stringParser.parSimp(S{k}{1}); pass(k) = strcmp(str,S{k}{2}); end functi...
github
foucart/Basc-master
test_minandmax.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_minandmax.m
1,272
utf_8
b7f82ced8f4185a032ec7496933a62f3
% Test file for @deltafun/test_minandmax.m function pass = test_minandmax(pref) if (nargin < 1) pref = chebfunpref(); end %% tol = pref.deltaPrefs.deltaTol; d = deltafun(); [vals, pos] = minandmax(d); pass(1) = isempty(vals) && isempty(pos); %% f = fun.constructor(@(x) exp(x)); mag = [1 2 3 4 5; randn(1...
github
foucart/Basc-master
test_feval.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_feval.m
1,099
utf_8
87d71bd4d4a8af55742246c3d5b01d4a
% Test file for @deltafun/feval.m function pass = test_feval(pref) if ( nargin < 1 ) pref = chebfunpref(); end seedRNG(1337) %% f = bndfun(@sin); d = deltafun(f, struct('deltaMag', 1, 'deltaLoc', 0)); pass(1) = isinf(feval(d, 0)) && feval(d, 0) > 0; pass(2) = isinf(feval(-d, 0)) && feval(-d, 0) <0; %% f = fun....
github
foucart/Basc-master
test_iszero.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_iszero.m
370
utf_8
676ae5a626e9a851dddf347b9cae929b
% Test file for @deltafun/isequal.m function pass = test_iszero(pref) if (nargin < 1) pref = chebfunpref(); end %% d1 = deltafun(); d2 = deltafun(fun.constructor(0), []); pass(1) = iszero(d1) && iszero(d2); f = fun.constructor(@(x) exp(x)); mag = rand(5,5); loc = rand(1,5); d = deltafun(f, struct('deltaMag', ma...
github
foucart/Basc-master
test_innerProduct.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_innerProduct.m
1,242
utf_8
f57ab0d93b63b43295b7a8258eb42ef2
% Test file for @deltafun/sum.m function pass = test_innerProduct(pref) if (nargin < 1) pref = chebfunpref(); end % Get the tolerance: tol = pref.deltaPrefs.deltaTol; d = deltafun(); f = deltafun(fun.constructor(@(x) exp(x)), []); zf = fun.constructor( @(x) 0.*x ); mag = rand(1,5); loc = rand(1,5); g = deltafu...
github
foucart/Basc-master
test_plus.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_plus.m
1,543
utf_8
2dc7b0e74928c1e4bda137444b393eff
% Test file for @deltafun/plus.m. function pass = test_plus(pref) if (nargin < 1) pref = chebfunpref(); end %% a = -4; b = 4; % Get the tolerances: proximityTol = pref.deltaPrefs.proximityTol; deltaTol = pref.deltaPrefs.deltaTol; f1 = fun.constructor(@(x) sin(x), struct('domain', [a, b])); d1 = .9*(a + (b-a)*ran...
github
foucart/Basc-master
test_isempty.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_isempty.m
345
utf_8
1e1ebc7deae1930631bfcdd285385e09
% Test file for @deltafun/isempty.m function pass = test_isempty(pref) if (nargin < 1) pref = chebfunpref(); end %% d = deltafun(); pass(1) = isempty(d); f = bndfun([]); d = deltafun(f); pass(2) = isempty(d); d = deltafun(f, []); pass(3) = isempty(d); d = deltafun(f, struct('deltaMag', [], 'deltaLoc', [])); pa...
github
foucart/Basc-master
test_isequal.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_isequal.m
913
utf_8
7b1cb8488282e5379afabad541c185f9
% Test file for @deltafun/isequal.m function pass = test_isequal(pref) if (nargin < 1) pref = chebfunpref(); end %% d1 = deltafun(); d2 = deltafun(); pass(1) = isequal(d1, []) && isequal( [], d1) && isequal( d1, d2); f = fun.constructor(@(x) exp(x)); mag = rand(5,5); loc = rand(1,5); d1 = deltafun(f, struct('...
github
foucart/Basc-master
test_imag.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_imag.m
571
utf_8
8df0882062a3933766086a8e61807baf
% Test file for @deltafun/imag.m function pass = test_real(pref) if (nargin < 1) pref = chebfunpref(); end %% d = deltafun(); pass(1) = isempty(imag(d)); f = bndfun(@sin); d = deltafun(f, struct('deltaMag', 1, 'deltaLoc', 0)); pass(2) = ~isa(imag(d), 'deltafun'); h = imag(1i*d); pass(3) = isa(h, 'deltafun'); pas...
github
foucart/Basc-master
test_zeroDeltaFun.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_zeroDeltaFun.m
510
utf_8
25284e177ebfd1ec59d11ec3f93318f9
% Test file for @deltafun/zeroDeltaFun.m. function pass = test_zeroDeltaFun(pref) if (nargin < 1) pref = chebfunpref(); end %% dTol = pref.deltaPrefs.deltaTol; d = deltafun.zeroDeltaFun(); pass(1) = iszero(d.funPart); pass(2) = all( d.funPart.domain == [-1, 1] ); pass(3) = isempty(d.deltaMag); pass(4) = isempty(...
github
foucart/Basc-master
test_real.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_real.m
573
utf_8
5bac9c901094cfc97561fa0dd85d9098
% Test file for @deltafun/real.m function pass = test_real(pref) if (nargin < 1) pref = chebfunpref(); end %% d = deltafun(); pass(1) = isempty(real(d)); f = bndfun(@sin); d = deltafun(f, struct('deltaMag', 1i, 'deltaLoc', 0)); pass(2) = ~isa(real(d), 'deltafun'); h = real(1i*d); pass(3) = isa(h, 'deltafun'); pa...
github
foucart/Basc-master
test_constructor.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_constructor.m
1,666
utf_8
f9e1d74ed922af58a46454744ea3cc49
% Test file for @deltafun/deltafun.m (constructor) function pass = test_constructor(pref) if ( nargin < 1 ) pref = chebfunpref(); end f = bndfun(0); %% deltaTol = pref.deltaPrefs.deltaTol; proximityTol = pref.deltaPrefs.proximityTol; d = deltafun(); pass(1) = isempty(d) && isa(d, 'deltafun'); d = deltafun(fu...
github
foucart/Basc-master
test_chebcoeffs.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_chebcoeffs.m
384
utf_8
11e59195ec2b34d09a1fe2a73c03808e
% Test file for @deltafun/chebcoeffs.m. function pass = test_chebcoeffs(pref) if (nargin < 1) pref = chebfunpref(); end a = -4; b = 4; f = fun.constructor(@(x) sin(x), struct('domain', [a, b])); mag = .9*(a + (b-a)*rand(3,3)); loc = .9*(a + (b-a)*rand(1,3)); df = deltafun(f, struct('deltaMag', mag, 'deltaLoc',...
github
foucart/Basc-master
test_diff.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_diff.m
749
utf_8
de6b4a80d775e60124b2a71169ef6367
% Test file for @deltafun/times.m. function pass = test_diff(pref) if (nargin < 1) pref = chebfunpref(); end tol = pref.deltaPrefs.deltaTol; %% a = -4; b = 4; d = deltafun(); pass(1) = isempty(diff(d)) && isempty(diff(d, 4)); f = bndfun(@sin, struct('domain', [a, b])); d = deltafun(f, struct('deltaMag', 1, 'delt...
github
foucart/Basc-master
test_cumsum.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_cumsum.m
642
utf_8
4d2790f813c44d9d2241fb0717bcd53f
% Test file for @deltafun/cumsum.m function pass = test_cumsum(pref) if (nargin < 1) pref = chebfunpref(); end %% tol = pref.deltaPrefs.deltaTol; d = deltafun(); F = cumsum(d); pass(1) = isempty(F); %% f = fun.constructor(@(x) exp(x)); mag = rand(5,5); loc = sort(rand(1,5)); d = deltafun(f, struct('deltaMag',...
github
foucart/Basc-master
test_sum.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_sum.m
559
utf_8
5fe04199955f536b5aa1d78ba0237e13
% Test file for @deltafun/sum.m function pass = test_sum(pref) if (nargin < 1) pref = chebfunpref(); end %% % Get the tolerance: tol = pref.deltaPrefs.deltaTol; d = deltafun(); pass(1) = sum(d) == 0; f = fun.constructor(@(x) exp(x)); mag = rand(5,5); loc = rand(1,5); d = deltafun(f, struct('deltaMag', mag, '...
github
foucart/Basc-master
test_anyDelta.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_anyDelta.m
607
utf_8
73bc4e6965b5e1f90fb2a3f2594f983e
% Test file for @deltafun/isequal.m function pass = test_anyDelta(pref) if (nargin < 1) pref = chebfunpref(); end %% d = deltafun(); pass(1) = ~anyDelta(d); f = fun.constructor(@(x) exp(x)); mag = rand(5,5); loc = rand(1,5); d = deltafun(f, struct('deltaMag', mag, 'deltaLoc', loc)); pass(2) = anyDelta(d); d = ...
github
foucart/Basc-master
test_times.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_times.m
2,290
utf_8
70e092cc41744f661d9bd4d0a084eeb6
% Test file for @deltafun/times.m. function pass = test_times(pref) if (nargin < 1) pref = chebfunpref(); end %% % Get the tolerance: dTol = pref.deltaPrefs.deltaTol; d = deltafun(bndfun(@sin), struct('deltaMag', 1, 'deltaLoc', 0)); pass(1) = isempty(deltafun() .* deltafun()); pass(2) = isempty(deltafun() .* d) ...
github
foucart/Basc-master
test_restrict.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_restrict.m
1,309
utf_8
fbdd4dda5c2f235899bcc2bbb8cc003b
% Test file for @deltafun/restrict.m function pass = test_restrict(pref) if (nargin < 1) pref = chebfunpref(); end %% d = deltafun(); pass(1) = isempty(restrict(d, [-.5, .5])); f = bndfun(@sin); d = deltafun(f, struct('deltaMag', 1, 'deltaLoc', 0)); pass(2) = ~isa(restrict(d, [-1, -.5]), 'deltafun'); pass(3) = ~...
github
foucart/Basc-master
test_conv.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/deltafun/test_conv.m
515
utf_8
2960b33c751d6d1c1222fadad3be8fd8
% Test file for @deltafun/conv.m function pass = test_conv(pref) if (nargin < 1) pref = chebfunpref(); end %% tol = pref.deltaPrefs.deltaTol; d = deltafun(); f = fun.constructor(@(x) x); d1 = deltafun(f, []); d2 = deltafun(bndfun(0), struct('deltaMag', 1, 'deltaLoc', 0)); pass(1) = isempty(conv(d, d)) && isemp...
github
foucart/Basc-master
test_polyfit.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/domain/test_polyfit.m
2,022
utf_8
42a880e074004d853282bde3b468273b
% Test file for POLYFIT. function pass = test_polyfit(pref) if ( nargin == 0 ) pref = chebfunpref(); end seedRNG(7681); %% Test POLYFIT on [-1 1]: % Fit quadratic data {yj} evaluated on equispaced points {xj}: x = linspace(-1, 1, 1000)'; y = x.^2; dom = domain([-1 1]); f = polyfit(x, y, 2, dom); err = norm(fev...
github
foucart/Basc-master
test_poly.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/domain/test_poly.m
829
utf_8
2d9762402f54b9d28c3b8e2f26b50a40
% Test file for POLY. function pass = test_poly(pref) if ( nargin == 0 ) pref = chebfunpref(); end %% Test POLY on [-1 1]: x = 0; f = poly(x, domain([-1 1])); err = feval(f, x); pass(1) = err < 100*epslevel(f)*vscale(f); x = 0.1; f = poly(x, domain([-1 1])); err = feval(f, x); pass(2) = length(f) == 2 && err <...
github
foucart/Basc-master
test_detectEdge.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fun/test_detectEdge.m
2,169
utf_8
02b8550c64cb5052ba9a2feb0b1d11eb
% Test file for @chebfun/detectEdge.m. function pass = test_detectEdge(pref) % We test detectEdge directly by giving it function handles with known % discontinuities in the 0, ..., 4th derivatives. if ( nargin == 0 ) pref = chebfunpref; end % Initialise seed: seedRNG(13); % Number of points to test: M = 10; % ...
github
foucart/Basc-master
test_assignColumns.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_assignColumns.m
694
utf_8
667d850077620b543fa4d916726dcfc7
% Test file for @fourtech/assignColumns.m. function pass = test_assignColumns(pref) if ( nargin < 1 ) pref = fourtech.techPref(); end % Generate a few random points to use as test values. seedRNG(6178); x = 2 * rand(100, 1) - 1; testclass = fourtech(); f = testclass.make(@(x) [sin(pi*x) cos(pi*x) exp(1i*pi*x)]...
github
foucart/Basc-master
test_sign.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_sign.m
900
utf_8
4e5c49a47e769856994189aa2cc05c26
% Test file for chebtech/sign.m function pass = test_sign(pref) if ( nargin < 1 ) pref = chebtech.techPref(); end testclass = fourtech(); % Test a positive function: F = @(x) sin(pi*x) + 2; f = testclass.make(@(x) F(x), [], pref); h = sign(f); pass(1) = normest(h - 1) < 10*f.epslevel; % Test a negative fun...
github
foucart/Basc-master
test_minandmax.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_minandmax.m
2,142
utf_8
bdf72f7d699144fd7d5ec53b81116ef0
% Test file for fourtech/minandmax.m function pass = test_minandmax(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); %% % Spot-check the extrema for a few functions. pass(1) = test_spotcheck_minmax(testclass, @(x) exp(-cos(2*pi*x)), ... exp(-1), exp(1), pref...
github
foucart/Basc-master
test_minus.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_minus.m
4,262
utf_8
9eb7d92ed11b9d5c341d7b997748f683
% Test file for fourtech/minus.m function pass = test_minus(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); % Generate a few random points to use as test values. seedRNG(6178); x = 2 * rand(100, 1) - 1; % A random number to use as an arbitrary additive constan...
github
foucart/Basc-master
test_alias.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_alias.m
1,419
utf_8
8b6b0112eb0ddf775e389a9b98a62710
% Test file for fourtech/alias.m function pass = test_alias(varargin) % Set a tolerance (pref.eps doesn't matter) tol = 10*eps; %% % Test padding of a vector of coefficients. c0 = (1:9)'; c1 = fourtech.alias(c0, 13); pass(1) = norm([0; 0; c0; 0; 0] - c1, inf) == 0; %% % Compare against result of evaluating on a ...
github
foucart/Basc-master
test_feval.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_feval.m
2,373
utf_8
b83c251c6266e5c99f5db45938fe6b75
% Test file for fourtech/feval.m function pass = test_feval(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end % Generate a few random points to use as test values. seedRNG(7681); x = 2 * rand(1000, 1) - 1; testclass = fourtech(); %% % Spot-check values for a couple of functions. We ca...
github
foucart/Basc-master
test_diffmat.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_diffmat.m
3,310
utf_8
012b97a075adeaea2de802abc4ab3fbd
% Test file for fourtech/diffmat.m function pass = test_diffmat(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); %% 1st-order derivative: %% Force n to be odd: op = @(x) exp(cos(pi*x)); f = testclass.make(op, [], pref); n = length(f); if ( ~rem(n,2) ) n = n...
github
foucart/Basc-master
test_max.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_max.m
1,582
utf_8
dba776e7ac56d0201ae4e7cb3214e7ed
% Test file for fourtech/max.m function pass = test_max(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); %% % Spot-check the extrema for a few functions. pass(1) = test_spotcheck_max(testclass, @(x) exp(-cos(2*pi*x)), exp(1), pref); pass(2) = test_spotcheck_max(...
github
foucart/Basc-master
test_simplify.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_simplify.m
1,574
utf_8
91d60726304e5f346f03e80fe793b667
% Test file for fourtech/simplify.m function pass = test_simplify(pref) % Get preferences: if ( nargin < 1 ) pref = chebtech.techPref(); end % Generate a few random points to use as test values. seedRNG(6178); x = 2 * rand(100, 1) - 1; testclass = fourtech(); % Tolerance for passing to simplify: simptol = 1e-6...
github
foucart/Basc-master
test_happinessCheck.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_happinessCheck.m
1,282
utf_8
9b8a2cbdaa28aa4d749cdff2336535a2
% Test file for fourtech/happinessCheck.m function pass = test_happinessCheck(pref) % Get preferences: if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); % Set the tolerance: tol = 50*pref.eps; %% % Test on a scalar-valued function: x = testclass.fourpts(33); omega = 8; f = @(x) sin(...
github
foucart/Basc-master
test_fourcoeffs.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_fourcoeffs.m
1,982
utf_8
c8484ba3d551d5117073d4a995b0789d
% Test file for fourtech/fourcoeffs.m function pass = test_fourcoeffs(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); %% % Check a few simple examples. f = testclass.make(@(x) zeros(size(x)), [], pref); p = fourcoeffs(f); pass(1) = (norm(p, inf) <= 10*f.vscale...
github
foucart/Basc-master
test_isinf.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_isinf.m
635
utf_8
4c437af4fe12e01ee34f74fee8df5587
% Test file for fourtech/isinf.m function pass = test_isinf(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); % Test a scalar-valued function. y = ones(11,1); y(4) = inf; f = testclass.make({[],y}, [], []); pass(1) = isinf(f); % Test an array-valued function. y ...
github
foucart/Basc-master
test_iszero.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_iszero.m
634
utf_8
63fb307f9178a8ca3beaf61a6ca4887b
% Test file for fourtech/iszero.m function pass = test_iszero(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); f = testclass.make(0, pref); f.values = [0 1 0 ; 0 0 NaN]; % iszero([0;0]) = 1, iszero([1;0]) = 0, iszero([0;NaN]) = 0. pass(1) = all(iszero(f) == [1 ...
github
foucart/Basc-master
test_innerProduct.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_innerProduct.m
2,952
utf_8
1c9888cb6d077180bf6bdbf1908b6e28
% Test file for fourtech/innerProduct.m function pass = test_innerProduct(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end % Fixed arbitrary numbers to use as multiplicative constants. alpha = -0.194758928283640 + 0.075474485412665i; beta = -0.526634844879922 - 0.685484380523668i; test...
github
foucart/Basc-master
test_min.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_min.m
1,773
utf_8
797b37745b1bc5a754131a81614bd81d
% Test file for fourtech/min.m function pass = test_min(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); %% % Spot-check the extrema for a few functions. pass(1) = test_spotcheck_min(testclass, @(x) -exp(-cos(2*pi*x)), -exp(1), pref); pass(2) = test_spotcheck_m...
github
foucart/Basc-master
test_mtimes.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_mtimes.m
3,107
utf_8
873b7540b9c334e0b8a8434e5e9181e1
% Test file for fourtechh/mtimes.m function pass = test_mtimes(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); % Generate a few random points to use as test values. seedRNG(6178); x = 2 * rand(100, 1) - 1; % A random number to use as an arbitrary scalar multip...
github
foucart/Basc-master
test_plus.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_plus.m
4,187
utf_8
edac84a86f8b7aa497da7a5b34db3922
% Test file for fourtech/plus.m function pass = test_plus(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); % Generate a few random points to use as test values. seedRNG(6178); x = 2 * rand(100, 1) - 1; % A random number to use as an arbitrary additive constant....
github
foucart/Basc-master
test_isempty.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_isempty.m
479
utf_8
d921b08665de29ad67d1413875b66f71
% Test file for fourtech/isempty.m function pass = test_isempty(varargin) testclass = fourtech(); %% f = testclass.make(); pass(1) = isempty(f); %% f = testclass.make(@(x) sin(200*pi*x)); pass(2) = ~isempty(f); %% f = testclass.make(@(x) [sin(200*pi*x), cos(200*pi*x)]); pass(3) = ~isempty(f); %% f = [ testclass.m...
github
foucart/Basc-master
test_fliplr.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_fliplr.m
451
utf_8
7f8ee3fd3d024843891cd751a0e90686
% Test file for fourtech/fliplr.m function pass = test_fliplr(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); %% % Conduct a few very straightforward tests. f = testclass.make(@(x) cos(pi*x), [], pref); pass(1) = isequal(f, fliplr(f)); f = testclass.make(@(x)...
github
foucart/Basc-master
test_length.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_length.m
498
utf_8
8c47a37fe0c53bcae569e78b2b711c43
% Test file for fourtech/length.m function pass = test_length(pref) if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); f = testclass.make(@(x) tanh(sin(pi*x)), [], pref); pass(1) = length(f) == size(f.coeffs, 1); f = testclass.make(@(x) tanh([sin(pi*x), cos(pi*x), 1i*exp(x)]), [], pref);...
github
foucart/Basc-master
test_isequal.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_isequal.m
591
utf_8
b737fcf88f56de3d3e2e08fc412d5589
% Test file for fourtech/isequal.m function pass = test_isequal(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); %% f = testclass.make(@(x) sin(200*pi*x), [], pref); g = f; pass(1) = isequal(f, g) && isequal(g, f); %% g = testclass.make(@(x) cos(200*pi*x), [], ...
github
foucart/Basc-master
test_rdivide.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_rdivide.m
3,805
utf_8
1fde85f8f5ac2baa8566d4d6c7a48d3f
% Test file for fourtech/rdivide.m function pass = test_rdivide(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); % Generate a few random points to use as test values. seedRNG(6178); x = 2 * rand(10, 1) - 1; % Random numbers to use as arbitrary constants. alpha ...
github
foucart/Basc-master
test_circconv.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_circconv.m
1,359
utf_8
54135bd5f9d1ea283772fbdf383b4161
% Test file for fourtech/circconv function pass = test_circconv(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); % Generate a random point to use as test values. seedRNG(6178); x = 2 * rand - 1; %% % Check operation in the face of empty arguments. f = testclas...
github
foucart/Basc-master
test_roots.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_roots.m
1,364
utf_8
df2166195a51bc66921fc02db8554bda
% Test file for chebtech/roots.m function pass = test_roots(pref) if ( nargin < 1 ) pref = chebtech.techPref(); end testclass = fourtech(); %% Simple test: f = testclass.make(@(x) cos(5*pi*x), [], pref); r = roots(f); exact = (-0.9:0.2:0.9).'; pass(1) = norm(r-exact,Inf) < length(f)*f.epslevel; %% More complic...
github
foucart/Basc-master
test_imag.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_imag.m
1,030
utf_8
ee41b7def1de8a8b6c806c2658e6ec4e
% Test file for fourtech/imag.m function pass = test_imag(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); %% % Test a scalar-valued function. f = testclass.make(@(x) cos(pi*x) + 1i*sin(pi*x), [], pref); g = testclass.make(@(x) sin(pi*x), [], pref); h = imag(f);...
github
foucart/Basc-master
test_isreal.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_isreal.m
765
utf_8
3af1afc1fe643e5fbd8de05a4e2d385e
% Test file for fourtech/isreal.m function pass = test_isreal(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); % Test a scalar-valued function. f = testclass.make(@(x) sin(100*pi*x) + 1i*sin(cos(10*pi*x)), [], pref); pass(1) = ~isreal(f); f = testclass.make(@(x...
github
foucart/Basc-master
test_cell2mat.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_cell2mat.m
420
utf_8
7a1c8b385ec9398691e0a22b8bc0c2e4
% Test file for fourtech/cell2mat.m function pass = test_cell2mat(pref) if ( nargin < 2 ) pref = fourtech.techPref(); end testclass = fourtech(); f = testclass.make(@(x) [sin(pi*x) cos(pi*x) exp(2*1i*pi*x)], [], pref); g = testclass.make(@(x) sin(pi*x), [], pref); h = testclass.make(@(x) [cos(pi*x) exp(2*1i*pi*...
github
foucart/Basc-master
test_mrdivide.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_mrdivide.m
2,195
utf_8
9848e4bfc76337320300289c07a36991
% Test file for fourtech/mrdivide.m function pass = test_mrdivide(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); % Generate a few random points to use as test values. seedRNG(6178); x = 2 * rand(100, 1) - 1; % Random number to use as a scalar constant. alpha ...
github
foucart/Basc-master
test_quadpts.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_quadpts.m
639
utf_8
5452705a80bc3337bcada725a26cdecc
% Test file for fourtech/quadwts.m function pass = test_quadpts(pref) if ( nargin == 1 ) pref = fourtech.techPref(); end testTech = fourtech(); n = 10; w = testTech.quadwts(n); % Test against some low order trig functions: x = testTech.fourpts(n); pass(1) = abs(sum(w) - 2) < 2*eps; pass(2) = abs(w*sin(pi*x)) < ...
github
foucart/Basc-master
test_real.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_real.m
1,051
utf_8
f22346ccb6078c03cba045c0d6f04c0a
% Test file for fourtech/real.m function pass = test_real(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); % Test a scalar-valued function. f = testclass.make(@(x) exp(20i*pi*x) + 1i*sin(100*pi*x), [], pref); g = testclass.make(@(x) cos(20*pi*x), [], pref); h = ...
github
foucart/Basc-master
test_constructor.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_constructor.m
2,130
utf_8
a97be8f70eb030c463d489b5e8024ec7
% Test file for fourtech constructor. function pass = test_constructor(pref) % Get preferences: if ( nargin < 1 ) pref = fourtech.techPref(); end %% % Test on a scalar-valued function: pref.refinementFunction = 'nested'; f = @(x) tanh(sin(pi*x)); g = populate(fourtech, f, [], [], pref); x = fourtech.fourpts(leng...
github
foucart/Basc-master
test_diff.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_diff.m
4,038
utf_8
b166a3d907bd730f73f9bbd21c992ab3
% Test file for fourtech/diff.m function pass = test_diff(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end % Generate a few random points to use as test values. seedRNG(6178); x = 2 * rand(100, 1) - 1; testclass = fourtech(); %% % Spot-check derivatives for a couple of functions. f =...
github
foucart/Basc-master
test_prolong.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_prolong.m
2,019
utf_8
31482f12c7499350f372106b698f211e
% Test file for fourtech/prolong.m function pass = test_prolong(pref) if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); F = @(x) exp(sin(pi*x)); f = testclass.make(F, [], pref); % Odd prolongation. k = 101; go = prolong(f, k); x = testclass.fourpts(k); pass(1) = size(go,1) == k && norm...
github
foucart/Basc-master
test_mat2cell.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_mat2cell.m
483
utf_8
97bada8d450727b884db9ad70862cb58
% Test file for fourtech/mat2cell.m function pass = test_mat2cell(pref) if ( nargin < 2 ) pref = fourtech.techPref(); end testclass = fourtech(); f = testclass.make(@(x) [sin(pi*x) cos(pi*x) exp(cos(pi*x))], [], pref); g = testclass.make(@(x) sin(pi*x), [], pref); h = testclass.make(@(x) [cos(pi*x) exp(cos(pi*x...
github
foucart/Basc-master
test_size.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_size.m
529
utf_8
1d53f010beefee1dfaf318387d06c3b7
% Test file for fourtech/size.m function pass = test_size(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); f = testclass.make(@(x) sin(10*pi*x), [], pref); pass(1) = all(size(f) == size(f.coeffs)); f = testclass.make(@(x) [sin(19*pi*x), cos(22*pi*x), exp(10i*pi...
github
foucart/Basc-master
test_cumsum.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_cumsum.m
3,307
utf_8
7bb1716ce8fdfb74c836f0595cc62f55
% Test file for fourtech/cumsum.m function pass = test_cumsum(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end % Generate a few random points to use as test values. seedRNG(6178); x = 2 * rand(100, 1) - 1; testclass = fourtech(); %% % Spot-check antiderivatives for a couple of function...
github
foucart/Basc-master
test_mldivide.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_mldivide.m
1,418
utf_8
5c9946c52af155eacc47d414b41a0eab
% Test file for fourtech/mldivide.m function pass = test_mldivide(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); %% % Basic correctness checks. % We get a known exact solution in this case. f = testclass.make(@(x) cos(sin(pi*x)), [], pref); x = f \ f; err = f...
github
foucart/Basc-master
test_sum.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_sum.m
2,360
utf_8
4d81971de4198461be6782e0fa9cbe40
% Test file for fourtech/sum.m function pass = test_sum(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); %% % Spot-check integrals for a couple of functions. f = testclass.make(@(x) exp(sin(pi*x)) - 1, [], pref); pass(1) = (abs(sum(f) - 0.532131755504017) < 10*f...
github
foucart/Basc-master
test_isnan.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_isnan.m
936
utf_8
784bea9e10c86faca9a3382a39fafbc0
% Test file for fourtech/isnan.m function pass = test_isnan(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); % Test a scalar-valued function. f = testclass.make(@(x) cos(pi*x), [], pref); pass(1) = ~isnan(f); % Test an array-valued function. f = testclass.make(...
github
foucart/Basc-master
test_conj.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_conj.m
978
utf_8
a11e2c50f1b2888a988473f8ab69ec3e
% Test file for fourtech/conj.m function pass = test_conj(pref) if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); % Test a scalar-valued function: f = testclass.make(@(x) cos(pi*x) + 1i*sin(pi*x), [], pref); g = testclass.make(@(x) cos(pi*x) - 1i*sin(pi*x), [], pref); h = conj(f); pass(1...
github
foucart/Basc-master
test_vals2coeffs.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_vals2coeffs.m
1,591
utf_8
c07d0245efc511451b270cb54dc0aaea
% Test file for fourtech/vals2coeffs.m function pass = test_vals2coeffs(varargin) % Set a tolerance (pref.eps doesn't matter) tol = 100*eps; %% % Test that a single value is converted correctly vals = sqrt(2); c = fourtech.vals2coeffs(vals); pass(1) = (vals == c); %% % Simple data (odd case) % Exact values f_exact ...
github
foucart/Basc-master
test_compose.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_compose.m
3,901
utf_8
ac7947936a17b94aa2131d71f46a733e
% Test file for fourtech/compose.m function pass = test_compose(pref) if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); % Compose a scalar-valued FOURTECH object with sin(x): f = testclass.make(@(x) pi*cos(pi*(x-0.1))); g = compose(f, @sin, [], [], pref); h = testclass.make(@(x) sin(pi*c...
github
foucart/Basc-master
test_times.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_times.m
5,469
utf_8
260311f65a8afa87e7ce1aea259d2f53
% Test file for fourtech/times.m function pass = test_times(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); % Generate a few random points to use as test values. seedRNG(6178); x = 2 * rand(100, 1) - 1; % Random numbers to use as arbitrary multiplicative const...
github
foucart/Basc-master
test_any.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_any.m
482
utf_8
747e2a8f084eea17e179fadbf2794c4d
% Test file for @fourtech/any.m. function pass = test_any(pref) if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); % Check behavior for any() down columns. pass(1) = ~any(testclass()); f = testclass.make(@(x) [sin(pi*x) 0*x cos(pi*x)]); pass(2) = isequal(any(f), [1 0 1]); % Check behavi...
github
foucart/Basc-master
test_coeffs2vals.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_coeffs2vals.m
1,628
utf_8
b2d207ca19ce0e56bed8573fec3b689b
% Test file for fourtech/coeffs2vals.m function pass = test_coeffs2vals(varargin) % Set a tolerance (pref.eps doesn't matter) tol = 100*eps; %% % Test that a single coefficient is converted correctly c = sqrt(2); v = fourtech.coeffs2vals(c); pass(1) = (c == v); %% % Simple data (even case) c = [0.5 0 1 0 0.5].'; % ...
github
foucart/Basc-master
test_restrict.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_restrict.m
2,552
utf_8
03c850b7480477a951d3ffe4c635ef14
% Test file for fourtech/restrict.m function pass = test_restrict(pref) % Get preferences. if (nargin < 1) pref = chebtech.techPref(); end testclass = fourtech(); %% % Check behavior for empty inputs. f = testclass.make(); f = restrict(f, [-0.5 0.5]); pass(1) = isempty(f); %% % Check behvaior for non-subinterv...
github
foucart/Basc-master
test_isfinite.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_isfinite.m
656
utf_8
0c7deda0c8b30fb374a9d8f44bb05da6
% Test file for fourtech/isfinite.m function pass = test_isfinite(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); %% % Test a scalar-valued function. y = ones(11, 1); y(4) = inf; f = testclass.make({[], y}, [], []); pass(1) = ~isfinite(f); %% % Test an array-v...
github
foucart/Basc-master
test_qr.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_qr.m
2,657
utf_8
8db44682fdb96e26ececb4be493fbed2
% Test file for fourtech/qr.m function pass = test_qr(pref) % Get preferences. if ( nargin < 1 ) pref = chebtech.techPref(); end % Generate a few random points to use as test values. seedRNG(6178); x = 2 * rand(100, 1) - 1; testclass = fourtech(); %% % Do a few spot-checks. f = testclass.make(@(x) exp(sin(pi*...
github
foucart/Basc-master
test_poly.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_poly.m
1,106
utf_8
ca86c3a56c0c155719dc08f498d6e3b3
% Test file for fourtech/poly.m function pass = test_poly(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); %% % Check a few simple examples. f = testclass.make(@(x) zeros(size(x)), [], pref); p = poly(f); pass(1) = (norm(p, inf) <= 10*f.vscale.*f.epslevel); f ...
github
foucart/Basc-master
test_flipud.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_flipud.m
627
utf_8
dee521a8fc899bdc3ea4567232474b43
% Test file for fourtech/flipud.m function pass = test_flipud(pref) % Get preferences. if ( nargin < 1 ) pref = fourtech.techPref(); end testclass = fourtech(); %% % Conduct a few very straightforward tests. f = testclass.make(@(x) sin(pi*x), [], pref); g = testclass.make(@(x) -sin(pi*x), [], pref); h = fli...
github
foucart/Basc-master
test_scaleInvariance.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/fourtech/test_scaleInvariance.m
749
utf_8
673200f1fe14296f48da09864707982a
% Test vertical scale invariance of FOURTECH construction. function pass = test_scaleInvariance(pref) % Get preferences. if ( nargin == 0 ) pref = fourtech.techPref(); end testclass = fourtech(); %% % Test CLASSICCHECK. pref.happinessCheck = 'classic'; % Choose a test function and make a FOURTECH. F = @(x) si...
github
foucart/Basc-master
test_ode45.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/chebfun2/test_ode45.m
1,301
utf_8
fa874db32c570195419cf5a9b23a2c3d
function pass = test_ode45( pref ) % A large battery of functions. if ( nargin < 1 ) pref = chebfunpref; end tol = 100 * pref.eps; % TODO: This isn't used. % Trivial check for ODE45 for now: t0 = 0; Tend = 30; F = chebfun2v(@(h,hp)hp, @(h,hp)-1-.01*hp, @(h,hp)1+0*h,[0 30 0 2]); u0 = [2 0 0]; ...
github
foucart/Basc-master
test_feval.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/bndfun/test_feval.m
2,704
utf_8
78e52ba1871caa5a1e736ee4668af8c9
% Test file for bndfun/feval.m function pass = test_feval(pref) % Get preferences. if ( nargin < 1 ) pref = chebfunpref(); end % Set the domain dom = [-2 7]; % Generate a few random points to use as test values. seedRNG(7681); x = diff(dom) * rand(1000, 1) + dom(1); %% % Spot-check values for a couple of funct...
github
foucart/Basc-master
test_createMap.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/bndfun/test_createMap.m
232
utf_8
9932ed6f8673178fa76bb6b5ccd1762b
% Test file for bndfun/createMap.m. function pass = test_createMap(pref) dom = [-2 7]; map = bndfun.createMap(dom); pass(1) = all(map.For([-1 1]) == dom) && all(map.Inv(dom) == [-1 1]); pass(2) = map.Der(1) == diff(dom)/2; end
github
foucart/Basc-master
test_innerProduct.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/bndfun/test_innerProduct.m
3,526
utf_8
8f75e4f7996a2ca13da04636ce22589e
% Test file for bndfun/innerProduct.m function pass = test_innerProduct(pref) % Get preferences. if ( nargin < 1 ) pref = chebfunpref(); end % Set a tolerance. (pref.eps doesn't matter here.) tol = 10*eps; % Set a domain dom = [-2 7]; % Fixed arbitrary numbers to use as multiplicative constants. alpha = -0.19...
github
foucart/Basc-master
test_mrdivide.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/bndfun/test_mrdivide.m
2,377
utf_8
768bc71ae67d2d81411ff31ea5025708
% Test file for bndfun/mrdivide.m function pass = test_mrdivide(pref) % Get preferences. if (nargin < 1) pref = chebfunpref(); end % Set a domain dom = [-2 7]; % Generate a few random points to use as test values. seedRNG(6178); x = diff(dom) * rand(100, 1) + dom(1); % Random number to use as a scalar constant...
github
foucart/Basc-master
test_constructor.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/bndfun/test_constructor.m
1,950
utf_8
df2334dc736169f5ea6b27399df24122
% Test file for bndfun constructor. function pass = test_constructor(pref) % Get preferences: if ( nargin < 1 ) pref = chebfunpref(); end % Set the domain dom = [-2 7]; % Generate a few random points to use as test values. seedRNG(6178); x = diff(dom) * rand(100, 1) + dom(1); %% % Test on a scalar-valued func...
github
foucart/Basc-master
test_diff.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/bndfun/test_diff.m
4,333
utf_8
d44b5997bb64825f778ec96960557079
% Test file for bndfun/diff.m function pass = test_diff(pref) % Get preferences. if ( nargin < 1 ) pref = chebfunpref(); end % Set the domain. dom = [-2 7]; % Generate a few random points to use as test values. seedRNG(6178); x = diff(dom) * rand(100, 1) + dom(1); %% % Spot-check derivatives for a couple of fu...
github
foucart/Basc-master
test_changeMap.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/bndfun/test_changeMap.m
1,257
utf_8
524c1dace779fbeb6b45f40d34b85a0c
% Test file for bndfun/changeMap.m. function pass = test_changeMap(pref) % Get preferences: if ( nargin < 1 ) pref = chebfunpref(); end % Test with two domains: dom1 = [-3 1]; dom2 = [-2 7]; a = dom1(1); b = dom1(2); c = dom2(1); d = dom2(2); % Generate a few random points to use as test values. seedRNG(6178); ...
github
foucart/Basc-master
test_cumsum.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/bndfun/test_cumsum.m
4,472
utf_8
861141b302c8d54517cdb48a9e9b62c2
% Test file for bndfun/cumsum.m function pass = test_cumsum(pref) % Get preferences. if ( nargin < 1 ) pref = chebfunpref(); end % Set a domain dom = [-2 7]; a = dom(1); % Generate a few random points to use as test values. seedRNG(6178); x = diff(dom) * rand(100, 1) + dom(1); %% % Spot-check antiderivatives f...
github
foucart/Basc-master
test_mldivide.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/bndfun/test_mldivide.m
1,414
utf_8
813a5e2fc6bc68c68ca8bd81698fc4ea
% Test file for bndfun/mldivide.m function pass = test_mldivide(pref) % Get preferences. if (nargin < 1) pref = chebfunpref(); end % Set a tolerance. (pref.eps does not matter here.) tol = 10*eps; % Set the domain dom = [-2 7]; % Generate a few random points to use as test values. seedRNG(6178); x = diff(dom)...
github
foucart/Basc-master
test_sum.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/bndfun/test_sum.m
3,215
utf_8
302488c5adc8a2c3a5dfff52e78503fd
% Test file for bndfun/sum.m function pass = test_sum(pref) % Get preferences. if ( nargin < 1 ) pref = chebfunpref(); end % Set a domain dom = [-2 7]; % Create seed for random number generator seedRNG(6178); % Generate a few random points to use as test values. x = diff(dom) * rand(1000, 1) + dom(1); %% % Sp...
github
foucart/Basc-master
test_compose.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/bndfun/test_compose.m
2,793
utf_8
dd6f562fe12ab0b17185cc911eb0f8ba
% Test file for bndfun/compose.m function pass = test_compose(pref) if ( nargin < 1 ) pref = chebfunpref(); end % Set the domain dom = [-2 7]; x = linspace(dom(1), dom(2), 1000); % Compose a scalar-valued BNDFUN object with sin(x): f = bndfun(@(x) x, struct('domain', dom)); g = compose(f, @sin, [], [], pref); h...
github
foucart/Basc-master
test_restrict.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/bndfun/test_restrict.m
3,170
utf_8
e355cbfd9dbc2d80e237989dabb70665
% Test file for bndfun/restrict.m function pass = test_restrict(pref) % Get preferences. if (nargin < 1) pref = chebfunpref(); end % Set the domain dom = [-2 7]; %% % Check behavior for empty inputs. f = bndfun(); f = restrict(f, [-0.5 0.5]); pass(1) = isempty(f); %% % Check behaviour for non-subinterval input...
github
foucart/Basc-master
test_qr.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/bndfun/test_qr.m
2,450
utf_8
f27b9c2ae461dbe3cc22a084cdba4ef1
% Test file for bndfun/qr.m function pass = test_qr(pref) % Get preferences. if ( nargin < 1 ) pref = chebfunpref(); end % Set the domain dom = [-2 7]; % Create seed for random number generator seedRNG(6178); % Generate a few random points to use as test values. x = diff(dom) * rand(100, 1) + dom(1); %% % Do ...
github
foucart/Basc-master
test_poly.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/bndfun/test_poly.m
1,200
utf_8
5fb4bb291a7863bb67aeeaa42c69a5e6
% Test file for bndfun/poly.m function pass = test_poly(pref) % Get preferences. if ( nargin < 1 ) pref = chebfunpref(); end % Set the domain dom = [-2 7]; %% % Check a few simple examples. f = bndfun(@(x) zeros(size(x)), struct('domain', dom), pref); p = poly(f); pass(1) = (norm(p, inf) <= get(f, 'vscale')*ge...
github
foucart/Basc-master
test_minandmax.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/singfun/test_minandmax.m
2,801
utf_8
c1ff5f337b668326b53be7be8e2158d8
% Test file for singfun/minandmax.m function pass = test_minandmax(pref) % Get preferences. if ( nargin < 1 ) pref = chebfunpref(); end % The order of the exponents: a = 0.64; b = -0.64; c = 1.28; d = -1.28; % fractional root at the left endpoint and the function value is bounded. data.exponents = [a 0]; data.s...
github
foucart/Basc-master
test_feval.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/singfun/test_feval.m
1,239
utf_8
c38a802c63eb5d2ebb5a9312a079b93c
% Test file for singfun/feval.m function pass = test_feval(pref) % Get preferences. if ( nargin < 1 ) pref = chebfunpref(); end % Generate a few random points to use as test values. seedRNG(786); x = -1 + 2*rand(100, 1); %% % Check feval on empty set of points data.exponents = [0, 0]; data.singType = {'none', ...
github
foucart/Basc-master
test_make.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/singfun/test_make.m
1,820
utf_8
f994d6971a9bb90cbe0974ea591d4991
% Test file for singfun/make.m function pass = test_make(pref) % Get preferences: if ( nargin < 1 ) pref = chebfunpref(); end % tests on different calling sequences: %% % Providing only the function handle: a = rand(); b = rand(); fh = @(x) sin(x)./((1+x).^a.*(1-x).^b); f = singfun(fh); g = f.make(fh); pass(1) ...
github
foucart/Basc-master
test_zeroSingFun.m
.m
Basc-master/basc_v1.0/chebfun-master/tests/singfun/test_zeroSingFun.m
314
utf_8
ce9f07207e5c86319d9b1e2feeff49fd
% Test file for singfun/zeroSingFun.m function pass = test_zeroSingFun(pref) % Get preferences. if ( nargin < 1 ) pref = chebfunpref(); end %% % Construct the zero SINGFUN: f = singfun.zeroSingFun(); % No exponents: pass(1) = ~any(f.exponents); % Trivial smooth part: pass(2) = iszero(f.smoothPart); end