Skip to content

Commit 5535944

Browse files
lucascolleyjorenham
authored andcommitted
BUG: missing complex lqmn derivates when |z|<1.001
1 parent 3a0b8a5 commit 5535944

File tree

3 files changed

+43
-9
lines changed

3 files changed

+43
-9
lines changed

.github/workflows/format.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Format
2+
3+
on: [ push, pull_request ]
4+
5+
permissions:
6+
contents: read # to fetch code (actions/checkout)
7+
8+
env:
9+
CCACHE_DIR: "${{ github.workspace }}/.ccache"
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
format:
17+
name: Check formatting
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
environment: [lint]
23+
steps:
24+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25+
- uses: prefix-dev/setup-pixi@92815284c57faa15cd896c4d5cfb2d59f32dc43d # v0.8.3
26+
with:
27+
pixi-version: v0.48.2
28+
cache: true
29+
environments: ${{ matrix.environment }}
30+
- name: Check for formatting violations
31+
run: |
32+
pixi run format-dry-error
33+
echo "Please execute 'pixi run format' to fix any errors."

include/xsf/legendre.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,17 +1046,17 @@ void lqmn(std::complex<T> z, OutputMat1 cqm, OutputMat2 cqd) {
10461046
cq1 = cqf;
10471047
}
10481048
}
1049+
}
10491050

1050-
cqd(0, 0) = static_cast<T>(ls) / zs;
1051-
for (j = 1; j <= n; j++) {
1052-
cqd(0, j) = ls * static_cast<T>(j) * (cqm(0, j - 1) - z * cqm(0, j)) / zs;
1053-
}
1051+
cqd(0, 0) = static_cast<T>(ls) / zs;
1052+
for (j = 1; j <= n; j++) {
1053+
cqd(0, j) = ls * static_cast<T>(j) * (cqm(0, j - 1) - z * cqm(0, j)) / zs;
1054+
}
10541055

1055-
for (i = 1; i <= m; i++) {
1056-
for (j = 0; j <= n; j++) {
1057-
cqd(i, j) = static_cast<T>(ls * i) * z / zs * cqm(i, j) +
1058-
static_cast<T>((i + j) * (j - i + 1)) / zq * cqm(i - 1, j);
1059-
}
1056+
for (i = 1; i <= m; i++) {
1057+
for (j = 0; j <= n; j++) {
1058+
cqd(i, j) = static_cast<T>(ls * i) * z / zs * cqm(i, j) +
1059+
static_cast<T>((i + j) * (j - i + 1)) / zq * cqm(i - 1, j);
10601060
}
10611061
}
10621062
}

pixi.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ clang-format = "*"
7474

7575
[feature.clang-format.tasks]
7676
format = "git ls-files '*.cpp' '*.h' | xargs clang-format -i --style=file"
77+
format-dry-error = "git ls-files '*.cpp' '*.h' | xargs clang-format --style=file --Werror --dry-run"
7778

7879
## Coverage
7980

0 commit comments

Comments
 (0)