gmp

numpy array with mpz/mpfr values

流过昼夜 提交于 2020-01-14 10:33:16
问题 I want to have a numpy array with mpz/mpfr values. Because my code: import numpy as np import gmpy2 A=np.ones((5,5)); print A/gmpy2.mpfr(1); generates: RuntimeWarning: invalid value encountered in divide print A/gmpy2.mpfr(1); [[1.0 1.0 1.0 1.0 1.0] [1.0 1.0 1.0 1.0 1.0] [1.0 1.0 1.0 1.0 1.0] [1.0 1.0 1.0 1.0 1.0] [1.0 1.0 1.0 1.0 1.0]] Which as I can understand is the impossibility to convert gmpy mpfr to numpy float64. So how can I get a numpy array with mpfr values in the first place?

python 'bigfloat' package installation issues

半腔热情 提交于 2020-01-10 16:59:09
问题 I'm trying to get the package 'bigfloat' installed on my Mac (OS X 10.8.4), and I'm running into some issues. The package 'bigfloat' requires two other dependencies: 1) mpfr, and 2) gmp. I've installed gmp here: http://gmplib.org/ <-- This seemed to work fine. But installing mpfr is not as easy (http://www.mpfr.org/mpfr-current/mpfr.html#Installing-MPFR). They say to simply ./configure, make, and make install to get it going, but I get this error: checking for gmp.h... no configure: error:

Linking problems for GMP to GCC during cross compilation

天涯浪子 提交于 2020-01-07 03:05:52
问题 Following this How To Build GCC 4.8.2 ARM Cross-Compiler, I have successfully installed everything. But GMP linkage to GCC isn't done there for which I referred to this tutorial- shown below mkdir $BUILDDIR/gmp cd $BUILDDIR/gmp export CFLAGS=-static ../../sources/gmp-4.3.2/configure \ --build=$BUILDMACH \ --host=$TARGETMACH \ --prefix=$INSTALLDIR \ --disable-shared make make install When I try to configure, this is what happens: checking build system type... i686-pc-linux-gnu checking host

PHP Configuration for GMP and Large Number Arithmetic

依然范特西╮ 提交于 2020-01-06 02:38:10
问题 I'm using PHP to do some of the problems on projecteuler.net, but I have found that with my current installation of PHP, I cannot compute numbers long or large enough to do some of the problems. Some initial research on Stackoverflow and through Google has told me that I must install an extension to PHP in order to do math with very large numbers. One such extension that was suggested is GMP, but I am not entirely sure how to configure my PHP installation to use GMP. I am currently running

scala use of GMPUtil for pidigits

我怕爱的太早我们不能终老 提交于 2020-01-04 11:07:10
问题 Rex Kerr has posted info about using GMP with scala, in particular to run the pidigits program. libjpargmp.so is generated using GmpUtil.c My question is: where do I find GMPUtil.c? My google searches haven't turned up anything. Regards, Doug 回答1: Posting on the Alioth computer languages benchmark game forum would more likely yield an answer than posting here. However, in this case you've gotten lucky (though I don't know if this is exactly an appropriate use of StackOverflow). GmpUtil.h: /*

Building a C library (GMP) for arm64 iOS

回眸只為那壹抹淺笑 提交于 2020-01-03 12:13:42
问题 I'm trying to build a C library (GMP 6.0.0) for arm64 for use on iOS. I'm running the configure script with the invocation below (compiler is as found using xcrun --find). ./configure \ CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" \ CPP="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -E" \ CPPFLAGS="-target arm64-apple-darwin -isysroot /Applications/Xcode.app/Contents/Developer/Platforms

Getting GMP to work with GCC 4.5.2

假装没事ソ 提交于 2020-01-02 09:57:13
问题 I'm trying to make a cross compiler with the files from http://crossgcc.rts-software.org/doku.php?id=i386linuxgccformac I'm on an Intel Mac (10.6.6, x86_64) I compiled: gmp, mpfr, mpc for the cross compiler as 32bit (as I'm on a 64bit Mac) but I'm getting ld: warning: option -s is obsolete and being ignored ld: warning: ignoring file /gmp1/lib/libmpc.dylib, file was built for unsupported file format which is not the architecture being linked (i386) ld: warning: ignoring file /gmp1/lib/libmpfr

How do you write a bigint library / how does libgmp work?

两盒软妹~` 提交于 2019-12-31 00:36:43
问题 I'm aware of a number of BigInt libraries for C on various platforms and how to use them but I'm intrigued: how do they work? How would I go about building my own library (I'm not going to try, no point re-inventing the wheel but I'm interested in how it might happen)? Can anyone point me towards tutorials etc that might explain the procedure / the basics? Thanks, Ninefingers. 回答1: I found that this wasn't a bad overview. However, if you want something more in depth (and almost guaranteed to

Compiling C Library for iOS 9 From Command Line, Xcode 7-beta 2

こ雲淡風輕ζ 提交于 2019-12-30 07:31:43
问题 I am having trouble compiling a C library (gmp) for iOS 9 using the latest Xcode 7-beta clang. I am trying to produce bitcode to get all the warnings in Xcode to stop (and I would like to produce these libraries in bitcode). However, I can't even compile the library in the first place. ./configure fails, and after looking at the config.log, it seems ld is the problem as it is failing with "ld: library not found for -lSystem". Here is the command I have used to compile gmp in the past : .

Installing GMP on Windows with cygwin

瘦欲@ 提交于 2019-12-30 05:24:08
问题 I am new to C++ and I have to handle large integers, so I have to install GMP through Cygwin. Any documentation I can find on installing this already assumes that you know what you are talking about, and I really don't. Anyway, I got the right .tar or whatever, extracted it properly, and now any website I see says to run ./configure --prefix=${gmp_install} ... What in the world is gmp_install ? And what directory do I run configure from? Huh? I can run it from my little Cygwin terminal, but