PageRenderTime 53ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
MATLAB | 103 lines | 84 code | 19 blank | 0 comment | 13 complexity | b15ea9e0cb807a8498ada79339681ff3 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. template_typedef_cplx2
  2. #
  3. # double case
  4. #
  5. try
  6. d = make_Identity_double();
  7. a = swig_this(d);
  8. catch
  9. d
  10. error("is not an instance")
  11. end_try_catch
  12. if (findstr('ArithUnaryFunction',swig_type(d)) != 1)
  13. d
  14. error("is not an ArithUnaryFunction")
  15. error
  16. endif
  17. try
  18. e = make_Multiplies_double_double_double_double(d, d);
  19. a = swig_this(e);
  20. catch
  21. e
  22. error("is not an instance")
  23. end_try_catch
  24. if (findstr('ArithUnaryFunction',swig_type(e)) != 1)
  25. e
  26. error("is not an ArithUnaryFunction")
  27. endif
  28. #
  29. # complex case
  30. #
  31. try
  32. c = make_Identity_complex();
  33. a = swig_this(c);
  34. catch
  35. c
  36. error("is not an instance")
  37. end_try_catch
  38. if (findstr('ArithUnaryFunction',swig_type(c)) != 1)
  39. c
  40. error("is not an ArithUnaryFunction")
  41. endif
  42. try
  43. f = make_Multiplies_complex_complex_complex_complex(c, c);
  44. a = swig_this(f);
  45. catch
  46. f
  47. error("is not an instance")
  48. end_try_catch
  49. if (findstr('ArithUnaryFunction',swig_type(f)) != 1)
  50. f
  51. error("is not an ArithUnaryFunction")
  52. endif
  53. #
  54. # Mix case
  55. #
  56. try
  57. g = make_Multiplies_double_double_complex_complex(d, c);
  58. a = swig_this(g);
  59. catch
  60. g
  61. error("is not an instance")
  62. end_try_catch
  63. if (findstr('ArithUnaryFunction',swig_type(g)) != 1)
  64. g
  65. error("is not an ArithUnaryFunction")
  66. error
  67. endif
  68. try
  69. h = make_Multiplies_complex_complex_double_double(c, d);
  70. a = swig_this(h);
  71. catch
  72. h
  73. error("is not an instance")
  74. end_try_catch
  75. if (findstr('ArithUnaryFunction',swig_type(h)) == -1)
  76. h
  77. error("is not an ArithUnaryFunction")
  78. endif
  79. try
  80. a = g.get_value();
  81. catch
  82. error(g, "has not get_value() method")
  83. error
  84. end_try_catch