From b04aaa0211ca53cd026b95852294f4a4d3f6b082 Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Sat, 13 Apr 2024 03:22:21 +0000 Subject: [PATCH] Update artifacts --- math/base/tools/lucaspoly/cache.js.html | 169 +++++++++ .../base/tools/lucaspoly/coefficients.js.html | 340 ++++++++++++++++++ math/base/tools/lucaspoly/coverage.ndjson | 1 + math/base/tools/lucaspoly/factory.js.html | 316 ++++++++++++++++ math/base/tools/lucaspoly/index.html | 176 +++++++++ math/base/tools/lucaspoly/index.js.html | 259 +++++++++++++ math/base/tools/lucaspoly/main.js.html | 265 ++++++++++++++ 7 files changed, 1526 insertions(+) create mode 100644 math/base/tools/lucaspoly/cache.js.html create mode 100644 math/base/tools/lucaspoly/coefficients.js.html create mode 100644 math/base/tools/lucaspoly/coverage.ndjson create mode 100644 math/base/tools/lucaspoly/factory.js.html create mode 100644 math/base/tools/lucaspoly/index.html create mode 100644 math/base/tools/lucaspoly/index.js.html create mode 100644 math/base/tools/lucaspoly/main.js.html diff --git a/math/base/tools/lucaspoly/cache.js.html b/math/base/tools/lucaspoly/cache.js.html new file mode 100644 index 000000000..10ae9458d --- /dev/null +++ b/math/base/tools/lucaspoly/cache.js.html @@ -0,0 +1,169 @@ + + + + + + Code coverage report for math/base/tools/lucaspoly/lib/cache.js + + + + + + + + + +
+
+

All files / math/base/tools/lucaspoly/lib cache.js

+
+ +
+ 100% + Statements + 28/28 +
+ + +
+ 100% + Branches + 1/1 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 28/28 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +293x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2018 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+ 
+'use strict';
+ 
+// MAIN //
+ 
+var cache = {};
+ 
+ 
+// EXPORTS //
+ 
+module.exports = cache;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/math/base/tools/lucaspoly/coefficients.js.html b/math/base/tools/lucaspoly/coefficients.js.html new file mode 100644 index 000000000..456c0261a --- /dev/null +++ b/math/base/tools/lucaspoly/coefficients.js.html @@ -0,0 +1,340 @@ + + + + + + Code coverage report for math/base/tools/lucaspoly/lib/coefficients.js + + + + + + + + + +
+
+

All files / math/base/tools/lucaspoly/lib coefficients.js

