]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
refs #5224
authorvillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 25 Aug 2014 16:23:03 +0000 (16:23 +0000)
committervillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 25 Aug 2014 16:23:03 +0000 (16:23 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@30131 ac1ea38d-2e2b-0410-8846-a27921b304fc

fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Variable.java
fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/VariableBase.java

index 9420424bf3de6232dc88a1ff15086f47c170d6a5..05ac71fdf868a43dee31a353407c77750d01dc5f 100644 (file)
@@ -128,7 +128,7 @@ public class Variable implements IExpression {
                \r
                if(value == null) return;\r
                \r
-               if(base.isStoredAsArray()) return;\r
+               if(base.isStoredAsArray(env)) return;\r
                \r
                int fullDimension = base.dimension();\r
                if(fullDimension == 1) {\r
@@ -169,13 +169,13 @@ public class Variable implements IExpression {
                validateSize(env, subscripts, value);\r
                \r
                if(value instanceof Array) {\r
-                       if(base.isStoredAsArray()) {\r
+                       if(base.isStoredAsArray(env)) {\r
                                env.put(base.index(env, subscripts), value);\r
                        } else {\r
                                assignArray(env, base.index(env, subscripts), (Array)value, 0);\r
                        }\r
                } else {\r
-                       if(base.isStoredAsArray()) {\r
+                       if(base.isStoredAsArray(env)) {\r
                                Object _existing = env.getValue(base.index);\r
                                Array existing = (Array)_existing;\r
                                if(existing == null) {\r
index 842cb93a3332b7d6843726b55d6f38468e310eac..355c7919b74c8459055e823c6630bd8fad6aab06 100644 (file)
@@ -80,10 +80,10 @@ public class VariableBase {
                for(int d : dimensions) result *= d;\r
                return result;\r
        }\r
-       public boolean isStoredAsArray() {\r
+       public boolean isStoredAsArray(IEnvironment env) {\r
                if(dimensions == null) return false;\r
                for(int d : dimensions) if(d == -1) return true;\r
-               return false;\r
+               return (env instanceof Frame);\r
        }\r
        \r
        VariableBase withBase(String prefix) {\r
@@ -161,7 +161,7 @@ public class VariableBase {
        \r
        public int getConstantIndex(IEnvironment environment, IExpression[] subscripts) {\r
 \r
-               if(isStoredAsArray()) {\r
+               if(isStoredAsArray(environment)) {\r
                        return -1;\r
                } else {\r
                        \r
@@ -210,7 +210,7 @@ public class VariableBase {
                        }\r
                }\r
                \r
-               if(isStoredAsArray()) {\r
+               if(isStoredAsArray(environment)) {\r
                        \r
                        Array array = (Array)environment.getValue(index);\r
                        if(hasScalarSubscript(subscripts)) {\r