Matrix with two diagonals: Difference between revisions

Content added Content deleted
Line 1,298: Line 1,298:


=={{header|Java}}==
=={{header|Java}}==
The "Java philosophy" is the object-oriented paradigm. The example solution given below is therefore somewhat incomplete. We should first declare the matrix as an interface (or abstract class), then create a whole hierarchy of subclasses where DiagonalDiagonalMatrix would be a subclass of SquareMatrix or something like that. Of course, it's a gigantic job, but as a result we would have a library competing with Matlab / Octave etc., compliant with SOLID principles.
<lang java>package example.diagdiag;
<lang java>package example.diagdiag;