+
+ +
+ 100% + Statements + 85/85 +
+ + +
+ 100% + Branches + 7/7 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 85/85 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +863x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +3x +332x +332x +332x +332x +332x +332x +332x +332x +332x +332x +332x +332x +332x +162x +162x +162x +3x +162x +159x +6037x +6037x +159x +159x +159x +159x +3058x +3058x +3058x +3058x +3058x +159x +162x +162x +162x +332x +332x +3x +3x +3x +3x +3x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2018 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+ 
+'use strict';
+ 
+// MODULES //
+ 
+var binomcoef = require( '@stdlib/math/base/special/binomcoef' );
+var floor = require( '@stdlib/math/base/special/floor' );
+var ceil = require( '@stdlib/math/base/special/ceil' );
+var cache = require( './cache.js' );
+ 
+ 
+// MAIN //
+ 
+/**
+* Computes polynomial coefficients.
+*
+* ## Notes
+*
+* -   Coefficients are computed via a (1,2)-Pascal triangle (i.e., Lucas triangle). For more details, see [Lucas polynomials][oeis-lucas-polynomials] and [Lucas triangle][oeis-lucas-triangle].
+*
+* [oeis-lucas-polynomials]: https://oeis.org/wiki/Lucas_polynomials
+* [oeis-lucas-triangle]: https://oeis.org/wiki/Lucas_triangle
+*
+* @private
+* @param {NonNegativeInteger} n - Lucas polynomial for which to compute coefficients
+* @returns {NonNegativeIntegerArray} polynomial coefficients
+*/
+function coefficients( n ) {
+	var coefs;
+	var half;
+	var high;
+	var low;
+	var p;
+	var a;
+	var b;
+	var m;
+	var i;
+ 
+	coefs = cache[ n ];
+	if ( coefs === void 0 ) {
+		m = n + 1;
+		coefs = new Array( m );
+		if ( n === 0 ) {
+			coefs[ 0 ] = 2.0;
+		} else {
+			for ( i = 0; i < m; i++ ) {
+				coefs[ i ] = 0.0;
+			}
+			half = n / 2;
+			high = ceil( half );
+			low = floor( half );
+			for ( i = 0; i <= low; i++ ) {
+				p = (2*i) + (n%2);
+				a = 2.0 * binomcoef( high+i-1, low-i-1 );
+				b = binomcoef( high+i-1, low-i );
+				coefs[ p ] += a + b;
+			}
+		}
+		// Memoize the coefficients:
+		cache[ n ] = coefs;
+	}
+	return coefs;
+}
+ 
+ 
+// EXPORTS //
+ 
+module.exports = coefficients;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/math/base/tools/lucaspoly/coverage.ndjson b/math/base/tools/lucaspoly/coverage.ndjson new file mode 100644 index 000000000..3aeadb3c2 --- /dev/null +++ b/math/base/tools/lucaspoly/coverage.ndjson @@ -0,0 +1 @@ +[308,308,100,19,19,100,4,4,100,308,308,100,"c43bb5824767f2def1b1bfa18297ac37a5ec5f9e","2024-04-12 23:20:12 -0400"] diff --git a/math/base/tools/lucaspoly/factory.js.html b/math/base/tools/lucaspoly/factory.js.html new file mode 100644 index 000000000..ea0d5a178 --- /dev/null +++ b/math/base/tools/lucaspoly/factory.js.html @@ -0,0 +1,316 @@ + + + + + + Code coverage report for math/base/tools/lucaspoly/lib/factory.js + + + + + + + + + +
+
+

All files / math/base/tools/lucaspoly/lib factory.js

+
+ +
+ 100% + Statements + 77/77 +
+ + +
+ 100% + Branches + 6/6 +
+ + +
+ 100% + Functions + 2/2 +
+ + +
+ 100% + Lines + 77/77 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +782x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +2x +162x +162x +162x +162x +162x +162x +162x +162x +162x +162x +162x +162x +124x +124x +38x +38x +38x +38x +38x +38x +38x +38x +38x +38x +38x +38x +162x +2x +2x +2x +2x +2x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2018 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+ 
+'use strict';
+ 
+// MODULES //
+ 
+var evalpoly = require( '@stdlib/math/base/tools/evalpoly' ).factory;
+var pow = require( '@stdlib/math/base/special/pow' );
+var abs = require( '@stdlib/math/base/special/abs' );
+var coefficients = require( './coefficients.js' );
+ 
+ 
+// MAIN //
+ 
+/**
+* Returns a function for evaluating a Lucas polynomial.
+*
+* @param {integer} n - Lucas polynomial to evaluate
+* @returns {Function} function for evaluating a Lucas polynomial
+*
+* @example
+* var polyval = factory( 5 );
+*
+* var v = polyval( 1.0 );
+* // returns 11.0
+*
+* v = polyval( 2.0 );
+* // returns 82.0
+*/
+function factory( n ) {
+	var coefs;
+	var an;
+	var f;
+	var s;
+ 
+	an = abs( n );
+	coefs = coefficients( an );
+ 
+	f = evalpoly( coefs );
+	s = pow( -1.0, an );
+	if ( n >= 0 || s === 1.0 ) {
+		return f;
+	}
+	return polyval;
+ 
+	/**
+	* Evaluates a Lucas polynomial.
+	*
+	* @private
+	* @param {number} x - value at which to evaluate a Lucas polynomial
+	* @returns {number} result
+	*/
+	function polyval( x ) {
+		return -1.0 * f( x );
+	}
+}
+ 
+ 
+// EXPORTS //
+ 
+module.exports = factory;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/math/base/tools/lucaspoly/index.html b/math/base/tools/lucaspoly/index.html new file mode 100644 index 000000000..68df8a561 --- /dev/null +++ b/math/base/tools/lucaspoly/index.html @@ -0,0 +1,176 @@ + + + + + + Code coverage report for math/base/tools/lucaspoly/lib + + + + + + + + + +
+
+

All files math/base/tools/lucaspoly/lib

