Hi, I need fast low dimensional vector (2, 3 and 4 dimension let say). How shall I implement them with boost? Off course ublas is a possibility but I feel it's more designed for higher dimension. Ideally, low dimension vector are better as POD, without any pointer indirection for instance. Maybe there's a way to enforce no indirection with ublas? Off course, boost::array would do the trick but it doesn't have any of the basic arithmetic operators. I could easily add them with the operators library, but maybe there's a better way? And off course, could be great to have POD small matrices as well... I know this request is probably over specialized but maybe I'm missing something already there Thanks, Frank
gtsml owevwr
I need fast low dimensional vector (2, 3 and 4 dimension let say). [snip] Ideally, low dimension vector are better as POD, without any pointer indirection for instance. [snip] And off course, could be great to have POD small matrices as well...
I know this request is probably over specialized but maybe I'm missing something already there
*shrug*, I don't know of anything.
I think every vis and graphics project ends up creating their own
vector class, which is kind of silly when you think about it. Such is
life though.
FWIW, one of the projects I work on uses these classes:
https://gforge.sci.utah.edu/gf/project/basics/scmsvn/?action=browse&path=%2Ftrunk%2FVectors.h&revision=4&view=markup
It's MIT licensed so I imagine you wouldn't have trouble using it.
There's currently a known buglet w/ matrices, but we can't find a
compiler on Linux / Mac / Windows which exhibits the bug.. and I'll fix
it eventually.
Still, you probably want to search around a bit more first. Without
checking, I'd bet all of CrystalSpace, Ogre, VTK, Irrlicht, and
On Fri, May 29, 2009 at 5:49 PM, tom fogal
gtsml owevwr
writes: I need fast low dimensional vector (2, 3 and 4 dimension let say).
Still, you probably want to search around a bit more first. Without checking, I'd bet all of CrystalSpace, Ogre, VTK, Irrlicht, and
include their own classes for vectors and matrices.
Have you looked at http://www.cgal.org/ ? --DD
Still, you probably want to search around a bit more first. Without checking, I'd bet all of CrystalSpace, Ogre, VTK, Irrlicht, and
include their own classes for vectors and matrices. Have you looked at http://www.cgal.org/ ? --DD
A fairly concise and elegant vector/matrix implementation from CERN's ROOT library: http://project-mathlibs.web.cern.ch/project-mathlibs/sw/html/SMatrix.html - I believe it is available under the LGPL. YC
----------------------------------------
Date: Fri, 29 May 2009 18:40:46 -0500 From: To: boost-users@lists.boost.org Subject: Re: [Boost-users] POD 3d vectors
On Fri, May 29, 2009 at 5:49 PM, tom fogal wrote:
gtsml owevwr writes:
I need fast low dimensional vector (2, 3 and 4 dimension let say).
Still, you probably want to search around a bit more first. Without checking, I'd bet all of CrystalSpace, Ogre, VTK, Irrlicht, and random google result for "open source 3d engine" here> include their own classes for vectors and matrices.
Fast usually depends on access patterns as lookahead or cache thrashing or VM limits the speed. These off course tend to be app or algorithm specific but if someone wanted to catagorize and parameterize these maybe you could make some general strategy paterns for optimum performance on different platforms but you can appreciate it could be involved. I still often use int[] for arbitrary "vectors" depending on need and often various simple types of encoding ( keeping smaller differences than absolute values ) can make some sense. So, it is easy to find reasons to reinvent your own wheels in this case. I can write a low dimensional add operator easily, I can't go through library code and yank out extra junk. You could probably get at more speed issues from increasing the locality of an algorithm rather than looking for the library with the best vector add code. Mike Marchywka 586 Saint James Walk Marietta GA 30067-7165 415-264-8477 (w)<- use this 404-788-1216 (C)<- leave message 989-348-4796 (P)<- emergency only marchywka@hotmail.com Note: If I am asking for free stuff, I normally use for hobby/non-profit information but may use in investment forums, public and private. Please indicate any concerns if applicable. Note: hotmail is getting cumbersom, try also marchywka@yahoo.com _________________________________________________________________ Hotmail® has a new way to see what's up with your friends. http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutori...
gtsml owevwr wrote:
Hi,
I need fast low dimensional vector (2, 3 and 4 dimension let say).
http://www.openexr.com/index.html Look at the ILMBase package, it has low dimensional vectors Regards -- Nicholas Yue
Hi, You could try the Configurable Math Library (CML), which supports n-D vectors/matrices, but is especially tuned for 2D and 3D graphics applications: http://www.cmldev.net The library is fast (implements expression templates *without* pointer indirection or iterators), is pretty well tested, and has a decent user base ranging from professionals to hobbyists. Best of all, it's released under the Boost 1.0 library, so you can do whatever you want with it. :-) If you want more information, I'm one of the library authors, so feel free to contact me off-list or via the CML forums: http://cmldev.net/forums/ Cheers, Demian
Hi, Sorry for the late but did you try GGL? http://geometrylibrary.geodan.nl This library contains geometry algorithms that can handle any type of point: C arrays, PODs, legacy points, user-defined points... A very basic use could be (using C arrays here): double p1[] = { 1.0, 2.0 }; double p2[] = { 3.0, 4.0 }; cout << "Distance: " << ggl::distance(p1, p2) << endl; cout << "Dot product: " << ggl::dot_product(p1, p2) << endl; Adapting your own point type is very simple using a few automagic macros (see c01_custom_point_example in the docs). Barend Gehrels, Mateusz Loskot and me are the current developers. It will be proposed to Boost. There's a dedicated mailing list on OSGeo: http://lists.osgeo.org/mailman/listinfo/ggl Regards Bruno
participants (8)
-
Bruno Lalande
-
Demian Nave
-
Dominique Devienne
-
gtsml owevwr
-
Mike Marchywka
-
Nicholas Yue
-
Oei, YC
-
tom fogal