|
View:
New views
9 Messages
—
Rating Filter:
Alert me
|
|
|
Math.Matrix revisitedHello:
I send a "patch" which adds the lu decomposition method to the Math.Matrix object. I don't know how to send patches, then I send the entire matrix_code.h file from src/modules/Math/matrix_code.h. I've verified that compiles with Pike 7.8 from the repository. At the moment, It's not usable because It shows lots of debug information, but maybe It would be good to have It at the repository. Maybe tomorrow If I've time I'll send another patch without debug information. The lu decomposition is used to solve linear equations systems. It decomposes a matrix , named A, like P x L x U = A , where P is a permutation matrix, L is a lower-diagonal matrix and U is an upper-diagonal matrix. The method doesn't needs any argument and It returns an array with 4 elements : ({ L , U , P , signum }) , where signum is an integer which contains the sign of the permutation. Now I want to implement solving linear equations systems into the Math.Matrix object. I've noticed something strange within the Math.Matrix object. Instead of using a 2D array, you use a vector (1D array) and then, to acces the (i,j) element you compute it as i * size_of_a_rows + j. This maybe saves some memory , but It's slower accessing the array elements. Maybe I can reimplement the class using 2D arrays if you want. Well, I'll send any improvement that I do. Bye! -- Felip Alàez Nadal |
|
|
Math.Matrix revisitedYou create a diff with
diff -u <old file> <new file> |
|
|
Math.Matrix revisited >I've noticed something strange within the Math.Matrix object. Instead of
>using a 2D array, you use a vector (1D array) and then, to acces the (i,j) >element you compute it as i * size_of_a_rows + j. This maybe saves some >memory , but It's slower accessing the array elements. Exactly how is it slower? Memory is, afaik, a 1d array... It should preferably be accessed as a pointer deference when speed is of matter, anyway, but in the case of random access, you need to create the pointer from base + y * size_of_a_row + x. It might go faster if you have only size_of_a_row at even base 2, and use shift instead of multiplication. Is that what you thought of? |
|
|
|
|
|
Re: Math.Matrix revisited"Felip Alàez Nadal" <uu.nix.uu@...> wrote:
> Math.Matrix a = Math.Matrix( ({ ({ 1.2 , 3.5 }) , ({ 2.4 , 5.7 }) }) ) ; >> a->norm() ; > Cannot compute norm of non 1xn or nx1 matricesUnknown program: norm() /.../ > It's obvius that norm is a known method for class Math.Matrix, as a->norm() > is called and It signals an error correctly. But I believe that the rest of > the message It's wrong. There's a newline missing at the end of the error message that apparently makes you misinterpret it (the "Unknown program" bit comes from that the backtrace formatter couldn't find the name of the program that contains norm()). I've now fixed newlines for several error messages in matrix_code.h. Thanks. As for your math patches, I hope someone else more familiar with that area will review your contribution so that we get it in. Note however that 7.8 is in strict feature freeze, so it's unlikely that it'll get into that version. |
|
|
Re: Math.Matrix revisitedWhat is the delay for 7.8 release right now?
|
|
|
Re: Math.Matrix revisitedChangelog. Absolutely only the changelog. Has been for weeks.
|
|
|
Re: Math.Matrix revisitedAnyone working on that?
|
|
|
Re: Math.Matrix revisitedThere hasn't been a lot of man-hours dedicated to it lately. Feel free
to pick a FIXME from CHANGES and fill out the details. |
| Free Forum Powered by Nabble | Forum Help |