+
+ +
+ 100% + Statements + 308/308 +
+ + +
+ 100% + Branches + 19/19 +
+ + +
+ 100% + Functions + 4/4 +
+ + +
+ 100% + Lines + 308/308 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
cache.js +
+
100%28/28100%1/1100%0/0100%28/28
coefficients.js +
+
100%85/85100%7/7100%1/1100%85/85
factory.js +
+
100%77/77100%6/6100%2/2100%77/77
index.js +
+
100%58/58100%1/1100%0/0100%58/58
main.js +
+
100%60/60100%4/4100%1/1100%60/60
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/math/base/tools/lucaspoly/index.js.html b/math/base/tools/lucaspoly/index.js.html new file mode 100644 index 000000000..800a27c65 --- /dev/null +++ b/math/base/tools/lucaspoly/index.js.html @@ -0,0 +1,259 @@ + + + + + + Code coverage report for math/base/tools/lucaspoly/lib/index.js + + + + + + + + + +
+
+

All files / math/base/tools/lucaspoly/lib index.js

+
+ +
+ 100% + Statements + 58/58 +
+ + +
+ 100% + Branches + 1/1 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 58/58 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +591x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2018 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+ 
+'use strict';
+ 
+/**
+* Evaluate a Lucas polynomial.
+*
+* @module @stdlib/math/base/tools/lucaspoly
+*
+* @example
+* var lucaspoly = require( '@stdlib/math/base/tools/lucaspoly' );
+*
+* var v = lucaspoly( 5, 1.0 );
+* // returns 11.0
+*
+* @example
+* var factory = require( '@stdlib/math/base/tools/lucaspoly' ).factory;
+*
+* var polyval = factory( 5 );
+*
+* var v = polyval( 1.0 );
+* // returns 11.0
+*
+* v = polyval( 2.0 );
+* // returns 82.0
+*/
+ 
+// MODULES //
+ 
+var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
+var main = require( './main.js' );
+var factory = require( './factory.js' );
+ 
+ 
+// MAIN //
+ 
+setReadOnly( main, 'factory', factory );
+ 
+ 
+// EXPORTS //
+ 
+module.exports = main;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/math/base/tools/lucaspoly/main.js.html b/math/base/tools/lucaspoly/main.js.html new file mode 100644 index 000000000..54d9d5bb8 --- /dev/null +++ b/math/base/tools/lucaspoly/main.js.html @@ -0,0 +1,265 @@ + + + + + + Code coverage report for math/base/tools/lucaspoly/lib/main.js + + + + + + + + + +
+
+

All files / math/base/tools/lucaspoly/lib main.js

+
+ +
+ 100% + Statements + 60/60 +
+ + +
+ 100% + Branches + 4/4 +
+ + +
+ 100% + Functions + 1/1 +
+ + +
+ 100% + Lines + 60/60 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +611x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +161x +161x +161x +161x +161x +161x +161x +161x +161x +161x +85x +85x +76x +161x +1x +1x +1x +1x +1x + 
/**
+* @license Apache-2.0
+*
+* Copyright (c) 2018 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*    http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+ 
+'use strict';
+ 
+// MODULES //
+ 
+var evalpoly = require( '@stdlib/math/base/tools/evalpoly' );
+var pow = require( '@stdlib/math/base/special/pow' );
+var abs = require( '@stdlib/math/base/special/abs' );
+var coefficients = require( './coefficients.js' );
+ 
+ 
+// MAIN //
+ 
+/**
+* Evaluates a Lucas polynomial.
+*
+* @param {integer} n - Lucas polynomial to evaluate
+* @param {number} x - value at which to evaluate a Lucas polynomial
+* @returns {number} result
+*
+* @example
+* var v = lucaspoly( 5, 1.0 );
+* // returns 11.0
+*/
+function lucaspoly( n, x ) {
+	var coefs;
+	var an;
+	var v;
+ 
+	an = abs( n );
+	coefs = coefficients( an );
+ 
+	v = evalpoly( coefs, x );
+	if ( n >= 0 ) {
+		return v;
+	}
+	return pow( -1.0, an ) * v;
+}
+ 
+ 
+// EXPORTS //
+ 
+module.exports = lucaspoly;
+ 
+ +
+
+ + + + + + + + \ No newline at end of file