# Changeset 0e760d0 in git

Ignore:
Timestamp:
Jul 2, 1999, 6:14:41 PM (24 years ago)
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
Parents:
78315991a696a660dd3d43059499d754ccf8c669
Message:
```* wenk: did some changes in floatToStr; removed TIMING

Location:
Singular
Files:
5 edited

Unmodified
Removed
• ## Singular/LIB/solve.lib

 r7831599 /////////////////////////////////////////////////////////////////////////////// version="\$Id: solve.lib,v 1.6 1999-07-02 14:33:45 wenk Exp \$"; version="\$Id: solve.lib,v 1.7 1999-07-02 16:14:41 wenk Exp \$"; info=" LIBRARY: solve.lib     PROCEDURES TO SOLVE POLYNOMIAL SYSTEMS // now with complex coefficient field, precision is 10 digits ring rsc= (real,10,I),(x,y),lp; ideal i = x2 + y2 - 8, x2 + xy + 2y2; ideal i = (2+3*I)*x2 + (0.35+I*45.0e-2)*y2 - 8, x2 + xy + (42.7)*y2; ures_solve(i); // result is a list of (x,y)-coordinates of complex numbers // Now with complex coefficients, precision is 20 digits: ring rsc= (real,20,I),x,lp; poly f = (15+I*5)*x^5 + (0.25+I*2)*x^3 + x2 - 10*I; poly f = (15.4+I*5)*x^5 + (25.0e-2+I*2)*x^3 + x2 - 10*I; list l = laguerre_solve(f); l;
• ## Singular/gnumpc.cc

 r7831599 *  Computer Algebra System SINGULAR     * ****************************************/ /* \$Id: gnumpc.cc,v 1.4 1999-07-02 14:28:51 Singular Exp \$ */ /* \$Id: gnumpc.cc,v 1.5 1999-07-02 16:14:38 wenk Exp \$ */ /* * ABSTRACT: computations with GMP complex floating-point numbers /*2 * za >= 0 ? * za >= 0 ? ( real() > 0 || imag() > 0 ) */ BOOLEAN ngcGreaterZero (number a) { return TRUE; if ( a == NULL ) return TRUE; return ( ((gmp_complex*)a)->real().sign() > 0 || ((gmp_complex*)a)->imag().sign() > 0 ); } { if ( a == NULL ) return FALSE; return (((gmp_complex*)a)->real().isOne() && ((gmp_complex*)a)->imag().isZero()); //return (((gmp_complex*)a)->real().isOne() && ((gmp_complex*)a)->imag().isZero()); return (((gmp_complex*)a)->real().isOne()); } { if ( a == NULL ) return FALSE; return (((gmp_complex*)a)->real().isMOne() && ((gmp_complex*)a)->imag().isZero()); //  return (((gmp_complex*)a)->real().isMOne() && ((gmp_complex*)a)->imag().isZero()); return (((gmp_complex*)a)->real().isMOne()); }
• ## Singular/gnumpfl.cc

 r7831599 *  Computer Algebra System SINGULAR     * ****************************************/ /* \$Id: gnumpfl.cc,v 1.6 1999-07-02 15:01:42 wenk Exp \$ */ /* \$Id: gnumpfl.cc,v 1.7 1999-07-02 16:14:39 wenk Exp \$ */ /* * ABSTRACT: computations with GMP floating-point numbers char *start= s; //Print("%s\n",s); s= ngfEatFloatNExp( s ); if (*s=='\0') if (*s=='\0')  // 0 { if ( *(gmp_float**)a == NULL ) (*(gmp_float**)a)= new gmp_float(); (*(gmp_float**)a)->setFromStr(start); } else if (s==start) else if (s==start)  // 1 { if ( *(gmp_float**)a != NULL )  delete (*(gmp_float**)a); else { if ( *s == '/' ) { } char c=*s; *s='\0'; *s=c; } return s; }
• ## Singular/mpr_complex.cc

 r7831599 *  Computer Algebra System SINGULAR     * ****************************************/ /* \$Id: mpr_complex.cc,v 1.10 1999-07-02 15:01:43 wenk Exp \$ */ /* \$Id: mpr_complex.cc,v 1.11 1999-07-02 16:14:40 wenk Exp \$ */ /* { in_real=floatToStr( c.real(), oprec );         // get real part in_real=floatToStr( c.real(), oprec );         // get real part in_imag=floatToStr( abs(c.imag()), oprec );    // get imaginary part if (rField_is_long_C()) { int len=(strlen(in_real)+strlen(in_imag)+5+strlen(currRing->parameter[0]))*sizeof(char); int len=(strlen(in_real)+strlen(in_imag)+7+strlen(currRing->parameter[0]))*sizeof(char); out=(char*)AllocL(len); memset(out,0,len); if (  !c.real().isZero() ) sprintf(out,"(%s%s%s*%s)",in_real,c.imag().sign()>=0?"+":"-",currRing->parameter[0],in_imag); else sprintf(out,"(%s%s*%s)",c.imag().sign()>=0?"":"-",currRing->parameter[0],in_imag); if (  !c.real().isZero() )  // (-23-i*5.43) or (15.1+i*5.3) sprintf(out,"%s(%s%s%s*%s)",(c.imag().sign()<0&&c.real().sign()<0)?"+":"", in_real,c.imag().sign()>=0?"+":"-",currRing->parameter[0],in_imag); else // +(-i*43) or +(i*34) sprintf(out,"%s(%s%s*%s)",c.imag().sign()>=0?"":"+", c.imag().sign()>=0?"":"-",currRing->parameter[0],in_imag); } else { int len=(strlen(in_real)+strlen(in_imag)+8) * sizeof(char); int len=(strlen(in_real)+strlen(in_imag)+9) * sizeof(char); out=(char*)AllocL( len ); memset(out,0,len); if (  !c.real().isZero() ) sprintf(out,"(%s%s%s)",in_real,c.imag().sign()>=0?"+I*":"-I*",in_imag); sprintf(out,"%s(%s%s%s)",(c.imag().sign()<0&&c.real().sign()<0)?"+":"", in_real,c.imag().sign()>=0?"+I*":"-I*",in_imag); else sprintf(out,"(%s%s)",c.imag().sign()>=0?"I*":"-I*",in_imag); sprintf(out,"%s(%s%s)",c.imag().sign()>=0?"":"+", c.imag().sign()>=0?"I*":"-I*",in_imag); } FreeL( (ADDRESS) in_real );
• ## Singular/mpr_global.h

 r7831599 *  Computer Algebra System SINGULAR     * ****************************************/ /* \$Id: mpr_global.h,v 1.4 1999-06-28 16:06:27 Singular Exp \$ */ /* \$Id: mpr_global.h,v 1.5 1999-07-02 16:14:41 wenk Exp \$ */ /* // to get detailed timigs, define MPR_TIMING #define MPR_TIMING //#define MPR_TIMING // Set to double or long double. double is recomended.
Note: See TracChangeset for help on using the changeset viewer.