Overdeterminded linear equation system



  • What is needed in C++, additional to the normal installation, to solve an overdetermined linear system of equations?
    The coefficien matrix is 15...300 by 7.

    I ask this question for a friend who has written many C++ lines. He doesn't see a way in his C++ installation and hesitates to contact this forum himself because he has never done so.
    My command of C++ is null, so sorry if I ask the wrong question.
    Kind regards
    helm



  • You could write the functions by your own and then nothing further is needed. But if you like to use a fast implementation try for example the one from boost:
    http://www.boost.org/doc/libs/1_43_0/libs/numeric/ublas/doc/index.htm

    There are some other implementations out there but i suppose the one from boost is pretty good.



  • Find a library that is able to solve these kinds of systems and use it.

    Alternativly, write your own solver. For example: Compute a Q-less QR decomposition via Householder transformations. The result is a small triangular equation system which is easily solved via back substitution.

    If you're not familiar with all this you better find a library that does this for you.



  • krümelkacker schrieb:

    If you're not familiar with all this you better find a library that does this for you.

    Even if you are familiar with techniques like QR decomposition i would say there are several more involved improvements to the common algoritms which speed up the computation.



  • @ drakon and @ krümelacker
    Thanks for your fast response. I will pass it on.
    Kind regards
    helm



  • drakon schrieb:

    Even if you are familiar with techniques like QR decomposition i would say there are several more involved improvements to the common algoritms which speed up the computation.

    Well, if you're only interested in solving an overdetermined system, you don't have to compute a full-blown QR decomposition. In case you find a library that gets around computing Q explicitly, you're fine. If not, you have to use the smaller building blocks (basic linear algebra subprograms) yourself to get the most out of it. There's noch much you can do about Householder transforms in terms of speed, is there? Memory layout is probably the most important one. 🙂

    kk


Anmelden zum Antworten