Re: [ojAlgo-user] Interface analogous to Numpy?
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Bruno D. <ab...@ma...> - 2012-04-21 11:01:57
|
Dear Anders Peterson and Stefan Richthofer, let's first establish the feasibility of Jumpy before really starting the project. The problems I've seen so far -- thanks also to Stefan -- are: - unsigned long ist not supported. BigInteger as a replacement would be much too slow because of the many boxed heap object allocations (mentioned, for example, in Bloch, Effective Java, Item 49: Prefer primitive types to boxed primitives). How often are unsigned longs used in Numpy? - Java arrays (and, sadly, Collections as well) have a maximum length of Integer.MAX_VALUE which is specified as 2^31 - 1. Numpy arrays, on the other hand, can be much larger. If we use a 1-dimensional array with strides in Jumpy, this would limit our quadratic matrices to only 46340 rows in Java. But the design of Numpy is seriously tied to this underlying 1-dimensional array implementation, and applications might allocate larger ndarrays than we can provide. - We cannot support the Array interface (__array_interface__, __array_struct__) for interfacing C libraries and the ctypes foreign function interface of Python. How often are they used in Numpy applications, in particular Machine Learning applications? - I'm not sure whether Numpy applications sometimes need to perform casts of the contained data array to a different kind of array without copying, e.g. from int[] to byte[] with 4 times the size or vice versa. This could not be supported in Java. And please forgive me for asking this question: Are there any benchmarks comparing ojAlgo to C/Fortran/C++ Linear Algebra libraries, e.g. Eigen (see http://eigen.tuxfamily.org/index.php?title=Benchmark )? Best regards Bruno Daniel Anders Peterson wrote: > I created a module ExtNumPy in the already existing SVN repository. (Actually tried switching to Git but couldn't get it working.) You'll have to give me your Google user names if you want commit rights to that repository. /Anders > > On 20 apr 2012, at 16:32, Bruno Daniel wrote: > >> Dear Stefan, >> >>> I'm not sure, how jython deals with it. Can it map field-access in python-code to getter/setter methods on java-side? If not, numpy-python code would run only with an additional preprocessing. >>> If you don't know, I would offer to check this out. >> >> You can always use properties in Python. It's explained here, for example: >> http://bytebaker.com/2009/03/31/python-properties-vs-java-access-modifiers/ >> >>> The rest of your post sounds good to me after a first view, although I must admit, that I only used rather basic numpy-stuff yet. For instance I very rarely used reshaping and never used striding, so I might lack enough experience to see problems in your approach. >> >> Reshaping and striding are seldom used explicitly by the users, but very often >> implicitly. >> >> Best regards >> Bruno Daniel >> >> Stefan Richthofer wrote: >>>> There are many fields which are all public. We could replace them by set- >>>> and >>>> get methods in the adapter. >>> >>> I'm not sure, how jython deals with it. Can it map field-access in python-code to getter/setter methods on java-side? If not, numpy-python code would run only with an additional preprocessing. >>> If you don't know, I would offer to check this out. >>> >>> The rest of your post sounds good to me after a first view, although I must admit, that I only used rather basic numpy-stuff yet. For instance I very rarely used reshaping and never used striding, so I might lack enough experience to see problems in your approach. >>> >>> cheers >>> >>> Stefan >>> -- >>> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir >>> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de >>> >>> ------------------------------------------------------------------------------ >>> For Developers, A Lot Can Happen In A Second. >>> Boundary is the first to Know...and Tell You. >>> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! >>> http://p.sf.net/sfu/Boundary-d2dvs2 >>> _______________________________________________ >>> ojAlgo-user mailing list >>> ojA...@li... >>> https://lists.sourceforge.net/lists/listinfo/ojalgo-user >> >> ------------------------------------------------------------------------------ >> For Developers, A Lot Can Happen In A Second. >> Boundary is the first to Know...and Tell You. >> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! >> http://p.sf.net/sfu/Boundary-d2dvs2 >> _______________________________________________ >> ojAlgo-user mailing list >> ojA...@li... >> https://lists.sourceforge.net/lists/listinfo/ojalgo-user >> >> > > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |