how to locate arrays in CLN library
Hi, I'd like to to work with fields of complex numbers of high precision using the CLN library. I can't successfuly allocate the memory using memalloc however. I tired few possibilities, but nothing worked. There is no notice about this topic in manual or in mail discussion, so it seems to be straightforward. But I have no idea how to do it. Thanks for a help Breta Sopik
Hi, sopik@fzu.cz wrote:
I'd like to to work with fields of complex numbers of high precision using the CLN library. I can't successfuly allocate the memory using memalloc however. I tired few possibilities, but nothing worked. There is no notice about this topic in manual or in mail discussion, so it seems to be straightforward. But I have no idea how to do it.
I'm not sure what you are trying to do, but working with complex numbers is straightforward. This is C++ and you should rely on the power of constructors/destructors and, if necessary, use new/delete for memory management, instead of malloc/free. Here is a working mini-example: #include <cln/cln.h> #include <iostream> using namespace std; using namespace cln; int main() { cl_N x = -4; cl_N sqrt_x = sqrt( x ); if ( sqrt_x == complex( 0, 2 ) ) { cout << "See, it works!" << endl; } } If this doesn't help, please post some example code. Best wishes -rbk. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>
participants (2)
-
Richard B. Kreckel
-
sopik@fzu.cz