Add ContourletOperators subpackage wrapping Contourlets.jl - #46
Draft
hakkelt wants to merge 5 commits into
Draft
Conversation
Benchmark Results (Julia v1.12.7)No significant performance or memory regressions detected. Time benchmarks
Memory benchmarks
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #46 +/- ##
=======================================
Coverage 90.13% 90.13%
=======================================
Files 51 51
Lines 3678 3678
=======================================
Hits 3315 3315
Misses 363 363 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Adds ContourletOp and NSCTOp linear operators wrapping the discrete Contourlet Transform and Nonsubsampled Contourlet Transform from Contourlets.jl, following the existing subpackage pattern (WaveletOperators, FFTWOperators, DSPOperators, NFFTOperators). Coefficients (coarse band + directional subbands) are exposed as a flat RecursiveArrayTools.ArrayPartition codomain, matching this repo's HCAT/DCAT multi-component convention. Each operator owns a preallocated Contourlets.ContourletWorkspace and coefficient buffer, so forward and adjoint mul! reuse scratch memory across calls instead of allocating per call; a threading keyword exposes Contourlets.jl's ThreadingPolicy (Auto/Enabled/Disabled) to control the directional filter bank stage. With the default biorthogonal (CDF97/Q2345) filters neither transform is self-adjoint, so the adjoint operator is wired to the declared inverse transform (a perfect-reconstruction left inverse) rather than the literal linear-algebra transpose; documented on both operator types, and covered by round-trip/in-place tests instead of the usual adjoint dot-product invariant test. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SUAy2tC1kyndjCrhNfZdoc
Fixes 'expected package ContourletOperators to be registered' failure on the LTS matrix job — it wasn't in the rm/develop lists alongside the other local subpackages.
hakkelt
force-pushed
the
add-contourlet-operators
branch
from
August 25, 2026 19:15
c9c9783 to
ce27237
Compare
similar_coefficients was using the raw requested T instead of the promoted Td that make_workspace already computes internally, causing a MethodError on the first mul! whenever T was narrower than the params' filter precision. Also unify ContourletOp/NSCTOp into a single ContourletTransformOp struct distinguished by a Kind trait, removing the ~110-line duplication between the two operators. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016vzNfSioXkuA1P84Y7BzzP
…IDCT convention The runtime Kind-field + const-alias approach diverged from the codebase's established pattern for near-duplicate transform pairs (FFTWOperators' DCT/IDCT: one abstract supertype for shared traits, two separate concrete structs for the rest). Switch to that pattern instead: ContourletTransform carries size/domain_type/codomain_type/is_invertible/is_thread_safe once, while ContourletOp/NSCTOp keep their own constructors, dispatch barriers, mul! pairs, and fun_name. Drops the fun_name/kind-field indirection and the confusing ContourletTransformOp name (it backed NSCT too). Behavior and public API unchanged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016vzNfSioXkuA1P84Y7BzzP
Adds an array_type constructor keyword (mirrors WaveletOp) so domain_array_type/
codomain_array_type report GPU storage. Contourlets.jl itself stays CPU-only (FFTW
plans, scalar filter-bank loops), so mul! stages x/y through an internal CPU buffer
(copyto! in, run the CPU transform, copyto! out) instead of executing on-device.
Verified on real CUDA hardware (Quadro RTX 6000): exact forward/adjoint round-trip
with array_type = CuArray{Float64}. Extended test_jet.jl's @test_call coverage for
the new array_type kwarg.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016vzNfSioXkuA1P84Y7BzzP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
ContourletOperatorssubpackage:ContourletOp/NSCTOpwrapping Contourlets.jl (Contourlet Transform and NSCT) asLinearOperators.