Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Return a list of non-reduced dimensions in an un-normalized multi-slice.

License

NotificationsYou must be signed in to change notification settings

stdlib-js/slice-base-nonreduced-dimensions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About stdlib...

We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.

The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.

When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.

To join us in bringing numerical computing to the web, get started by checking us out onGitHub, and please considerfinancially supporting stdlib. We greatly appreciate your continued support!

nonreducedDimensions

NPM versionBuild StatusCoverage Status

Return a list of non-reduced dimensions in an un-normalizedMultiSlice object.

In a multi-axis indexing expression (e.g., '1,:,2,:,0:10:1'), a non-reduced dimension corresponds to a dimension which is retained in the slice result. Only integer indexing expressions (e.g., only the first and third dimensions in '1,:,2,:,0:10:1') result in dimension reduction; slices always retain respective dimensions, even if a slice is empty or only selects a single element.

Usage

importnonreducedDimensionsfrom'https://cdn.jsdelivr.net/gh/stdlib-js/slice-base-nonreduced-dimensions@deno/mod.js';

nonreducedDimensions( slice )

Returns a list of non-reduced dimensions in an un-normalizedMultiSlice object.

importMultiSlicefrom'https://cdn.jsdelivr.net/gh/stdlib-js/slice-multi@deno/mod.js';importSlicefrom'https://cdn.jsdelivr.net/gh/stdlib-js/slice-ctor@deno/mod.js';vars=newMultiSlice(1,null,2,void0,newSlice(0,10,1));// returns <MultiSlice>varindices=nonreducedDimensions(s);// returns [ 1, 3, 4 ]

Examples

importSfrom'https://cdn.jsdelivr.net/gh/stdlib-js/slice-ctor@deno/mod.js';importMultiSlicefrom'https://cdn.jsdelivr.net/gh/stdlib-js/slice-multi@deno/mod.js';importnonreducedDimensionsfrom'https://cdn.jsdelivr.net/gh/stdlib-js/slice-base-nonreduced-dimensions@deno/mod.js';vars=newMultiSlice(null,S(),-1);varout=nonreducedDimensions(s);console.log('%s => [%s]',s.toString(),out.join(','));s=newMultiSlice(null);out=nonreducedDimensions(s);console.log('%s => [%s]',s.toString(),out.join(','));s=newMultiSlice(S(-1,null,-1),3);out=nonreducedDimensions(s);console.log('%s => [%s]',s.toString(),out.join(','));s=newMultiSlice(2,S(-10,-2,2),3,null);out=nonreducedDimensions(s);console.log('%s => [%s]',s.toString(),out.join(','));s=newMultiSlice(S(1,20,2),S(null,null,-1));out=nonreducedDimensions(s);console.log('%s => [%s]',s.toString(),out.join(','));

See Also


Notice

This package is part ofstdlib, a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to developstdlib, see the main projectrepository.

Community

Chat


License

SeeLICENSE.

Copyright

Copyright © 2016-2025. The StdlibAuthors.

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp