Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions lib/node_modules/@stdlib/lapack/base/dsyconvf-rook/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Derived from Reference-LAPACK DSYCONVF_ROOK at commit
2e5d9c1273435fbd953adb294ed603e4789afaba (SRC/dsyconvf_rook.f).
The JavaScript and C storage algorithms retain the following BSD terms.

Copyright (c) 1992-2025 The University of Tennessee and The University
of Tennessee Research Foundation. All rights
reserved.
Copyright (c) 2000-2025 The University of California Berkeley. All
rights reserved.
Copyright (c) 2006-2025 The University of Colorado Denver. All rights
reserved.

$COPYRIGHT$

Additional copyrights may follow

$HEADER$

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer listed
in this license in the documentation and/or other materials
provided with the distribution.

- Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

The copyright holders provide no reassurances that the source code
provided does not infringe any patent, copyright, or any other
intellectual property rights of third parties. The copyright holders
disclaim any liability to any recipient for claims brought against
recipient by any third party for infringement of that parties
intellectual property rights.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
402 changes: 402 additions & 0 deletions lib/node_modules/@stdlib/lapack/base/dsyconvf-rook/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2026 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var bench = require( '@stdlib/bench' );
var Float64Array = require( '@stdlib/array/float64' );
var Int32Array = require( '@stdlib/array/int32' );
var format = require( '@stdlib/string/format' );
var pkg = require( './../package.json' ).name;
var dsyconvfRook = require( './../lib' );


// FUNCTIONS //

/**
* Creates a bounded conversion/reversion benchmark.
*
* @private
* @param {PositiveInteger} N - matrix order
* @param {string} uplo - stored triangle
* @returns {Function} benchmark function
*/
function createBenchmark( N, uplo ) {
var IPIV;
var A;
var E;
var i;
var j;

A = new Float64Array( N*N );
E = new Float64Array( N );
IPIV = new Int32Array( N );
for ( i = 0; i < N; i++ ) {
IPIV[ i ] = i + 1;
for ( j = 0; j < N; j++ ) {
A[ (i*N)+j ] = i + j + 1.0;
}
}
// The first two rows form a 2x2 block with distinct negative pivots:
IPIV[ 0 ] = -1;
IPIV[ 1 ] = -2;
return benchmark;

/**
* Benchmark function.
*
* @private
* @param {Benchmark} b - benchmark instance
*/
function benchmark( b ) {
var info;
var i;

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
info = dsyconvfRook( 'row-major', uplo, 'convert', N, A, N, E, IPIV );
if ( info !== 0 ) {
b.fail( 'should return a success status code' );
break;
}
info = dsyconvfRook( 'row-major', uplo, 'revert', N, A, N, E, IPIV );
if ( info !== 0 ) {
b.fail( 'should return a success status code' );
break;
}
}
b.toc();
if (
A[ 1 ] !== 2.0 ||
A[ N ] !== 2.0 ||
IPIV[ 0 ] !== -1 ||
IPIV[ 1 ] !== -2
) {
b.fail( 'should preserve factor storage after a complete cycle' );
}
if (
( uplo === 'upper' && E[ 1 ] !== 2.0 ) ||
( uplo === 'lower' && E[ 0 ] !== 2.0 )
) {
b.fail( 'should extract the known off-diagonal block value' );
}
b.pass( 'benchmark finished' );
b.end();
}
}


// MAIN //

/**
* Main execution sequence.
*
* @private
*/
function main() {
var options;
var sizes;
var uplos;
var name;
var i;
var j;

options = {
'iterations': 1000,
'repeats': 2
};
sizes = [ 8, 32 ];
uplos = [ 'upper', 'lower' ];
for ( i = 0; i < sizes.length; i++ ) {
for ( j = 0; j < uplos.length; j++ ) {
name = format( '%s:triangle=%s:N=%d', pkg, uplos[ j ], sizes[ i ] );
bench( name, options, createBenchmark( sizes[ i ], uplos[ j ] ) );
}
}
}

main();
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2026 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var bench = require( '@stdlib/bench' );
var Float64Array = require( '@stdlib/array/float64' );
var Int32Array = require( '@stdlib/array/int32' );
var format = require( '@stdlib/string/format' );
var pkg = require( './../package.json' ).name;
var dsyconvfRook = require( './../lib' ).ndarray;


// FUNCTIONS //

/**
* Creates a bounded conversion/reversion benchmark.
*
* @private
* @param {PositiveInteger} N - matrix order
* @param {string} uplo - stored triangle
* @returns {Function} benchmark function
*/
function createBenchmark( N, uplo ) {
var IPIV;
var A;
var E;
var i;
var j;

A = new Float64Array( N*N );
E = new Float64Array( N );
IPIV = new Int32Array( N );
for ( i = 0; i < N; i++ ) {
IPIV[ i ] = i + 1;
for ( j = 0; j < N; j++ ) {
A[ (i*N)+j ] = i + j + 1.0;
}
}
// The first two rows form a 2x2 block with distinct negative pivots:
IPIV[ 0 ] = -1;
IPIV[ 1 ] = -2;
return benchmark;

/**
* Benchmark function.
*
* @private
* @param {Benchmark} b - benchmark instance
*/
function benchmark( b ) {
var info;
var i;

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
info = dsyconvfRook( uplo, 'convert', N, A, N, 1, 0, E, 1, 0, IPIV, 1, 0 );
if ( info !== 0 ) {
b.fail( 'should return a success status code' );
break;
}
info = dsyconvfRook( uplo, 'revert', N, A, N, 1, 0, E, 1, 0, IPIV, 1, 0 );
if ( info !== 0 ) {
b.fail( 'should return a success status code' );
break;
}
}
b.toc();
if (
A[ 1 ] !== 2.0 ||
A[ N ] !== 2.0 ||
IPIV[ 0 ] !== -1 ||
IPIV[ 1 ] !== -2
) {
b.fail( 'should preserve factor storage after a complete cycle' );
}
if (
( uplo === 'upper' && E[ 1 ] !== 2.0 ) ||
( uplo === 'lower' && E[ 0 ] !== 2.0 )
) {
b.fail( 'should extract the known off-diagonal block value' );
}
b.pass( 'benchmark finished' );
b.end();
}
}


// MAIN //

/**
* Main execution sequence.
*
* @private
*/
function main() {
var options;
var sizes;
var uplos;
var name;
var i;
var j;

options = {
'iterations': 1000,
'repeats': 2
};
sizes = [ 8, 32 ];
uplos = [ 'upper', 'lower' ];
for ( i = 0; i < sizes.length; i++ ) {
for ( j = 0; j < uplos.length; j++ ) {
name = format( '%s:ndarray:triangle=%s:N=%d', pkg, uplos[ j ], sizes[ i ] );
bench( name, options, createBenchmark( sizes[ i ], uplos[ j ] ) );
}
}
}

main();
Loading
Loading