Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Aug 13, 2021
1 parent 23e3ec0 commit 02b95bd
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 36 deletions.
61 changes: 26 additions & 35 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,101 +29,92 @@ trim_trailing_whitespace = true
insert_final_newline = true

# Set properties for JavaScript files:
[*.js]
indent_style = tab

[*.js.txt]
[*.{js,js.txt}]
indent_style = tab

# Set properties for JavaScript ES module files:
[*.mjs]
indent_style = tab

[*.mjs.txt]
[*.{mjs,mjs.txt}]
indent_style = tab

# Set properties for JavaScript CommonJS files:
[*.cjs]
[*.{cjs,cjs.txt}]
indent_style = tab

[*.cjs.txt]
indent_style = tab
# Set properties for JSON files:
[*.{json,json.txt}]
indent_style = space
indent_size = 2

# Set properties for TypeScript files:
[*.ts]
indent_style = tab

# Set properties for Python files:
[*.py]
[*.{py,py.txt}]
indent_style = space
indent_size = 4

# Set properties for Julia files:
[*.jl]
[*.{jl,jl.txt}]
indent_style = tab

# Set properties for R files:
[*.R]
[*.{R,R.txt}]
indent_style = tab

# Set properties for C files:
[*.c]
[*.{c,c.txt}]
indent_style = tab

# Set properties for C header files:
[*.h]
[*.{h,h.txt}]
indent_style = tab

# Set properties for C++ files:
[*.cpp]
[*.{cpp,cpp.txt}]
indent_style = tab

# Set properties for C++ header files:
[*.hpp]
[*.{hpp,hpp.txt}]
indent_style = tab

# Set properties for Fortran files:
[*.f]
[*.{f,f.txt}]
indent_style = space
indent_size = 2
insert_final_newline = false

# Set properties for shell files:
[*.sh]
[*.{sh,sh.txt}]
indent_style = tab

# Set properties for AWK files:
[*.awk]
[*.{awk,awk.txt}]
indent_style = tab

# Set properties for HTML files:
[*.html]
[*.{html,html.txt}]
indent_style = tab
tab_width = 2

# Set properties for XML files:
[*.xml]
[*.{xml,xml.txt}]
indent_style = tab
tab_width = 2

# Set properties for CSS files:
[*.css]
[*.{css,css.txt}]
indent_style = tab

# Set properties for Makefiles:
[Makefile]
indent_style = tab

[*.mk]
[*.{mk,mk.txt}]
indent_style = tab

# Set properties for Markdown files:
[*.md]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false

[*.md.txt]
[*.{md,md.txt}]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false
Expand All @@ -139,7 +130,7 @@ indent_style = space
indent_size = 4

# Set properties for `package.json` files:
[package.json]
[package.{json,json.txt}]
indent_style = space
indent_size = 2

Expand All @@ -164,15 +155,15 @@ indent_style = space
indent_size = 2

# Set properties for LaTeX files:
[*.tex]
[*.{tex,tex.txt}]
indent_style = tab

# Set properties for LaTeX Bibliography files:
[*.bib]
[*.{bib,bib.txt}]
indent_style = tab

# Set properties for YAML files:
[*.yml]
[*.{yml,yml.txt}]
indent_style = space
indent_size = 2

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:
# * is a special character in YAML so you have to quote this string
- cron: '30 1 * * 6'
workflow_dispatch:
push:

# Workflow jobs:
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Files #
#########

package.json.copy

# Directories #
###############
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Makefile
**/examples/
reports/
support/
scripts/
**/tmp/
workshops/

Expand Down
52 changes: 52 additions & 0 deletions base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import assert = require( './../../../base/assert' );
import bind2vind = require( './../../../base/bind2vind' );
import broadcastArray = require( './../../../base/broadcast-array' );
import broadcastShapes = require( './../../../base/broadcast-shapes' );
import buffer = require( './../../../base/buffer' );
import bufferCtors = require( './../../../base/buffer-ctors' );
Expand Down Expand Up @@ -84,6 +85,57 @@ interface Namespace {
*/
bind2vind: typeof bind2vind;

/**
* Broadcasts an ndarray to a specified shape.
*
* ## Notes
*
* - The function throws an error if a provided ndarray is incompatible with a provided shape.
* - The returned array is a view on the input array data buffer. The view is typically **not** contiguous. As more than one element of a returned view may refer to the same memory location, writing to the view may affect multiple elements. If you need to write to the returned array, copy the array before performing operations which may mutate elements.
* - The returned array is a "base" ndarray, and, thus, the returned array does not perform bounds checking or afford any of the guarantees of the non-base ndarray constructor. The primary intent of this function is to broadcast an ndarray-like object within internal implementations and to do so with minimal overhead.
* - The function always returns a new ndarray instance even if the input ndarray shape and the desired shape are the same.
*
* @param arr - input array
* @param shape - desired shape
* @throws input array cannot have more dimensions than the desired shape
* @throws input array dimension sizes must be `1` or equal to the corresponding dimension in the provided shape
* @returns broadcasted array
*
* @example
* var array = require( `@stdlib/ndarray/array` );
*
* var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
* // returns <ndarray>
*
* var shx = x.shape;
* // returns [ 2, 2 ]
*
* var y = ns.broadcastArray( x, [ 3, 2, 2 ] );
* // returns <ndarray>
*
* var shy = y.shape;
* // returns [ 3, 2, 2 ]
*
* var v = y.get( 0, 0, 0 );
* // returns 1
*
* v = y.get( 0, 0, 1 );
* // returns 2
*
* v = y.get( 1, 0, 0 );
* // returns 1
*
* v = y.get( 1, 1, 0 );
* // returns 3
*
* v = y.get( 2, 0, 0 );
* // returns 1
*
* v = y.get( 2, 1, 1 );
* // returns 4
*/
broadcastArray: typeof broadcastArray;

/**
* Broadcasts array shapes to a single shape.
*
Expand Down

0 comments on commit 02b95bd

Please sign in to comment.