forum.alglib.net

ALGLIB forum
It is currently Thu Mar 28, 2024 8:24 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: How to use in c++ the function rmatrixlu, it doesn't work
PostPosted: Tue Feb 01, 2022 12:18 pm 
Offline

Joined: Tue Feb 01, 2022 12:03 pm
Posts: 4
Hello, I'm trying to using alglib in c++. But I haven't get use it. I'm trying use the function rmatrixl.

Firstly I have added the src folder to my copilator. (Dev-C++) And then, I have added the files .h to my .cpp file, using include: #include "....h" with all files .h. And I have written :

void alglib::rmatrixlu(A,n,n,p,const xparams _params = alglib::xdefault);

When A is my initial matrix, n is its dimension , and p is a one dimension vector with dimension n. But it doesn't work. It say :

[Error] qualified-id in declaration before '(' token

Can you help me, please??


Top
 Profile  
 
 Post subject: Re: How to use in c++ the function rmatrixlu, it doesn't wor
PostPosted: Wed Feb 02, 2022 11:48 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 903
Hi!

It should be
Code:
alglib::rmatrixlu(A,n,n,p);


Top
 Profile  
 
 Post subject: Re: How to use in c++ the function rmatrixlu, it doesn't wor
PostPosted: Thu Feb 03, 2022 7:25 pm 
Offline

Joined: Tue Feb 01, 2022 12:03 pm
Posts: 4
Thank you

But now I have other problem, There is other error :

I have written :

int main(){
double A[2][2]={{1.,2.},{3.,4.}};
int p[2];
int n=2;

alglib::rmatrixlu(A,n,n,p);
}

But it's say [Error] invalid initialization of reference of type 'alglib::real_2d_array&' from expression of type 'double[2][2]'

How could it be solve??


Top
 Profile  
 
 Post subject: Re: How to use in c++ the function rmatrixlu, it doesn't wor
PostPosted: Thu Feb 03, 2022 9:33 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 903
Code:
alglib::real_2d_array A="[[1,2],[3,4]]";


Top
 Profile  
 
 Post subject: Re: How to use in c++ the function rmatrixlu, it doesn't wor
PostPosted: Sat Feb 05, 2022 5:42 pm 
Offline

Joined: Tue Feb 01, 2022 12:03 pm
Posts: 4
Thank you, but I have other mistake,

I have written:

int main(){

alglib::real_2d_array A="[[1,2],[3,4]]";
alglib::ae_int_t n="2";
alglib::integer_1d_array p="";

alglib::rmatrixlu(A,n,n,p);

}

But it's says: [Error] invalid conversion from 'const char* to 'alglib::ae_int_t'{aka 'long long int'} [-fpermissive]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 57 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group