forked from JavaTX/JavaCompilerCore
modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified: ../../src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java modified: ../javFiles/Matrix.jav mul1 und add ergaenzt. Fehler bei elementAt: Liefert Object als Returntyp
This commit is contained in:
parent
1667b394f2
commit
13c70148a8
@ -362,7 +362,10 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
}
|
}
|
||||||
if (!result.isEmpty()) {
|
if (!result.isEmpty()) {
|
||||||
if (variance == 1) {
|
if (variance == 1) {
|
||||||
if (a.equals(a_next) || (oup.compare(a, a_next) == 1)) {
|
if (a.iterator().next().getLhsType().getName().equals("WL"))
|
||||||
|
System.out.print("");
|
||||||
|
if (a.equals(a_next) ||
|
||||||
|
(oup.compare(a, a_next) == 1)) {
|
||||||
System.out.print("");
|
System.out.print("");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,8 @@ public class OrderingUnifyPair extends Ordering<Set<UnifyPair>> {
|
|||||||
Stream<UnifyPair> rseq = righteq.stream(); //right.filter(x -> (x.getLhsType() instanceof PlaceholderType && x.getPairOp() == PairOperator.EQUALSDOT));
|
Stream<UnifyPair> rseq = righteq.stream(); //right.filter(x -> (x.getLhsType() instanceof PlaceholderType && x.getPairOp() == PairOperator.EQUALSDOT));
|
||||||
BinaryOperator<HashMap<UnifyType,UnifyPair>> combiner = (x,y) -> { x.putAll(y); return x;};
|
BinaryOperator<HashMap<UnifyType,UnifyPair>> combiner = (x,y) -> { x.putAll(y); return x;};
|
||||||
HashMap<UnifyType,UnifyPair> hm = rseq.reduce(new HashMap<UnifyType,UnifyPair>(), (x, y)-> { x.put(y.getLhsType(),y); return x; }, combiner);
|
HashMap<UnifyType,UnifyPair> hm = rseq.reduce(new HashMap<UnifyType,UnifyPair>(), (x, y)-> { x.put(y.getLhsType(),y); return x; }, combiner);
|
||||||
lseq = lseq.filter(x -> !(hm.get(x.getLhsType()) == null));
|
lseq = lseq.filter(x -> !(hm.get(x.getLhsType()) == null));//NOCHMALS UEBERPRUEFEN!!!!
|
||||||
|
lseq = lseq.filter(x -> !x.equals(hm.get(x.getLhsType()))); //Elemente die gleich sind muessen nicht verglichen werden
|
||||||
Optional<Integer> si = lseq.map(x -> compareEq(x, hm.get(x.getLhsType()))).reduce((x,y)-> { if (x == y) return x; else return 0; } );
|
Optional<Integer> si = lseq.map(x -> compareEq(x, hm.get(x.getLhsType()))).reduce((x,y)-> { if (x == y) return x; else return 0; } );
|
||||||
if (!si.isPresent()) return 0;
|
if (!si.isPresent()) return 0;
|
||||||
else return si.get();
|
else return si.get();
|
||||||
|
@ -3,6 +3,8 @@ import java.lang.Integer;
|
|||||||
import java.lang.Boolean;
|
import java.lang.Boolean;
|
||||||
|
|
||||||
class Matrix extends Vector<Vector<Integer>> {
|
class Matrix extends Vector<Vector<Integer>> {
|
||||||
|
Integer mul1(Integer x, Integer y) { return x;}
|
||||||
|
Integer add(Integer x, Integer y) { return x;}
|
||||||
mul(m) {
|
mul(m) {
|
||||||
var ret = new Matrix();
|
var ret = new Matrix();
|
||||||
var i = 0;
|
var i = 0;
|
||||||
@ -14,8 +16,8 @@ class Matrix extends Vector<Vector<Integer>> {
|
|||||||
var erg = 0;
|
var erg = 0;
|
||||||
var k = 0;
|
var k = 0;
|
||||||
while(k < v1.size()) {
|
while(k < v1.size()) {
|
||||||
erg = erg + v1.elementAt(k)
|
erg = add(erg, mul1(v1.elementAt(k),
|
||||||
* m.elementAt(k).elementAt(j);
|
m.elementAt(k).elementAt(j)));
|
||||||
k++; }
|
k++; }
|
||||||
v2.addElement(new Integer(erg));
|
v2.addElement(new Integer(erg));
|
||||||
j++; }
|
j++; }
|
||||||
|
Loading…
Reference in New Issue
Block a user