Skip to content

feat: add javascript implementation for lapack/base/dlaswp #2483

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

Merged
merged 61 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
c92f72c
feat: add initial implementation for lapack/base/dlaswp
Pranavchiku Jul 1, 2024
eece712
chore: update dlaswp.js
Pranavchiku Jul 1, 2024
b35d940
chore: update dlaswp.js
Pranavchiku Jul 1, 2024
5f84f99
chore: update dlaswp.js
Pranavchiku Jul 1, 2024
711aa9b
chore: lib/index.js
Pranavchiku Jul 1, 2024
b0eec9a
chore: add dlaswp.js
Pranavchiku Jul 1, 2024
4649c54
chore: add main.js
Pranavchiku Jul 1, 2024
44075d2
chore: delete lapack/blas/dlaswp.js
Pranavchiku Jul 1, 2024
dd393d4
chore: add example
Pranavchiku Jul 1, 2024
40349ca
chore: add README.md
Pranavchiku Jul 1, 2024
e19ff82
chore: add package.json
Pranavchiku Jul 1, 2024
559824a
chore: add README.md
Pranavchiku Jul 1, 2024
9dcfa53
chore: add repl.txt
Pranavchiku Jul 1, 2024
b761225
chore: add test.ts
Pranavchiku Jul 1, 2024
d3f8069
chore: add index.d.ts
Pranavchiku Jul 1, 2024
15a6b5a
chore: add benchmark
Pranavchiku Jul 1, 2024
6326803
fix: row-major implementation
Pranavchiku Jul 1, 2024
682b172
test: add tests
Pranavchiku Jul 1, 2024
dccfcf8
chore: apply suggestion and replace incX with strideIPIV
Pranavchiku Jul 1, 2024
d88b69b
chore: apply suggestion in index.d.ts
Pranavchiku Jul 1, 2024
6514e12
chore: add all files
Pranavchiku Jul 1, 2024
486985f
chore: show sipiv instead of strideIPIV in readme and repl
Pranavchiku Jul 1, 2024
01237eb
chore: apply code review
Pranavchiku Jul 1, 2024
2a0cf83
chore: apply code review
Pranavchiku Jul 1, 2024
1cb1206
chore: apply suggestions from code review
Pranavchiku Jul 1, 2024
3a6dc5c
test: update incorrect description
Pranavchiku Jul 2, 2024
62e1af9
chore: update base.js description
Pranavchiku Jul 2, 2024
1a91314
chore: link to LAPACK doc in readme
Pranavchiku Jul 2, 2024
8610f1a
chore: update package level description
Pranavchiku Jul 2, 2024
a336167
chore: introduce offsetIPIV and consequent changes
Pranavchiku Jul 2, 2024
d2507ac
bench: update data generation
kgryte Jul 3, 2024
b436402
refactor: reorder parameters
kgryte Jul 4, 2024
6001634
test: reorder parameters
kgryte Jul 4, 2024
db68b19
chore: consequent changes of parameter reorder
Pranavchiku Jul 5, 2024
d5bcee5
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into pr…
kgryte Jul 10, 2024
c5f42cd
temp: save snapshot
kgryte Jul 11, 2024
fee1ce6
refactor: update to support matrix strides
kgryte Jul 11, 2024
f317d45
test: rename fixtures and update ndarray tests
kgryte Jul 11, 2024
ddfd2c7
fix: account for layout when passing stride arguments and update tests
kgryte Jul 11, 2024
3e53660
docs: fix parameters and resolve lint errors
kgryte Jul 11, 2024
d668fe1
docs: fix example
kgryte Jul 11, 2024
5c29c0f
docs: update example
kgryte Jul 11, 2024
81b27ac
chore: consequent changes
Pranavchiku Jul 11, 2024
4c663d3
fix: incorrect readme example
Pranavchiku Jul 11, 2024
5af48c0
bench: add facet for the number of interchanged rows
kgryte Jul 11, 2024
254f41f
bench: add facet for measuring performance for different layouts
kgryte Jul 11, 2024
8c47131
docs: update descriptions
kgryte Jul 11, 2024
0f69c03
docs: update descriptions
kgryte Jul 11, 2024
402d5c8
docs: update example
kgryte Jul 11, 2024
70dc36f
chore: update keywords
kgryte Jul 11, 2024
03eed0f
fix: ensure support for applying pivots in reverse
kgryte Jul 12, 2024
461749a
refactor: remove comments
kgryte Jul 12, 2024
9b9dbce
test: add tests for applying pivots in reverse with an IPIV stride
kgryte Jul 12, 2024
45facca
test: add tests for appying pivots in reverse with an IPIV offset
kgryte Jul 12, 2024
1ec29ed
test: add tests for positive `k1` value
kgryte Jul 12, 2024
0a99eed
docs: update copy
kgryte Jul 12, 2024
b50c740
test: add stride tests
kgryte Jul 13, 2024
be33a85
test: add error handling tests
kgryte Jul 13, 2024
6247f98
docs: add example
kgryte Jul 13, 2024
8dd21b6
docs: update copy
kgryte Jul 13, 2024
9019417
docs: fix note
kgryte Jul 13, 2024
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
Prev Previous commit
Next Next commit
fix: account for layout when passing stride arguments and update tests
  • Loading branch information
