Skip to content

Commit

Permalink
#7 - matrix math iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
obriensystems committed Jul 7, 2024
1 parent 0124b3b commit b1374c4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 17 deletions.
10 changes: 7 additions & 3 deletions metrichash.map/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,19 @@
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
8 changes: 4 additions & 4 deletions metrichash.map/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
Expand All @@ -13,5 +13,5 @@ org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="11"/>
<installed facet="java" version="17"/>
</faceted-project>
4 changes: 2 additions & 2 deletions metrichash.map/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<!-- source>1.11</source>
<target>1.11</target-->
<source>17</source>
<target>17</target>
</configuration>
</plugin>
</plugins>
Expand Down
21 changes: 14 additions & 7 deletions metrichash.map/src/main/java/com/metrichash/map/ScratchPad.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.metrichash.map;

import java.util.Optional;

import java.util.stream.LongStream;
import java.util.stream.Stream;
public class ScratchPad {

/**
Expand All @@ -10,16 +11,22 @@ public class ScratchPad {
*/
public void matrixReductionForAdding() {
long m1[][] = {{1,2,3},{4,5,6}};
long red0[][];
long red0[] = {7,8,9};

//LongStream.of(red0).forEach(System.out::println);
//Stream.of(red0).forEach(x -> System.out.println(x));

// initialize reduction matrix
for(long[] row : m1) {
//for(long[] row : m1) {
Stream.of(m1).forEach(y ->
LongStream.of(y).forEach(x -> System.out.println(x)));
//}

/*for(long[] row : m1) {
for(long col : row) {
System.out.println(col);
}
}


}*/
}

public void optional() {
Expand All @@ -36,7 +43,7 @@ public void optional() {

public static void main(String[] args) {
ScratchPad pad = new ScratchPad();
pad.optional();
//pad.optional();
pad.matrixReductionForAdding();
}

Expand Down

0 comments on commit b1374c4

Please sign in to comment.