Skip to content

feat: add lapack/base/dgtts2 #5882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 39 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
9e097b9
feat: add base algorithm
aayush0325 Mar 8, 2025
41be81c
fix: remove useless isRowMajor check
aayush0325 Mar 8, 2025
9eaeca2
fix: fix bug
aayush0325 Mar 8, 2025
0e0f694
feat: complete initial implementation
aayush0325 Mar 9, 2025
3e68299
fix: update function return value and add docs and benchmarks
aayush0325 Mar 10, 2025
9a78528
bench: remove benchmarks for now
aayush0325 Mar 11, 2025
bb30a2d
test: add initial tests
aayush0325 Mar 12, 2025
9f1e284
chore: update copyright years
stdlib-bot Mar 12, 2025
9ad6153
test: more test coverage
aayush0325 Mar 12, 2025
e935826
fix: fix tests failing
aayush0325 Mar 13, 2025
6100480
fix: reduce tolerance to zero and use deepequals
aayush0325 Mar 13, 2025
7dd1e0f
test: more test coverage
aayush0325 Mar 13, 2025
9a533bd
chore: reorder tests
aayush0325 Mar 13, 2025
ddf9bbe
test: more test coverage
aayush0325 Mar 13, 2025
78ad0a6
fix: use correct fixture
aayush0325 Mar 13, 2025
dfcc8f8
test: more test coverage
aayush0325 Mar 14, 2025
b948269
test: fix up fixtures
aayush0325 Mar 17, 2025
0947dbb
test: add tests for ndarray offsets
aayush0325 Mar 17, 2025
a0af19c
test: add tests for positive strides
aayush0325 Mar 18, 2025
2623647
test: add tests for negative strides
aayush0325 Mar 19, 2025
172bc38
test: add tests for complex access patterns
aayush0325 Mar 21, 2025
866bded
chore: organize fixtures into different folderrs
aayush0325 Mar 21, 2025
56807f9
chore: update spacing
aayush0325 Mar 21, 2025
518459c
chore: update examples
aayush0325 Mar 22, 2025
f22e05a
docs: add README and update examples
aayush0325 Mar 22, 2025
4c9b7e9
docs: use links for int32array and float64array
aayush0325 Mar 22, 2025
82af8e9
docs: add repl.txt
aayush0325 Mar 22, 2025
2af58b6
docs: update repl.txt
aayush0325 Mar 24, 2025
b2a1360
docs: update repl.txt
aayush0325 Mar 24, 2025
8312416
docs: update repl.txt
aayush0325 Mar 24, 2025
94b73d9
docs: update repl.txt
aayush0325 Mar 24, 2025
aed4c82
docs: update examples
aayush0325 Mar 24, 2025
154588f
docs: add info about itrans
aayush0325 Mar 24, 2025
6670404
docs: update functiond descripton
aayush0325 Mar 24, 2025
c231362
chore: fix typo
aayush0325 Mar 24, 2025
58996d4
Merge branch 'develop' into lapack-dgtts2
aayush0325 Mar 30, 2025
ac1e2d1
bench: add benchmarks
aayush0325 Mar 30, 2025
c581a01
bench: update benchmarks
aayush0325 Mar 31, 2025
b1fb239
chore: update package.json description
aayush0325 Apr 5, 2025
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
153 changes: 153 additions & 0 deletions lib/node_modules/@stdlib/lapack/base/dgtts2/docs/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
/*
* @license Apache-2.0
*
* Copyright (c) 2025 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.
*/

// TypeScript Version: 4.1

/// <reference types="@stdlib/types"/>

import { Layout } from '@stdlib/types/blas';

