Author |
Topic |
|
thamizh
India
3 Posts |
Posted - 03/04/2013 : 04:45:13 AM
|
Origin Ver.8.6 and Service Release 2 (Select Help-->About Origin): Operating System:Windows XP
When I tried to use this Folowing function,
thamizh.Replace(1.0e-7, 0, MATREPL_TEST_LESSTHAN | MATREPL_USE_ABSOLUTE_VALUE_IN_TEST);
I get the compiling error: "Error, Incompatible variable types in expression"
I have been using this function since Origin 7.5 in those cases I did not get this error.
Can anyone help how to get rid this compilation error..?
Let me thank you in advance,
Best, Thamizhavel. |
|
Penn
China
644 Posts |
Posted - 03/04/2013 : 9:25:37 PM
|
Hi Thamizhavel,
With just your one line code, I declare thamizh as matrix or vector, neither has the compilation error in Origin 8.6. Better that you can provide the whole code for compilation.
Penn |
|
|
thamizh
India
3 Posts |
Posted - 03/05/2013 : 12:06:33 AM
|
Hi Penn
Thanks for your reply. yes you are correct, I have already declared thamizh as a matrix. The code is too long to post here. I am posting a part of my code where I get the error message:
Part of my code goes like this:
int n; n = 6;
double tda, tdv; tda = n; tdv = n;
matrix dcef; dcef.SetSize(n, n);
matrix thamizh; thamizh.SetSize(n, n);
vector valsz; NagError err; nag_real_symm_eigensystem(n, dcef, tda, valsz, thamizh, tdv, &err); thamizh.Transpose(); thamizh.Replace(1.0e-7, 0, MATREPL_TEST_LESSTHAN | MATREPL_USE_ABSOLUTE_VALUE_IN_TEST);
I am getting the compiling error for the line :
"thamizh.Replace(1.0e-7, 0, MATREPL_TEST_LESSTHAN | MATREPL_USE_ABSOLUTE_VALUE_IN_TEST);"
The compilation error message: "Error, Incompatible variable types in expression"
This code was compiling without any problem for Origin 8. For origin 8.6 it is not compiling
- Thamizhavel.
|
|
|
Penn
China
644 Posts |
Posted - 03/05/2013 : 01:56:22 AM
|
Hi Thamizhavel,
The code you provided works fine, here is how I use your code:
#include <origin.h>
#include <oc_nag.h>
void test_replace()
{
int n;
n = 6;
double tda, tdv;
tda = n;
tdv = n;
matrix dcef;
dcef.SetSize(n, n);
matrix thamizh;
thamizh.SetSize(n, n);
vector valsz;
NagError err;
nag_real_symm_eigensystem(n, dcef, tda, valsz, thamizh, tdv, &err);
thamizh.Transpose();
thamizh.Replace(1.0e-7, 0, MATREPL_TEST_LESSTHAN | MATREPL_USE_ABSOLUTE_VALUE_IN_TEST);
}
You can try to see whether it is fine or not.
Penn |
|
|
|
Topic |
|
|
|