The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 pseudoinverse matrix
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

kubra

Slovakia
10 Posts

Posted - 01/26/2017 :  06:25:07 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 9 (Academic), 64-bit
Operating System: win7

Hello

During my calculations I do need to calculate inverse matrices, however, sometimes a pseudoinverse matrix needs to be calculated. When this happens, a pop-up window appears, informing about the fact, that pseudoinverse matrix has to be calculated (X-abort calculation, OK-continue), and the whole calculation is interrupted. I am always OK with this, so is there a way (or C command) to stop this pop up window appearing (like automatic OK response), and just leave code to continue?

Thanks.
Branislav

cpyang

USA
1406 Posts

Posted - 01/26/2017 :  10:10:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can you put down a few lines of code to show?

CP
Go to Top of Page

kubra

Slovakia
10 Posts

Posted - 01/27/2017 :  04:05:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hopefully this will be enough:
//:calculation.//
zaklWeight = field * loess;
zaklTransp = zaklWeight * tField;
BOOL in;
in = LT_execute("minverse im:=[MatrixValues]Fields*Transp om:=[MatrixValues]Inverse;");
inverField = inverse * field;
weighted = inverField *loess;
coef = weighted * signal;

lowercase name is matrix name
(Matrix<double> inverse(inverseMl), Matrix<double> zaklTransp(zaklTranspMl)).
uppercase name is matrix layer name
(int matindex8 = MatrixValuesMp.AddLayer("Inverse"), int matindex7 = MatrixValuesMp.AddLayer("Fields*Transp"))

It works perfectly most of the time, and results seem to be all right. It is only, that sometimes the program stops due to pseudoinverse matrix attention window. I have not noticed problems with values, matrix dimensions.
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 01/27/2017 :  10:37:02 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
from script window, run

ed.open(minverse)

and then you will see the code in the minverse X-function in code builder. As you can see, it simply call the Inverse() method of the matrix class. So your best bet is not to use this X-Function with LT_execute and use the Origin C code directly.

CP

Go to Top of Page

kubra

Slovakia
10 Posts

Posted - 01/30/2017 :  10:14:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for advice, tried it with
zaklWeight = field * loess;
zaklTransp = zaklWeight * tField;
inverse=zaklTransp.Inverse();
inverField = inverse * field;
weighted = inverField *loess;
coef = weighted * signal;

The windows did not show up, however, results of calculations were not right (in fact, all are 0). Is my code wrong (as usual) or am I missing something?
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 01/30/2017 :  11:08:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Without seeing your code, hard to know what was wrong,

did you look up these examples and see if they are usful?

http://www.originlab.com/doc/OriginC/ref/matrixbase-Inverse

CP
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000