@stdlib/ndarray-flipud
v0.1.1
Published
Return a read-only view of an input ndarray in which the order of elements along the second-to-last dimension is reversed.
Readme
flipud
Return a read-only view of an input
ndarrayin which the order of elements along the second-to-last dimension is reversed.
Installation
npm install @stdlib/ndarray-flipudUsage
var flipud = require( '@stdlib/ndarray-flipud' );flipud( x )
Returns a read-only view of an input ndarray in which the order of elements along the second-to-last dimension is reversed.
var array = require( '@stdlib/ndarray-array' );
var x = array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], {
'shape': [ 3, 2 ]
});
// returns <ndarray>[ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
var y = flipud( x );
// returns <ndarray>[ [ 5.0, 6.0 ], [ 3.0, 4.0 ], [ 1.0, 2.0 ] ]Examples
var uniform = require( '@stdlib/random-uniform' );
var ndarray2array = require( '@stdlib/ndarray-to-array' );
var flipud = require( '@stdlib/ndarray-flipud' );
var x = uniform( [ 3, 3, 3 ], -10.0, 10.0 );
console.log( ndarray2array( x ) );
var y = flipud( x );
console.log( ndarray2array( y ) );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-2026. The Stdlib Authors.
