Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


Hi Regina,

On Sun, 2010-10-24 at 18:13 +0200, Regina Henschel wrote:
Hi all,

I'm currently working on LINEST and have attached a draft to issue
http://www.openoffice.org/issues/show_bug.cgi?id=115189

There is no mathematical problem, but I'm uncertain about coding style. 
The algorithms work on matrices. They have a lot of parts which are 
nearly identical but the matrices are transposed. How to handle that?

If one algorithm traverses matrix row-wise, and another column-wise,
then I would just leave them as-is.  There isn't much we could do to
reduce code side in that situation, and I don't think it would be worth
the effort.

If we really wanted, we could try templates as Thorsten suggested, but
we can try that after your initial code gets integrated with some test
cases to verify calculations.

And I do not know how much comments are needed for those, who have to 
maintain the code later, and if a separate documentation is needed.

As Michael said, your level of comments look just fine to me. :-)  The
only thing I would change is to remove commenting of closing braces.
For instance,

if (nCase == 2)
{
    ...
} // end of nCase == 2

type of comment is a bit too much since most modern editors should
detect the begin end brace pair.  I would consider this to be
over-commenting.  But other than that, your code looks just fine.

FYI, I'm planning to integrate a major refactoring of the guts of
ScMatrix, to push most of its implementation out to an external library
and to allow different base values (numerical-0 vs empty elements).  It
should not affect ScInterpreter code as the change should be transparent
to the users of ScMatrix, but I thought I would mention.

And I would probably be the one to maintain your code, unless you want
to maintain it yourself. ;-)

Thanks a lot, and keep us informed of your progress.

Kohei

-- 
Kohei Yoshida, LibreOffice hacker, Calc
<kyoshida@novell.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.