Jump to content
  • Advertisement

Mantear

Member
  • Content count

    765
  • Joined

  • Last visited

Community Reputation

251 Neutral

About Mantear

  • Rank
    Advanced Member
  1. Mantear

    Matrix inversion

    @ Brother Bob;  I'm sure that's good advice.  The problem is I don't understand enough for it to help me.  I wouldn't know how to properly condition the matrix.  I also do not know how Matlab is coming up with its answer.   @ unbird: I'm looking at your linked article.  My current solution claims to use row-pivoting; I'm going to attempt to better understand pivoting to see if: A) i'm already pivoting and B) if I'm not, if doing so will help.   Thanks.
  2. Mantear

    Matrix inversion

    I'm a linear algebra weakling and am looking for help anywhere I can find it.   I'm attempting to calculate the inverse of a 14x14 square matrix using Gauss-Jordan elimination.  This seems to work for some matrix input, but not all.  I end up with an almost zero value on the diagonal, which really blows up the scaling of the values in the matrix.   I'm comparing my results to those calculated by Matlab.  For my initial set of matricies, the results match (within rounding differences).  But for the following matrix, they do not.  (sorry for the large data set: if there's a better way to show this please let me know).         -10.685512    -1.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000     63.545570    1.000000    -1.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000     -213.193800    0.000000    1.000000    -1.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000     493.092433    0.000000    0.000000    1.000000    -1.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000     -831.846712    0.000000    0.000000    0.000000    1.000000    -1.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000     1055.702065    0.000000    0.000000    0.000000    0.000000    1.000000    -1.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000     -1024.015861    0.000000    0.000000    0.000000    0.000000    0.000000    1.000000    -1.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000     762.935063    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    1.000000    -1.000000    0.000000    0.000000    0.000000    0.000000    0.000000     -434.501577    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    1.000000    -1.000000    0.000000    0.000000    0.000000    0.000000     186.205620    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    1.000000    -1.000000    0.000000    0.000000    0.000000     -58.228421    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    1.000000    -1.000000    0.000000    0.000000     12.560150    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    1.000000    -1.000000    0.000000     -1.672796    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    1.000000    -1.000000     0.103779    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    1.000000   Element (14,14) becomes nearly zero [~4.354*10^-12] when eliminating element (14,13) by scaling and subtracting row 13 from row 14.  So when I go to scale row 14 to get the diagonal value to equal 1.0, the scaling just gets huge.  [Note: I'm using long double data types to operate on.] The Matlab result is also a matrix with very large values, but they are quite different than mine.  I'm guess the very small/very large numbers are throwing things off, but I can't tell where.  Is there a different technique I need to employ to get the same answer as Matlab?
  3. Mantear

    why is C++ not commonly used in low level code?

    There's no reason to use C over C++, even in embedded systems, except for legacy support. All compilers that target embedded systems allow you to turn off exceptions and RTTI, etc. If you don't use a feature, you don't pay for it. But there's no reason to use C and paint yourself in a corner if you end up needing a feature found in C++ that C doesn't have. This perspective is coming from someone who does embedded development for a living. I've worked with DSPs (TI C64x+), microprocessors (MSP430), and FPGA softcores (Xilinx MicroBlaze) all within the past 3 months. Guess what? All of the applications were written in C++. Even on the MSP430 that ran at 16MHz and had 4kBytes of RAM.
  4. What is the data type of 'data'? Where did it come from? Are stereo audio streams actually interleaved in that buffer? Is OpenAL expecting your mono buffer to be 16-bit or 32-bit?
  5. I mostly develop code on embedded systems. In the past when I've done PC development I've usually used Visual Studio. Recently, I decided to use Qt Creator to create a GUI application. Qt has worked great for what I need, but now I'm trying to generate release/optimized builds of the GUI that is now nearly feature complete. The GUI does some fairly heavy data analysis, so I could really use the optimization speed boosts. However, I'm not sure how Qt Creator goes about generating its builds. I currently have a Debug configuration. It uses the debug DLLs (QtCored4.dll, QtGuid4.dll, etc) and I'm asusming gcc optimizations are default/disabled as walking through the debugger is always straight forward. However, I can't figure out how to create a Release configuration that uses the non-debug DLLs or how to pass the optimization level to gcc (ie, -O2). I feel this should be a simple task, but for the life of me I can't figure it out. Searching the Qt forums hasn't been much help. I'm using Qt Creator 2.0.0 (based on Qt 4.7.0). I've tried adding -O2 to the "Additional arguments:" under Build Steps for qmake, but it doesn't like that.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!