matrix operation optimization

This is a discussion on matrix operation optimization within the C++ Programming forums, part of the General Programming Boards category; Hi I am trying to implement a code that requires 4 x 4, 4x 1 matrix operations at each grid ...

  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    65

    matrix operation optimization

    Hi

    I am trying to implement a code that requires 4 x 4, 4x 1 matrix operations at each grid node on a 2-D computational space.

    Are there C/C++ libraries available that can do handle this type of matrix calculations?

    My understanding is that libraries like lapack etc. are suited for large matrix inversions.

    cheers
    shuo

  2. #2
    3735928559
    Join Date
    Mar 2008
    Location
    RTP
    Posts
    839
    LU decomposition might be relevant to your interests.

    google yields many results.

    http://www.alglib.net/matrixops/general/lu.php

  3. #3
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,167
    SIMD instructions (MMX, SSE, etc) might help. GCC and the Intel compilers have intrinsics (built-in non-standard functions) that you can use to achieve this. Don't even need to go into assembly. There is probably something equivalent on the Microsoft compiler.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by cyberfish View Post
    SIMD instructions (MMX, SSE, etc) might help. GCC and the Intel compilers have intrinsics (built-in non-standard functions) that you can use to achieve this. Don't even need to go into assembly. There is probably something equivalent on the Microsoft compiler.
    Yes, and both do not do that great a job of translating the intrinsics into good code.

    Also, SIMD requires a little bit of planning so that data that should be processed together sits together in memory - otherwise the code ends up spending as much time shuffling data around as you save on doing multiple data in one instruction

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C - access violation
    By uber in forum C Programming
    Replies: 2
    Last Post: 07-08-2009, 01:30 PM
  2. Matrix Help
    By HelpmeMark in forum C++ Programming
    Replies: 27
    Last Post: 03-06-2008, 04:57 PM
  3. What is a matrix's purpose in OpenGL
    By jimboob in forum Game Programming
    Replies: 5
    Last Post: 11-13-2004, 11:19 PM
  4. Matrix and vector operations on computers
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 05-11-2004, 06:36 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21