Skip to content

Commit

Permalink
First commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
pacosta committed Dec 17, 2012
0 parents commit 9565f95
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>AeminiumJavaGrande</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
11 changes: 11 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
93 changes: 93 additions & 0 deletions src/aeminium/compiler/benchmarks/MatrixMultiplicationAE.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
package aeminium.compiler.benchmarks;

class MatrixMultiplicationAE {
public static void main(String args[]) {

double starttime = System.nanoTime();

int m, n, p, q, sum = 0, c, d, k;

// Scanner in = new Scanner(System.in);
// System.out.println("Enter the number of rows and columns of first matrix");
// m = in.nextInt();
// n = in.nextInt();
m = 1920;
n = 1920;

int first[][] = new int[m][n];

// System.out.println("Enter the elements of first matrix");

c = 0;
while (c < m) {
d = 0;
while (d < n) {
first[c][d] = d * c;
// first[c][d] = in.nextInt();
d++;
}
c++;
}

// System.out.println("Enter the number of rows and columns of second matrix");
// p = in.nextInt();
// q = in.nextInt();
p = 1920;
q = 1920;

if (n != p)
System.out
.println("Matrices with entered orders can't be multiplied with each other.");
else {
int second[][] = new int[p][q];
int multiply[][] = new int[m][q];

// System.out.println("Enter the elements of second matrix");

c = 0;
while (c < p) {
d = 0;
while (d < q) {
second[c][d] = d * c;
d++;
}
// second[c][d] = in.nextInt();
c++;
}

c = 0;
while (c < m) {
d = 0;
while (d < q) {
k = 0;
while (k < p) {
sum = sum + first[c][k] * second[k][d];
k++;
}

multiply[c][d] = sum;
sum = 0;
d++;
}
c++;
}

System.out.println("Product of entered matrices:-");

// c = 0;
// while (c < m) {
// d = 0;
// while (d < q) {
// System.out.print(multiply[c][d] + "\t");
// d++;
// }
//
// System.out.print("\n");
// c++;
// }

starttime = System.nanoTime() - starttime;
System.out.println("Time= " + starttime / 1000000000);
}
}
}

0 comments on commit 9565f95

Please sign in to comment.