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
 MATREPL_TEST_LESSTHAN compiling error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

thamizh

India
3 Posts

Posted - 03/04/2013 :  04:45:13 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

thamizh

India
3 Posts

Posted - 03/05/2013 :  12:06:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

Penn

China
644 Posts

Posted - 03/05/2013 :  01:56:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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