Oskar,

I think you are probably right there.  Of course that code is never
executed in practice since the way the code is organised this function
is only called when disc is negative, but of course that is not going
to keep the compiler happy.  So the line

return to_bigfloat(0);

should be replaced by

return bigcomplex(to_bigfloat(0));

or similar.

Feel free to try that out, and I will patch my code accordingly.

John

2008/5/6 Oskar45 <[EMAIL PROTECTED]>:
>
>  Hi John,
>
>  thanks for your answer. Maybe it's of no relevance for the described
>  problem but I noticed the following anyway:
>
>  In procs/interface.h, I have
>
>  ...
>  #include <NTL/RR.h>
>  #define bigfloat RR
>  ...
>  #include <complex>
>  typedef complex<RR> CC;
>  #define bigcomplex CC
>  ...
>  inline RR to_bigfloat(const int& n) {return to_RR(n);}
>  inline RR to_bigfloat(const long& n) {return to_RR(n);}
>  inline RR to_bigfloat(const double& x) {return to_RR(x);}
>
>  In procs/cubic.cc, I have
>
>  bigcomplex cubic::hess_root() const
>  {
>   bigfloat discr = I2bigfloat(disc());
>   if(!is_positive(disc()))
>     {
>       cout<<"Error: hess_root called with negative dicriminant!\n";
>       return
>  to_bigfloat(0);                                                            //
>  <---- this is where the problem is
>     }
>   bigfloat P = I2bigfloat(p_semi());
>   bigfloat Q = I2bigfloat(q_semi());
>   bigfloat delta = sqrt(3*discr);
>   bigcomplex gamma(-Q,delta); gamma/=(2*P);
>   return gamma;
>  }
>
>  Could it be that the issue arises because a bigfloat is returned
>  instead of a bigcomplex?
>
>  Thanks.
>  /oskar
>
>
>
>  On May 3, 10:59 pm, "John Cremona" <[EMAIL PROTECTED]> wrote:
>  > Well, as the author of eclib I hope I can help.  It is a C++ library.
>  > It uses the NTL library, whcih includes a multiprecision real number
>  > type called RR.  MTL does not have multiprecision complexes, so
>  > implement those using RR for the real and imaginary parts, and a
>  > standard C++ library template fto get a complex<RR> type;  that needs
>  > some additional functionality which is provided in eclib.
>  >
>  > Before Sage, I had only even compiled any of this using gcc.  My guess
>  > is that whatever templates your system provides for complexes is not
>  > working properly, or something else to do with template classes.
>  >
>  > Maybey mabshoff or someone else has some ideas on how to proceed
>  >
>  > John Cremona.
>  >
>  > 2008/5/3 Oskar45 <[EMAIL PROTECTED]>:
>
>
> >
>  >
>  >
>  >
>  >
>  > >  Hi everyone,
>  >
>  > >  am trying to get sage-2.11 running under the officially unsupported
>  > >  [!!!]
>  > >  Irix 6.5.30 with MipsPro 7.4.4 [my box is an SGI Fuel/R16000]. Up to
>  > >  now,
>  > >  after battling a few inconsistencies, I got GMP, PARI and NTL
>  > >  installed.
>  > >  However, I now got stuck with the compilation of <eclib-20080310.p0>.
>  > >  As
>  > >  Michael had suggested to me in private conversation, I'm posting to
>  > >  the list
>  > >  nevertheless hoping someone has a clue regarding my problem so I can
>  > >  continue:
>  >
>  > >  cc-1262 CC: ERROR File = /usr/include/CC/complex, Line = 55
>  > >   No instance of constructor "NTL::RR::RR" matches the argument list.
>  >
>  > >             The argument types are:  (int).
>  > >       : _M_re(__x), _M_im(0) {}
>  > >                           ^
>  > >           detected during instantiation of
>  > >                     "std::complex<NTL::RR>::complex(const
>  > >                     std::complex<NTL::RR>::value_type &)" at line 172
>  > >  of
>  > >                     "cubic.cc"
>  >
>  > >  1 error detected in the compilation of "cubic.cc".
>  > >  gmake[1]: *** [cubic_n.o] Error 2
>  > >  gmake[1]: Leaving directory `/disk03/mephisto/source/sage-2.11/spkg/
>  > >  build/eclib-20080310.p0/src/procs'
>  >
>  > >  All your help is certainly appreciated.
>  >
>  > >  Best regards,
>  > >  /oskar- Hide quoted text -
>  >
>  > - Show quoted text -
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to