Advertisement
Guest User

Untitled

a guest
Jun 17th, 2014
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. octave_value arg = args (0);
  2.  
  3. if (arg.is_bool_type ())
  4. {
  5. if (arg.is_sparse_type ())
  6. {
  7. SparseBoolMatrix v = arg.sparse_bool_matrix_value ();
  8.  
  9. if (! error_state)
  10. retval = do_fun(v);
  11. }
  12. else
  13. {
  14. boolNDArray v = arg.bool_array_value ();
  15.  
  16. if (! error_state)
  17. retval = do_fun(v)
  18. }
  19. }
  20. else if (arg.is_integer_type ())
  21. {
  22. #define DO_INT_BRANCH(INTT) \
  23. else if (arg.is_ ## INTT ## _type ()) \
  24. { \
  25. INTT ## NDArray v = arg.INTT ## _array_value (); \
  26. \
  27. if (! error_state) \
  28. retval = do_fun (v);\
  29. }
  30.  
  31. if (false)
  32. ;
  33. DO_INT_BRANCH (int8)
  34. DO_INT_BRANCH (int16)
  35. DO_INT_BRANCH (int32)
  36. DO_INT_BRANCH (int64)
  37. DO_INT_BRANCH (uint8)
  38. DO_INT_BRANCH (uint16)
  39. DO_INT_BRANCH (uint32)
  40. DO_INT_BRANCH (uint64)
  41. else
  42. panic_impossible ();
  43. }
  44. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement