martinResearch / MatlabAutoDiff

A matlab implementation of forward automatic differentiation with operator overloading and sparse jacobians
BSD 3-Clause "New" or "Revised" License
39 stars 12 forks source link

repmat in 3rd dim #10

Closed jamesascham closed 2 years ago

jamesascham commented 2 years ago

Hi Martin,

I detected an issue, mwe:

a = AutoDiff(ones(3,3)); b = 100; c = repmat(a, 1, 1, b);

as input to sparse must be 2D.

Whereas,

a = ones(3,3); b = 100; c = repmat(a, 1, 1, b);

works fine.

Kind regards, James

martinResearch commented 2 years ago

Hi James,

thank you for spotting the problem. Commited a fix to main branch https://github.com/martinResearch/MatlabAutoDiff/commit/b396201494897d45e69770f018d0e69612fb2732 please let me know if that solves you problem