0.2.1 • Published 3 months ago
@stdlib/slice-base v0.2.1
Base
Base slice namespace.
Installation
npm install @stdlib/slice-base
Usage
var ns = require( '@stdlib/slice-base' );
ns
Base slice namespace.
var o = ns;
// returns {...}
The namespace contains the following:
args2multislice( args )
: create aMultiSlice
object from a list ofMultiSlice
constructor arguments.int2slice( value, max, strict )
: convert an integer to aSlice
object.sliceLength( slice )
: compute the number of elements in a normalized slice.nonreducedDimensions( slice )
: return a list of non-reduced dimensions in an un-normalizedMultiSlice
object.normalizeMultiSlice( slice, shape, strict )
: normalize aMultiSlice
object.normalizeSlice( slice, len, strict )
: normalize aSlice
object.reducedDimensions( slice )
: return a list of reduced dimensions in an un-normalizedMultiSlice
object.sargs2multislice( str )
: create aMultiSlice
object from a comma-separated list of string-serializedMultiSlice
constructor arguments.seq2multislice( str, shape, strict )
: convert a multidimensional subsequence string to aMultiSlice
object.seq2slice( str, len, strict )
: convert a subsequence string to aSlice
object.sliceShape( slice )
: compute the shape of a normalized multi-slice.slice2seq( str )
: convert aSlice
object to a subsequence string.str2multislice( str )
: parse a string-serializedMultiSlice
object.str2slice( str )
: parse a string-serializedSlice
object.
Examples
var objectKeys = require( '@stdlib/utils-keys' );
var ns = require( '@stdlib/slice-base' );
console.log( objectKeys( ns ) );
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, 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 develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.