[CLN-list] internal error has been reached
Richard B. Kreckel
kreckel at ginac.de
Fri Mar 28 08:54:46 CET 2014
Hi Michael,
On 03/28/2014 04:25 AM, Michael Miller wrote:
> FYI - when I run the code
>
> ====================
> #include <cln/cln.h>
> using namespace std;
> using namespace cln;
> const cl_univpoly_complex_ring CZ = find_univpoly_ring(cl_C_ring);
> struct parameter { cl_UP_N& p; };
>
> parameter InitializeParameter(int n) {
> const cl_UP_N Z1 = CZ->monomial(1, 1);
> const cl_UP_N Z0 = CZ->monomial(1, 0);
> cl_R beta=random_F(cl_float(2));
> cl_UP_N p=Z1-beta*Z0;
> parameter param={p};
> return param;
> }
>
> int main(void) {
> default_float_format=float_format(200);
> parameter initparam=InitializeParameter(3);
> cout << initparam.p << "\n";
> }
> ===================
>
> I get the error message and output
>
> -------------------
> terminate called after throwing an instance of 'cln::notreached_exception'
> what(): Internal error: statement in file
> float/output/cl_F_dprint.cc, line 464 has been reached!!
> Please send the authors of the program a description how you produced
> this error!
> 1*x +
> -1.36062836991623237822723027868985516363623132879821473160126387357647155893917339260414115079493220011187343026833144928737100377766266870510325749056188223177423109599205862683403974607609610401462854382538584223Aborted
>
> ---------------------
Sorry for having mislead you: I shouldn't have pointed out the reference
declaration as cl_UP_N& p.
The thing is that, for efficiency, cl_UP_N itself works like a pointer
to the real polynomial when copying. So, you can safely remove the
ampersand in the definition of parameter's member variable p and your
program should work.
Best regards
-richy.
--
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>
More information about the CLN-list
mailing list