Browse Source

explicit.StateValues: add createFromIntegerArray (analogue to createFromBitSet, createFromDoubleArray)

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11189 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Joachim Klein 10 years ago
parent
commit
432d017bbf
  1. 15
      prism/src/explicit/StateValues.java

15
prism/src/explicit/StateValues.java

@ -157,6 +157,21 @@ public class StateValues implements StateVector
}
}
/**
* Create a new (int-valued) state values vector from an existing array of ints.
* The array is stored directly, not copied.
* Also set associated model (whose state space size should match vector size).
*/
public static StateValues createFromIntegerArray(int[] array, Model model)
{
StateValues sv = new StateValues();
sv.type = TypeInt.getInstance();
sv.size = array.length;
sv.valuesI = array;
sv.statesList = model.getStatesList();
return sv;
}
/**
* Create a new (double-valued) state values vector from an existing array of doubles.
* The array is stored directly, not copied.

Loading…
Cancel
Save