<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div>   There is a bug in the design of MATLRC, it should have a <span style="font-family: Menlo; font-size: 14px; font-variant-ligatures: no-common-ligatures; color: rgb(180, 36, 25);"><b>MatLRCS</b></span><span style="font-family: Menlo; font-size: 14px; font-variant-ligatures: no-common-ligatures;">etMats(</span>) that takes Mat U, Vec c, Mat V.  <div><br><div>   Then the convenience constructor MatCreateLRC() would call this method so no code duplication.</div><div><br></div><div>   Your code would then properly be </div><div><br></div><div>   </div><div>  TSComputeIJacobian(ts, ..., A0, B, ...)</div><blockquote type="cite"><div dir="ltr"><div>  MatSetType(A0, MATLRC)</div></div></blockquote><div><blockquote type="cite"><div dir="ltr">  MatLRCSetMats(A0, U, NULL, V)</div></blockquote><div><br></div>  convenience constructors should NEVER be the only way to get data into an object. That "need the information when you instantiate the object" model of OOP is horrible and sadly kind of tied into some languages OOP model. We don't do this. </div><div><br></div><div>  Just fix the MATLRC API.</div><div><br></div><div>  Barry</div><div><br></div><div><div><br><blockquote type="cite"><div>On Apr 11, 2023, at 1:34 PM, Matthew Knepley <knepley@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr">I want to modify the Jacobian inside an IJacobian call. Right now I just have<div><br></div><div>  TSComputeIJacobian(ts, ..., A, B, ...)</div><div><br></div><div>but I want to do</div><div><br></div><div>  TSComputeIJacobian(ts, ..., A0, B, ...)</div><div>  MatCreateLRC(A0, U, NULL, V, &A)</div><div><br></div><div>However, the MatCreateLRC() needs a Mat *, so what I really want is to do something like</div><div><br></div><div>  TSComputeIJacobian(ts, ..., A, B, ...)<div>  MatCreateLRC(A, U, NULL, V, &Anew)</div><div>  <copy implementation of Anew into A><br></div><div><br></div><div>Isn't there a function for this?</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div></div>
</div></blockquote></div><br></div></div></body></html>