Re: [ojAlgo-user] Problem with float-matrix
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Anders P. <an...@op...> - 2010-10-07 20:48:49
|
ojAlgo only supports BigDecimal, ComplexNumber and double matrices. It would be very easy to extend ojAlgo to also support float and/or some other Number subclass, but I have no plans to do so. The recommendation/intention is that you should work either with BasicMatrix or MatrixStore/PhysicalStore - don't mix. If you want to create a BasicMatrix with double elements you do this: BasicMatrix b = PrimitiveMatrix.FACTORY.makeEye(4,4); Where do you get an "error" when you use Float? If you want to work with small matrices (3x3 and 4x4) with float elements maybe you should look at javax.vecmath. https://vecmath.dev.java.net/ ojAlgo is best suited for larger matrices. /Anders On 7 okt 2010, at 21.55, Birgit Doelle wrote: > Hi to all ojaglo-user! > My problem: > I want to do high performance calculations with matrices. For precision is float enough. I found a way to create a double-matrix. > > "MatrixStore<Double> a = PrimitiveDenseStore.FACTORY.makeEye(4,4); " > "BasicMatrix b = new PrimitiveMatrix(a);" > > But how can I create a float-matrix? I know, that there are many factories, which expect a type of Number, like double or float. But if I set Float, I get only errors. > > Nice would be a short tutorial how to deal with float-matrices in ojaglo. I will need functions like add, mult and invert. And the initialization should be possible with a 2-dimensional-float-array, or something like that. > > Thanks for your help > Birgit > > > > > > Neu: WEB.DE De-Mail - Einfach wie E-Mail, sicher wie ein Brief! > Jetzt De-Mail-Adresse reservieren: https://produkte.web.de/go/demail02 > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today. > http://p.sf.net/sfu/beautyoftheweb_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |