On 2020-08-23 02:40, Lutz Gehlen wrote:
Hi all,
I am working on a set of modules dealing with banded matrices (aka
band matrices or band diagonal matrices). These are a certain kind
of sparse matrices where all entries are known to be 0 except close
to the main diagonal. Obviously, this condition can be exploited for
efficient storage and algorithms.
I am planning to use the Math::Matrix::Banded namespace. However, I
require separate namespaces for rectangular (i.e. non-square) and
symmetric systems because they are stored differently and allow a
distinct set of algorithms.
I have considered
Math::Matrix::Banded
Math::Matrix::BandedRectangular
Math::Matrix::BandedSymmetric
What I don't like about this option is that the package name would
be Math-Matrix-Banded, but it would use namespaces outside the top
level namespace.
An obvious alternative would be
Math::Matrix::Banded
Math::Matrix::Banded::Rectangular
Math::Matrix::Banded::Symmetric
What I don't like here is that it suggests that the latter two
classes are subclasses of the first, which is not the case.
The third option I came up with is
Math::Matrix::Banded::Square
Math::Matrix::Banded::Rectangular
Math::Matrix::Banded::Symmetric
This is all within the Math::Matrix::Banded namespace and reflects
the sibling relationship between the three classes. What I can see
as a disadvantage - apart from long names - is that the package
would still be called Math-Matrix-Banded, but there is no class
occupying the top level namespace, which might be confusing for
users.
Do you have any thoughts on this matter?
Thank you and best wishes,
Lutz
First, I am not a mathematician.
Follow the application domain taxonomy names makes the most sense.
If your implementation is OO and maps 1:1 with the taxonomy, that would
be ideal. If not, I might have modules per the taxonomy where it makes
sense, and put everything else into sub-directories organized by
whatever makes sense for them (such as OO modules, utility functions,
whatever).
Your third option could work for module names if Square, Rectangular,
and Symmetric are at the same level of the taxonomy. If they are the
only three choices that will ever exist for banded matrices, then one
distribution named Math::Matrix::Banded makes sense.
But if there are other types of banded matrices, if those terms are
really at different levels, or if there are other taxonomy issues,
perhaps you should release multiple distributions -- one per work
product, named per the taxonomy. The idea is that you do not want to
block future modules or distributions.
David