diff --git a/Examples/test-suite/java/lib_std_string_runme.java b/Examples/test-suite/java/lib_std_string_runme.java deleted file mode 100644 index eb6a896bb..000000000 --- a/Examples/test-suite/java/lib_std_string_runme.java +++ /dev/null @@ -1,76 +0,0 @@ -import li_std_string.*; - -public class li_std_string_runme { - - static { - try { - System.loadLibrary("li_std_string"); - } catch (UnsatisfiedLinkError e) { - System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); - System.exit(1); - } - } - - public static void main(String argv[]) throws Throwable - { - // Checking expected use of %typemap(in) std::string {} - li_std_string.test_value("Fee"); - - // Checking expected result of %typemap(out) std::string {} - if (!li_std_string.test_value("Fi").equals("Fi")) - throw new RuntimeException("Test 1 failed"); - - // Verify type-checking for %typemap(in) std::string {} - try { - li_std_string.test_value(null); - throw new RuntimeException("Test 2 failed"); - } catch (NullPointerException e) { - } - - // Checking expected use of %typemap(in) const std::string & {} - li_std_string.test_const_reference("Fo"); - - // Checking expected result of %typemap(out) const std::string& {} - if (!li_std_string.test_const_reference("Fum").equals("Fum")) - throw new RuntimeException("Test 3 failed"); - - // Verify type-checking for %typemap(in) const std::string & {} - try { - li_std_string.test_const_reference(null); - throw new RuntimeException("Test 4 failed"); - } catch (NullPointerException e) { - } - - // - // Input and output typemaps for pointers and non-const references to - // std::string are *not* supported; the following tests confirm - // that none of these cases are slipping through. - // - - SWIGTYPE_p_std__string stringPtr = null; - - stringPtr = li_std_string.test_pointer_out(); - - li_std_string.test_pointer(stringPtr); - - stringPtr = li_std_string.test_const_pointer_out(); - - li_std_string.test_const_pointer(stringPtr); - - stringPtr = li_std_string.test_reference_out(); - - li_std_string.test_reference(stringPtr); - - // Check throw exception specification - try { - li_std_string.test_throw(); - throw new Throwable("Test 5 failed"); - } catch (RuntimeException e) { - } - try { - li_std_string.test_const_reference_throw(); - throw new Throwable("Test 6 failed"); - } catch (RuntimeException e) { - } - } -} diff --git a/Examples/test-suite/java/lib_typemaps_runme.java b/Examples/test-suite/java/lib_typemaps_runme.java deleted file mode 100644 index 327b188c2..000000000 --- a/Examples/test-suite/java/lib_typemaps_runme.java +++ /dev/null @@ -1,125 +0,0 @@ - -// Check a few of the INPUT, OUTPUT and INOUT typemaps. - -import li_typemaps.*; -import java.math.*; - -public class li_typemaps_runme { - - static { - try { - System.loadLibrary("li_typemaps"); - } catch (UnsatisfiedLinkError e) { - System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); - System.exit(1); - } - } - - public static void main(String argv[]) { - - // Check double INPUT typemaps - if (li_typemaps.in_double(22.22) != 22.22) exit_test("in_double"); - if (li_typemaps.inr_double(22.22) != 22.22) exit_test("inr_double"); - - // Check double OUTPUT typemaps - { - double[] var = {44.44}; - li_typemaps.out_double(22.22, var); - if (var[0] != 22.22) exit_test("out_double"); - } - { - double[] var = {44.44}; - li_typemaps.outr_double(22.22, var); - if (var[0] != 22.22) exit_test("outr_double"); - } - try { - double[] var = null; - li_typemaps.out_double(22.22, var); - exit_test("null out_double"); - } catch (NullPointerException e) { - } - - // Check double INOUT typemaps - { - double[] var = {44.44}; - li_typemaps.inout_double(var); - if (var[0] != 44.44) exit_test("inout_double"); - } - { - double[] var = {44.44}; - li_typemaps.inoutr_double(var); - if (var[0] != 44.44) exit_test("inoutr_double"); - } - try { - double[] var = null; - li_typemaps.inout_double(var); - exit_test("null inout_double"); - } catch (NullPointerException e) { - } - - // Check unsigned long long INPUT typemaps - BigInteger forty = new BigInteger("40"); - BigInteger twenty = new BigInteger("20"); - if (!li_typemaps.in_ulonglong(twenty).equals(twenty)) exit_test("in_ulonglong"); - if (!li_typemaps.inr_ulonglong(twenty).equals(twenty)) exit_test("inr_ulonglong"); - - try { - li_typemaps.in_ulonglong(null); - exit_test("null in_ulonglong"); - } catch (NullPointerException e) { - } - - // Check unsigned long long OUTPUT typemaps - { - BigInteger[] var = {new BigInteger("40")}; - li_typemaps.out_ulonglong(twenty, var); - if (!var[0].equals(twenty)) exit_test("out_ulonglong"); - } - { - BigInteger[] var = {new BigInteger("40")}; - li_typemaps.outr_ulonglong(twenty, var); - if (!var[0].equals(twenty)) exit_test("outr_ulonglong"); - } - try { - BigInteger[] var = null; - li_typemaps.out_ulonglong(twenty, var); - exit_test("null out_ulonglong"); - } catch (NullPointerException e) { - } - { - BigInteger[] var = { null }; - li_typemaps.out_ulonglong(twenty, var); - if (!var[0].equals(twenty)) exit_test("null element out_ulonglong"); - } - - // Check unsigned long long INOUT typemaps - { - BigInteger[] var = {new BigInteger("40")}; - li_typemaps.inout_ulonglong(var); - if (!var[0].equals(forty)) exit_test("inout_ulonglong"); - } - { - BigInteger[] var = {new BigInteger("40")}; - li_typemaps.inoutr_ulonglong(var); - if (!var[0].equals(forty)) exit_test("inoutr_ulonglong"); - } - try { - BigInteger[] var = null; - li_typemaps.inout_ulonglong(var); - exit_test("null inout_ulonglong"); - } catch (NullPointerException e) { - } - try { - BigInteger[] var = { null }; - li_typemaps.inout_ulonglong(var); - exit_test("null element inout_ulonglong"); - } catch (NullPointerException e) { - } - - } - - private static void exit_test(String funcName) { - throw new RuntimeException("Test FAILED in function " + funcName); - } -} - diff --git a/Examples/test-suite/perl5/lib_std_string_runme.pl b/Examples/test-suite/perl5/lib_std_string_runme.pl deleted file mode 100644 index 662182848..000000000 --- a/Examples/test-suite/perl5/lib_std_string_runme.pl +++ /dev/null @@ -1,63 +0,0 @@ -use li_std_string; - - -# Checking expected use of %typemap(in) std::string {} -li_std_string::test_value("Fee"); - -# Checking expected result of %typemap(out) std::string {} -if (li_std_string::test_value("Fi") != "Fi") { - die "Test 1 failed"; -} - -###### passing undef seems to work - surely it should fail ???? -# Verify type-checking for %typemap(in) std::string {} -#eval { li_std_string::test_value(undef) }; -#if (!$@) { -# die "Test 2 failed"; -#} - -# Checking expected use of %typemap(in) const std::string & {} -li_std_string::test_const_reference("Fo"); - -# Checking expected result of %typemap(out) const std::string& {} -if (li_std_string::test_const_reference("Fum") != "Fum") { - die "Test 3 failed"; -} - -###### passing undef seems to work - surely it should fail ???? -# Verify type-checking for %typemap(in) const std::string & {} -#eval { li_std_string::test_const_reference(undef) }; -#if (!$@) { -# die "Test 4 failed"; -#} - -# -# Input and output typemaps for pointers and non-const references to -# std::string are *not* supported; the following tests confirm -# that none of these cases are slipping through. -# - -my $stringPtr = undef; - -$stringPtr = li_std_string::test_pointer_out(); - -li_std_string::test_pointer($stringPtr); - -$stringPtr = li_std_string::test_const_pointer_out(); - -li_std_string::test_const_pointer($stringPtr); - -$stringPtr = li_std_string::test_reference_out(); - -li_std_string::test_reference($stringPtr); - -# Check throw exception specification -eval { li_std_string::test_throw() }; -if (!$@) { - die "Test 5 failed"; -} -eval { li_std_string::test_const_reference_throw() }; -if (!$@) { - die "Test 6 failed"; -} - diff --git a/Examples/test-suite/php4/lib_carrays_runme.php4 b/Examples/test-suite/php4/lib_carrays_runme.php4 deleted file mode 100644 index 26fd06e88..000000000 --- a/Examples/test-suite/php4/lib_carrays_runme.php4 +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/Examples/test-suite/python/lib_std_map_runme.py b/Examples/test-suite/python/lib_std_map_runme.py deleted file mode 100644 index be190f101..000000000 --- a/Examples/test-suite/python/lib_std_map_runme.py +++ /dev/null @@ -1,17 +0,0 @@ -import li_std_map - -a1 = li_std_map.A(3) -a2 = li_std_map.A(7) - - -if 1: - p0 = li_std_map.pairii(1,2) - p1 = li_std_map.pairA(1,a1.this) - m = {} - m[1] = a1 - m[2] = a2 - - li_std_map.p_identa(p1) - li_std_map.m_identa(m) - - diff --git a/Examples/test-suite/python/lib_std_pair_runme.py b/Examples/test-suite/python/lib_std_pair_runme.py deleted file mode 100644 index 27e291d08..000000000 --- a/Examples/test-suite/python/lib_std_pair_runme.py +++ /dev/null @@ -1,49 +0,0 @@ -import li_std_pair - -p = (1,2) -p1 = li_std_pair.p_inout(p) -p2 = li_std_pair.p_inoutd(p1) - -d1 = li_std_pair.d_inout(2) - -i,d2 = li_std_pair.d_inout2(2) - -i,p = li_std_pair.p_inout2(p) -p3,p4 = li_std_pair.p_inout3(p1,p1) - -psi = li_std_pair.SIPair("hello",1) -pci = li_std_pair.CIPair(1,1) - - -#psi.first = "hi" - - -psi = li_std_pair.SIPair("hi",1) -if psi != ("hi",1): - raise RuntimeError - -psii = li_std_pair.SIIPair(psi,1) - -a = li_std_pair.A() -b = li_std_pair.B() - -pab = li_std_pair.ABPair(a,b); - -pab.first = a -pab.first.val = 2 - -if pab.first.val != 2: - raise RuntimeError - - -pci = li_std_pair.CIntPair(1,0) - -a = li_std_pair.A(5) -p1 = li_std_pair.pairP1(1,a.this) -p2 = li_std_pair.pairP2(a,1) -p3 = li_std_pair.pairP3(a,a) - - -if a.val != li_std_pair.p_identa(p1.this)[1].val: - raise RuntimeError - diff --git a/Examples/test-suite/python/lib_std_string_runme.py b/Examples/test-suite/python/lib_std_string_runme.py deleted file mode 100644 index 1564da560..000000000 --- a/Examples/test-suite/python/lib_std_string_runme.py +++ /dev/null @@ -1,74 +0,0 @@ -import li_std_string - -x="hello" - - - -if li_std_string.test_ccvalue(x) != x: - raise RuntimeError, "bad string mapping" - -if li_std_string.test_cvalue(x) != x: - raise RuntimeError, "bad string mapping" - -if li_std_string.test_value(x) != x: - raise RuntimeError, "bad string mapping" - -if li_std_string.test_const_reference(x) != x: - raise RuntimeError, "bad string mapping" - - -s = li_std_string.string("he") -#s += "ll" -#s.append('o') -s += "llo" - -if s != x: - print s, x - raise RuntimeError, "bad string mapping" - -if s[1:4] != x[1:4]: - raise RuntimeError, "bad string mapping" - -if li_std_string.test_value(s) != x: - raise RuntimeError, "bad string mapping" - -if li_std_string.test_const_reference(s) != x: - raise RuntimeError, "bad string mapping" - -a = li_std_string.A(s) - -if li_std_string.test_value(a) != x: - raise RuntimeError, "bad string mapping" - -if li_std_string.test_const_reference(a) != x: - raise RuntimeError, "bad string mapping" - -b = li_std_string.string(" world") - -if a + b != "hello world": - raise RuntimeError, "bad string mapping" - -if a + " world" != "hello world": - raise RuntimeError, "bad string mapping" - -if "hello" + b != "hello world": - raise RuntimeError, "bad string mapping" - -c = "hello" + b -if c.find_last_of("l") != 9: - raise RuntimeError, "bad string mapping" - -s = "hello world" - -b = li_std_string.B("hi") - -b.name = li_std_string.string("hello") -if b.name != "hello": - raise RuntimeError, "bad string mapping" - - -b.a = li_std_string.A("hello") -if b.a != "hello": - raise RuntimeError, "bad string mapping" - - diff --git a/Examples/test-suite/python/lib_std_vector_runme.py b/Examples/test-suite/python/lib_std_vector_runme.py deleted file mode 100644 index 89e5f3968..000000000 --- a/Examples/test-suite/python/lib_std_vector_runme.py +++ /dev/null @@ -1,91 +0,0 @@ -from li_std_vector import * - -iv = IntVector(4) -for i in range(0,4): - iv[i] = i - -x = average(iv) -y = average([1,2,3,4]) - -a = half([10,10.5,11,11.5]) - -dv = DoubleVector(10) -for i in range(0,10): - dv[i] = i/2.0 - -halve_in_place(dv) - - -bv = BoolVector(4) -bv[0]= 1 -bv[1]= 0 -bv[2]= 4 -bv[3]= 0 - -if bv[0] != bv[2]: - raise RuntimeError,"bad std::vector mapping" - -b = B(5) -va = VecA([b,None,b,b]) - -if va[0].f(1) != 6: - raise RuntimeError,"bad std::vector mapping" - -if vecAptr(va) != 6: - raise RuntimeError,"bad std::vector mapping" - -b.val = 7 -if va[3].f(1) != 8: - raise RuntimeError,"bad std::vector mapping" - - -ip = PtrInt() -ap = new_ArrInt(10) - -ArrInt_setitem(ip,0,123) -ArrInt_setitem(ap,2,123) - -vi = IntPtrVector((ip,ap,None)) -if ArrInt_getitem(vi[0],0) != ArrInt_getitem(vi[1],2): - raise RuntimeError,"bad std::vector mapping" - - - -a = halfs([10,8,4,3]) - -v = IntVector() -v[0:2] = [1,2] -if v[0] != 1 or v[1] != 2: - raise RuntimeError,"bad setslice" - -if v[0:-1][0] != 1: - raise RuntimeError,"bad getslice" - -if v[0:-2].size() != 0: - raise RuntimeError,"bad getslice" - -v[0:1] = [2] -if v[0] != 2: - raise RuntimeError,"bad setslice" - -v[1:] = [3] -if v[1] != 3: - raise RuntimeError,"bad setslice" - -v[2:] = [3] -if v[2] != 3: - raise RuntimeError,"bad setslice" - -if v[0:][0] != v[0]: - raise RuntimeError,"bad getslice" - - -del v[:] -if v.size() != 0: - raise RuntimeError,"bad getslice" - -del v[:] -if v.size() != 0: - raise RuntimeError,"bad getslice" - - diff --git a/Examples/test-suite/python/lib_std_wstring_runme.py b/Examples/test-suite/python/lib_std_wstring_runme.py deleted file mode 100644 index 3e49033fd..000000000 --- a/Examples/test-suite/python/lib_std_wstring_runme.py +++ /dev/null @@ -1,75 +0,0 @@ -import li_std_wstring - -x=u"h" - -if li_std_wstring.test_wcvalue(x) != x: - raise RuntimeError, "bad string mapping" - -x=u"hello" -if li_std_wstring.test_ccvalue(x) != x: - raise RuntimeError, "bad string mapping" - -if li_std_wstring.test_cvalue(x) != x: - raise RuntimeError, "bad string mapping" - -if li_std_wstring.test_value(x) != x: - print x, li_std_wstring.test_value(x) - raise RuntimeError, "bad string mapping" - -if li_std_wstring.test_const_reference(x) != x: - raise RuntimeError, "bad string mapping" - - -s = li_std_wstring.wstring(u"he") -s += u"llo" - -if s != x: - print s, x - raise RuntimeError, "bad string mapping" - -if s[1:4] != x[1:4]: - raise RuntimeError, "bad string mapping" - -if li_std_wstring.test_value(s) != x: - raise RuntimeError, "bad string mapping" - -if li_std_wstring.test_const_reference(s) != x: - raise RuntimeError, "bad string mapping" - -a = li_std_wstring.A(s) - -if li_std_wstring.test_value(a) != x: - raise RuntimeError, "bad string mapping" - -if li_std_wstring.test_const_reference(a) != x: - raise RuntimeError, "bad string mapping" - -b = li_std_wstring.wstring(" world") - -if a + b != "hello world": - raise RuntimeError, "bad string mapping" - -if a + " world" != "hello world": - raise RuntimeError, "bad string mapping" - -if "hello" + b != "hello world": - raise RuntimeError, "bad string mapping" - -c = "hello" + b -if c.find_last_of("l") != 9: - raise RuntimeError, "bad string mapping" - -s = "hello world" - -b = li_std_wstring.B("hi") - -b.name = li_std_wstring.wstring(u"hello") -if b.name != "hello": - raise RuntimeError, "bad string mapping" - - -b.a = li_std_wstring.A("hello") -if b.a != u"hello": - raise RuntimeError, "bad string mapping" - - diff --git a/Examples/test-suite/ruby/lib_carrays_runme.rb b/Examples/test-suite/ruby/lib_carrays_runme.rb deleted file mode 100644 index d133526f9..000000000 --- a/Examples/test-suite/ruby/lib_carrays_runme.rb +++ /dev/null @@ -1,25 +0,0 @@ -require 'li_carrays' - -include Lib_carrays - -# -# Testing for %array_functions(int,intArray) -# -ary = new_intArray(2) -intArray_setitem(ary, 0, 0) -intArray_setitem(ary, 1, 1) -intArray_getitem(ary, 0) -intArray_getitem(ary, 1) -delete_intArray(ary) - -# -# Testing for %array_class(double, doubleArray) -# -ary = DoubleArray.new(2) -ary[0] = 0.0 -ary[1] = 1.0 -ary[0] -ary[1] -ptr = ary.cast -ary2 = DoubleArray.frompointer(ptr) - diff --git a/Examples/test-suite/ruby/lib_std_deque_runme.rb b/Examples/test-suite/ruby/lib_std_deque_runme.rb deleted file mode 100644 index 24a84b78d..000000000 --- a/Examples/test-suite/ruby/lib_std_deque_runme.rb +++ /dev/null @@ -1,44 +0,0 @@ -require 'li_std_deque' - -include Lib_std_deque - -# Test constructors for std::deque -intDeque = IntDeque.new -intDeque2 = IntDeque.new(3) -intDeque3 = IntDeque.new(4, 42) -intDeque4 = IntDeque.new(intDeque3) - -# Test constructors for std::deque -doubleDeque = DoubleDeque.new -doubleDeque2 = DoubleDeque.new(3) -doubleDeque3 = DoubleDeque.new(4, 42.0) -doubleDeque4 = DoubleDeque.new(doubleDeque3) - -# Test constructors for std::deque -realDeque = RealDeque.new -realDeque2 = RealDeque.new(3) -realDeque3 = RealDeque.new(4, 42.0) -realDeque4 = RealDeque.new(realDeque3) - -# average() should return the average of all values in a std::deque -intDeque << 2 -intDeque << 4 -intDeque << 6 -avg = average(intDeque) -raise RuntimeError if avg != 4.0 - -# -# half() should return a std::deque, where each element is half -# the value of the corresponding element in the input deque. -# The original deque's contents are unchanged. -# -realDeque.clear -realDeque << 2.0 -halfDeque = half(realDeque) -raise RuntimeError unless halfDeque[0] == 1.0 - -# -# halve_in_place() should... -# -halve_in_place(doubleDeque) - diff --git a/Examples/test-suite/ruby/lib_std_pair_runme.rb b/Examples/test-suite/ruby/lib_std_pair_runme.rb deleted file mode 100755 index dbb36529e..000000000 --- a/Examples/test-suite/ruby/lib_std_pair_runme.rb +++ /dev/null @@ -1,47 +0,0 @@ -require 'li_std_pair' - -include Lib_std_pair - -# -# Because of template specializations for pair, this should return -# an Array of size 2, where both elements are Fixnums. -# -intPair = makeIntPair(7, 6) -raise RuntimeError unless intPair.instance_of?(Array) -raise RuntimeError unless intPair.size == 2 -raise RuntimeError unless (intPair[0] == 7 && intPair[1] == 6) - -# -# Each of these should return a reference to a wrapped -# std::pair object (i.e. an IntPair instance). -# -intPairPtr = makeIntPairPtr(7, 6) -raise RuntimeError unless intPairPtr.instance_of?(IntPair) -raise RuntimeError unless (intPairPtr.first == 7 && intPairPtr.second == 6) - -intPairRef = makeIntPairRef(7, 6) -raise RuntimeError unless intPairRef.instance_of?(IntPair) -raise RuntimeError unless (intPairRef.first == 7 && intPairRef.second == 6) - -intPairConstRef = makeIntPairConstRef(7, 6) -raise RuntimeError unless intPairConstRef.instance_of?(IntPair) -raise RuntimeError unless (intPairConstRef.first == 7 && intPairConstRef.second == 6) - -# -# Now test various input typemaps. Each of the wrapped C++ functions -# (product1, product2 and product3) is expecting an argument of a -# different type (see li_std_pair.i). Typemaps should be in place to -# convert this Array into the expected argument type. -# -raise RuntimeError unless product1(intPair) == 42 -raise RuntimeError unless product2(intPair) == 42 -raise RuntimeError unless product3(intPair) == 42 - -# -# Similarly, each of the input typemaps should know what to do -# with an IntPair instance. -# -raise RuntimeError unless product1(intPairPtr) == 42 -raise RuntimeError unless product2(intPairPtr) == 42 -raise RuntimeError unless product3(intPairPtr) == 42 - diff --git a/Examples/test-suite/ruby/lib_std_string_runme.rb b/Examples/test-suite/ruby/lib_std_string_runme.rb deleted file mode 100644 index 8836a05a0..000000000 --- a/Examples/test-suite/ruby/lib_std_string_runme.rb +++ /dev/null @@ -1,78 +0,0 @@ -require 'li_std_string' - -include Lib_std_string - -# Checking expected use of %typemap(in) std::string {} -test_value("Fee") - -# Checking expected result of %typemap(out) std::string {} -raise RuntimeError unless test_value("Fi") == "Fi" - -# Verify type-checking for %typemap(in) std::string {} -exceptionRaised = false -begin - test_value(0) -rescue TypeError - exceptionRaised = true -ensure - raise RuntimeError unless exceptionRaised -end - -# Checking expected use of %typemap(in) const std::string & {} -test_const_reference("Fo") - -# Checking expected result of %typemap(out) const std::string& {} -raise RuntimeError unless test_const_reference("Fum") == "Fum" - -# Verify type-checking for %typemap(in) const std::string & {} -exceptionRaised = false -begin - test_const_reference(0) -rescue TypeError - exceptionRaised = true -ensure - raise RuntimeError unless exceptionRaised -end - -# -# Input and output typemaps for pointers and non-const references to -# std::string are *not* supported; the following tests confirm -# that none of these cases are slipping through. -# - -exceptionRaised = false -begin - test_pointer("foo") -rescue TypeError - exceptionRaised = true -ensure - raise RuntimeError unless exceptionRaised -end - -result = test_pointer_out() -raise RuntimeError if result.is_a? String - -exceptionRaised = false -begin - test_const_pointer("bar") -rescue TypeError - exceptionRaised = true -ensure - raise RuntimeError unless exceptionRaised -end - -result = test_const_pointer_out() -raise RuntimeError if result.is_a? String - -exceptionRaised = false -begin - test_reference("foo") -rescue TypeError - exceptionRaised = true -ensure - raise RuntimeError unless exceptionRaised -end - -result = test_reference_out() -raise RuntimeError if result.is_a? String - diff --git a/Examples/test-suite/ruby/lib_std_vector_runme.rb b/Examples/test-suite/ruby/lib_std_vector_runme.rb deleted file mode 100755 index 4340377ea..000000000 --- a/Examples/test-suite/ruby/lib_std_vector_runme.rb +++ /dev/null @@ -1,17 +0,0 @@ -require 'li_std_vector' - -include Lib_std_vector - -iv = IntVector.new(4) -0.upto(3) { |i| iv[i] = i } - -x = average(iv) -y = average([1, 2, 3, 4]) - -a = half([10, 10.5, 11, 11.5]) - -dv = DoubleVector.new(10) -0.upto(9) { |i| dv[i] = i/2.0 } - -halve_in_place(dv) -