kgryte committed Jul 11, 2024
commit ddfd2c730ddcd3db27336e63e242d75e4004264d
11 changes: 10 additions & 1 deletion lib/node_modules/@stdlib/lapack/base/dlaswp/lib/dlaswp.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ var base = require( './base.js' );
function dlaswp( order, N, A, LDA, k1, k2, IPIV, incx ) {
var tmp;
var inc;
var sa1;
var sa2;
var io;
if ( !isLayout( order ) ) {
throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) );
Expand All @@ -75,7 +77,14 @@ function dlaswp( order, N, A, LDA, k1, k2, IPIV, incx ) {
} else {
return A;
}
return base( order, N, A, LDA, 1, 0, k1, k2, inc, IPIV, 1, io );
if ( order === 'column-major' ) {
sa1 = 1;
sa2 = LDA;
} else { // order === 'row-major'
sa1 = LDA;
sa2 = 1;
}
return base( order, N, A, sa1, sa2, 0, k1, k2, inc, IPIV, incx, io );
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"order": "column-major",

"A_mat": [
[ 1.0, 4.0 ],
[ 2.0, 5.0 ],
[ 3.0, 6.0 ]
],
"N": 2,
"LDA": 12,
"strideA1": 1,
"strideA2": 12,
"offsetA": 0,
"A": [
1.0,
2.0,
3.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
4.0,
5.0,
6.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0
],

"k1": 0,
"k2": 2,
"incK": 1,

"IPIV": [ 2, 0, 1 ],
"strideIPIV": 1,
"offsetIPIV": 0,

"interchanges": [
[ 0, 2 ],
[ 1, 0 ],
[ 2, 1 ]
],

"A_out_mat": [
[ 2.0, 5.0 ],
[ 1.0, 4.0 ],
[ 3.0, 6.0 ]
],
"A_out": [
2.0,
1.0,
3.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
5.0,
4.0,
6.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0,
9999.0
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"order": "row-major",

"A_mat": [
[ 1.0, 2.0 ],
[ 3.0, 4.0 ],
[ 5.0, 6.0 ]
],
"N": 2,
"LDA": 4,
"strideA1": 4,
"strideA2": 1,
"offsetA": 0,
"A": [
1.0,
2.0,
9999.0,
9999.0,
3.0,
4.0,
9999.0,
9999.0,
5.0,
6.0,
9999.0,
9999.0
],

"k1": 0,
"k2": 2,
"incK": 1,

"IPIV": [ 2, 0, 1 ],
"strideIPIV": 1,
"offsetIPIV": 0,

"interchanges": [
[ 0, 2 ],
[ 1, 0 ],
[ 2, 1 ]
],

"A_out_mat": [
[ 3.0, 4.0 ],
[ 1.0, 2.0 ],
[ 5.0, 6.0 ]
],
"A_out": [
3.0,
4.0,
9999.0,
9999.0,
1.0,
2.0,
9999.0,
9999.0,
5.0,
6.0,
9999.0,
9999.0
]
}
Loading