From: luukkainen Date: Mon, 3 Sep 2012 07:23:30 +0000 (+0000) Subject: fixes #3673 X-Git-Tag: simantics-1.7~4^2~13 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=e00109cdadf1f74b9125577fbdbccdfaaedb7421;p=simantics%2Fsysdyn.git fixes #3673 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@25587 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.modelica/src/org/simantics/modelica/data/Mat4Reader.java b/org.simantics.modelica/src/org/simantics/modelica/data/Mat4Reader.java index ceafe6b0..0ed50f52 100644 --- a/org.simantics.modelica/src/org/simantics/modelica/data/Mat4Reader.java +++ b/org.simantics.modelica/src/org/simantics/modelica/data/Mat4Reader.java @@ -142,7 +142,7 @@ public class Mat4Reader { int size = values.columns % outputInterval != 0 ? values.columns / outputInterval + 1 : values.columns; double[] v = new double[size]; int sc = infoData[i*4+1]; - int c = sc > 0 ? sc-1 : 1-sc; + int c = sc > 0 ? sc-1 : -sc-1; //System.out.println("i=" + i + ", sc=" + sc + ", c=" + c); for(int j=0;j 0 ? sc-1 : 1-sc; + int c = sc > 0 ? sc-1 : -sc-1; @@ -345,7 +345,7 @@ public class MatFileReader implements ResultFileReader { int rows = header.rows; double[] v = new double[count]; int sc = infoData[row * 4 + 1]; - int c = sc > 0 ? sc-1 : 1-sc; + int c = sc > 0 ? sc-1 : -sc-1; @@ -366,9 +366,6 @@ public class MatFileReader implements ResultFileReader { private double[][] readRows(MatrixHeader header, List unSortedRows, InputStream in)throws IOException { - - ; - if (header.type != 0) throw new IOException("Only double type supported"); for (int row : unSortedRows) @@ -383,7 +380,7 @@ public class MatFileReader implements ResultFileReader { int row = unSortedRows.get(i); //vs[i] = new double[size]; usc[i] = infoData[row * 4 + 1]; - uc[i] = usc[i] > 0 ? usc[i]-1 : 1-usc[i]; + uc[i] = usc[i] > 0 ? usc[i]-1 : -usc[i]-1; } //Map cToRow = new HashMap(); @@ -503,7 +500,7 @@ public class MatFileReader implements ResultFileReader { int row = unSortedRows.get(i); //vs[i] = new double[count]; usc[i] = infoData[row * 4 + 1]; - uc[i] = usc[i] > 0 ? usc[i]-1 : 1-usc[i]; + uc[i] = usc[i] > 0 ? usc[i]-1 : -usc[i]-1; } //Map cToRow = new HashMap();