Hi Neil, On Monday, 24.08.2020 10:06:10 Neil Bowers wrote: [...] > One thing to be aware of, is that if you’re releasing a > distribution Math-Matrix-Banded, then your distribution needs to > include a module Math::Matrix::Banded[*].
Thank you, I wasn't aware of that. > I like the model where you also have ::Square, ::Rectangular, and > ::Symmetric — a class for each internal representation. > > Not knowing anything about your planned design, could you have > Math::Matrix::Banded be the public facing interface, with the > appropriate "back-end" loaded by it? This could either be > explicit, with the caller telling you what type to use, or more > DWIMish, by looking at the matrix and deciding which of the three > back-ends to use, factory method stylee: > > use Math::Matrix::Banded; > my $matrix = > Math::Matrix::Banded->load_from_file('foobar.matrix'); print > ref($matrix), "\n"; > > # Math::Matrix::Banded::Symmetric [...] I like this idea a lot. The size of the matrix is immutable and set at construction time, so whether it's square or not can be detected automatically. Symmetry will have to be set explicitly since the elements of the matrix are mutable. Thanks, Lutz