public void SetValues_1D_Double() { var values = new[] { 1.0, 2.0, 3.0 }; library.SetValues(library.VariableNames[0], values); Assert.AreEqual(values, library.GetValues(library.VariableNames[0])); }
public static void SetValue <T>(this IBasicModelInterface model, string variable, T value) { var length = BasicModelInterfaceLibrary.GetTotalLength(model.GetShape(variable)); var values = Enumerable.Repeat(value, length).ToArray(); model.SetValues(variable, values); }
public static void SetValue <T>(this IBasicModelInterface model, string variable, int index, T value) { var shape = model.GetShape(variable); if (shape.Length != 1) { throw new NotSupportedException("use SetValue(variable, start, count, values)"); } //model.SetValues(variable, new int[] { index }, new int[] { 1 }, new T[] { value }); model.SetValues(variable, new int[] { index }, new T[] { value }); }