/trunk/Examples/test-suite/octave/template_typedef_runme.m

# · MATLAB · 51 lines · 41 code · 10 blank · 0 comment · 7 complexity · 6fbdba6cf75e62c4e8cbbec9bbf92f51 MD5 · raw file

  1. template_typedef
  2. d = make_Identity_float();
  3. c = make_Identity_reald();
  4. try
  5. a = swig_this(d);
  6. a = swig_this(c);
  7. catch
  8. error
  9. end_try_catch
  10. try
  11. e = make_Multiplies_float_float_float_float(d, d);
  12. a = swig_this(e);
  13. catch
  14. e
  15. error("is not an instance")
  16. end_try_catch
  17. try
  18. f = make_Multiplies_reald_reald_reald_reald(c, c);
  19. a = swig_this(f);
  20. catch
  21. f
  22. error("is not an instance");
  23. end_try_catch
  24. try
  25. g = make_Multiplies_float_float_reald_reald(d, c);
  26. a = swig_this(g);
  27. catch
  28. error(g, "is not an instance")
  29. end_try_catch
  30. # the old large format
  31. if (strcmp("<unknown>",swig_typequery("vfncs::ArithUnaryFunction<vfncs::arith_traits<float,double>::argument_type,vfncs::arith_traits<float,double >::result_type > *")))
  32. error
  33. endif
  34. # the reduced format
  35. if (strcmp("<unknown>",swig_typequery("vfncs::ArithUnaryFunction<double,double> *")))
  36. error
  37. endif
  38. # this is a bad name
  39. if (!strcmp("<unknown>",swig_typequery("vfncs::ArithUnaryFunction<double,doublex> *")))
  40. error
  41. endif