Jump to content

Matrix with two diagonals: Difference between revisions

Line 1,298:
 
=={{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;
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.