CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 21

Thread: newmat vs boost

  1. #1
    Join Date
    Jan 2009
    Location
    In a cave on Mars
    Posts
    30

    newmat vs boost

    Whats peoples thoughts on newmat vs boost for matrix manipulation.

    I've used newmat before and find it very good. I've also heard boost is good but have never used it as yet. Can boost do everything newmat can?
    "What comes around, goes around"

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: newmat vs boost

    I'd probably go with LAPACK for heavy-duty matrix work, since there are highly optimized builds of it custom-tailored for specific CPUs available from several vendors. Or any C++ package that uses LAPACK.

    Only tricky bit is that LAPACK, being Fortran-based, assumes column-major matrix ordering.

  3. #3
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: newmat vs boost

    In addition to LAPACK based code, you might want to take a look at various APL based libraries.

    APL was (as a language) specifically designed to handle multi-dimensional matrix operations. At the core is the ability to perform minimal (lazy) evaluations. When it was introduced (1970's), an APL based small system [it would site on a desktop] could outperform even the fastest mainframes.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  4. #4
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: newmat vs boost

    According to the Wikipedia article, the notion that APL derives its speed from lazy evaluation is a myth: they claim it actually comes from the ability to do optimal instruction scheduling since equations are specified without specific guidelines about what needs to be evaluated first. This also makes it extremely extensible to multi-core and other parallel architectures.

  5. #5
    Join Date
    Nov 2008
    Location
    Netherlands
    Posts
    77

    Re: newmat vs boost


  6. #6
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: newmat vs boost

    Hmm, haven't seen that one before. What, does MS have a compulsive need to compete with OpenCL or something?
    Last edited by Lindley; January 12th, 2009 at 12:45 PM.

  7. #7
    Join Date
    Nov 2003
    Posts
    1,405

    Re: newmat vs boost

    Quote Originally Posted by TheCPUWizard View Post
    In addition to LAPACK based code, you might want to take a look at various APL based libraries.

    APL was (as a language) specifically designed to handle multi-dimensional matrix operations. At the core is the ability to perform minimal (lazy) evaluations. When it was introduced (1970's), an APL based small system [it would site on a desktop] could outperform even the fastest mainframes.
    You must be joking. APL may be a good idea for rapid prototyping but otherwise it's a joke, a slow joke. The most prominent features are its cryptic syntax and bad performance. If you want to hit rock bottom, use APL.

    LAPACK is way better.

  8. #8
    Join Date
    Nov 2003
    Posts
    1,405

    Re: newmat vs boost

    Quote Originally Posted by Lindley View Post
    Hmm, haven't seen that one before. What, do they have a compulsive need to compete with OpenCL or something?
    There's a current trend to open up graphics cards for general number crunching. This is what nVidia offers for example,

    http://www.nvidia.com/object/cuda_learn.html

  9. #9
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: newmat vs boost

    Quote Originally Posted by Lindley View Post
    According to the Wikipedia article, the notion that APL derives its speed from lazy evaluation is a myth: they claim it actually comes from the ability to do optimal instruction scheduling since equations are specified without specific guidelines about what needs to be evaluated first. This also makes it extremely extensible to multi-core and other parallel architectures.
    One needs to be careful whe using Wikipedia.

    The MCM 800 was built specifically to handle APL. "Micro Computer Machines, Inc." ran into financial issues and "ILC Data Device Corp" recieved a number of these machines along with detailed engineering documentation as compensation (approx 1977). At the time I was a "Software Technician" with the engineering department and spent a few months dedicated to understanding the machine. [as a side note, these financial troubles were the driving factor of the "name change" to "MCM Computers

    While different terminologies are used, the core premise was (and still is) that a command can be executed, without performing all of the operations implied by that operation in order to satisfy the computational requirements of later commands.

    A trivial example is the multiplication of two matrices, followed by a summation of the values in the first row of the result. Even if the intermediate array was [1000][1000], the calculation of 999,000 cells never needed to be performed.

    By having the language/platform determine what portions of calculation where actually necessary, without any direction from the programmer is still a valuable technique today. When combined with the modern parallization methods (which were not practical 30+ years ago), the effect is amazing to many people.

    In closing, my previous recommendation was simply "to check out" the features provided. If the math has already been reduced down to an optimal (or near optimal) pathway, then the other alternatives may provide much better options. But if it is desirable to express the material in the general mathematical terms, and let the computer figure out which calculations (and in what order) are necessary, then APL is still hard to beat.

    (I recently used it when working on a photon detector for medical use. The physicists expressed everything as high order matrix calculations, while the engineers wanted/needed discrete analytical results. Since the physicists wer constantly revising their equation sets, being able to express them directly and running a new set of simulation was a great help)
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  10. #10
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: newmat vs boost

    Quote Originally Posted by _uj View Post
    There's a current trend to open up graphics cards for general number crunching. This is what nVidia offers for example,

    http://www.nvidia.com/object/cuda_learn.html
    I know about CUDA and CTM and whatnot, I was just surprised to learn that Microsoft is throwing their own entry into the mix as well. It's not like they make graphics cards....

  11. #11
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: newmat vs boost

    Quote Originally Posted by Lindley View Post
    I know about CUDA and CTM and whatnot, I was just surprised to learn that Microsoft is throwing their own entry into the mix as well. It's not like they make graphics cards....
    BSGP (Microsoft's offering) makes some good sense because it is NOT tied to a specific graphics card vendor.

    So far [IMPO] every alternative listed has its strengths and weaknesses when applied to specific conditions. Attempting to say "X is better than Y" without knowing more about the specifics of coleteks' requirements is impossible.

    Even the choice to use the GPU for non-graphical calculations may yield slower system performance if the GPU is at saturation doing complex 3-D rendering. The number of cores/processors also comes into play when measuring the items listed for scalability (Consider what will happen when Keifer is releases in a year or so, how will 32 CPU's stackup against a single or dual GPU?

    Unless more detailed information is provided by coletek, I believe the best bet is to look at the information that was presented, and then measure which one of the viable alternatives provide the best fit. Raw performance is often secondary to other criteria provided it is fast enough to meet the requirements
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  12. #12
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: newmat vs boost

    Quote Originally Posted by TheCPUWizard View Post
    BSGP (Microsoft's offering) makes some good sense because it is NOT tied to a specific graphics card vendor.
    Neither will OpenCL be, and that's due to have implementations out any time now if they aren't already. It'll be interesting to see which one comes out on top.

  13. #13
    Join Date
    Nov 2008
    Location
    Netherlands
    Posts
    77

    Re: newmat vs boost

    First of all if the case is the GPU is busy doing 3-D rendering CPU will most likely be at 100% if there is a multicore CPU, than the cores will be busy with other threads, even if they are idle.

    and its not reasonable to assume that there is a 3D app running while doing complex heavy processing.

    multicore CPUs will be alot worse in data-processing than a single core.

    GPU's are really good at processing large ammount of data, it will be a rare case that in this situation a new GPU will lose against a new CPU.

    CPUs are really to process the multi-task system while GPUs are for 3d processing.
    There are also cards available that are for physics processing. In the end the best soluttion would be a new card just for doing data-processing, but i dont see that happening.
    Last edited by cj-wijtmans; January 12th, 2009 at 03:52 PM.

  14. #14
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: newmat vs boost

    The question of GPU vs multi-core CPU is largely this: Is the algorithm in question fine-grained parallelizable, or course-grained parallelizable? The former favors a GPU, the latter a multi-core setup.

  15. #15
    Join Date
    Nov 2008
    Location
    Netherlands
    Posts
    77

    Re: newmat vs boost

    even tho operating system will interfere with multi-tasking?
    idk if you can claim a whole core in a program?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured