Skip to content

Instantly share code, notes, and snippets.

View revan730's full-sized avatar
🐱
Meow

Yevhenii Burlachenko revan730

🐱
Meow
  • Ukraine, Kyiv
View GitHub Profile
@revan730
revan730 / MatrUtil.java
Created March 13, 2016 12:16
MatrUtil class
public class MatrUtil {
static double[][] mult(double[][] Mat1,double[][] Mat2){
if (Mat1.length != Mat2[0].length || Mat1[0].length != Mat2.length) throw new ArithmeticException("Множення не можливе");
else {
double[][] C = new double[Mat1.length][Mat2[0].length];
for (int i = 0; i < Mat1.length; i++) {
for (int j = 0; j < Mat2[0].length; j++) {
double s = 0;
for (int k = 0; k < Mat1[0].length; k++) s += Mat1[i][k] * Mat2[k][j];