/**
* Interface describing `dgtts2`.
*/
interface Routine {
/**
* Solves a system of linear equations with a tri diagonal matrix using the LU factorization.
*
* @param order - storage layout of B
* @param itrans - specifies the form of the system of equations (0: no transpose, 1: transpose, 2: conjugate transpose)
* @param N - order of the matrix A
* @param nrhs - number of right-hand sides
* @param DL - multipliers defining matrix L (length N-1)
* @param D - diagonal elements of upper triangular matrix U (length N)
* @param DU - first super-diagonal elements of U (length N-1)
* @param DU2 - second super-diagonal elements of U (length N-2)
* @param IPIV - pivot indices from factorization (length N)
* @param B - right-hand side matrix (overwritten with solution)
* @param LDB - leading dimension of B
* @returns the solution matrix X
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var Int32Array = require( '@stdlib/array/int32' );
*
* var DL = new Float64Array( [ 0.25, 0.26666667 ] );
* var D = new Float64Array( [ 4.0, 3.75, 3.73333333 ] );
* var DU = new Float64Array( [ 1.0, 0.73333333 ] );
* var DU2 = new Float64Array( [ 0.0 ] );
* var IPIV = new Int32Array( [ 0, 1, 2 ] );
* var B = new Float64Array( [ 7.0, 8.0, 7.0 ] );
*
* dgtts2( 'column-major', 1, 3, 1, DL, D, DU, DU2, IPIV, B, 3 );
* // B => <Float64Array>[ ~1.437, ~1.254, ~1.548 ]
*/
( order: Layout, itrans: number, N: number, nrhs: number, DL: Float64Array, D: Float64Array, DU: Float64Array, DU2: Float64Array, IPIV: Int32Array, B: Float64Array, LDB: number ): Float64Array;

/**
* Solves a system of linear equations with alternative indexing semantics.
*
* @param itrans - specifies the form of the system of equations
* @param N - order of the matrix A
* @param nrhs - number of right-hand sides
* @param DL - multipliers defining matrix L
* @param sdl - DL stride length
* @param odl - DL starting index
* @param D - diagonal elements of U
* @param sd - D stride length
* @param od - D starting index
* @param DU - first super-diagonal elements
* @param sdu - DU stride length
* @param odu - DU starting index
* @param DU2 - second super-diagonal elements
* @param sdu2 - DU2 stride length
* @param odu2 - DU2 starting index
* @param IPIV - pivot indices
* @param si - IPIV stride length
* @param oi - IPIV starting index
* @param B - right-hand side matrix
* @param sb1 - B first dimension stride
* @param sb2 - B second dimension stride
* @param ob - B starting index
* @returns the solution matrix X
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var Int32Array = require( '@stdlib/array/int32' );
*
* var DL = new Float64Array( [ 0.25, 0.26666667 ] );
* var D = new Float64Array( [ 4.0, 3.75, 3.73333333 ] );
* var DU = new Float64Array( [ 1.0, 0.73333333 ] );
* var DU2 = new Float64Array( [ 0.0 ] );
* var IPIV = new Int32Array( [ 0, 1, 2 ] );
* var B = new Float64Array( [ 7.0, 8.0, 7.0 ] );
*
* dgtts2.ndarray( 1, 3, 1, DL, 1, 0, D, 1, 0, DU, 1, 0, DU2, 1, 0, IPIV, 1, 0, B, 1, 1, 0 );
* // B => <Float64Array>[ ~1.437, ~1.254, ~1.548 ]
*/
ndarray( itrans: number, N: number, nrhs: number, DL: Float64Array, sdl: number, odl: number, D: Float64Array, sd: number, od: number, DU: Float64Array, sdu: number, odu: number, DU2: Float64Array, sdu2: number, odu2: number, IPIV: Int32Array, si: number, oi: number, B: Float64Array, sb1: number, sb2: number, ob: number ): Float64Array;
}

/**
* Solves a system of linear equations with a tri diagonal matrix using the LU factorization.
*
* @param order - storage layout of B
* @param itrans - system equation form specification
* @param N - matrix order
* @param nrhs - number of right-hand sides
* @param DL - L matrix multipliers
* @param D - U matrix diagonal
* @param DU - U first super-diagonal
* @param DU2 - U second super-diagonal
* @param IPIV - pivot indices
* @param B - right-hand side matrix
* @param LDB - B leading dimension
* @returns the solution matrix X
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var Int32Array = require( '@stdlib/array/int32' );
*
* var DL = new Float64Array( [ 0.25, 0.26666667 ] );
* var D = new Float64Array( [ 4.0, 3.75, 3.73333333 ] );
* var DU = new Float64Array( [ 1.0, 0.73333333 ] );
* var DU2 = new Float64Array( [ 0.0 ] );
* var IPIV = new Int32Array( [ 0, 1, 2 ] );
* var B = new Float64Array( [ 7.0, 8.0, 7.0 ] );
*
* dgtts2( 'row-major', 1, 3, 1, DL, D, DU, DU2, IPIV, B, 3 );
* // B => <Float64Array>[ 1.4365079379889456, 1.2539682480442178, 1.5476190504889455 ]
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var Int32Array = require( '@stdlib/array/int32' );
*
* var DL = new Float64Array( [ 0.25, 0.26666667 ] );
* var D = new Float64Array( [ 4.0, 3.75, 3.73333333 ] );
* var DU = new Float64Array( [ 1.0, 0.73333333 ] );
* var DU2 = new Float64Array( [ 0.0 ] );
* var IPIV = new Int32Array( [ 0, 1, 2 ] );
* var B = new Float64Array( [ 7.0, 8.0, 7.0 ] );
*
* dgtts2.ndarray( 1, 3, 1, DL, 1, 0, D, 1, 0, DU, 1, 0, DU2, 1, 0, IPIV, 1, 0, B, 1, 1, 0 );
* // B => <Float64Array>[ 1.4365079379889456, 1.2539682480442178, 1.5476190504889455 ]
*/
declare var dgtts2: Routine;

// EXPORTS //

export = dgtts2;
Loading
Loading