<div class="gmail_quote">On Wed, Jun 15, 2011 at 19:05, Xiang Hao <span dir="ltr"><<a href="mailto:haoxiang@yahoo.cn">haoxiang@yahoo.cn</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Now, I have a problem when I try to change the above to a c++ version(I want to use a class).</blockquote></div><div><br></div>Set the class pointer as the application context and use a simple wrapper:<div><br></div><div>
MatMult_Wrapped(Mat A,Vec X,Vec Y) {</div><div> TheClass *cls;</div><div> MatShellGetContext(A,&cls);</div><div> return cls->matmult(A,X,Y);</div><div>}</div>