Last active
August 13, 2017 17:52
-
-
Save fazlerabbi37/5dd521487dc1f2e3c756e6cd09bfadaf to your computer and use it in GitHub Desktop.
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 FazleRabbi implements Matrix | |
{ | |
private int [][] inMatrix1; | |
private int [][] inMatrix2; | |
private int [][] outMatrix; | |
public FazleRabbi(int m1[][],int m2[][]) | |
{ | |
inMatrix1=m1; | |
inMatrix2=m2; | |
} | |
public boolean check() | |
{ | |
boolean flag=false; | |
if(inMatrix1.length==inMatrix2.length&&inMatrix1[0].length==inMatrix2[0].length) | |
{ | |
flag=true; | |
} | |
return flag; | |
} | |
public int[][] calculation() | |
{ | |
int c= inMatrix1.length; | |
int r=inMatrix2[0].length; | |
int [][] outMatrix=new int [c][r]; | |
for(int counter=0;counter<c;counter++){ | |
for(int counter1=0;counter1<r;counter1++){ | |
outMatrix[counter][counter1]=inMatrix1[counter][counter1]-inMatrix2[counter][counter1]; | |
} | |
} | |
return outMatrix; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment