This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Matrix | |
{ | |
private int rows; | |
private int columns; | |
private double[][]theMatrix; | |
/** | |
* Constructor for class Matrix | |
* @param setRows | |
* @param setColumns | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SquareMatrix extends Matrix | |
{ | |
private int order; | |
/** | |
* constructor for class SquareMatrix | |
* @param n | |
*/ | |
public SquareMatrix(int n) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TwoByTwoMatrix extends SquareMatrix | |
{ | |
private static final double[][] IDENTITY_MATRIX = {{1,0}, {0,1}}; | |
/** | |
* constructor for the class TwoByTwoMatrix | |
*/ | |
public TwoByTwoMatrix() | |
{ | |
super(2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ThreeByThreeMatrix extends SquareMatrix | |
{ | |
private static final double[][] IDENTITY_MATRIX = {{1,0,0},{0,1,0},{0,0,1}}; | |
/** | |
* constructor for class ThreeByThreeMatrix | |
*/ | |
public ThreeByThreeMatrix() | |
{ | |
super(3); |