Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// MODULES //

var ndarray = require( '@stdlib/ndarray/array' );
var zeros = require( '@stdlib/ndarray/zeros' );
var minn = require( '@stdlib/math/base/special/minn' );


Expand All @@ -31,7 +31,7 @@
*
* ## Notes
*
* - the edit distance between two strings is the number of insertions, deletions, character substitutions, as well as transpositions of adjacent characters to convert one of the strings into the other.
* - The edit distance between two strings is the number of insertions, deletions, character substitutions, as well as transpositions of adjacent characters to convert one of the strings into the other.
*
* [damerau-levenshtein]: https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance
*
Expand All @@ -55,10 +55,8 @@
m = word1.length;
n = word2.length;

// FIXME: all of the following needs to be cleaned up. There may be an opportunity for a `blas/ext/base` implementation of edit distance; however, we need to think carefully about this as the following doesn't take into account grapheme clusters.

Check warning on line 58 in lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-typedef-typos/lib/edit_distance.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'fixme' comment: 'FIXME: all of the following needs to be...'
d = ndarray({
'shape': [ m+1, n+1 ]
});
d = zeros( [ m+1, n+1 ] );
for ( i = 0; i <= m; i++ ) {
d.set( i, 0, i );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

'use strict';

// MODULES //

var format = require( '@stdlib/string/format' );


// VARIABLES //

var DEFAULT_SPACING = 2;
Expand Down Expand Up @@ -52,7 +57,7 @@ function main( context ) {
elem = interfaces[ i ];
emptyLines = elem.start - end - 1;
if ( emptyLines !== spacing ) {
context.report( 'Interface documentation sections must be separated by `' + spacing + '` empty lines. Encountered: `'+ emptyLines+'`.', interfaces[ i ] );
context.report( format( 'Interface documentation sections must be separated by `%s` empty lines. Encountered: `%s`.', spacing, emptyLines ), interfaces[ i ] );
}
end = elem.end;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// MODULES //

var isCapitalized = require( '@stdlib/assert/is-capitalized' );
var format = require( '@stdlib/string/format' );


// VARIABLES //
Expand Down Expand Up @@ -59,10 +60,10 @@ function main( context ) {
*/
function sectionStyle( section ) {
if ( !isCapitalized( section.title ) ) {
context.report( 'Section title "'+section.title+'" should be capitalized', section );
context.report( format( 'Section title "%s" should be capitalized', section.title ), section );
}
if ( countHyphens( section.rawTitle ) !== section.title.length ) {
context.report( 'Number of hyphens in the line following "'+section.title+'" must match the length of the title', section );
context.report( format( 'Number of hyphens in the line following "%s" must match the length of the title', section.title ), section );
}
}
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// MODULES //

var indexOf = require( '@stdlib/utils/index-of' );
var format = require( '@stdlib/string/format' );


// VARIABLES //
Expand Down Expand Up @@ -61,7 +62,7 @@ function main( context ) {
section = sections[ i ];
idx = indexOf( order, section.title );
if ( last !== void 0 && idx < last ) {
context.report( 'Sections have to be arranged in the following order: '+order.join( ', ' ), section );
context.report( format( 'Sections have to be arranged in the following order: %s', order.join( ', ' ) ), section );
}
last = idx;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// MODULES //

var indexOf = require( '@stdlib/utils/index-of' );
var format = require( '@stdlib/string/format' );


// VARIABLES //
Expand Down Expand Up @@ -54,7 +55,7 @@ function main( context ) {

idx = indexOf( SECTIONS, section.title );
if ( idx === -1 ) {
context.report( 'Only use one of the following section header titles: '+SECTIONS.join( '\n' ), section );
context.report( format( 'Only use one of the following section header titles: %s', SECTIONS.join( '\n' ) ), section );
}
}
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ var opts = {
var mu = uniform( 10, -5.0, 5.0, opts );
var sigma = uniform( 10, 0.1, 20.0, opts );

logEachMap( 'µ: %0.4f, σ: %0.4f, E(X;µ,σ): %0.4f', mu, sigma, mean );
logEachMap( 'μ: %0.4f, σ: %0.4f, E(X;μ,σ): %0.4f', mu, sigma, mean );
```

</section>
Expand Down Expand Up @@ -205,7 +205,7 @@ int main( void ) {
mu = random_uniform( -5.0, 5.0 );
sigma = random_uniform( 0.1, 20.0 );
y = stdlib_base_dists_anglit_mean( mu, sigma );
printf( "µ: %lf, σ: %lf, E(X;µ,σ): %lf\n", mu, sigma, y );
printf( "μ: %lf, σ: %lf, E(X;μ,σ): %lf\n", mu, sigma, y );
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ int main( void ) {
mu = random_uniform( -5.0, 5.0 );
sigma = random_uniform( 0.1, 20.0 );
y = stdlib_base_dists_anglit_mean( mu, sigma );
printf( "µ: %lf, σ: %lf, E(X;µ,σ): %lf\n", mu, sigma, y );
printf( "μ: %lf, σ: %lf, E(X;μ,σ): %lf\n", mu, sigma, y );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ var opts = {
var mu = uniform( 10, -5.0, 5.0, opts );
var sigma = uniform( 10, 0.1, 20.0, opts );

logEachMap( 'µ: %0.4f, σ: %0.4f, E(X;µ,σ): %0.4f', mu, sigma, mean );
logEachMap( 'μ: %0.4f, σ: %0.4f, E(X;μ,σ): %0.4f', mu, sigma, mean );
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ var opts = {
var mu = uniform( 10, -5.0, 5.0, opts );
var sigma = uniform( 10, 0.1, 20.0, opts );

logEachMap( 'µ: %0.4f, σ: %0.4f, Median(X;µ,σ): %0.4f', mu, sigma, median );
logEachMap( 'μ: %0.4f, σ: %0.4f, Median(X;μ,σ): %0.4f', mu, sigma, median );
```

</section>
Expand Down Expand Up @@ -205,7 +205,7 @@ int main( void ) {
mu = random_uniform( -5.0, 5.0 );
sigma = random_uniform( 0.1, 20.0 );
y = stdlib_base_dists_anglit_median( mu, sigma );
printf( "µ: %lf, σ: %lf, Median(X;µ,σ): %lf\n", mu, sigma, y );
printf( "μ: %lf, σ: %lf, Median(X;μ,σ): %lf\n", mu, sigma, y );
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ int main( void ) {
mu = random_uniform( -5.0, 5.0 );
sigma = random_uniform( 0.1, 20.0 );
y = stdlib_base_dists_anglit_median( mu, sigma );
printf( "µ: %lf, σ: %lf, Median(X;µ,σ): %lf\n", mu, sigma, y );
printf( "μ: %lf, σ: %lf, Median(X;μ,σ): %lf\n", mu, sigma, y );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ var opts = {
var mu = uniform( 10, -5.0, 5.0, opts );
var sigma = uniform( 10, 0.1, 20.0, opts );

logEachMap( 'µ: %0.4f, σ: %0.4f, Median(X;µ,σ): %0.4f', mu, sigma, median );
logEachMap( 'μ: %0.4f, σ: %0.4f, Median(X;μ,σ): %0.4f', mu, sigma, median );
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ var p = uniform( 10, 0.0, 1.0, opts );
var mu = uniform( 10, -5.0, 5.0, opts );
var sigma = uniform( 10, 0.0, 5.0, opts );

logEachMap( 'p: %0.4f, µ: %0.4f, σ: %0.4f, Q(p;µ,σ): %0.4f', p, mu, sigma, quantile );
logEachMap( 'p: %0.4f, μ: %0.4f, σ: %0.4f, Q(p;μ,σ): %0.4f', p, mu, sigma, quantile );
```

</section>
Expand Down Expand Up @@ -221,7 +221,7 @@ int main( void ) {
mu = random_uniform( -5.0, 5.0 );
sigma = random_uniform( 0.0, 5.0 );
y = stdlib_base_dists_anglit_quantile( p, mu, sigma );
printf( "p: %lf, µ: %lf, σ: %lf, Q(p;µ,σ): %lf\n", p, mu, sigma, y );
printf( "p: %lf, μ: %lf, σ: %lf, Q(p;μ,σ): %lf\n", p, mu, sigma, y );
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ int main( void ) {
mu = random_uniform( -5.0, 5.0 );
sigma = random_uniform( 0.0, 5.0 );
y = stdlib_base_dists_anglit_quantile( p, mu, sigma );
printf( "p: %lf, µ: %lf, σ: %lf, Q(p;µ,σ): %lf\n", p, mu, sigma, y );
printf( "p: %lf, μ: %lf, σ: %lf, Q(p;μ,σ): %lf\n", p, mu, sigma, y );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ var p = uniform( 10, 0.0, 1.0, opts );
var mu = uniform( 10, -5.0, 5.0, opts );
var sigma = uniform( 10, 0.0, 5.0, opts );

logEachMap( 'p: %0.4f, µ: %0.4f, σ: %0.4f, Q(p;µ,σ): %0.4f', p, mu, sigma, quantile );
logEachMap( 'p: %0.4f, μ: %0.4f, σ: %0.4f, Q(p;μ,σ): %0.4f', p, mu, sigma, quantile );
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ var opts = {
var mu = uniform( 10, -50.0, 50.0, opts );
var sigma = uniform( 10, 0.1, 20.0, opts );

logEachMap( 'µ: %0.4f, σ: %0.4f, SD(X;µ,σ): %0.4f', mu, sigma, stdev );
logEachMap( 'μ: %0.4f, σ: %0.4f, SD(X;μ,σ): %0.4f', mu, sigma, stdev );
```

</section>
Expand Down Expand Up @@ -202,7 +202,7 @@ int main( void ) {
mu = random_uniform( -50.0, 50.0 );
sigma = random_uniform( 0.1, 20.0 );
y = stdlib_base_dists_anglit_stdev( mu, sigma );
printf( "µ: %lf, σ: %lf, SD(X;µ,σ): %lf\n", mu, sigma, y );
printf( "μ: %lf, σ: %lf, SD(X;μ,σ): %lf\n", mu, sigma, y );
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ int main( void ) {
mu = random_uniform( -50.0, 50.0 );
sigma = random_uniform( 0.1, 20.0 );
y = stdlib_base_dists_anglit_stdev( mu, sigma );
printf( "µ: %lf, σ: %lf, SD(X;µ,σ): %lf\n", mu, sigma, y );
printf( "μ: %lf, σ: %lf, SD(X;μ,σ): %lf\n", mu, sigma, y );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ var opts = {
var sigma = uniform( 10, 0.1, 20.0, opts );
var mu = uniform( 10, -50.0, 50.0, opts );

logEachMap( 'µ: %0.4f, σ: %0.4f, SD(X;µ,σ): %0.4f', mu, sigma, stdev );
logEachMap( 'μ: %0.4f, σ: %0.4f, SD(X;μ,σ): %0.4f', mu, sigma, stdev );
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ var opts = {
var mu = uniform( 10, -5.0, 5.0, opts );
var sigma = uniform( 10, 0.1, 20.0, opts );

logEachMap( 'µ: %0.4f, σ: %0.4f, Var(X;µ,σ): %0.4f', mu, sigma, variance );
logEachMap( 'μ: %0.4f, σ: %0.4f, Var(X;μ,σ): %0.4f', mu, sigma, variance );
```

</section>
Expand Down Expand Up @@ -205,7 +205,7 @@ int main( void ) {
mu = random_uniform( -5.0, 5.0 );
sigma = random_uniform( 0.1, 20.0 );
y = stdlib_base_dists_anglit_variance( mu, sigma );
printf( "µ: %lf, σ: %lf, Var(X;µ,σ): %lf\n", mu, sigma, y );
printf( "μ: %lf, σ: %lf, Var(X;μ,σ): %lf\n", mu, sigma, y );
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ int main( void ) {
mu = random_uniform( -5.0, 5.0 );
sigma = random_uniform( 0.1, 20.0 );
y = stdlib_base_dists_anglit_variance( mu, sigma );
printf( "µ: %lf, σ: %lf, Var(X;µ,σ): %lf\n", mu, sigma, y );
printf( "μ: %lf, σ: %lf, Var(X;μ,σ): %lf\n", mu, sigma, y );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ var opts = {
var mu = uniform( 10, -5.0, 5.0, opts );
var sigma = uniform( 10, 0.1, 20.0, opts );

logEachMap( 'µ: %0.4f, σ: %0.4f, Var(X;µ,σ): %0.4f', mu, sigma, variance );
logEachMap( 'μ: %0.4f, σ: %0.4f, Var(X;μ,σ): %0.4f', mu, sigma, variance );
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ var x = uniform( 10, 0.0, 10.0, opts );
var mu = uniform( 10, 0.0, 10.0, opts );
var s = uniform( 10, 0.0, 10.0, opts );

logEachMap( 'x: %0.4f, µ: %0.4f, s: %0.4f, F(x;µ,s): %0.4f', x, mu, s, cdf );
logEachMap( 'x: %0.4f, μ: %0.4f, s: %0.4f, F(x;μ,s): %0.4f', x, mu, s, cdf );
```

</section>
Expand Down Expand Up @@ -233,7 +233,7 @@ int main( void ) {
mu = random_uniform( -50.0, 50.0 );
s = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
y = stdlib_base_dists_cosine_cdf( x, mu, s );
printf( "x: %lf, µ: %lf, s: %lf, F(x;µ,s): %lf\n", x, mu, s, y );
printf( "x: %lf, μ: %lf, s: %lf, F(x;μ,s): %lf\n", x, mu, s, y );
}

return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ int main( void ) {
mu = random_uniform( -50.0, 50.0 );
s = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
y = stdlib_base_dists_cosine_cdf( x, mu, s );
printf( "x: %lf, µ: %lf, s: %lf, F(x;µ,s): %lf\n", x, mu, s, y );
printf( "x: %lf, μ: %lf, s: %lf, F(x;μ,s): %lf\n", x, mu, s, y );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ var x = uniform( 10, 0.0, 10.0, opts );
var mu = uniform( 10, 0.0, 10.0, opts );
var s = uniform( 10, 0.0, 10.0, opts );

logEachMap( 'x: %0.4f, µ: %0.4f, s: %0.4f, F(x;µ,s): %0.4f', x, mu, s, cdf );
logEachMap( 'x: %0.4f, μ: %0.4f, s: %0.4f, F(x;μ,s): %0.4f', x, mu, s, cdf );
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ var opts = {
var mu = uniform( 10, -5.0, 5.0, opts );
var s = uniform( 10, 0.0, 20.0, opts );

logEachMap( 'µ: %0.4f, s: %0.4f, Kurt(X;µ,s): %0.4f', mu, s, kurtosis );
logEachMap( 'μ: %0.4f, s: %0.4f, Kurt(X;μ,s): %0.4f', mu, s, kurtosis );
```

</section>
Expand Down Expand Up @@ -211,7 +211,7 @@ int main( void ) {
mu = random_uniform( -50.0, 50.0 );
s = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
y = stdlib_base_dists_cosine_kurtosis( mu, s );
printf( "µ: %lf, s: %lf, Kurt(X;µ,s): %lf\n", mu, s, y );
printf( "μ: %lf, s: %lf, Kurt(X;μ,s): %lf\n", mu, s, y );
}

return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ int main( void ) {
mu = random_uniform( -50.0, 50.0 );
s = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
y = stdlib_base_dists_cosine_kurtosis( mu, s );
printf( "µ: %lf, s: %lf, Kurt(X;µ,s): %lf\n", mu, s, y );
printf( "μ: %lf, s: %lf, Kurt(X;μ,s): %lf\n", mu, s, y );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ var opts = {
var mu = uniform( 10, -5.0, 5.0, opts );
var s = uniform( 10, 0.0, 20.0, opts );

logEachMap( 'µ: %0.4f, s: %0.4f, Kurt(X;µ,s): %0.4f', mu, s, kurtosis );
logEachMap( 'μ: %0.4f, s: %0.4f, Kurt(X;μ,s): %0.4f', mu, s, kurtosis );
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ var x = uniform( 10, 0.0, 10.0, opts );
var mu = uniform( 10, 0.0, 10.0, opts );
var s = uniform( 10, 0.0, 10.0, opts );

logEachMap( 'x: %0.4f, µ: %0.4f, s: %0.4f, ln(F(x;µ,s)): %0.4f', x, mu, s, logcdf );
logEachMap( 'x: %0.4f, μ: %0.4f, s: %0.4f, ln(F(x;μ,s)): %0.4f', x, mu, s, logcdf );
```

</section>
Expand Down Expand Up @@ -243,7 +243,7 @@ int main( void ) {
mu = random_uniform( -50.0, 50.0 );
s = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
y = stdlib_base_dists_cosine_logcdf( x, mu, s );
printf( "x: %lf, µ: %lf, s: %lf, ln(F(x;µ,s)): %lf\n", x, mu, s, y );
printf( "x: %lf, μ: %lf, s: %lf, ln(F(x;μ,s)): %lf\n", x, mu, s, y );
}

return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ int main( void ) {
mu = random_uniform( -50.0, 50.0 );
s = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
y = stdlib_base_dists_cosine_logcdf( x, mu, s );
printf( "x: %lf, µ: %lf, s: %lf, ln(F(x;µ,s)): %lf\n", x, mu, s, y );
printf( "x: %lf, μ: %lf, s: %lf, ln(F(x;μ,s)): %lf\n", x, mu, s, y );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ var x = uniform( 10, 0.0, 10.0, opts );
var mu = uniform( 10, 0.0, 10.0, opts );
var s = uniform( 10, 0.0, 10.0, opts );

logEachMap( 'x: %0.4f, µ: %0.4f, s: %0.4f, ln(F(x;µ,s)): %0.4f', x, mu, s, logcdf );
logEachMap( 'x: %0.4f, μ: %0.4f, s: %0.4f, ln(F(x;μ,s)): %0.4f', x, mu, s, logcdf );
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ var x = uniform( 10, 0.0, 10.0, opts );
var mu = uniform( 10, 0.0, 10.0, opts );
var s = uniform( 10, 0.0, 10.0, opts );

logEachMap( 'x: %0.4f, µ: %0.4f, s: %0.4f, ln(f(x;µ,s)): %0.4f', x, mu, s, logpdf );
logEachMap( 'x: %0.4f, μ: %0.4f, s: %0.4f, ln(f(x;μ,s)): %0.4f', x, mu, s, logpdf );
```

</section>
Expand Down Expand Up @@ -234,7 +234,7 @@ int main( void ) {
mu = random_uniform( -50.0, 50.0 );
s = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
y = stdlib_base_dists_cosine_logpdf( x, mu, s );
printf( "x: %lf, µ: %lf, s: %lf, ln(f(x;µ,s)): %lf\n", x, mu, s, y );
printf( "x: %lf, μ: %lf, s: %lf, ln(f(x;μ,s)): %lf\n", x, mu, s, y );
}

return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ int main( void ) {
mu = random_uniform( -50.0, 50.0 );
s = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
y = stdlib_base_dists_cosine_logpdf( x, mu, s );
printf( "x: %lf, µ: %lf, s: %lf, ln(f(x;µ,s)): %lf\n", x, mu, s, y );
printf( "x: %lf, μ: %lf, s: %lf, ln(f(x;μ,s)): %lf\n", x, mu, s, y );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ var x = uniform( 10, 0.0, 10.0, opts );
var mu = uniform( 10, 0.0, 10.0, opts );
var s = uniform( 10, 0.0, 10.0, opts );

logEachMap( 'x: %0.4f, µ: %0.4f, s: %0.4f, ln(f(x;µ,s)): %0.4f', x, mu, s, logpdf );
logEachMap( 'x: %0.4f, μ: %0.4f, s: %0.4f, ln(f(x;μ,s)): %0.4f', x, mu, s, logpdf );
Loading
Loading