webruby 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1364) hide show
  1. checksums.yaml +7 -0
  2. data/bin/webruby +36 -0
  3. data/driver/driver.c +50 -0
  4. data/driver/main.c +40 -0
  5. data/lib/webruby/app.rb +13 -0
  6. data/lib/webruby/config.rb +61 -0
  7. data/lib/webruby/environment.rb +32 -0
  8. data/lib/webruby/rake/files.rake +66 -0
  9. data/lib/webruby/rake/general.rake +22 -0
  10. data/lib/webruby/rake/mruby.rake +44 -0
  11. data/lib/webruby/utility.rb +132 -0
  12. data/lib/webruby.rb +10 -0
  13. data/modules/emscripten/AUTHORS +89 -0
  14. data/modules/emscripten/LICENSE +68 -0
  15. data/modules/emscripten/README.markdown +14 -0
  16. data/modules/emscripten/cmake/Platform/Emscripten.cmake +61 -0
  17. data/modules/emscripten/cmake/Platform/Emscripten_unix.cmake +24 -0
  18. data/modules/emscripten/em++ +12 -0
  19. data/modules/emscripten/em++.bat +2 -0
  20. data/modules/emscripten/em-config +24 -0
  21. data/modules/emscripten/em-config.bat +2 -0
  22. data/modules/emscripten/emar +24 -0
  23. data/modules/emscripten/emar.bat +2 -0
  24. data/modules/emscripten/emcc +1744 -0
  25. data/modules/emscripten/emcc.bat +2 -0
  26. data/modules/emscripten/emcc.py +5 -0
  27. data/modules/emscripten/emconfigure +27 -0
  28. data/modules/emscripten/emconfigure.bat +2 -0
  29. data/modules/emscripten/emlibtool +11 -0
  30. data/modules/emscripten/emlibtool.bat +2 -0
  31. data/modules/emscripten/emlink.py +293 -0
  32. data/modules/emscripten/emmake +29 -0
  33. data/modules/emscripten/emmake.bat +2 -0
  34. data/modules/emscripten/emranlib +9 -0
  35. data/modules/emscripten/emranlib.bat +2 -0
  36. data/modules/emscripten/emscons +20 -0
  37. data/modules/emscripten/emscripten.py +835 -0
  38. data/modules/emscripten/patches/README +4 -0
  39. data/modules/emscripten/patches/series +2 -0
  40. data/modules/emscripten/scons-tools/closure.py +28 -0
  41. data/modules/emscripten/scons-tools/emscripten.py +359 -0
  42. data/modules/emscripten/scons-tools/llvm.py +33 -0
  43. data/modules/emscripten/src/analyzer.js +1695 -0
  44. data/modules/emscripten/src/compiler.html +48 -0
  45. data/modules/emscripten/src/compiler.js +298 -0
  46. data/modules/emscripten/src/corruptionCheck.js +98 -0
  47. data/modules/emscripten/src/determinstic.js +20 -0
  48. data/modules/emscripten/src/embind/embind.js +1677 -0
  49. data/modules/emscripten/src/embind/emval.js +283 -0
  50. data/modules/emscripten/src/experimental/allow_loopvars_from_memsetcpy_inasm.diff +97 -0
  51. data/modules/emscripten/src/experimental/batching.diff +44 -0
  52. data/modules/emscripten/src/experimental/functypeopt.diff +113 -0
  53. data/modules/emscripten/src/experimental/multiple_heaps.diff +175 -0
  54. data/modules/emscripten/src/experimental/noncallgraphprofiling.diff +197 -0
  55. data/modules/emscripten/src/experimental/optimize_memcpy_for_ta1.diff +124 -0
  56. data/modules/emscripten/src/experimental/remove__label__s.diff +140 -0
  57. data/modules/emscripten/src/experimental/renderer_cache_hash.diff +99 -0
  58. data/modules/emscripten/src/experimental/sdl_key_forwarding.diff +57 -0
  59. data/modules/emscripten/src/experimental/simplifyGeneratedFunctionsDetection.diff +336 -0
  60. data/modules/emscripten/src/experimental/stringCache.diff +147 -0
  61. data/modules/emscripten/src/fastLong.js +299 -0
  62. data/modules/emscripten/src/framework.js +257 -0
  63. data/modules/emscripten/src/gl-matrix.js +1952 -0
  64. data/modules/emscripten/src/headless.js +904 -0
  65. data/modules/emscripten/src/intertyper.js +1050 -0
  66. data/modules/emscripten/src/jsifier.js +1827 -0
  67. data/modules/emscripten/src/library.js +8270 -0
  68. data/modules/emscripten/src/library_browser.js +911 -0
  69. data/modules/emscripten/src/library_egl.js +491 -0
  70. data/modules/emscripten/src/library_gc.js +236 -0
  71. data/modules/emscripten/src/library_gl.js +4452 -0
  72. data/modules/emscripten/src/library_glfw.js +576 -0
  73. data/modules/emscripten/src/library_glut.js +449 -0
  74. data/modules/emscripten/src/library_jansson.js +320 -0
  75. data/modules/emscripten/src/library_openal.js +602 -0
  76. data/modules/emscripten/src/library_sdl.js +2024 -0
  77. data/modules/emscripten/src/library_strtok_r.c +97 -0
  78. data/modules/emscripten/src/library_xlib.js +23 -0
  79. data/modules/emscripten/src/long.js +1609 -0
  80. data/modules/emscripten/src/modules.js +491 -0
  81. data/modules/emscripten/src/parseTools.js +2474 -0
  82. data/modules/emscripten/src/postamble.js +170 -0
  83. data/modules/emscripten/src/postamble_sharedlib.js +16 -0
  84. data/modules/emscripten/src/preamble.js +914 -0
  85. data/modules/emscripten/src/preamble_sharedlib.js +25 -0
  86. data/modules/emscripten/src/relooper/README.markdown +14 -0
  87. data/modules/emscripten/src/relooper/Relooper.cpp +1236 -0
  88. data/modules/emscripten/src/relooper/Relooper.h +250 -0
  89. data/modules/emscripten/src/relooper/doit.sh +70 -0
  90. data/modules/emscripten/src/relooper/emscripten/glue.js +57 -0
  91. data/modules/emscripten/src/relooper/emscripten/test.js +44 -0
  92. data/modules/emscripten/src/relooper/fuzzer.py +116 -0
  93. data/modules/emscripten/src/relooper/ministring.h +35 -0
  94. data/modules/emscripten/src/relooper/paper.pdf +0 -0
  95. data/modules/emscripten/src/relooper/test.cpp +262 -0
  96. data/modules/emscripten/src/relooper/test.txt +155 -0
  97. data/modules/emscripten/src/relooper/test2.c +44 -0
  98. data/modules/emscripten/src/relooper/test2.txt +12 -0
  99. data/modules/emscripten/src/relooper/test3.c +42 -0
  100. data/modules/emscripten/src/relooper/test3.txt +27 -0
  101. data/modules/emscripten/src/relooper/test4.cpp +40 -0
  102. data/modules/emscripten/src/relooper/test4.txt +23 -0
  103. data/modules/emscripten/src/relooper/test5.cpp +40 -0
  104. data/modules/emscripten/src/relooper/test5.txt +32 -0
  105. data/modules/emscripten/src/relooper/test6.cpp +31 -0
  106. data/modules/emscripten/src/relooper/test6.txt +12 -0
  107. data/modules/emscripten/src/relooper/test_dead.cpp +28 -0
  108. data/modules/emscripten/src/relooper/test_dead.txt +9 -0
  109. data/modules/emscripten/src/relooper/test_debug.cpp +30 -0
  110. data/modules/emscripten/src/relooper/test_debug.txt +128 -0
  111. data/modules/emscripten/src/relooper/test_fuzz1.cpp +52 -0
  112. data/modules/emscripten/src/relooper/test_fuzz1.txt +32 -0
  113. data/modules/emscripten/src/relooper/test_fuzz2.cpp +34 -0
  114. data/modules/emscripten/src/relooper/test_fuzz2.txt +13 -0
  115. data/modules/emscripten/src/relooper/test_fuzz3.cpp +36 -0
  116. data/modules/emscripten/src/relooper/test_fuzz3.txt +9 -0
  117. data/modules/emscripten/src/relooper/test_fuzz4.cpp +38 -0
  118. data/modules/emscripten/src/relooper/test_fuzz4.txt +19 -0
  119. data/modules/emscripten/src/relooper/test_fuzz5.cpp +57 -0
  120. data/modules/emscripten/src/relooper/test_fuzz5.txt +52 -0
  121. data/modules/emscripten/src/relooper/test_fuzz6.cpp +322 -0
  122. data/modules/emscripten/src/relooper/test_fuzz6.txt +108 -0
  123. data/modules/emscripten/src/relooper/test_inf.cpp +813 -0
  124. data/modules/emscripten/src/relooper/test_inf.txt +385 -0
  125. data/modules/emscripten/src/relooper/testit.sh +62 -0
  126. data/modules/emscripten/src/relooper/updateit.sh +17 -0
  127. data/modules/emscripten/src/relooper.js +11516 -0
  128. data/modules/emscripten/src/relooper.js.raw.js +11511 -0
  129. data/modules/emscripten/src/runtime.js +546 -0
  130. data/modules/emscripten/src/settings.js +1284 -0
  131. data/modules/emscripten/src/shell.html +92 -0
  132. data/modules/emscripten/src/shell.js +153 -0
  133. data/modules/emscripten/src/shell_sharedlib.js +12 -0
  134. data/modules/emscripten/src/socket.io.js +3870 -0
  135. data/modules/emscripten/src/utility.js +379 -0
  136. data/modules/emscripten/src/wrtcp.js +821 -0
  137. data/modules/emscripten/system/include/AL/al.h +172 -0
  138. data/modules/emscripten/system/include/AL/alc.h +84 -0
  139. data/modules/emscripten/system/include/EGL/egl.h +329 -0
  140. data/modules/emscripten/system/include/EGL/eglext.h +398 -0
  141. data/modules/emscripten/system/include/EGL/eglplatform.h +141 -0
  142. data/modules/emscripten/system/include/GL/freeglut_std.h +628 -0
  143. data/modules/emscripten/system/include/GL/gl.h +2241 -0
  144. data/modules/emscripten/system/include/GL/glew.h +6 -0
  145. data/modules/emscripten/system/include/GL/glext.h +11127 -0
  146. data/modules/emscripten/system/include/GL/glfw.h +518 -0
  147. data/modules/emscripten/system/include/GL/glu.h +353 -0
  148. data/modules/emscripten/system/include/GL/glut.h +21 -0
  149. data/modules/emscripten/system/include/GLES/gl.h +770 -0
  150. data/modules/emscripten/system/include/GLES/glext.h +1278 -0
  151. data/modules/emscripten/system/include/GLES/glplatform.h +30 -0
  152. data/modules/emscripten/system/include/GLES2/gl2.h +621 -0
  153. data/modules/emscripten/system/include/GLES2/gl2ext.h +803 -0
  154. data/modules/emscripten/system/include/GLES2/gl2platform.h +30 -0
  155. data/modules/emscripten/system/include/KHR/khrplatform.h +277 -0
  156. data/modules/emscripten/system/include/SDL/COPYING +19 -0
  157. data/modules/emscripten/system/include/SDL/SDL.h +162 -0
  158. data/modules/emscripten/system/include/SDL/SDL_assert.h +241 -0
  159. data/modules/emscripten/system/include/SDL/SDL_atomic.h +318 -0
  160. data/modules/emscripten/system/include/SDL/SDL_audio.h +509 -0
  161. data/modules/emscripten/system/include/SDL/SDL_blendmode.h +60 -0
  162. data/modules/emscripten/system/include/SDL/SDL_clipboard.h +75 -0
  163. data/modules/emscripten/system/include/SDL/SDL_compat.h +365 -0
  164. data/modules/emscripten/system/include/SDL/SDL_config.h +48 -0
  165. data/modules/emscripten/system/include/SDL/SDL_config.h.in +297 -0
  166. data/modules/emscripten/system/include/SDL/SDL_config_android.h +133 -0
  167. data/modules/emscripten/system/include/SDL/SDL_config_iphoneos.h +148 -0
  168. data/modules/emscripten/system/include/SDL/SDL_config_macosx.h +172 -0
  169. data/modules/emscripten/system/include/SDL/SDL_config_minimal.h +74 -0
  170. data/modules/emscripten/system/include/SDL/SDL_config_nintendods.h +129 -0
  171. data/modules/emscripten/system/include/SDL/SDL_config_pandora.h +125 -0
  172. data/modules/emscripten/system/include/SDL/SDL_config_windows.h +207 -0
  173. data/modules/emscripten/system/include/SDL/SDL_config_wiz.h +119 -0
  174. data/modules/emscripten/system/include/SDL/SDL_copying.h +20 -0
  175. data/modules/emscripten/system/include/SDL/SDL_cpuinfo.h +150 -0
  176. data/modules/emscripten/system/include/SDL/SDL_endian.h +248 -0
  177. data/modules/emscripten/system/include/SDL/SDL_error.h +77 -0
  178. data/modules/emscripten/system/include/SDL/SDL_events.h +639 -0
  179. data/modules/emscripten/system/include/SDL/SDL_gesture.h +91 -0
  180. data/modules/emscripten/system/include/SDL/SDL_gfxPrimitives.h +246 -0
  181. data/modules/emscripten/system/include/SDL/SDL_haptic.h +1200 -0
  182. data/modules/emscripten/system/include/SDL/SDL_hints.h +206 -0
  183. data/modules/emscripten/system/include/SDL/SDL_image.h +138 -0
  184. data/modules/emscripten/system/include/SDL/SDL_input.h +87 -0
  185. data/modules/emscripten/system/include/SDL/SDL_joystick.h +208 -0
  186. data/modules/emscripten/system/include/SDL/SDL_keyboard.h +169 -0
  187. data/modules/emscripten/system/include/SDL/SDL_keycode.h +344 -0
  188. data/modules/emscripten/system/include/SDL/SDL_loadso.h +85 -0
  189. data/modules/emscripten/system/include/SDL/SDL_log.h +211 -0
  190. data/modules/emscripten/system/include/SDL/SDL_main.h +98 -0
  191. data/modules/emscripten/system/include/SDL/SDL_mixer.h +634 -0
  192. data/modules/emscripten/system/include/SDL/SDL_mouse.h +213 -0
  193. data/modules/emscripten/system/include/SDL/SDL_mutex.h +248 -0
  194. data/modules/emscripten/system/include/SDL/SDL_name.h +11 -0
  195. data/modules/emscripten/system/include/SDL/SDL_opengl.h +11116 -0
  196. data/modules/emscripten/system/include/SDL/SDL_opengles.h +38 -0
  197. data/modules/emscripten/system/include/SDL/SDL_opengles2.h +38 -0
  198. data/modules/emscripten/system/include/SDL/SDL_pixels.h +423 -0
  199. data/modules/emscripten/system/include/SDL/SDL_platform.h +160 -0
  200. data/modules/emscripten/system/include/SDL/SDL_power.h +79 -0
  201. data/modules/emscripten/system/include/SDL/SDL_quit.h +58 -0
  202. data/modules/emscripten/system/include/SDL/SDL_rect.h +136 -0
  203. data/modules/emscripten/system/include/SDL/SDL_render.h +615 -0
  204. data/modules/emscripten/system/include/SDL/SDL_revision.h +2 -0
  205. data/modules/emscripten/system/include/SDL/SDL_revision.h.orig +2 -0
  206. data/modules/emscripten/system/include/SDL/SDL_rotozoom.h +123 -0
  207. data/modules/emscripten/system/include/SDL/SDL_rwops.h +220 -0
  208. data/modules/emscripten/system/include/SDL/SDL_scancode.h +398 -0
  209. data/modules/emscripten/system/include/SDL/SDL_shape.h +147 -0
  210. data/modules/emscripten/system/include/SDL/SDL_stdinc.h +764 -0
  211. data/modules/emscripten/system/include/SDL/SDL_surface.h +499 -0
  212. data/modules/emscripten/system/include/SDL/SDL_syswm.h +241 -0
  213. data/modules/emscripten/system/include/SDL/SDL_thread.h +182 -0
  214. data/modules/emscripten/system/include/SDL/SDL_timer.h +108 -0
  215. data/modules/emscripten/system/include/SDL/SDL_touch.h +124 -0
  216. data/modules/emscripten/system/include/SDL/SDL_ttf.h +249 -0
  217. data/modules/emscripten/system/include/SDL/SDL_types.h +29 -0
  218. data/modules/emscripten/system/include/SDL/SDL_version.h +166 -0
  219. data/modules/emscripten/system/include/SDL/SDL_video.h +820 -0
  220. data/modules/emscripten/system/include/SDL/begin_code.h +135 -0
  221. data/modules/emscripten/system/include/SDL/close_code.h +37 -0
  222. data/modules/emscripten/system/include/X11/X.h +717 -0
  223. data/modules/emscripten/system/include/X11/Xatom.h +79 -0
  224. data/modules/emscripten/system/include/X11/Xfuncproto.h +127 -0
  225. data/modules/emscripten/system/include/X11/Xlib.h +4023 -0
  226. data/modules/emscripten/system/include/X11/Xosdefs.h +116 -0
  227. data/modules/emscripten/system/include/X11/Xutil.h +826 -0
  228. data/modules/emscripten/system/include/X11/keysym.h +73 -0
  229. data/modules/emscripten/system/include/X11/keysymdef.h +2389 -0
  230. data/modules/emscripten/system/include/bsd/float.h +91 -0
  231. data/modules/emscripten/system/include/bsd/readme.txt +2 -0
  232. data/modules/emscripten/system/include/bsd/sys/mman.h +180 -0
  233. data/modules/emscripten/system/include/bsd/sys/utsname.h +70 -0
  234. data/modules/emscripten/system/include/dlfcn.h +31 -0
  235. data/modules/emscripten/system/include/emscripten/bind.h +1210 -0
  236. data/modules/emscripten/system/include/emscripten/emscripten.h +388 -0
  237. data/modules/emscripten/system/include/emscripten/val.h +311 -0
  238. data/modules/emscripten/system/include/emscripten/wire.h +393 -0
  239. data/modules/emscripten/system/include/err.h +95 -0
  240. data/modules/emscripten/system/include/execinfo.h +44 -0
  241. data/modules/emscripten/system/include/features.h +3 -0
  242. data/modules/emscripten/system/include/gc.h +70 -0
  243. data/modules/emscripten/system/include/gfx/png.h +3798 -0
  244. data/modules/emscripten/system/include/gfx/pngconf.h +1665 -0
  245. data/modules/emscripten/system/include/gfx/tiff.h +654 -0
  246. data/modules/emscripten/system/include/gfx/tiffconf.h +104 -0
  247. data/modules/emscripten/system/include/gfx/tiffio.h +526 -0
  248. data/modules/emscripten/system/include/gfx/tiffvers.h +9 -0
  249. data/modules/emscripten/system/include/jansson.h +323 -0
  250. data/modules/emscripten/system/include/jansson_config.h +54 -0
  251. data/modules/emscripten/system/include/libc/_ansi.h +135 -0
  252. data/modules/emscripten/system/include/libc/_syslist.h +40 -0
  253. data/modules/emscripten/system/include/libc/alloca.h +21 -0
  254. data/modules/emscripten/system/include/libc/ar.h +69 -0
  255. data/modules/emscripten/system/include/libc/argz.h +33 -0
  256. data/modules/emscripten/system/include/libc/assert.h +46 -0
  257. data/modules/emscripten/system/include/libc/complex.h +124 -0
  258. data/modules/emscripten/system/include/libc/ctype.h +196 -0
  259. data/modules/emscripten/system/include/libc/dirent.h +16 -0
  260. data/modules/emscripten/system/include/libc/endian.h +3 -0
  261. data/modules/emscripten/system/include/libc/envlock.h +15 -0
  262. data/modules/emscripten/system/include/libc/envz.h +16 -0
  263. data/modules/emscripten/system/include/libc/errno.h +11 -0
  264. data/modules/emscripten/system/include/libc/fastmath.h +13 -0
  265. data/modules/emscripten/system/include/libc/fcntl.h +1 -0
  266. data/modules/emscripten/system/include/libc/fnmatch.h +55 -0
  267. data/modules/emscripten/system/include/libc/getopt.h +196 -0
  268. data/modules/emscripten/system/include/libc/glob.h +89 -0
  269. data/modules/emscripten/system/include/libc/grp.h +94 -0
  270. data/modules/emscripten/system/include/libc/iconv.h +62 -0
  271. data/modules/emscripten/system/include/libc/ieeefp.h +256 -0
  272. data/modules/emscripten/system/include/libc/ifaddrs.h +64 -0
  273. data/modules/emscripten/system/include/libc/inttypes.h +290 -0
  274. data/modules/emscripten/system/include/libc/iso646.h +43 -0
  275. data/modules/emscripten/system/include/libc/langinfo.h +316 -0
  276. data/modules/emscripten/system/include/libc/libgen.h +23 -0
  277. data/modules/emscripten/system/include/libc/limits.h +155 -0
  278. data/modules/emscripten/system/include/libc/locale.h +80 -0
  279. data/modules/emscripten/system/include/libc/machine/_default_types.h +121 -0
  280. data/modules/emscripten/system/include/libc/machine/_types.h +8 -0
  281. data/modules/emscripten/system/include/libc/machine/ansi.h +1 -0
  282. data/modules/emscripten/system/include/libc/machine/endian.h +31 -0
  283. data/modules/emscripten/system/include/libc/machine/fastmath.h +100 -0
  284. data/modules/emscripten/system/include/libc/machine/ieeefp.h +376 -0
  285. data/modules/emscripten/system/include/libc/machine/malloc.h +8 -0
  286. data/modules/emscripten/system/include/libc/machine/param.h +1 -0
  287. data/modules/emscripten/system/include/libc/machine/setjmp-dj.h +43 -0
  288. data/modules/emscripten/system/include/libc/machine/setjmp.h +361 -0
  289. data/modules/emscripten/system/include/libc/machine/stdlib.h +8 -0
  290. data/modules/emscripten/system/include/libc/machine/termios.h +1 -0
  291. data/modules/emscripten/system/include/libc/machine/time.h +19 -0
  292. data/modules/emscripten/system/include/libc/machine/types.h +30 -0
  293. data/modules/emscripten/system/include/libc/malloc.h +169 -0
  294. data/modules/emscripten/system/include/libc/math.h +594 -0
  295. data/modules/emscripten/system/include/libc/newlib.h +2 -0
  296. data/modules/emscripten/system/include/libc/paths.h +7 -0
  297. data/modules/emscripten/system/include/libc/process.h +44 -0
  298. data/modules/emscripten/system/include/libc/pthread.h +362 -0
  299. data/modules/emscripten/system/include/libc/pwd.h +78 -0
  300. data/modules/emscripten/system/include/libc/readme.txt +3 -0
  301. data/modules/emscripten/system/include/libc/reent.h +183 -0
  302. data/modules/emscripten/system/include/libc/regdef.h +7 -0
  303. data/modules/emscripten/system/include/libc/regex.h +102 -0
  304. data/modules/emscripten/system/include/libc/sched.h +97 -0
  305. data/modules/emscripten/system/include/libc/search.h +59 -0
  306. data/modules/emscripten/system/include/libc/setjmp.h +20 -0
  307. data/modules/emscripten/system/include/libc/signal.h +30 -0
  308. data/modules/emscripten/system/include/libc/stdarg.h +50 -0
  309. data/modules/emscripten/system/include/libc/stddef.h +64 -0
  310. data/modules/emscripten/system/include/libc/stdint.h +493 -0
  311. data/modules/emscripten/system/include/libc/stdio.h +694 -0
  312. data/modules/emscripten/system/include/libc/stdlib.h +230 -0
  313. data/modules/emscripten/system/include/libc/string.h +105 -0
  314. data/modules/emscripten/system/include/libc/strings.h +35 -0
  315. data/modules/emscripten/system/include/libc/sys/_default_fcntl.h +223 -0
  316. data/modules/emscripten/system/include/libc/sys/_types.h +93 -0
  317. data/modules/emscripten/system/include/libc/sys/cdefs.h +123 -0
  318. data/modules/emscripten/system/include/libc/sys/config.h +255 -0
  319. data/modules/emscripten/system/include/libc/sys/custom_file.h +2 -0
  320. data/modules/emscripten/system/include/libc/sys/dir.h +10 -0
  321. data/modules/emscripten/system/include/libc/sys/dirent.h +58 -0
  322. data/modules/emscripten/system/include/libc/sys/errno.h +190 -0
  323. data/modules/emscripten/system/include/libc/sys/fcntl.h +4 -0
  324. data/modules/emscripten/system/include/libc/sys/features.h +212 -0
  325. data/modules/emscripten/system/include/libc/sys/file.h +2 -0
  326. data/modules/emscripten/system/include/libc/sys/iconvnls.h +77 -0
  327. data/modules/emscripten/system/include/libc/sys/lock.h +24 -0
  328. data/modules/emscripten/system/include/libc/sys/param.h +25 -0
  329. data/modules/emscripten/system/include/libc/sys/queue.h +471 -0
  330. data/modules/emscripten/system/include/libc/sys/reent.h +843 -0
  331. data/modules/emscripten/system/include/libc/sys/resource.h +59 -0
  332. data/modules/emscripten/system/include/libc/sys/sched.h +67 -0
  333. data/modules/emscripten/system/include/libc/sys/signal.h +314 -0
  334. data/modules/emscripten/system/include/libc/sys/stat.h +222 -0
  335. data/modules/emscripten/system/include/libc/sys/stdio.h +27 -0
  336. data/modules/emscripten/system/include/libc/sys/string.h +2 -0
  337. data/modules/emscripten/system/include/libc/sys/syslimits.h +65 -0
  338. data/modules/emscripten/system/include/libc/sys/termios.h +280 -0
  339. data/modules/emscripten/system/include/libc/sys/time.h +85 -0
  340. data/modules/emscripten/system/include/libc/sys/timeb.h +39 -0
  341. data/modules/emscripten/system/include/libc/sys/times.h +28 -0
  342. data/modules/emscripten/system/include/libc/sys/ttydefaults.h +97 -0
  343. data/modules/emscripten/system/include/libc/sys/types.h +481 -0
  344. data/modules/emscripten/system/include/libc/sys/unistd.h +514 -0
  345. data/modules/emscripten/system/include/libc/sys/utime.h +26 -0
  346. data/modules/emscripten/system/include/libc/sys/wait.h +40 -0
  347. data/modules/emscripten/system/include/libc/tar.h +39 -0
  348. data/modules/emscripten/system/include/libc/termios.h +7 -0
  349. data/modules/emscripten/system/include/libc/time.h +273 -0
  350. data/modules/emscripten/system/include/libc/unctrl.h +46 -0
  351. data/modules/emscripten/system/include/libc/unistd.h +6 -0
  352. data/modules/emscripten/system/include/libc/utime.h +12 -0
  353. data/modules/emscripten/system/include/libc/utmp.h +8 -0
  354. data/modules/emscripten/system/include/libc/wchar.h +194 -0
  355. data/modules/emscripten/system/include/libc/wctype.h +47 -0
  356. data/modules/emscripten/system/include/libc/wordexp.h +53 -0
  357. data/modules/emscripten/system/include/libcxx/CREDITS.TXT +91 -0
  358. data/modules/emscripten/system/include/libcxx/LICENSE.txt +76 -0
  359. data/modules/emscripten/system/include/libcxx/__bit_reference +1268 -0
  360. data/modules/emscripten/system/include/libcxx/__config +485 -0
  361. data/modules/emscripten/system/include/libcxx/__debug +193 -0
  362. data/modules/emscripten/system/include/libcxx/__functional_03 +2130 -0
  363. data/modules/emscripten/system/include/libcxx/__functional_base +437 -0
  364. data/modules/emscripten/system/include/libcxx/__functional_base_03 +1087 -0
  365. data/modules/emscripten/system/include/libcxx/__hash_table +1945 -0
  366. data/modules/emscripten/system/include/libcxx/__locale +1435 -0
  367. data/modules/emscripten/system/include/libcxx/__mutex_base +438 -0
  368. data/modules/emscripten/system/include/libcxx/__split_buffer +654 -0
  369. data/modules/emscripten/system/include/libcxx/__sso_allocator +77 -0
  370. data/modules/emscripten/system/include/libcxx/__std_stream +317 -0
  371. data/modules/emscripten/system/include/libcxx/__tree +2293 -0
  372. data/modules/emscripten/system/include/libcxx/__tuple +305 -0
  373. data/modules/emscripten/system/include/libcxx/__tuple_03 +27 -0
  374. data/modules/emscripten/system/include/libcxx/__undef_min_max +19 -0
  375. data/modules/emscripten/system/include/libcxx/algorithm +5458 -0
  376. data/modules/emscripten/system/include/libcxx/array +341 -0
  377. data/modules/emscripten/system/include/libcxx/atomic +1521 -0
  378. data/modules/emscripten/system/include/libcxx/bitset +1081 -0
  379. data/modules/emscripten/system/include/libcxx/cassert +25 -0
  380. data/modules/emscripten/system/include/libcxx/ccomplex +29 -0
  381. data/modules/emscripten/system/include/libcxx/cctype +164 -0
  382. data/modules/emscripten/system/include/libcxx/cerrno +393 -0
  383. data/modules/emscripten/system/include/libcxx/cfenv +82 -0
  384. data/modules/emscripten/system/include/libcxx/cfloat +78 -0
  385. data/modules/emscripten/system/include/libcxx/chrono +898 -0
  386. data/modules/emscripten/system/include/libcxx/cinttypes +259 -0
  387. data/modules/emscripten/system/include/libcxx/ciso646 +25 -0
  388. data/modules/emscripten/system/include/libcxx/climits +48 -0
  389. data/modules/emscripten/system/include/libcxx/clocale +53 -0
  390. data/modules/emscripten/system/include/libcxx/cmath +1683 -0
  391. data/modules/emscripten/system/include/libcxx/codecvt +547 -0
  392. data/modules/emscripten/system/include/libcxx/complex +1526 -0
  393. data/modules/emscripten/system/include/libcxx/complex.h +35 -0
  394. data/modules/emscripten/system/include/libcxx/condition_variable +256 -0
  395. data/modules/emscripten/system/include/libcxx/csetjmp +52 -0
  396. data/modules/emscripten/system/include/libcxx/csignal +58 -0
  397. data/modules/emscripten/system/include/libcxx/cstdarg +48 -0
  398. data/modules/emscripten/system/include/libcxx/cstdbool +32 -0
  399. data/modules/emscripten/system/include/libcxx/cstddef +103 -0
  400. data/modules/emscripten/system/include/libcxx/cstdint +191 -0
  401. data/modules/emscripten/system/include/libcxx/cstdio +175 -0
  402. data/modules/emscripten/system/include/libcxx/cstdlib +172 -0
  403. data/modules/emscripten/system/include/libcxx/cstring +112 -0
  404. data/modules/emscripten/system/include/libcxx/ctgmath +29 -0
  405. data/modules/emscripten/system/include/libcxx/ctime +72 -0
  406. data/modules/emscripten/system/include/libcxx/cwchar +208 -0
  407. data/modules/emscripten/system/include/libcxx/cwctype +213 -0
  408. data/modules/emscripten/system/include/libcxx/deque +2846 -0
  409. data/modules/emscripten/system/include/libcxx/exception +250 -0
  410. data/modules/emscripten/system/include/libcxx/ext/__hash +46 -0
  411. data/modules/emscripten/system/include/libcxx/ext/hash_map +1003 -0
  412. data/modules/emscripten/system/include/libcxx/ext/hash_set +657 -0
  413. data/modules/emscripten/system/include/libcxx/forward_list +1636 -0
  414. data/modules/emscripten/system/include/libcxx/fstream +1415 -0
  415. data/modules/emscripten/system/include/libcxx/functional +2063 -0
  416. data/modules/emscripten/system/include/libcxx/future +2505 -0
  417. data/modules/emscripten/system/include/libcxx/initializer_list +105 -0
  418. data/modules/emscripten/system/include/libcxx/iomanip +504 -0
  419. data/modules/emscripten/system/include/libcxx/ios +988 -0
  420. data/modules/emscripten/system/include/libcxx/iosfwd +194 -0
  421. data/modules/emscripten/system/include/libcxx/iostream +60 -0
  422. data/modules/emscripten/system/include/libcxx/istream +1713 -0
  423. data/modules/emscripten/system/include/libcxx/iterator +1869 -0
  424. data/modules/emscripten/system/include/libcxx/limits +809 -0
  425. data/modules/emscripten/system/include/libcxx/list +2275 -0
  426. data/modules/emscripten/system/include/libcxx/locale +4591 -0
  427. data/modules/emscripten/system/include/libcxx/map +1924 -0
  428. data/modules/emscripten/system/include/libcxx/memory +5437 -0
  429. data/modules/emscripten/system/include/libcxx/mutex +566 -0
  430. data/modules/emscripten/system/include/libcxx/new +117 -0
  431. data/modules/emscripten/system/include/libcxx/numeric +197 -0
  432. data/modules/emscripten/system/include/libcxx/ostream +1286 -0
  433. data/modules/emscripten/system/include/libcxx/queue +717 -0
  434. data/modules/emscripten/system/include/libcxx/random +6750 -0
  435. data/modules/emscripten/system/include/libcxx/ratio +487 -0
  436. data/modules/emscripten/system/include/libcxx/readme.txt +1 -0
  437. data/modules/emscripten/system/include/libcxx/regex +6439 -0
  438. data/modules/emscripten/system/include/libcxx/scoped_allocator +578 -0
  439. data/modules/emscripten/system/include/libcxx/set +1025 -0
  440. data/modules/emscripten/system/include/libcxx/sstream +888 -0
  441. data/modules/emscripten/system/include/libcxx/stack +292 -0
  442. data/modules/emscripten/system/include/libcxx/stdexcept +162 -0
  443. data/modules/emscripten/system/include/libcxx/streambuf +564 -0
  444. data/modules/emscripten/system/include/libcxx/string +3987 -0
  445. data/modules/emscripten/system/include/libcxx/strstream +400 -0
  446. data/modules/emscripten/system/include/libcxx/support/solaris/floatingpoint.h +5 -0
  447. data/modules/emscripten/system/include/libcxx/support/solaris/wchar.h +38 -0
  448. data/modules/emscripten/system/include/libcxx/support/solaris/xlocale.h +146 -0
  449. data/modules/emscripten/system/include/libcxx/support/win32/limits_win32.h +79 -0
  450. data/modules/emscripten/system/include/libcxx/support/win32/locale_win32.h +116 -0
  451. data/modules/emscripten/system/include/libcxx/support/win32/math_win32.h +113 -0
  452. data/modules/emscripten/system/include/libcxx/support/win32/support.h +115 -0
  453. data/modules/emscripten/system/include/libcxx/system_error +636 -0
  454. data/modules/emscripten/system/include/libcxx/tgmath.h +29 -0
  455. data/modules/emscripten/system/include/libcxx/thread +459 -0
  456. data/modules/emscripten/system/include/libcxx/tuple +1092 -0
  457. data/modules/emscripten/system/include/libcxx/type_traits +3040 -0
  458. data/modules/emscripten/system/include/libcxx/typeindex +103 -0
  459. data/modules/emscripten/system/include/libcxx/typeinfo +124 -0
  460. data/modules/emscripten/system/include/libcxx/unordered_map +1864 -0
  461. data/modules/emscripten/system/include/libcxx/unordered_set +1144 -0
  462. data/modules/emscripten/system/include/libcxx/utility +583 -0
  463. data/modules/emscripten/system/include/libcxx/valarray +4779 -0
  464. data/modules/emscripten/system/include/libcxx/vector +3228 -0
  465. data/modules/emscripten/system/include/memory.h +10 -0
  466. data/modules/emscripten/system/include/mntent.h +23 -0
  467. data/modules/emscripten/system/include/net/arpa/inet.h +32 -0
  468. data/modules/emscripten/system/include/net/arpa/nameser.h +535 -0
  469. data/modules/emscripten/system/include/net/arpa/nameser_compat.h +187 -0
  470. data/modules/emscripten/system/include/net/if.h +87 -0
  471. data/modules/emscripten/system/include/net/netinet/in.h +166 -0
  472. data/modules/emscripten/system/include/net/netinet/tcp.h +246 -0
  473. data/modules/emscripten/system/include/net/resolv.h +389 -0
  474. data/modules/emscripten/system/include/netdb.h +94 -0
  475. data/modules/emscripten/system/include/nl_types.h +19 -0
  476. data/modules/emscripten/system/include/poll.h +3 -0
  477. data/modules/emscripten/system/include/pty.h +6 -0
  478. data/modules/emscripten/system/include/semaphore.h +31 -0
  479. data/modules/emscripten/system/include/spawn.h +105 -0
  480. data/modules/emscripten/system/include/stdbool.h +16 -0
  481. data/modules/emscripten/system/include/sys/bitypes.h +3 -0
  482. data/modules/emscripten/system/include/sys/io.h +14 -0
  483. data/modules/emscripten/system/include/sys/ioctl.h +26 -0
  484. data/modules/emscripten/system/include/sys/poll.h +31 -0
  485. data/modules/emscripten/system/include/sys/select.h +14 -0
  486. data/modules/emscripten/system/include/sys/socket.h +101 -0
  487. data/modules/emscripten/system/include/sys/socketvar.h +3 -0
  488. data/modules/emscripten/system/include/sys/statvfs.h +32 -0
  489. data/modules/emscripten/system/include/sys/sysctl.h +14 -0
  490. data/modules/emscripten/system/include/sys/uio.h +22 -0
  491. data/modules/emscripten/system/include/sys/un.h +66 -0
  492. data/modules/emscripten/system/include/sysexits.h +108 -0
  493. data/modules/emscripten/system/include/unwind.h +154 -0
  494. data/modules/emscripten/system/include/xlocale.h +47 -0
  495. data/modules/emscripten/system/include/zconf.h +428 -0
  496. data/modules/emscripten/system/include/zlib.h +1613 -0
  497. data/modules/emscripten/system/lib/compiler-rt/LICENSE.TXT +97 -0
  498. data/modules/emscripten/system/lib/compiler-rt/divdi3.c +47 -0
  499. data/modules/emscripten/system/lib/compiler-rt/int_endianness.h +116 -0
  500. data/modules/emscripten/system/lib/compiler-rt/int_lib.h +46 -0
  501. data/modules/emscripten/system/lib/compiler-rt/int_math.h +67 -0
  502. data/modules/emscripten/system/lib/compiler-rt/int_types.h +140 -0
  503. data/modules/emscripten/system/lib/compiler-rt/int_util.h +29 -0
  504. data/modules/emscripten/system/lib/compiler-rt/muldi3.c +56 -0
  505. data/modules/emscripten/system/lib/compiler-rt/readme.txt +20 -0
  506. data/modules/emscripten/system/lib/compiler-rt/udivdi3.c +36 -0
  507. data/modules/emscripten/system/lib/compiler-rt/udivmoddi4.c +251 -0
  508. data/modules/emscripten/system/lib/debugging.cpp +24 -0
  509. data/modules/emscripten/system/lib/dlmalloc.c +6299 -0
  510. data/modules/emscripten/system/lib/embind/bind.cpp +63 -0
  511. data/modules/emscripten/system/lib/libc/gen/err.c +49 -0
  512. data/modules/emscripten/system/lib/libc/gen/errx.c +49 -0
  513. data/modules/emscripten/system/lib/libc/gen/verr.c +58 -0
  514. data/modules/emscripten/system/lib/libc/gen/verrx.c +51 -0
  515. data/modules/emscripten/system/lib/libc/gen/vwarn.c +55 -0
  516. data/modules/emscripten/system/lib/libc/gen/vwarnx.c +48 -0
  517. data/modules/emscripten/system/lib/libc/gen/warn.c +49 -0
  518. data/modules/emscripten/system/lib/libc/gen/warnx.c +49 -0
  519. data/modules/emscripten/system/lib/libc/musl/COPYRIGHT +92 -0
  520. data/modules/emscripten/system/lib/libc/musl/readme.txt +1 -0
  521. data/modules/emscripten/system/lib/libc/musl/src/ctype/alpha.h +125 -0
  522. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswalnum.c +7 -0
  523. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswalpha.c +14 -0
  524. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswblank.c +8 -0
  525. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswcntrl.c +10 -0
  526. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswctype.c +63 -0
  527. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswdigit.c +9 -0
  528. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswgraph.c +7 -0
  529. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswlower.c +6 -0
  530. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswprint.c +19 -0
  531. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswpunct.c +12 -0
  532. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswspace.c +19 -0
  533. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswupper.c +6 -0
  534. data/modules/emscripten/system/lib/libc/musl/src/ctype/iswxdigit.c +7 -0
  535. data/modules/emscripten/system/lib/libc/musl/src/ctype/nonspacing.h +62 -0
  536. data/modules/emscripten/system/lib/libc/musl/src/ctype/punct.h +109 -0
  537. data/modules/emscripten/system/lib/libc/musl/src/ctype/towctrans.c +268 -0
  538. data/modules/emscripten/system/lib/libc/musl/src/ctype/wcswidth.c +8 -0
  539. data/modules/emscripten/system/lib/libc/musl/src/ctype/wctrans.c +16 -0
  540. data/modules/emscripten/system/lib/libc/musl/src/ctype/wcwidth.c +29 -0
  541. data/modules/emscripten/system/lib/libc/musl/src/ctype/wide.h +42 -0
  542. data/modules/emscripten/system/lib/libc/musl/src/internal/libc.c +22 -0
  543. data/modules/emscripten/system/lib/libc/musl/src/internal/libc.h +71 -0
  544. data/modules/emscripten/system/lib/libc/musl/src/multibyte/btowc.c +7 -0
  545. data/modules/emscripten/system/lib/libc/musl/src/multibyte/internal.c +38 -0
  546. data/modules/emscripten/system/lib/libc/musl/src/multibyte/internal.h +22 -0
  547. data/modules/emscripten/system/lib/libc/musl/src/multibyte/mblen.c +17 -0
  548. data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbrlen.c +18 -0
  549. data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbrtowc.c +57 -0
  550. data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsinit.c +17 -0
  551. data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsnrtowcs.c +65 -0
  552. data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsrtowcs.c +100 -0
  553. data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbstowcs.c +7 -0
  554. data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbtowc.c +53 -0
  555. data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcrtomb.c +38 -0
  556. data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcsnrtombs.c +52 -0
  557. data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcsrtombs.c +58 -0
  558. data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcstombs.c +7 -0
  559. data/modules/emscripten/system/lib/libc/musl/src/multibyte/wctob.c +8 -0
  560. data/modules/emscripten/system/lib/libc/musl/src/multibyte/wctomb.c +18 -0
  561. data/modules/emscripten/system/lib/libc/musl/src/string/wcpcpy.c +6 -0
  562. data/modules/emscripten/system/lib/libc/musl/src/string/wcpncpy.c +6 -0
  563. data/modules/emscripten/system/lib/libc/musl/src/string/wcscasecmp.c +7 -0
  564. data/modules/emscripten/system/lib/libc/musl/src/string/wcscasecmp_l.c +6 -0
  565. data/modules/emscripten/system/lib/libc/musl/src/string/wcscat.c +7 -0
  566. data/modules/emscripten/system/lib/libc/musl/src/string/wcschr.c +8 -0
  567. data/modules/emscripten/system/lib/libc/musl/src/string/wcscmp.c +7 -0
  568. data/modules/emscripten/system/lib/libc/musl/src/string/wcscpy.c +8 -0
  569. data/modules/emscripten/system/lib/libc/musl/src/string/wcscspn.c +10 -0
  570. data/modules/emscripten/system/lib/libc/musl/src/string/wcsdup.c +11 -0
  571. data/modules/emscripten/system/lib/libc/musl/src/string/wcslen.c +8 -0
  572. data/modules/emscripten/system/lib/libc/musl/src/string/wcsncasecmp.c +9 -0
  573. data/modules/emscripten/system/lib/libc/musl/src/string/wcsncasecmp_l.c +6 -0
  574. data/modules/emscripten/system/lib/libc/musl/src/string/wcsncat.c +10 -0
  575. data/modules/emscripten/system/lib/libc/musl/src/string/wcsncmp.c +7 -0
  576. data/modules/emscripten/system/lib/libc/musl/src/string/wcsncpy.c +9 -0
  577. data/modules/emscripten/system/lib/libc/musl/src/string/wcsnlen.c +8 -0
  578. data/modules/emscripten/system/lib/libc/musl/src/string/wcspbrk.c +7 -0
  579. data/modules/emscripten/system/lib/libc/musl/src/string/wcsrchr.c +8 -0
  580. data/modules/emscripten/system/lib/libc/musl/src/string/wcsspn.c +8 -0
  581. data/modules/emscripten/system/lib/libc/musl/src/string/wcsstr.c +108 -0
  582. data/modules/emscripten/system/lib/libc/musl/src/string/wcstok.c +12 -0
  583. data/modules/emscripten/system/lib/libc/musl/src/string/wcswcs.c +6 -0
  584. data/modules/emscripten/system/lib/libc/musl/src/string/wmemchr.c +8 -0
  585. data/modules/emscripten/system/lib/libc/musl/src/string/wmemcmp.c +8 -0
  586. data/modules/emscripten/system/lib/libc/musl/src/string/wmemcpy.c +9 -0
  587. data/modules/emscripten/system/lib/libc/musl/src/string/wmemmove.c +12 -0
  588. data/modules/emscripten/system/lib/libc/musl/src/string/wmemset.c +9 -0
  589. data/modules/emscripten/system/lib/libc/stdlib/getopt_long.c +511 -0
  590. data/modules/emscripten/system/lib/libc/stdlib/strtod.c +305 -0
  591. data/modules/emscripten/system/lib/libc.symbols +81 -0
  592. data/modules/emscripten/system/lib/libcextra.symbols +61 -0
  593. data/modules/emscripten/system/lib/libcxx/CREDITS.TXT +91 -0
  594. data/modules/emscripten/system/lib/libcxx/LICENSE.txt +76 -0
  595. data/modules/emscripten/system/lib/libcxx/algorithm.cpp +83 -0
  596. data/modules/emscripten/system/lib/libcxx/bind.cpp +30 -0
  597. data/modules/emscripten/system/lib/libcxx/chrono.cpp +132 -0
  598. data/modules/emscripten/system/lib/libcxx/condition_variable.cpp +81 -0
  599. data/modules/emscripten/system/lib/libcxx/debug.cpp +504 -0
  600. data/modules/emscripten/system/lib/libcxx/exception.cpp +226 -0
  601. data/modules/emscripten/system/lib/libcxx/future.cpp +285 -0
  602. data/modules/emscripten/system/lib/libcxx/hash.cpp +564 -0
  603. data/modules/emscripten/system/lib/libcxx/ios.cpp +455 -0
  604. data/modules/emscripten/system/lib/libcxx/iostream.cpp +68 -0
  605. data/modules/emscripten/system/lib/libcxx/locale.cpp +6093 -0
  606. data/modules/emscripten/system/lib/libcxx/memory.cpp +223 -0
  607. data/modules/emscripten/system/lib/libcxx/mutex.cpp +250 -0
  608. data/modules/emscripten/system/lib/libcxx/new.cpp +205 -0
  609. data/modules/emscripten/system/lib/libcxx/random.cpp +48 -0
  610. data/modules/emscripten/system/lib/libcxx/readme.txt +1 -0
  611. data/modules/emscripten/system/lib/libcxx/regex.cpp +325 -0
  612. data/modules/emscripten/system/lib/libcxx/stdexcept.cpp +196 -0
  613. data/modules/emscripten/system/lib/libcxx/string.cpp +687 -0
  614. data/modules/emscripten/system/lib/libcxx/strstream.cpp +329 -0
  615. data/modules/emscripten/system/lib/libcxx/support/solaris/README +4 -0
  616. data/modules/emscripten/system/lib/libcxx/support/solaris/mbsnrtowcs.inc +76 -0
  617. data/modules/emscripten/system/lib/libcxx/support/solaris/wcsnrtombs.inc +93 -0
  618. data/modules/emscripten/system/lib/libcxx/support/solaris/xlocale.c +245 -0
  619. data/modules/emscripten/system/lib/libcxx/support/win32/locale_win32.cpp +94 -0
  620. data/modules/emscripten/system/lib/libcxx/support/win32/support.cpp +70 -0
  621. data/modules/emscripten/system/lib/libcxx/symbols +2927 -0
  622. data/modules/emscripten/system/lib/libcxx/system_error.cpp +201 -0
  623. data/modules/emscripten/system/lib/libcxx/thread.cpp +208 -0
  624. data/modules/emscripten/system/lib/libcxx/typeinfo.cpp +60 -0
  625. data/modules/emscripten/system/lib/libcxx/utility.cpp +17 -0
  626. data/modules/emscripten/system/lib/libcxx/valarray.cpp +54 -0
  627. data/modules/emscripten/system/lib/libcxxabi/CREDITS.TXT +38 -0
  628. data/modules/emscripten/system/lib/libcxxabi/LICENSE.TXT +76 -0
  629. data/modules/emscripten/system/lib/libcxxabi/include/cxa_demangle.h +167 -0
  630. data/modules/emscripten/system/lib/libcxxabi/include/cxxabi.h +175 -0
  631. data/modules/emscripten/system/lib/libcxxabi/lib/buildit +99 -0
  632. data/modules/emscripten/system/lib/libcxxabi/readme.txt +1 -0
  633. data/modules/emscripten/system/lib/libcxxabi/src/abort_message.cpp +50 -0
  634. data/modules/emscripten/system/lib/libcxxabi/src/abort_message.h +33 -0
  635. data/modules/emscripten/system/lib/libcxxabi/src/cxa_aux_runtime.cpp +34 -0
  636. data/modules/emscripten/system/lib/libcxxabi/src/cxa_demangle.cpp +11036 -0
  637. data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception.cpp +622 -0
  638. data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception.hpp +123 -0
  639. data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception_storage.cpp +91 -0
  640. data/modules/emscripten/system/lib/libcxxabi/src/cxa_guard.cpp +231 -0
  641. data/modules/emscripten/system/lib/libcxxabi/src/cxa_handlers.cpp +125 -0
  642. data/modules/emscripten/system/lib/libcxxabi/src/cxa_handlers.hpp +54 -0
  643. data/modules/emscripten/system/lib/libcxxabi/src/cxa_new_delete.cpp +242 -0
  644. data/modules/emscripten/system/lib/libcxxabi/src/cxa_personality.cpp +1055 -0
  645. data/modules/emscripten/system/lib/libcxxabi/src/cxa_unexpected.cpp +27 -0
  646. data/modules/emscripten/system/lib/libcxxabi/src/cxa_vector.cpp +367 -0
  647. data/modules/emscripten/system/lib/libcxxabi/src/cxa_virtual.cpp +31 -0
  648. data/modules/emscripten/system/lib/libcxxabi/src/exception.cpp +41 -0
  649. data/modules/emscripten/system/lib/libcxxabi/src/fallback_malloc.ipp +174 -0
  650. data/modules/emscripten/system/lib/libcxxabi/src/private_typeinfo.cpp +1146 -0
  651. data/modules/emscripten/system/lib/libcxxabi/src/private_typeinfo.h +248 -0
  652. data/modules/emscripten/system/lib/libcxxabi/src/stdexcept.cpp +169 -0
  653. data/modules/emscripten/system/lib/libcxxabi/src/typeinfo.cpp +53 -0
  654. data/modules/emscripten/system/lib/libcxxabi/symbols +236 -0
  655. data/modules/emscripten/system/lib/sdl.cpp +13 -0
  656. data/modules/emscripten/system/lib/sdl.symbols +1 -0
  657. data/modules/emscripten/tests/hello_world.js +92 -0
  658. data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/CppHeaderParser.py +2347 -0
  659. data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/__init__.py +4 -0
  660. data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/doc/CppHeaderParser.html +657 -0
  661. data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/examples/SampleClass.h +147 -0
  662. data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/examples/readSampleClass.py +74 -0
  663. data/modules/emscripten/third_party/CppHeaderParser/PKG-INFO +249 -0
  664. data/modules/emscripten/third_party/CppHeaderParser/README.html +544 -0
  665. data/modules/emscripten/third_party/CppHeaderParser/README.txt +226 -0
  666. data/modules/emscripten/third_party/CppHeaderParser/setup.py +43 -0
  667. data/modules/emscripten/third_party/ansidecl.h +371 -0
  668. data/modules/emscripten/third_party/closure-compiler/COPYING +202 -0
  669. data/modules/emscripten/third_party/closure-compiler/README +292 -0
  670. data/modules/emscripten/third_party/closure-compiler/compiler.jar +0 -0
  671. data/modules/emscripten/third_party/closure-compiler/readme.txt +3 -0
  672. data/modules/emscripten/third_party/cp-demangle.h +161 -0
  673. data/modules/emscripten/third_party/demangle.h +549 -0
  674. data/modules/emscripten/third_party/demangler.py +49 -0
  675. data/modules/emscripten/third_party/gcc_demangler.c +4226 -0
  676. data/modules/emscripten/third_party/gcc_demangler.js +21282 -0
  677. data/modules/emscripten/third_party/jni/emjvm.cpp +133 -0
  678. data/modules/emscripten/third_party/jni/emjvm.h +8 -0
  679. data/modules/emscripten/third_party/jni/emjvm.js +185 -0
  680. data/modules/emscripten/third_party/jni/jni.h +1154 -0
  681. data/modules/emscripten/third_party/libiberty.h +634 -0
  682. data/modules/emscripten/third_party/lzma.js/README.markdown +37 -0
  683. data/modules/emscripten/third_party/lzma.js/doit.sh +37 -0
  684. data/modules/emscripten/third_party/lzma.js/lzip/AUTHORS +7 -0
  685. data/modules/emscripten/third_party/lzma.js/lzip/COPYING +676 -0
  686. data/modules/emscripten/third_party/lzma.js/lzip/ChangeLog +201 -0
  687. data/modules/emscripten/third_party/lzma.js/lzip/INSTALL +56 -0
  688. data/modules/emscripten/third_party/lzma.js/lzip/Makefile +160 -0
  689. data/modules/emscripten/third_party/lzma.js/lzip/Makefile.in +138 -0
  690. data/modules/emscripten/third_party/lzma.js/lzip/NEWS +22 -0
  691. data/modules/emscripten/third_party/lzma.js/lzip/README +77 -0
  692. data/modules/emscripten/third_party/lzma.js/lzip/arg_parser.cc +204 -0
  693. data/modules/emscripten/third_party/lzma.js/lzip/arg_parser.h +106 -0
  694. data/modules/emscripten/third_party/lzma.js/lzip/configure +192 -0
  695. data/modules/emscripten/third_party/lzma.js/lzip/decoder.cc +252 -0
  696. data/modules/emscripten/third_party/lzma.js/lzip/decoder.h +268 -0
  697. data/modules/emscripten/third_party/lzma.js/lzip/encoder.cc +643 -0
  698. data/modules/emscripten/third_party/lzma.js/lzip/encoder.h +582 -0
  699. data/modules/emscripten/third_party/lzma.js/lzip/fast_encoder.cc +378 -0
  700. data/modules/emscripten/third_party/lzma.js/lzip/fast_encoder.h +171 -0
  701. data/modules/emscripten/third_party/lzma.js/lzip/lzip.h +264 -0
  702. data/modules/emscripten/third_party/lzma.js/lzip/main.cc +545 -0
  703. data/modules/emscripten/third_party/lzma.js/lzma-decoder.js +27 -0
  704. data/modules/emscripten/third_party/lzma.js/lzma-full.js +27 -0
  705. data/modules/emscripten/third_party/lzma.js/native_test.sh +5 -0
  706. data/modules/emscripten/third_party/lzma.js/post.js +13 -0
  707. data/modules/emscripten/third_party/lzma.js/pre.js +13 -0
  708. data/modules/emscripten/third_party/lzma.js/test-decoder.js +39 -0
  709. data/modules/emscripten/third_party/lzma.js/test-full.html +9 -0
  710. data/modules/emscripten/third_party/lzma.js/test-full.js +78 -0
  711. data/modules/emscripten/third_party/ply/ANNOUNCE +40 -0
  712. data/modules/emscripten/third_party/ply/CHANGES +1093 -0
  713. data/modules/emscripten/third_party/ply/PKG-INFO +22 -0
  714. data/modules/emscripten/third_party/ply/README +271 -0
  715. data/modules/emscripten/third_party/ply/TODO +16 -0
  716. data/modules/emscripten/third_party/ply/doc/internal.html +874 -0
  717. data/modules/emscripten/third_party/ply/doc/makedoc.py +194 -0
  718. data/modules/emscripten/third_party/ply/doc/ply.html +3262 -0
  719. data/modules/emscripten/third_party/ply/example/BASIC/README +79 -0
  720. data/modules/emscripten/third_party/ply/example/BASIC/basic.py +71 -0
  721. data/modules/emscripten/third_party/ply/example/BASIC/basiclex.py +74 -0
  722. data/modules/emscripten/third_party/ply/example/BASIC/basiclog.py +79 -0
  723. data/modules/emscripten/third_party/ply/example/BASIC/basinterp.py +441 -0
  724. data/modules/emscripten/third_party/ply/example/BASIC/basparse.py +424 -0
  725. data/modules/emscripten/third_party/ply/example/BASIC/dim.bas +14 -0
  726. data/modules/emscripten/third_party/ply/example/BASIC/func.bas +5 -0
  727. data/modules/emscripten/third_party/ply/example/BASIC/gcd.bas +22 -0
  728. data/modules/emscripten/third_party/ply/example/BASIC/gosub.bas +13 -0
  729. data/modules/emscripten/third_party/ply/example/BASIC/hello.bas +4 -0
  730. data/modules/emscripten/third_party/ply/example/BASIC/linear.bas +17 -0
  731. data/modules/emscripten/third_party/ply/example/BASIC/maxsin.bas +12 -0
  732. data/modules/emscripten/third_party/ply/example/BASIC/powers.bas +13 -0
  733. data/modules/emscripten/third_party/ply/example/BASIC/rand.bas +4 -0
  734. data/modules/emscripten/third_party/ply/example/BASIC/sales.bas +20 -0
  735. data/modules/emscripten/third_party/ply/example/BASIC/sears.bas +18 -0
  736. data/modules/emscripten/third_party/ply/example/BASIC/sqrt1.bas +5 -0
  737. data/modules/emscripten/third_party/ply/example/BASIC/sqrt2.bas +4 -0
  738. data/modules/emscripten/third_party/ply/example/GardenSnake/GardenSnake.py +709 -0
  739. data/modules/emscripten/third_party/ply/example/GardenSnake/README +5 -0
  740. data/modules/emscripten/third_party/ply/example/README +10 -0
  741. data/modules/emscripten/third_party/ply/example/ansic/README +2 -0
  742. data/modules/emscripten/third_party/ply/example/ansic/clex.py +164 -0
  743. data/modules/emscripten/third_party/ply/example/ansic/cparse.py +863 -0
  744. data/modules/emscripten/third_party/ply/example/calc/calc.py +107 -0
  745. data/modules/emscripten/third_party/ply/example/calcdebug/calc.py +113 -0
  746. data/modules/emscripten/third_party/ply/example/classcalc/calc.py +157 -0
  747. data/modules/emscripten/third_party/ply/example/cleanup.sh +2 -0
  748. data/modules/emscripten/third_party/ply/example/closurecalc/calc.py +130 -0
  749. data/modules/emscripten/third_party/ply/example/hedit/hedit.py +48 -0
  750. data/modules/emscripten/third_party/ply/example/newclasscalc/calc.py +160 -0
  751. data/modules/emscripten/third_party/ply/example/optcalc/README +9 -0
  752. data/modules/emscripten/third_party/ply/example/optcalc/calc.py +119 -0
  753. data/modules/emscripten/third_party/ply/example/unicalc/calc.py +117 -0
  754. data/modules/emscripten/third_party/ply/example/yply/README +41 -0
  755. data/modules/emscripten/third_party/ply/example/yply/ylex.py +112 -0
  756. data/modules/emscripten/third_party/ply/example/yply/yparse.py +217 -0
  757. data/modules/emscripten/third_party/ply/example/yply/yply.py +53 -0
  758. data/modules/emscripten/third_party/ply/ply/__init__.py +4 -0
  759. data/modules/emscripten/third_party/ply/ply/cpp.py +898 -0
  760. data/modules/emscripten/third_party/ply/ply/ctokens.py +133 -0
  761. data/modules/emscripten/third_party/ply/ply/lex.py +1058 -0
  762. data/modules/emscripten/third_party/ply/ply/yacc.py +3276 -0
  763. data/modules/emscripten/third_party/ply/setup.py +31 -0
  764. data/modules/emscripten/third_party/ply/test/README +7 -0
  765. data/modules/emscripten/third_party/ply/test/calclex.py +49 -0
  766. data/modules/emscripten/third_party/ply/test/cleanup.sh +4 -0
  767. data/modules/emscripten/third_party/ply/test/lex_closure.py +54 -0
  768. data/modules/emscripten/third_party/ply/test/lex_doc1.py +26 -0
  769. data/modules/emscripten/third_party/ply/test/lex_dup1.py +29 -0
  770. data/modules/emscripten/third_party/ply/test/lex_dup2.py +33 -0
  771. data/modules/emscripten/third_party/ply/test/lex_dup3.py +31 -0
  772. data/modules/emscripten/third_party/ply/test/lex_empty.py +20 -0
  773. data/modules/emscripten/third_party/ply/test/lex_error1.py +24 -0
  774. data/modules/emscripten/third_party/ply/test/lex_error2.py +26 -0
  775. data/modules/emscripten/third_party/ply/test/lex_error3.py +27 -0
  776. data/modules/emscripten/third_party/ply/test/lex_error4.py +27 -0
  777. data/modules/emscripten/third_party/ply/test/lex_hedit.py +47 -0
  778. data/modules/emscripten/third_party/ply/test/lex_ignore.py +31 -0
  779. data/modules/emscripten/third_party/ply/test/lex_ignore2.py +29 -0
  780. data/modules/emscripten/third_party/ply/test/lex_literal1.py +25 -0
  781. data/modules/emscripten/third_party/ply/test/lex_literal2.py +25 -0
  782. data/modules/emscripten/third_party/ply/test/lex_many_tokens.py +27 -0
  783. data/modules/emscripten/third_party/ply/test/lex_module.py +10 -0
  784. data/modules/emscripten/third_party/ply/test/lex_module_import.py +42 -0
  785. data/modules/emscripten/third_party/ply/test/lex_object.py +55 -0
  786. data/modules/emscripten/third_party/ply/test/lex_opt_alias.py +54 -0
  787. data/modules/emscripten/third_party/ply/test/lex_optimize.py +50 -0
  788. data/modules/emscripten/third_party/ply/test/lex_optimize2.py +50 -0
  789. data/modules/emscripten/third_party/ply/test/lex_optimize3.py +52 -0
  790. data/modules/emscripten/third_party/ply/test/lex_re1.py +27 -0
  791. data/modules/emscripten/third_party/ply/test/lex_re2.py +27 -0
  792. data/modules/emscripten/third_party/ply/test/lex_re3.py +29 -0
  793. data/modules/emscripten/third_party/ply/test/lex_rule1.py +27 -0
  794. data/modules/emscripten/third_party/ply/test/lex_rule2.py +29 -0
  795. data/modules/emscripten/third_party/ply/test/lex_rule3.py +27 -0
  796. data/modules/emscripten/third_party/ply/test/lex_state1.py +40 -0
  797. data/modules/emscripten/third_party/ply/test/lex_state2.py +40 -0
  798. data/modules/emscripten/third_party/ply/test/lex_state3.py +42 -0
  799. data/modules/emscripten/third_party/ply/test/lex_state4.py +41 -0
  800. data/modules/emscripten/third_party/ply/test/lex_state5.py +40 -0
  801. data/modules/emscripten/third_party/ply/test/lex_state_noerror.py +39 -0
  802. data/modules/emscripten/third_party/ply/test/lex_state_norule.py +40 -0
  803. data/modules/emscripten/third_party/ply/test/lex_state_try.py +45 -0
  804. data/modules/emscripten/third_party/ply/test/lex_token1.py +19 -0
  805. data/modules/emscripten/third_party/ply/test/lex_token2.py +22 -0
  806. data/modules/emscripten/third_party/ply/test/lex_token3.py +24 -0
  807. data/modules/emscripten/third_party/ply/test/lex_token4.py +26 -0
  808. data/modules/emscripten/third_party/ply/test/lex_token5.py +31 -0
  809. data/modules/emscripten/third_party/ply/test/lex_token_dup.py +29 -0
  810. data/modules/emscripten/third_party/ply/test/testlex.py +606 -0
  811. data/modules/emscripten/third_party/ply/test/testyacc.py +347 -0
  812. data/modules/emscripten/third_party/ply/test/yacc_badargs.py +68 -0
  813. data/modules/emscripten/third_party/ply/test/yacc_badid.py +77 -0
  814. data/modules/emscripten/third_party/ply/test/yacc_badprec.py +64 -0
  815. data/modules/emscripten/third_party/ply/test/yacc_badprec2.py +68 -0
  816. data/modules/emscripten/third_party/ply/test/yacc_badprec3.py +68 -0
  817. data/modules/emscripten/third_party/ply/test/yacc_badrule.py +68 -0
  818. data/modules/emscripten/third_party/ply/test/yacc_badtok.py +68 -0
  819. data/modules/emscripten/third_party/ply/test/yacc_dup.py +68 -0
  820. data/modules/emscripten/third_party/ply/test/yacc_error1.py +68 -0
  821. data/modules/emscripten/third_party/ply/test/yacc_error2.py +68 -0
  822. data/modules/emscripten/third_party/ply/test/yacc_error3.py +67 -0
  823. data/modules/emscripten/third_party/ply/test/yacc_error4.py +72 -0
  824. data/modules/emscripten/third_party/ply/test/yacc_inf.py +56 -0
  825. data/modules/emscripten/third_party/ply/test/yacc_literal.py +69 -0
  826. data/modules/emscripten/third_party/ply/test/yacc_misplaced.py +68 -0
  827. data/modules/emscripten/third_party/ply/test/yacc_missing1.py +68 -0
  828. data/modules/emscripten/third_party/ply/test/yacc_nested.py +33 -0
  829. data/modules/emscripten/third_party/ply/test/yacc_nodoc.py +67 -0
  830. data/modules/emscripten/third_party/ply/test/yacc_noerror.py +66 -0
  831. data/modules/emscripten/third_party/ply/test/yacc_nop.py +68 -0
  832. data/modules/emscripten/third_party/ply/test/yacc_notfunc.py +66 -0
  833. data/modules/emscripten/third_party/ply/test/yacc_notok.py +67 -0
  834. data/modules/emscripten/third_party/ply/test/yacc_prec1.py +68 -0
  835. data/modules/emscripten/third_party/ply/test/yacc_rr.py +72 -0
  836. data/modules/emscripten/third_party/ply/test/yacc_rr_unused.py +30 -0
  837. data/modules/emscripten/third_party/ply/test/yacc_simple.py +68 -0
  838. data/modules/emscripten/third_party/ply/test/yacc_sr.py +63 -0
  839. data/modules/emscripten/third_party/ply/test/yacc_term1.py +68 -0
  840. data/modules/emscripten/third_party/ply/test/yacc_unused.py +77 -0
  841. data/modules/emscripten/third_party/ply/test/yacc_unused_rule.py +72 -0
  842. data/modules/emscripten/third_party/ply/test/yacc_uprec.py +63 -0
  843. data/modules/emscripten/third_party/ply/test/yacc_uprec2.py +63 -0
  844. data/modules/emscripten/third_party/readme.txt +7 -0
  845. data/modules/emscripten/third_party/websockify/CHANGES.txt +23 -0
  846. data/modules/emscripten/third_party/websockify/LICENSE.txt +16 -0
  847. data/modules/emscripten/third_party/websockify/MANIFEST.in +1 -0
  848. data/modules/emscripten/third_party/websockify/Makefile +11 -0
  849. data/modules/emscripten/third_party/websockify/README.md +168 -0
  850. data/modules/emscripten/third_party/websockify/Windows/Windows Service Readme.txt +39 -0
  851. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Program.cs +24 -0
  852. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.Designer.cs +61 -0
  853. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.cs +19 -0
  854. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.resx +129 -0
  855. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Properties/AssemblyInfo.cs +36 -0
  856. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Service1.Designer.cs +37 -0
  857. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Service1.cs +41 -0
  858. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/noVNC Websocket.csproj +75 -0
  859. data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/noVNC Websocket.sln +20 -0
  860. data/modules/emscripten/third_party/websockify/docs/LICENSE.GPL-3 +621 -0
  861. data/modules/emscripten/third_party/websockify/docs/LICENSE.LGPL-3 +165 -0
  862. data/modules/emscripten/third_party/websockify/docs/LICENSE.MPL-2.0 +373 -0
  863. data/modules/emscripten/third_party/websockify/docs/TODO +9 -0
  864. data/modules/emscripten/third_party/websockify/docs/flash_policy.txt +4 -0
  865. data/modules/emscripten/third_party/websockify/docs/latency_results.txt +114 -0
  866. data/modules/emscripten/third_party/websockify/docs/notes +17 -0
  867. data/modules/emscripten/third_party/websockify/docs/release.txt +9 -0
  868. data/modules/emscripten/third_party/websockify/docs/websockify.1 +110 -0
  869. data/modules/emscripten/third_party/websockify/include/VT100.js +919 -0
  870. data/modules/emscripten/third_party/websockify/include/base64.js +114 -0
  871. data/modules/emscripten/third_party/websockify/include/keysym.js +99 -0
  872. data/modules/emscripten/third_party/websockify/include/util.js +359 -0
  873. data/modules/emscripten/third_party/websockify/include/web-socket-js/README.txt +109 -0
  874. data/modules/emscripten/third_party/websockify/include/web-socket-js/WebSocketMain.swf +0 -0
  875. data/modules/emscripten/third_party/websockify/include/web-socket-js/swfobject.js +4 -0
  876. data/modules/emscripten/third_party/websockify/include/web-socket-js/web_socket.js +391 -0
  877. data/modules/emscripten/third_party/websockify/include/websock.js +422 -0
  878. data/modules/emscripten/third_party/websockify/include/webutil.js +216 -0
  879. data/modules/emscripten/third_party/websockify/include/wsirc.js +235 -0
  880. data/modules/emscripten/third_party/websockify/include/wstelnet.js +335 -0
  881. data/modules/emscripten/third_party/websockify/other/Makefile +14 -0
  882. data/modules/emscripten/third_party/websockify/other/README.md +51 -0
  883. data/modules/emscripten/third_party/websockify/other/launch.sh +108 -0
  884. data/modules/emscripten/third_party/websockify/other/project.clj +13 -0
  885. data/modules/emscripten/third_party/websockify/other/websocket.c +802 -0
  886. data/modules/emscripten/third_party/websockify/other/websocket.h +84 -0
  887. data/modules/emscripten/third_party/websockify/other/websocket.rb +456 -0
  888. data/modules/emscripten/third_party/websockify/other/websockify.c +385 -0
  889. data/modules/emscripten/third_party/websockify/other/websockify.clj +233 -0
  890. data/modules/emscripten/third_party/websockify/other/websockify.js +196 -0
  891. data/modules/emscripten/third_party/websockify/other/websockify.rb +171 -0
  892. data/modules/emscripten/third_party/websockify/other/wswrap +22 -0
  893. data/modules/emscripten/third_party/websockify/rebind +18 -0
  894. data/modules/emscripten/third_party/websockify/rebind.c +94 -0
  895. data/modules/emscripten/third_party/websockify/run +5 -0
  896. data/modules/emscripten/third_party/websockify/setup.py +30 -0
  897. data/modules/emscripten/third_party/websockify/tests/b64_vs_utf8.py +29 -0
  898. data/modules/emscripten/third_party/websockify/tests/base64.html +91 -0
  899. data/modules/emscripten/third_party/websockify/tests/base64.js +12 -0
  900. data/modules/emscripten/third_party/websockify/tests/echo.html +148 -0
  901. data/modules/emscripten/third_party/websockify/tests/echo.py +75 -0
  902. data/modules/emscripten/third_party/websockify/tests/echo.rb +62 -0
  903. data/modules/emscripten/third_party/websockify/tests/latency.html +290 -0
  904. data/modules/emscripten/third_party/websockify/tests/latency.py +75 -0
  905. data/modules/emscripten/third_party/websockify/tests/load.html +250 -0
  906. data/modules/emscripten/third_party/websockify/tests/load.py +167 -0
  907. data/modules/emscripten/third_party/websockify/tests/plain_echo.html +168 -0
  908. data/modules/emscripten/third_party/websockify/tests/simple.html +68 -0
  909. data/modules/emscripten/third_party/websockify/tests/utf8-list.py +22 -0
  910. data/modules/emscripten/third_party/websockify/websockify/__init__.py +2 -0
  911. data/modules/emscripten/third_party/websockify/websockify/websocket.py +982 -0
  912. data/modules/emscripten/third_party/websockify/websockify/websocketproxy.py +393 -0
  913. data/modules/emscripten/third_party/websockify/websockify.py +5 -0
  914. data/modules/emscripten/third_party/websockify/wsirc.html +99 -0
  915. data/modules/emscripten/third_party/websockify/wstelnet.html +74 -0
  916. data/modules/emscripten/tools/__init__.py +0 -0
  917. data/modules/emscripten/tools/__init__.pyc +0 -0
  918. data/modules/emscripten/tools/autodebugger.py +289 -0
  919. data/modules/emscripten/tools/autodebugger_c.py +37 -0
  920. data/modules/emscripten/tools/autodebugger_indenter.py +18 -0
  921. data/modules/emscripten/tools/autodebugger_js.py +47 -0
  922. data/modules/emscripten/tools/autodediffer.py +60 -0
  923. data/modules/emscripten/tools/bindings_generator.py +832 -0
  924. data/modules/emscripten/tools/bisect_pair.py +88 -0
  925. data/modules/emscripten/tools/cache.py +198 -0
  926. data/modules/emscripten/tools/cache.pyc +0 -0
  927. data/modules/emscripten/tools/clean_webconsole.py +34 -0
  928. data/modules/emscripten/tools/crunch-worker.js +124 -0
  929. data/modules/emscripten/tools/diff_autodebugger.py +15 -0
  930. data/modules/emscripten/tools/eliminator/asm-eliminator-test-output.js +5129 -0
  931. data/modules/emscripten/tools/eliminator/asm-eliminator-test.js +6861 -0
  932. data/modules/emscripten/tools/eliminator/eliminator-test-output.js +6122 -0
  933. data/modules/emscripten/tools/eliminator/eliminator-test.js +8856 -0
  934. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/README.html +888 -0
  935. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/README.org +463 -0
  936. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/bin/uglifyjs +317 -0
  937. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/docstyle.css +75 -0
  938. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/object-ast.js +75 -0
  939. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/parse-js.js +1363 -0
  940. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/process.js +2005 -0
  941. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/squeeze-more.js +51 -0
  942. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/package.json +22 -0
  943. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/beautify.js +28 -0
  944. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/testparser.js +402 -0
  945. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array1.js +1 -0
  946. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array2.js +1 -0
  947. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array3.js +1 -0
  948. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array4.js +1 -0
  949. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/assignment.js +1 -0
  950. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/concatstring.js +1 -0
  951. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/const.js +1 -0
  952. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/empty-blocks.js +1 -0
  953. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/forstatement.js +1 -0
  954. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/if.js +1 -0
  955. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/ifreturn.js +1 -0
  956. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/ifreturn2.js +1 -0
  957. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue10.js +1 -0
  958. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue11.js +1 -0
  959. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue13.js +1 -0
  960. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue14.js +1 -0
  961. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue16.js +1 -0
  962. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue17.js +1 -0
  963. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue20.js +1 -0
  964. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue21.js +1 -0
  965. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue25.js +1 -0
  966. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue27.js +1 -0
  967. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue28.js +1 -0
  968. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue29.js +1 -0
  969. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue30.js +1 -0
  970. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue34.js +1 -0
  971. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue4.js +1 -0
  972. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue48.js +1 -0
  973. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue50.js +1 -0
  974. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue53.js +1 -0
  975. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue54.1.js +1 -0
  976. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue68.js +1 -0
  977. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue69.js +1 -0
  978. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue9.js +1 -0
  979. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/mangle.js +1 -0
  980. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/strict-equals.js +1 -0
  981. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/var.js +1 -0
  982. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/with.js +1 -0
  983. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array1.js +3 -0
  984. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array2.js +4 -0
  985. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array3.js +4 -0
  986. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array4.js +6 -0
  987. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/assignment.js +20 -0
  988. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/concatstring.js +3 -0
  989. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/const.js +5 -0
  990. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/empty-blocks.js +4 -0
  991. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/forstatement.js +10 -0
  992. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/if.js +6 -0
  993. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/ifreturn.js +9 -0
  994. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/ifreturn2.js +16 -0
  995. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue10.js +1 -0
  996. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue11.js +3 -0
  997. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue13.js +1 -0
  998. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue14.js +1 -0
  999. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue16.js +1 -0
  1000. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue17.js +4 -0
  1001. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue20.js +1 -0
  1002. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue21.js +6 -0
  1003. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue25.js +7 -0
  1004. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue27.js +1 -0
  1005. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue28.js +3 -0
  1006. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue29.js +1 -0
  1007. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue30.js +3 -0
  1008. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue34.js +3 -0
  1009. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue4.js +3 -0
  1010. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue48.js +1 -0
  1011. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue50.js +9 -0
  1012. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue53.js +1 -0
  1013. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue54.1.js +3 -0
  1014. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue68.js +5 -0
  1015. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue69.js +1 -0
  1016. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue9.js +4 -0
  1017. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/mangle.js +5 -0
  1018. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/strict-equals.js +3 -0
  1019. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/var.js +3 -0
  1020. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/with.js +2 -0
  1021. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/scripts.js +55 -0
  1022. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/hoist.js +33 -0
  1023. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/instrument.js +97 -0
  1024. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/instrument2.js +138 -0
  1025. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/test.js +16 -0
  1026. data/modules/emscripten/tools/eliminator/node_modules/uglify-js/uglify-js.js +17 -0
  1027. data/modules/emscripten/tools/eliminator/safe-eliminator-test-output.js +85 -0
  1028. data/modules/emscripten/tools/eliminator/safe-eliminator-test.js +103 -0
  1029. data/modules/emscripten/tools/emconfiguren.py +19 -0
  1030. data/modules/emscripten/tools/emmaken.py +230 -0
  1031. data/modules/emscripten/tools/emmakenxx.py +18 -0
  1032. data/modules/emscripten/tools/exec_llvm.py +50 -0
  1033. data/modules/emscripten/tools/file2json.py +49 -0
  1034. data/modules/emscripten/tools/file_packager.py +649 -0
  1035. data/modules/emscripten/tools/find_bigfuncs.py +23 -0
  1036. data/modules/emscripten/tools/find_bigis.py +18 -0
  1037. data/modules/emscripten/tools/fix_closure.py +88 -0
  1038. data/modules/emscripten/tools/ie7_fix.py +14 -0
  1039. data/modules/emscripten/tools/js-optimizer.js +3440 -0
  1040. data/modules/emscripten/tools/js_optimizer.py +341 -0
  1041. data/modules/emscripten/tools/js_optimizer.pyc +0 -0
  1042. data/modules/emscripten/tools/jsrun.py +27 -0
  1043. data/modules/emscripten/tools/jsrun.pyc +0 -0
  1044. data/modules/emscripten/tools/ll-strip.py +56 -0
  1045. data/modules/emscripten/tools/make_file.py +19 -0
  1046. data/modules/emscripten/tools/make_minigzip.py +13 -0
  1047. data/modules/emscripten/tools/namespacer.py +95 -0
  1048. data/modules/emscripten/tools/nativize_llvm.py +34 -0
  1049. data/modules/emscripten/tools/node_modules/source-map/CHANGELOG.md +58 -0
  1050. data/modules/emscripten/tools/node_modules/source-map/LICENSE +28 -0
  1051. data/modules/emscripten/tools/node_modules/source-map/Makefile.dryice.js +166 -0
  1052. data/modules/emscripten/tools/node_modules/source-map/README.md +347 -0
  1053. data/modules/emscripten/tools/node_modules/source-map/build/assert-shim.js +56 -0
  1054. data/modules/emscripten/tools/node_modules/source-map/build/mini-require.js +152 -0
  1055. data/modules/emscripten/tools/node_modules/source-map/build/prefix-source-map.jsm +20 -0
  1056. data/modules/emscripten/tools/node_modules/source-map/build/prefix-utils.jsm +18 -0
  1057. data/modules/emscripten/tools/node_modules/source-map/build/suffix-browser.js +8 -0
  1058. data/modules/emscripten/tools/node_modules/source-map/build/suffix-source-map.jsm +6 -0
  1059. data/modules/emscripten/tools/node_modules/source-map/build/suffix-utils.jsm +21 -0
  1060. data/modules/emscripten/tools/node_modules/source-map/build/test-prefix.js +8 -0
  1061. data/modules/emscripten/tools/node_modules/source-map/build/test-suffix.js +3 -0
  1062. data/modules/emscripten/tools/node_modules/source-map/lib/source-map/array-set.js +96 -0
  1063. data/modules/emscripten/tools/node_modules/source-map/lib/source-map/base64-vlq.js +144 -0
  1064. data/modules/emscripten/tools/node_modules/source-map/lib/source-map/base64.js +42 -0
  1065. data/modules/emscripten/tools/node_modules/source-map/lib/source-map/binary-search.js +81 -0
  1066. data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-map-consumer.js +430 -0
  1067. data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-map-generator.js +381 -0
  1068. data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-node.js +353 -0
  1069. data/modules/emscripten/tools/node_modules/source-map/lib/source-map/util.js +117 -0
  1070. data/modules/emscripten/tools/node_modules/source-map/lib/source-map.js +8 -0
  1071. data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/LICENSE +58 -0
  1072. data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/README.md +119 -0
  1073. data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/amdefine.js +299 -0
  1074. data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/package.json +33 -0
  1075. data/modules/emscripten/tools/node_modules/source-map/package.json +74 -0
  1076. data/modules/emscripten/tools/node_modules/source-map/test/run-tests.js +73 -0
  1077. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-api.js +26 -0
  1078. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-array-set.js +71 -0
  1079. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-base64-vlq.js +24 -0
  1080. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-base64.js +35 -0
  1081. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-binary-search.js +54 -0
  1082. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-dog-fooding.js +72 -0
  1083. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-map-consumer.js +306 -0
  1084. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-map-generator.js +391 -0
  1085. data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-node.js +282 -0
  1086. data/modules/emscripten/tools/node_modules/source-map/test/source-map/util.js +152 -0
  1087. data/modules/emscripten/tools/reproduceriter.js +216 -0
  1088. data/modules/emscripten/tools/reproduceriter.py +160 -0
  1089. data/modules/emscripten/tools/response_file.py +28 -0
  1090. data/modules/emscripten/tools/response_file.pyc +0 -0
  1091. data/modules/emscripten/tools/scan_js.py +20 -0
  1092. data/modules/emscripten/tools/scan_ll.py +18 -0
  1093. data/modules/emscripten/tools/scons/site_scons/site_tools/emscripten/__init__.py +3 -0
  1094. data/modules/emscripten/tools/scons/site_scons/site_tools/emscripten/emscripten.py +46 -0
  1095. data/modules/emscripten/tools/settings_template_readonly.py +47 -0
  1096. data/modules/emscripten/tools/shared.py +1437 -0
  1097. data/modules/emscripten/tools/shared.pyc +0 -0
  1098. data/modules/emscripten/tools/source-maps/sourcemap2json.js +15 -0
  1099. data/modules/emscripten/tools/source-maps/sourcemapper.js +177 -0
  1100. data/modules/emscripten/tools/split.py +97 -0
  1101. data/modules/emscripten/tools/tempfiles.py +40 -0
  1102. data/modules/emscripten/tools/tempfiles.pyc +0 -0
  1103. data/modules/emscripten/tools/test-js-optimizer-asm-last-output.js +75 -0
  1104. data/modules/emscripten/tools/test-js-optimizer-asm-last.js +91 -0
  1105. data/modules/emscripten/tools/test-js-optimizer-asm-outline-output.js +570 -0
  1106. data/modules/emscripten/tools/test-js-optimizer-asm-outline.js +606 -0
  1107. data/modules/emscripten/tools/test-js-optimizer-asm-pre-output.js +540 -0
  1108. data/modules/emscripten/tools/test-js-optimizer-asm-pre.js +550 -0
  1109. data/modules/emscripten/tools/test-js-optimizer-asm-regs-min-output.js +36 -0
  1110. data/modules/emscripten/tools/test-js-optimizer-asm-regs-min.js +37 -0
  1111. data/modules/emscripten/tools/test-js-optimizer-asm-regs-output.js +106 -0
  1112. data/modules/emscripten/tools/test-js-optimizer-asm-regs.js +110 -0
  1113. data/modules/emscripten/tools/test-js-optimizer-asm-relocate-output.js +9 -0
  1114. data/modules/emscripten/tools/test-js-optimizer-asm-relocate.js +12 -0
  1115. data/modules/emscripten/tools/test-js-optimizer-output.js +291 -0
  1116. data/modules/emscripten/tools/test-js-optimizer-regs-output.js +232 -0
  1117. data/modules/emscripten/tools/test-js-optimizer-regs.js +237 -0
  1118. data/modules/emscripten/tools/test-js-optimizer-t2-output.js +91 -0
  1119. data/modules/emscripten/tools/test-js-optimizer-t2.js +92 -0
  1120. data/modules/emscripten/tools/test-js-optimizer-t2c-output.js +17 -0
  1121. data/modules/emscripten/tools/test-js-optimizer-t2c.js +18 -0
  1122. data/modules/emscripten/tools/test-js-optimizer-t3-output.js +49 -0
  1123. data/modules/emscripten/tools/test-js-optimizer-t3.js +50 -0
  1124. data/modules/emscripten/tools/test-js-optimizer.js +401 -0
  1125. data/modules/mruby/AUTHORS +18 -0
  1126. data/modules/mruby/CONTRIBUTING.md +65 -0
  1127. data/modules/mruby/ChangeLog +15 -0
  1128. data/modules/mruby/INSTALL +29 -0
  1129. data/modules/mruby/LEGAL +6 -0
  1130. data/modules/mruby/MITL +20 -0
  1131. data/modules/mruby/Makefile +18 -0
  1132. data/modules/mruby/NEWS +13 -0
  1133. data/modules/mruby/README.md +116 -0
  1134. data/modules/mruby/Rakefile +114 -0
  1135. data/modules/mruby/TODO +11 -0
  1136. data/modules/mruby/benchmark/ao-render.rb +315 -0
  1137. data/modules/mruby/benchmark/bm_so_lists.rb +47 -0
  1138. data/modules/mruby/benchmark/fib39.rb +8 -0
  1139. data/modules/mruby/build_config.rb +88 -0
  1140. data/modules/mruby/doc/compile/README.md +376 -0
  1141. data/modules/mruby/doc/mrbgems/README.md +254 -0
  1142. data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/README.md +4 -0
  1143. data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake +23 -0
  1144. data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/mrblib/example.rb +5 -0
  1145. data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/src/example.c +20 -0
  1146. data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/test/example.rb +7 -0
  1147. data/modules/mruby/examples/mrbgems/c_extension_example/README.md +4 -0
  1148. data/modules/mruby/examples/mrbgems/c_extension_example/mrbgem.rake +23 -0
  1149. data/modules/mruby/examples/mrbgems/c_extension_example/src/example.c +20 -0
  1150. data/modules/mruby/examples/mrbgems/c_extension_example/test/example.c +7 -0
  1151. data/modules/mruby/examples/mrbgems/c_extension_example/test/example.rb +3 -0
  1152. data/modules/mruby/examples/mrbgems/ruby_extension_example/README.md +4 -0
  1153. data/modules/mruby/examples/mrbgems/ruby_extension_example/mrbgem.rake +23 -0
  1154. data/modules/mruby/examples/mrbgems/ruby_extension_example/mrblib/example.rb +5 -0
  1155. data/modules/mruby/examples/mrbgems/ruby_extension_example/test/example.rb +3 -0
  1156. data/modules/mruby/examples/targets/ArduinoDue.rb +65 -0
  1157. data/modules/mruby/examples/targets/chipKitMax32.rb +68 -0
  1158. data/modules/mruby/include/mrbconf.h +87 -0
  1159. data/modules/mruby/include/mruby/array.h +63 -0
  1160. data/modules/mruby/include/mruby/class.h +75 -0
  1161. data/modules/mruby/include/mruby/compile.h +176 -0
  1162. data/modules/mruby/include/mruby/data.h +53 -0
  1163. data/modules/mruby/include/mruby/dump.h +151 -0
  1164. data/modules/mruby/include/mruby/gc.h +17 -0
  1165. data/modules/mruby/include/mruby/hash.h +54 -0
  1166. data/modules/mruby/include/mruby/irep.h +40 -0
  1167. data/modules/mruby/include/mruby/khash.h +257 -0
  1168. data/modules/mruby/include/mruby/numeric.h +32 -0
  1169. data/modules/mruby/include/mruby/proc.h +62 -0
  1170. data/modules/mruby/include/mruby/range.h +35 -0
  1171. data/modules/mruby/include/mruby/string.h +78 -0
  1172. data/modules/mruby/include/mruby/value.h +483 -0
  1173. data/modules/mruby/include/mruby/variable.h +78 -0
  1174. data/modules/mruby/include/mruby.h +388 -0
  1175. data/modules/mruby/minirake +477 -0
  1176. data/modules/mruby/mrbgems/default.gembox +61 -0
  1177. data/modules/mruby/mrbgems/full-core.gembox +9 -0
  1178. data/modules/mruby/mrbgems/mruby-array-ext/mrbgem.rake +4 -0
  1179. data/modules/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +204 -0
  1180. data/modules/mruby/mrbgems/mruby-array-ext/src/array.c +140 -0
  1181. data/modules/mruby/mrbgems/mruby-array-ext/test/array.rb +109 -0
  1182. data/modules/mruby/mrbgems/mruby-bin-mirb/mrbgem.rake +5 -0
  1183. data/modules/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +365 -0
  1184. data/modules/mruby/mrbgems/mruby-bin-mruby/mrbgem.rake +5 -0
  1185. data/modules/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +243 -0
  1186. data/modules/mruby/mrbgems/mruby-enum-ext/mrbgem.rake +4 -0
  1187. data/modules/mruby/mrbgems/mruby-enum-ext/mrblib/enum.rb +164 -0
  1188. data/modules/mruby/mrbgems/mruby-enum-ext/test/enum.rb +44 -0
  1189. data/modules/mruby/mrbgems/mruby-eval/mrbgem.rake +4 -0
  1190. data/modules/mruby/mrbgems/mruby-eval/src/eval.c +23 -0
  1191. data/modules/mruby/mrbgems/mruby-fiber/mrbgem.rake +4 -0
  1192. data/modules/mruby/mrbgems/mruby-fiber/src/fiber.c +251 -0
  1193. data/modules/mruby/mrbgems/mruby-fiber/test/fiber.rb +64 -0
  1194. data/modules/mruby/mrbgems/mruby-hash-ext/mrbgem.rake +4 -0
  1195. data/modules/mruby/mrbgems/mruby-hash-ext/mrblib/hash.rb +13 -0
  1196. data/modules/mruby/mrbgems/mruby-hash-ext/src/hash-ext.c +62 -0
  1197. data/modules/mruby/mrbgems/mruby-hash-ext/test/hash.rb +26 -0
  1198. data/modules/mruby/mrbgems/mruby-math/mrbgem.rake +4 -0
  1199. data/modules/mruby/mrbgems/mruby-math/src/math.c +685 -0
  1200. data/modules/mruby/mrbgems/mruby-math/test/math.rb +136 -0
  1201. data/modules/mruby/mrbgems/mruby-numeric-ext/mrbgem.rake +4 -0
  1202. data/modules/mruby/mrbgems/mruby-numeric-ext/src/numeric_ext.c +31 -0
  1203. data/modules/mruby/mrbgems/mruby-numeric-ext/test/numeric.rb +10 -0
  1204. data/modules/mruby/mrbgems/mruby-object-ext/mrbgem.rake +4 -0
  1205. data/modules/mruby/mrbgems/mruby-object-ext/src/object.c +108 -0
  1206. data/modules/mruby/mrbgems/mruby-object-ext/test/nil.rb +11 -0
  1207. data/modules/mruby/mrbgems/mruby-object-ext/test/object.rb +9 -0
  1208. data/modules/mruby/mrbgems/mruby-objectspace/mrbgem.rake +4 -0
  1209. data/modules/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +117 -0
  1210. data/modules/mruby/mrbgems/mruby-objectspace/test/objectspace.rb +38 -0
  1211. data/modules/mruby/mrbgems/mruby-print/mrbgem.rake +4 -0
  1212. data/modules/mruby/mrbgems/mruby-print/mrblib/print.rb +64 -0
  1213. data/modules/mruby/mrbgems/mruby-print/src/print.c +44 -0
  1214. data/modules/mruby/mrbgems/mruby-proc-ext/mrbgem.rake +4 -0
  1215. data/modules/mruby/mrbgems/mruby-proc-ext/mrblib/proc.rb +40 -0
  1216. data/modules/mruby/mrbgems/mruby-proc-ext/src/proc.c +97 -0
  1217. data/modules/mruby/mrbgems/mruby-proc-ext/test/proc.rb +41 -0
  1218. data/modules/mruby/mrbgems/mruby-random/mrbgem.rake +4 -0
  1219. data/modules/mruby/mrbgems/mruby-random/src/mt19937ar.c +193 -0
  1220. data/modules/mruby/mrbgems/mruby-random/src/mt19937ar.h +48 -0
  1221. data/modules/mruby/mrbgems/mruby-random/src/random.c +231 -0
  1222. data/modules/mruby/mrbgems/mruby-random/src/random.h +12 -0
  1223. data/modules/mruby/mrbgems/mruby-random/test/random.rb +32 -0
  1224. data/modules/mruby/mrbgems/mruby-range-ext/mrbgem.rake +4 -0
  1225. data/modules/mruby/mrbgems/mruby-range-ext/src/range.c +141 -0
  1226. data/modules/mruby/mrbgems/mruby-range-ext/test/range.rb +20 -0
  1227. data/modules/mruby/mrbgems/mruby-sprintf/mrbgem.rake +4 -0
  1228. data/modules/mruby/mrbgems/mruby-sprintf/src/kernel.c +30 -0
  1229. data/modules/mruby/mrbgems/mruby-sprintf/src/sprintf.c +1102 -0
  1230. data/modules/mruby/mrbgems/mruby-sprintf/test/sprintf.rb +3 -0
  1231. data/modules/mruby/mrbgems/mruby-string-ext/mrbgem.rake +4 -0
  1232. data/modules/mruby/mrbgems/mruby-string-ext/mrblib/string.rb +52 -0
  1233. data/modules/mruby/mrbgems/mruby-string-ext/src/string.c +175 -0
  1234. data/modules/mruby/mrbgems/mruby-string-ext/test/string.rb +112 -0
  1235. data/modules/mruby/mrbgems/mruby-struct/mrbgem.rake +4 -0
  1236. data/modules/mruby/mrbgems/mruby-struct/mrblib/struct.rb +50 -0
  1237. data/modules/mruby/mrbgems/mruby-struct/src/struct.c +818 -0
  1238. data/modules/mruby/mrbgems/mruby-struct/test/struct.rb +77 -0
  1239. data/modules/mruby/mrbgems/mruby-symbol-ext/mrbgem.rake +4 -0
  1240. data/modules/mruby/mrbgems/mruby-symbol-ext/mrblib/symbol.rb +9 -0
  1241. data/modules/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +55 -0
  1242. data/modules/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +12 -0
  1243. data/modules/mruby/mrbgems/mruby-time/mrbgem.rake +4 -0
  1244. data/modules/mruby/mrbgems/mruby-time/src/time.c +749 -0
  1245. data/modules/mruby/mrbgems/mruby-time/test/time.rb +201 -0
  1246. data/modules/mruby/mrbgems/mruby-toplevel-ext/mrbgem.rake +4 -0
  1247. data/modules/mruby/mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb +11 -0
  1248. data/modules/mruby/mrbgems/mruby-toplevel-ext/test/toplevel.rb +24 -0
  1249. data/modules/mruby/mrblib/array.rb +111 -0
  1250. data/modules/mruby/mrblib/class.rb +26 -0
  1251. data/modules/mruby/mrblib/compar.rb +104 -0
  1252. data/modules/mruby/mrblib/enum.rb +398 -0
  1253. data/modules/mruby/mrblib/error.rb +66 -0
  1254. data/modules/mruby/mrblib/hash.rb +193 -0
  1255. data/modules/mruby/mrblib/init_mrblib.c +14 -0
  1256. data/modules/mruby/mrblib/kernel.rb +46 -0
  1257. data/modules/mruby/mrblib/mrblib.rake +18 -0
  1258. data/modules/mruby/mrblib/numeric.rb +101 -0
  1259. data/modules/mruby/mrblib/print.rb +18 -0
  1260. data/modules/mruby/mrblib/range.rb +40 -0
  1261. data/modules/mruby/mrblib/string.rb +145 -0
  1262. data/modules/mruby/src/array.c +1150 -0
  1263. data/modules/mruby/src/backtrace.c +73 -0
  1264. data/modules/mruby/src/class.c +1942 -0
  1265. data/modules/mruby/src/codegen.c +2864 -0
  1266. data/modules/mruby/src/compar.c +13 -0
  1267. data/modules/mruby/src/crc.c +38 -0
  1268. data/modules/mruby/src/dump.c +542 -0
  1269. data/modules/mruby/src/enum.c +14 -0
  1270. data/modules/mruby/src/error.c +454 -0
  1271. data/modules/mruby/src/error.h +18 -0
  1272. data/modules/mruby/src/etc.c +204 -0
  1273. data/modules/mruby/src/gc.c +1542 -0
  1274. data/modules/mruby/src/hash.c +1261 -0
  1275. data/modules/mruby/src/init.c +62 -0
  1276. data/modules/mruby/src/kernel.c +1105 -0
  1277. data/modules/mruby/src/keywords +50 -0
  1278. data/modules/mruby/src/lex.def +212 -0
  1279. data/modules/mruby/src/load.c +629 -0
  1280. data/modules/mruby/src/mruby_core.rake +28 -0
  1281. data/modules/mruby/src/node.h +117 -0
  1282. data/modules/mruby/src/numeric.c +1418 -0
  1283. data/modules/mruby/src/object.c +593 -0
  1284. data/modules/mruby/src/opcode.h +160 -0
  1285. data/modules/mruby/src/parse.y +6050 -0
  1286. data/modules/mruby/src/pool.c +190 -0
  1287. data/modules/mruby/src/print.c +71 -0
  1288. data/modules/mruby/src/proc.c +209 -0
  1289. data/modules/mruby/src/range.c +442 -0
  1290. data/modules/mruby/src/re.h +13 -0
  1291. data/modules/mruby/src/state.c +200 -0
  1292. data/modules/mruby/src/string.c +2580 -0
  1293. data/modules/mruby/src/symbol.c +456 -0
  1294. data/modules/mruby/src/value_array.h +27 -0
  1295. data/modules/mruby/src/variable.c +1147 -0
  1296. data/modules/mruby/src/vm.c +2129 -0
  1297. data/modules/mruby/tasks/libmruby.rake +18 -0
  1298. data/modules/mruby/tasks/mrbgem_spec.rake +297 -0
  1299. data/modules/mruby/tasks/mrbgems.rake +85 -0
  1300. data/modules/mruby/tasks/mrbgems_test.rake +88 -0
  1301. data/modules/mruby/tasks/mruby_build.rake +211 -0
  1302. data/modules/mruby/tasks/mruby_build_commands.rake +287 -0
  1303. data/modules/mruby/tasks/mruby_build_gem.rake +67 -0
  1304. data/modules/mruby/tasks/ruby_ext.rake +70 -0
  1305. data/modules/mruby/tasks/toolchains/androideabi.rake +126 -0
  1306. data/modules/mruby/tasks/toolchains/clang.rake +8 -0
  1307. data/modules/mruby/tasks/toolchains/gcc.rake +21 -0
  1308. data/modules/mruby/tasks/toolchains/vs2010.rake +3 -0
  1309. data/modules/mruby/tasks/toolchains/vs2012.rake +44 -0
  1310. data/modules/mruby/test/README.md +7 -0
  1311. data/modules/mruby/test/assert.rb +238 -0
  1312. data/modules/mruby/test/driver.c +118 -0
  1313. data/modules/mruby/test/init_mrbtest.c +24 -0
  1314. data/modules/mruby/test/mrbtest.rake +47 -0
  1315. data/modules/mruby/test/report.rb +4 -0
  1316. data/modules/mruby/test/t/argumenterror.rb +21 -0
  1317. data/modules/mruby/test/t/array.rb +309 -0
  1318. data/modules/mruby/test/t/basicobject.rb +11 -0
  1319. data/modules/mruby/test/t/bs_block.rb +489 -0
  1320. data/modules/mruby/test/t/bs_literal.rb +38 -0
  1321. data/modules/mruby/test/t/class.rb +219 -0
  1322. data/modules/mruby/test/t/comparable.rb +72 -0
  1323. data/modules/mruby/test/t/enumerable.rb +108 -0
  1324. data/modules/mruby/test/t/exception.rb +337 -0
  1325. data/modules/mruby/test/t/false.rb +33 -0
  1326. data/modules/mruby/test/t/float.rb +145 -0
  1327. data/modules/mruby/test/t/gc.rb +45 -0
  1328. data/modules/mruby/test/t/hash.rb +310 -0
  1329. data/modules/mruby/test/t/indexerror.rb +10 -0
  1330. data/modules/mruby/test/t/integer.rb +222 -0
  1331. data/modules/mruby/test/t/kernel.rb +425 -0
  1332. data/modules/mruby/test/t/literals.rb +287 -0
  1333. data/modules/mruby/test/t/localjumperror.rb +13 -0
  1334. data/modules/mruby/test/t/methods.rb +109 -0
  1335. data/modules/mruby/test/t/module.rb +344 -0
  1336. data/modules/mruby/test/t/nameerror.rb +32 -0
  1337. data/modules/mruby/test/t/nil.rb +29 -0
  1338. data/modules/mruby/test/t/nomethoderror.rb +13 -0
  1339. data/modules/mruby/test/t/numeric.rb +29 -0
  1340. data/modules/mruby/test/t/object.rb +11 -0
  1341. data/modules/mruby/test/t/proc.rb +56 -0
  1342. data/modules/mruby/test/t/range.rb +82 -0
  1343. data/modules/mruby/test/t/rangeerror.rb +10 -0
  1344. data/modules/mruby/test/t/regexperror.rb +4 -0
  1345. data/modules/mruby/test/t/runtimeerror.rb +6 -0
  1346. data/modules/mruby/test/t/standarderror.rb +10 -0
  1347. data/modules/mruby/test/t/string.rb +483 -0
  1348. data/modules/mruby/test/t/symbol.rb +27 -0
  1349. data/modules/mruby/test/t/syntax.rb +67 -0
  1350. data/modules/mruby/test/t/true.rb +33 -0
  1351. data/modules/mruby/test/t/typeerror.rb +11 -0
  1352. data/modules/mruby/tools/mrbc/mrbc.c +318 -0
  1353. data/modules/mruby/tools/mrbc/mrbc.rake +14 -0
  1354. data/modules/mruby/travis_config.rb +6 -0
  1355. data/modules/mrubymix/LICENSE +21 -0
  1356. data/modules/mrubymix/README.md +6 -0
  1357. data/modules/mrubymix/bin/mrubymix +29 -0
  1358. data/modules/mrubymix/lib/mrubymix.rb +93 -0
  1359. data/modules/mrubymix/mrubymix.gemspec +13 -0
  1360. data/scripts/gen_gems_config.rb +185 -0
  1361. data/scripts/gen_post.rb +104 -0
  1362. data/templates/minimal/Rakefile +36 -0
  1363. data/templates/minimal/app/app.rb +3 -0
  1364. metadata +1408 -0
@@ -0,0 +1,4779 @@
1
+ // -*- C++ -*-
2
+ //===-------------------------- valarray ----------------------------------===//
3
+ //
4
+ // The LLVM Compiler Infrastructure
5
+ //
6
+ // This file is dual licensed under the MIT and the University of Illinois Open
7
+ // Source Licenses. See LICENSE.TXT for details.
8
+ //
9
+ //===----------------------------------------------------------------------===//
10
+
11
+ #ifndef _LIBCPP_VALARRAY
12
+ #define _LIBCPP_VALARRAY
13
+
14
+ /*
15
+ valarray synopsis
16
+
17
+ namespace std
18
+ {
19
+
20
+ template<class T>
21
+ class valarray
22
+ {
23
+ public:
24
+ typedef T value_type;
25
+
26
+ // construct/destroy:
27
+ valarray();
28
+ explicit valarray(size_t n);
29
+ valarray(const value_type& x, size_t n);
30
+ valarray(const value_type* px, size_t n);
31
+ valarray(const valarray& v);
32
+ valarray(valarray&& v) noexcept;
33
+ valarray(const slice_array<value_type>& sa);
34
+ valarray(const gslice_array<value_type>& ga);
35
+ valarray(const mask_array<value_type>& ma);
36
+ valarray(const indirect_array<value_type>& ia);
37
+ valarray(initializer_list<value_type> il);
38
+ ~valarray();
39
+
40
+ // assignment:
41
+ valarray& operator=(const valarray& v);
42
+ valarray& operator=(valarray&& v) noexcept;
43
+ valarray& operator=(initializer_list<value_type> il);
44
+ valarray& operator=(const value_type& x);
45
+ valarray& operator=(const slice_array<value_type>& sa);
46
+ valarray& operator=(const gslice_array<value_type>& ga);
47
+ valarray& operator=(const mask_array<value_type>& ma);
48
+ valarray& operator=(const indirect_array<value_type>& ia);
49
+
50
+ // element access:
51
+ const value_type& operator[](size_t i) const;
52
+ value_type& operator[](size_t i);
53
+
54
+ // subset operations:
55
+ valarray operator[](slice s) const;
56
+ slice_array<value_type> operator[](slice s);
57
+ valarray operator[](const gslice& gs) const;
58
+ gslice_array<value_type> operator[](const gslice& gs);
59
+ valarray operator[](const valarray<bool>& vb) const;
60
+ mask_array<value_type> operator[](const valarray<bool>& vb);
61
+ valarray operator[](const valarray<size_t>& vs) const;
62
+ indirect_array<value_type> operator[](const valarray<size_t>& vs);
63
+
64
+ // unary operators:
65
+ valarray operator+() const;
66
+ valarray operator-() const;
67
+ valarray operator~() const;
68
+ valarray<bool> operator!() const;
69
+
70
+ // computed assignment:
71
+ valarray& operator*= (const value_type& x);
72
+ valarray& operator/= (const value_type& x);
73
+ valarray& operator%= (const value_type& x);
74
+ valarray& operator+= (const value_type& x);
75
+ valarray& operator-= (const value_type& x);
76
+ valarray& operator^= (const value_type& x);
77
+ valarray& operator&= (const value_type& x);
78
+ valarray& operator|= (const value_type& x);
79
+ valarray& operator<<=(const value_type& x);
80
+ valarray& operator>>=(const value_type& x);
81
+
82
+ valarray& operator*= (const valarray& v);
83
+ valarray& operator/= (const valarray& v);
84
+ valarray& operator%= (const valarray& v);
85
+ valarray& operator+= (const valarray& v);
86
+ valarray& operator-= (const valarray& v);
87
+ valarray& operator^= (const valarray& v);
88
+ valarray& operator|= (const valarray& v);
89
+ valarray& operator&= (const valarray& v);
90
+ valarray& operator<<=(const valarray& v);
91
+ valarray& operator>>=(const valarray& v);
92
+
93
+ // member functions:
94
+ void swap(valarray& v) noexcept;
95
+
96
+ size_t size() const;
97
+
98
+ value_type sum() const;
99
+ value_type min() const;
100
+ value_type max() const;
101
+
102
+ valarray shift (int i) const;
103
+ valarray cshift(int i) const;
104
+ valarray apply(value_type f(value_type)) const;
105
+ valarray apply(value_type f(const value_type&)) const;
106
+ void resize(size_t n, value_type x = value_type());
107
+ };
108
+
109
+ class slice
110
+ {
111
+ public:
112
+ slice();
113
+ slice(size_t start, size_t size, size_t stride);
114
+
115
+ size_t start() const;
116
+ size_t size() const;
117
+ size_t stride() const;
118
+ };
119
+
120
+ template <class T>
121
+ class slice_array
122
+ {
123
+ public:
124
+ typedef T value_type;
125
+
126
+ const slice_array& operator=(const slice_array& sa) const;
127
+ void operator= (const valarray<value_type>& v) const;
128
+ void operator*= (const valarray<value_type>& v) const;
129
+ void operator/= (const valarray<value_type>& v) const;
130
+ void operator%= (const valarray<value_type>& v) const;
131
+ void operator+= (const valarray<value_type>& v) const;
132
+ void operator-= (const valarray<value_type>& v) const;
133
+ void operator^= (const valarray<value_type>& v) const;
134
+ void operator&= (const valarray<value_type>& v) const;
135
+ void operator|= (const valarray<value_type>& v) const;
136
+ void operator<<=(const valarray<value_type>& v) const;
137
+ void operator>>=(const valarray<value_type>& v) const;
138
+
139
+ void operator=(const value_type& x) const;
140
+
141
+ slice_array() = delete;
142
+ };
143
+
144
+ class gslice
145
+ {
146
+ public:
147
+ gslice();
148
+ gslice(size_t start, const valarray<size_t>& size,
149
+ const valarray<size_t>& stride);
150
+
151
+ size_t start() const;
152
+ valarray<size_t> size() const;
153
+ valarray<size_t> stride() const;
154
+ };
155
+
156
+ template <class T>
157
+ class gslice_array
158
+ {
159
+ public:
160
+ typedef T value_type;
161
+
162
+ void operator= (const valarray<value_type>& v) const;
163
+ void operator*= (const valarray<value_type>& v) const;
164
+ void operator/= (const valarray<value_type>& v) const;
165
+ void operator%= (const valarray<value_type>& v) const;
166
+ void operator+= (const valarray<value_type>& v) const;
167
+ void operator-= (const valarray<value_type>& v) const;
168
+ void operator^= (const valarray<value_type>& v) const;
169
+ void operator&= (const valarray<value_type>& v) const;
170
+ void operator|= (const valarray<value_type>& v) const;
171
+ void operator<<=(const valarray<value_type>& v) const;
172
+ void operator>>=(const valarray<value_type>& v) const;
173
+
174
+ gslice_array(const gslice_array& ga);
175
+ ~gslice_array();
176
+ const gslice_array& operator=(const gslice_array& ga) const;
177
+ void operator=(const value_type& x) const;
178
+
179
+ gslice_array() = delete;
180
+ };
181
+
182
+ template <class T>
183
+ class mask_array
184
+ {
185
+ public:
186
+ typedef T value_type;
187
+
188
+ void operator= (const valarray<value_type>& v) const;
189
+ void operator*= (const valarray<value_type>& v) const;
190
+ void operator/= (const valarray<value_type>& v) const;
191
+ void operator%= (const valarray<value_type>& v) const;
192
+ void operator+= (const valarray<value_type>& v) const;
193
+ void operator-= (const valarray<value_type>& v) const;
194
+ void operator^= (const valarray<value_type>& v) const;
195
+ void operator&= (const valarray<value_type>& v) const;
196
+ void operator|= (const valarray<value_type>& v) const;
197
+ void operator<<=(const valarray<value_type>& v) const;
198
+ void operator>>=(const valarray<value_type>& v) const;
199
+
200
+ mask_array(const mask_array& ma);
201
+ ~mask_array();
202
+ const mask_array& operator=(const mask_array& ma) const;
203
+ void operator=(const value_type& x) const;
204
+
205
+ mask_array() = delete;
206
+ };
207
+
208
+ template <class T>
209
+ class indirect_array
210
+ {
211
+ public:
212
+ typedef T value_type;
213
+
214
+ void operator= (const valarray<value_type>& v) const;
215
+ void operator*= (const valarray<value_type>& v) const;
216
+ void operator/= (const valarray<value_type>& v) const;
217
+ void operator%= (const valarray<value_type>& v) const;
218
+ void operator+= (const valarray<value_type>& v) const;
219
+ void operator-= (const valarray<value_type>& v) const;
220
+ void operator^= (const valarray<value_type>& v) const;
221
+ void operator&= (const valarray<value_type>& v) const;
222
+ void operator|= (const valarray<value_type>& v) const;
223
+ void operator<<=(const valarray<value_type>& v) const;
224
+ void operator>>=(const valarray<value_type>& v) const;
225
+
226
+ indirect_array(const indirect_array& ia);
227
+ ~indirect_array();
228
+ const indirect_array& operator=(const indirect_array& ia) const;
229
+ void operator=(const value_type& x) const;
230
+
231
+ indirect_array() = delete;
232
+ };
233
+
234
+ template<class T> void swap(valarray<T>& x, valarray<T>& y) noexcept;
235
+
236
+ template<class T> valarray<T> operator* (const valarray<T>& x, const valarray<T>& y);
237
+ template<class T> valarray<T> operator* (const valarray<T>& x, const T& y);
238
+ template<class T> valarray<T> operator* (const T& x, const valarray<T>& y);
239
+
240
+ template<class T> valarray<T> operator/ (const valarray<T>& x, const valarray<T>& y);
241
+ template<class T> valarray<T> operator/ (const valarray<T>& x, const T& y);
242
+ template<class T> valarray<T> operator/ (const T& x, const valarray<T>& y);
243
+
244
+ template<class T> valarray<T> operator% (const valarray<T>& x, const valarray<T>& y);
245
+ template<class T> valarray<T> operator% (const valarray<T>& x, const T& y);
246
+ template<class T> valarray<T> operator% (const T& x, const valarray<T>& y);
247
+
248
+ template<class T> valarray<T> operator+ (const valarray<T>& x, const valarray<T>& y);
249
+ template<class T> valarray<T> operator+ (const valarray<T>& x, const T& y);
250
+ template<class T> valarray<T> operator+ (const T& x, const valarray<T>& y);
251
+
252
+ template<class T> valarray<T> operator- (const valarray<T>& x, const valarray<T>& y);
253
+ template<class T> valarray<T> operator- (const valarray<T>& x, const T& y);
254
+ template<class T> valarray<T> operator- (const T& x, const valarray<T>& y);
255
+
256
+ template<class T> valarray<T> operator^ (const valarray<T>& x, const valarray<T>& y);
257
+ template<class T> valarray<T> operator^ (const valarray<T>& x, const T& y);
258
+ template<class T> valarray<T> operator^ (const T& x, const valarray<T>& y);
259
+
260
+ template<class T> valarray<T> operator& (const valarray<T>& x, const valarray<T>& y);
261
+ template<class T> valarray<T> operator& (const valarray<T>& x, const T& y);
262
+ template<class T> valarray<T> operator& (const T& x, const valarray<T>& y);
263
+
264
+ template<class T> valarray<T> operator| (const valarray<T>& x, const valarray<T>& y);
265
+ template<class T> valarray<T> operator| (const valarray<T>& x, const T& y);
266
+ template<class T> valarray<T> operator| (const T& x, const valarray<T>& y);
267
+
268
+ template<class T> valarray<T> operator<<(const valarray<T>& x, const valarray<T>& y);
269
+ template<class T> valarray<T> operator<<(const valarray<T>& x, const T& y);
270
+ template<class T> valarray<T> operator<<(const T& x, const valarray<T>& y);
271
+
272
+ template<class T> valarray<T> operator>>(const valarray<T>& x, const valarray<T>& y);
273
+ template<class T> valarray<T> operator>>(const valarray<T>& x, const T& y);
274
+ template<class T> valarray<T> operator>>(const T& x, const valarray<T>& y);
275
+
276
+ template<class T> valarray<bool> operator&&(const valarray<T>& x, const valarray<T>& y);
277
+ template<class T> valarray<bool> operator&&(const valarray<T>& x, const T& y);
278
+ template<class T> valarray<bool> operator&&(const T& x, const valarray<T>& y);
279
+
280
+ template<class T> valarray<bool> operator||(const valarray<T>& x, const valarray<T>& y);
281
+ template<class T> valarray<bool> operator||(const valarray<T>& x, const T& y);
282
+ template<class T> valarray<bool> operator||(const T& x, const valarray<T>& y);
283
+
284
+ template<class T> valarray<bool> operator==(const valarray<T>& x, const valarray<T>& y);
285
+ template<class T> valarray<bool> operator==(const valarray<T>& x, const T& y);
286
+ template<class T> valarray<bool> operator==(const T& x, const valarray<T>& y);
287
+
288
+ template<class T> valarray<bool> operator!=(const valarray<T>& x, const valarray<T>& y);
289
+ template<class T> valarray<bool> operator!=(const valarray<T>& x, const T& y);
290
+ template<class T> valarray<bool> operator!=(const T& x, const valarray<T>& y);
291
+
292
+ template<class T> valarray<bool> operator< (const valarray<T>& x, const valarray<T>& y);
293
+ template<class T> valarray<bool> operator< (const valarray<T>& x, const T& y);
294
+ template<class T> valarray<bool> operator< (const T& x, const valarray<T>& y);
295
+
296
+ template<class T> valarray<bool> operator> (const valarray<T>& x, const valarray<T>& y);
297
+ template<class T> valarray<bool> operator> (const valarray<T>& x, const T& y);
298
+ template<class T> valarray<bool> operator> (const T& x, const valarray<T>& y);
299
+
300
+ template<class T> valarray<bool> operator<=(const valarray<T>& x, const valarray<T>& y);
301
+ template<class T> valarray<bool> operator<=(const valarray<T>& x, const T& y);
302
+ template<class T> valarray<bool> operator<=(const T& x, const valarray<T>& y);
303
+
304
+ template<class T> valarray<bool> operator>=(const valarray<T>& x, const valarray<T>& y);
305
+ template<class T> valarray<bool> operator>=(const valarray<T>& x, const T& y);
306
+ template<class T> valarray<bool> operator>=(const T& x, const valarray<T>& y);
307
+
308
+ template<class T> valarray<T> abs (const valarray<T>& x);
309
+ template<class T> valarray<T> acos (const valarray<T>& x);
310
+ template<class T> valarray<T> asin (const valarray<T>& x);
311
+ template<class T> valarray<T> atan (const valarray<T>& x);
312
+
313
+ template<class T> valarray<T> atan2(const valarray<T>& x, const valarray<T>& y);
314
+ template<class T> valarray<T> atan2(const valarray<T>& x, const T& y);
315
+ template<class T> valarray<T> atan2(const T& x, const valarray<T>& y);
316
+
317
+ template<class T> valarray<T> cos (const valarray<T>& x);
318
+ template<class T> valarray<T> cosh (const valarray<T>& x);
319
+ template<class T> valarray<T> exp (const valarray<T>& x);
320
+ template<class T> valarray<T> log (const valarray<T>& x);
321
+ template<class T> valarray<T> log10(const valarray<T>& x);
322
+
323
+ template<class T> valarray<T> pow(const valarray<T>& x, const valarray<T>& y);
324
+ template<class T> valarray<T> pow(const valarray<T>& x, const T& y);
325
+ template<class T> valarray<T> pow(const T& x, const valarray<T>& y);
326
+
327
+ template<class T> valarray<T> sin (const valarray<T>& x);
328
+ template<class T> valarray<T> sinh (const valarray<T>& x);
329
+ template<class T> valarray<T> sqrt (const valarray<T>& x);
330
+ template<class T> valarray<T> tan (const valarray<T>& x);
331
+ template<class T> valarray<T> tanh (const valarray<T>& x);
332
+
333
+ template <class T> unspecified1 begin(valarray<T>& v);
334
+ template <class T> unspecified2 begin(const valarray<T>& v);
335
+ template <class T> unspecified1 end(valarray<T>& v);
336
+ template <class T> unspecified2 end(const valarray<T>& v);
337
+
338
+ } // std
339
+
340
+ */
341
+
342
+ #include <__config>
343
+ #include <cstddef>
344
+ #include <cmath>
345
+ #include <initializer_list>
346
+ #include <algorithm>
347
+ #include <functional>
348
+
349
+ #include <__undef_min_max>
350
+
351
+ #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
352
+ #pragma GCC system_header
353
+ #endif
354
+
355
+ _LIBCPP_BEGIN_NAMESPACE_STD
356
+
357
+ template<class _Tp> class _LIBCPP_TYPE_VIS valarray;
358
+
359
+ class _LIBCPP_TYPE_VIS slice
360
+ {
361
+ size_t __start_;
362
+ size_t __size_;
363
+ size_t __stride_;
364
+ public:
365
+ _LIBCPP_INLINE_VISIBILITY
366
+ slice()
367
+ : __start_(0),
368
+ __size_(0),
369
+ __stride_(0)
370
+ {}
371
+
372
+ _LIBCPP_INLINE_VISIBILITY
373
+ slice(size_t __start, size_t __size, size_t __stride)
374
+ : __start_(__start),
375
+ __size_(__size),
376
+ __stride_(__stride)
377
+ {}
378
+
379
+ _LIBCPP_INLINE_VISIBILITY size_t start() const {return __start_;}
380
+ _LIBCPP_INLINE_VISIBILITY size_t size() const {return __size_;}
381
+ _LIBCPP_INLINE_VISIBILITY size_t stride() const {return __stride_;}
382
+ };
383
+
384
+ template <class _Tp> class _LIBCPP_TYPE_VIS slice_array;
385
+ class _LIBCPP_TYPE_VIS gslice;
386
+ template <class _Tp> class _LIBCPP_TYPE_VIS gslice_array;
387
+ template <class _Tp> class _LIBCPP_TYPE_VIS mask_array;
388
+ template <class _Tp> class _LIBCPP_TYPE_VIS indirect_array;
389
+
390
+ template <class _Tp>
391
+ _LIBCPP_INLINE_VISIBILITY
392
+ _Tp*
393
+ begin(valarray<_Tp>& __v);
394
+
395
+ template <class _Tp>
396
+ _LIBCPP_INLINE_VISIBILITY
397
+ const _Tp*
398
+ begin(const valarray<_Tp>& __v);
399
+
400
+ template <class _Tp>
401
+ _LIBCPP_INLINE_VISIBILITY
402
+ _Tp*
403
+ end(valarray<_Tp>& __v);
404
+
405
+ template <class _Tp>
406
+ _LIBCPP_INLINE_VISIBILITY
407
+ const _Tp*
408
+ end(const valarray<_Tp>& __v);
409
+
410
+ template <class _Op, class _A0>
411
+ struct _UnaryOp
412
+ {
413
+ typedef typename _Op::result_type result_type;
414
+ typedef typename _A0::value_type value_type;
415
+
416
+ _Op __op_;
417
+ _A0 __a0_;
418
+
419
+ _LIBCPP_INLINE_VISIBILITY
420
+ _UnaryOp(const _Op& __op, const _A0& __a0) : __op_(__op), __a0_(__a0) {}
421
+
422
+ _LIBCPP_INLINE_VISIBILITY
423
+ result_type operator[](size_t __i) const {return __op_(__a0_[__i]);}
424
+
425
+ _LIBCPP_INLINE_VISIBILITY
426
+ size_t size() const {return __a0_.size();}
427
+ };
428
+
429
+ template <class _Op, class _A0, class _A1>
430
+ struct _BinaryOp
431
+ {
432
+ typedef typename _Op::result_type result_type;
433
+ typedef typename _A0::value_type value_type;
434
+
435
+ _Op __op_;
436
+ _A0 __a0_;
437
+ _A1 __a1_;
438
+
439
+ _LIBCPP_INLINE_VISIBILITY
440
+ _BinaryOp(const _Op& __op, const _A0& __a0, const _A1& __a1)
441
+ : __op_(__op), __a0_(__a0), __a1_(__a1) {}
442
+
443
+ _LIBCPP_INLINE_VISIBILITY
444
+ value_type operator[](size_t __i) const {return __op_(__a0_[__i], __a1_[__i]);}
445
+
446
+ _LIBCPP_INLINE_VISIBILITY
447
+ size_t size() const {return __a0_.size();}
448
+ };
449
+
450
+ template <class _Tp>
451
+ class __scalar_expr
452
+ {
453
+ public:
454
+ typedef _Tp value_type;
455
+ typedef const _Tp& result_type;
456
+ private:
457
+ const value_type& __t_;
458
+ size_t __s_;
459
+ public:
460
+ _LIBCPP_INLINE_VISIBILITY
461
+ explicit __scalar_expr(const value_type& __t, size_t __s) : __t_(__t), __s_(__s) {}
462
+
463
+ _LIBCPP_INLINE_VISIBILITY
464
+ result_type operator[](size_t) const {return __t_;}
465
+
466
+ _LIBCPP_INLINE_VISIBILITY
467
+ size_t size() const {return __s_;}
468
+ };
469
+
470
+ template <class _Tp>
471
+ struct __unary_plus : unary_function<_Tp, _Tp>
472
+ {
473
+ _LIBCPP_INLINE_VISIBILITY
474
+ _Tp operator()(const _Tp& __x) const
475
+ {return +__x;}
476
+ };
477
+
478
+ template <class _Tp>
479
+ struct __bit_not : unary_function<_Tp, _Tp>
480
+ {
481
+ _LIBCPP_INLINE_VISIBILITY
482
+ _Tp operator()(const _Tp& __x) const
483
+ {return ~__x;}
484
+ };
485
+
486
+ template <class _Tp>
487
+ struct __bit_shift_left : binary_function<_Tp, _Tp, _Tp>
488
+ {
489
+ _LIBCPP_INLINE_VISIBILITY
490
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
491
+ {return __x << __y;}
492
+ };
493
+
494
+ template <class _Tp>
495
+ struct __bit_shift_right : binary_function<_Tp, _Tp, _Tp>
496
+ {
497
+ _LIBCPP_INLINE_VISIBILITY
498
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
499
+ {return __x >> __y;}
500
+ };
501
+
502
+ template <class _Tp, class _Fp>
503
+ struct __apply_expr : unary_function<_Tp, _Tp>
504
+ {
505
+ private:
506
+ _Fp __f_;
507
+ public:
508
+ _LIBCPP_INLINE_VISIBILITY
509
+ explicit __apply_expr(_Fp __f) : __f_(__f) {}
510
+
511
+ _LIBCPP_INLINE_VISIBILITY
512
+ _Tp operator()(const _Tp& __x) const
513
+ {return __f_(__x);}
514
+ };
515
+
516
+ template <class _Tp>
517
+ struct __abs_expr : unary_function<_Tp, _Tp>
518
+ {
519
+ _LIBCPP_INLINE_VISIBILITY
520
+ _Tp operator()(const _Tp& __x) const
521
+ {return abs(__x);}
522
+ };
523
+
524
+ template <class _Tp>
525
+ struct __acos_expr : unary_function<_Tp, _Tp>
526
+ {
527
+ _LIBCPP_INLINE_VISIBILITY
528
+ _Tp operator()(const _Tp& __x) const
529
+ {return acos(__x);}
530
+ };
531
+
532
+ template <class _Tp>
533
+ struct __asin_expr : unary_function<_Tp, _Tp>
534
+ {
535
+ _LIBCPP_INLINE_VISIBILITY
536
+ _Tp operator()(const _Tp& __x) const
537
+ {return asin(__x);}
538
+ };
539
+
540
+ template <class _Tp>
541
+ struct __atan_expr : unary_function<_Tp, _Tp>
542
+ {
543
+ _LIBCPP_INLINE_VISIBILITY
544
+ _Tp operator()(const _Tp& __x) const
545
+ {return atan(__x);}
546
+ };
547
+
548
+ template <class _Tp>
549
+ struct __atan2_expr : binary_function<_Tp, _Tp, _Tp>
550
+ {
551
+ _LIBCPP_INLINE_VISIBILITY
552
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
553
+ {return atan2(__x, __y);}
554
+ };
555
+
556
+ template <class _Tp>
557
+ struct __cos_expr : unary_function<_Tp, _Tp>
558
+ {
559
+ _LIBCPP_INLINE_VISIBILITY
560
+ _Tp operator()(const _Tp& __x) const
561
+ {return cos(__x);}
562
+ };
563
+
564
+ template <class _Tp>
565
+ struct __cosh_expr : unary_function<_Tp, _Tp>
566
+ {
567
+ _LIBCPP_INLINE_VISIBILITY
568
+ _Tp operator()(const _Tp& __x) const
569
+ {return cosh(__x);}
570
+ };
571
+
572
+ template <class _Tp>
573
+ struct __exp_expr : unary_function<_Tp, _Tp>
574
+ {
575
+ _LIBCPP_INLINE_VISIBILITY
576
+ _Tp operator()(const _Tp& __x) const
577
+ {return exp(__x);}
578
+ };
579
+
580
+ template <class _Tp>
581
+ struct __log_expr : unary_function<_Tp, _Tp>
582
+ {
583
+ _LIBCPP_INLINE_VISIBILITY
584
+ _Tp operator()(const _Tp& __x) const
585
+ {return log(__x);}
586
+ };
587
+
588
+ template <class _Tp>
589
+ struct __log10_expr : unary_function<_Tp, _Tp>
590
+ {
591
+ _LIBCPP_INLINE_VISIBILITY
592
+ _Tp operator()(const _Tp& __x) const
593
+ {return log10(__x);}
594
+ };
595
+
596
+ template <class _Tp>
597
+ struct __pow_expr : binary_function<_Tp, _Tp, _Tp>
598
+ {
599
+ _LIBCPP_INLINE_VISIBILITY
600
+ _Tp operator()(const _Tp& __x, const _Tp& __y) const
601
+ {return pow(__x, __y);}
602
+ };
603
+
604
+ template <class _Tp>
605
+ struct __sin_expr : unary_function<_Tp, _Tp>
606
+ {
607
+ _LIBCPP_INLINE_VISIBILITY
608
+ _Tp operator()(const _Tp& __x) const
609
+ {return sin(__x);}
610
+ };
611
+
612
+ template <class _Tp>
613
+ struct __sinh_expr : unary_function<_Tp, _Tp>
614
+ {
615
+ _LIBCPP_INLINE_VISIBILITY
616
+ _Tp operator()(const _Tp& __x) const
617
+ {return sinh(__x);}
618
+ };
619
+
620
+ template <class _Tp>
621
+ struct __sqrt_expr : unary_function<_Tp, _Tp>
622
+ {
623
+ _LIBCPP_INLINE_VISIBILITY
624
+ _Tp operator()(const _Tp& __x) const
625
+ {return sqrt(__x);}
626
+ };
627
+
628
+ template <class _Tp>
629
+ struct __tan_expr : unary_function<_Tp, _Tp>
630
+ {
631
+ _LIBCPP_INLINE_VISIBILITY
632
+ _Tp operator()(const _Tp& __x) const
633
+ {return tan(__x);}
634
+ };
635
+
636
+ template <class _Tp>
637
+ struct __tanh_expr : unary_function<_Tp, _Tp>
638
+ {
639
+ _LIBCPP_INLINE_VISIBILITY
640
+ _Tp operator()(const _Tp& __x) const
641
+ {return tanh(__x);}
642
+ };
643
+
644
+ template <class _ValExpr>
645
+ class __slice_expr
646
+ {
647
+ typedef typename remove_reference<_ValExpr>::type _RmExpr;
648
+ public:
649
+ typedef typename _RmExpr::value_type value_type;
650
+ typedef value_type result_type;
651
+
652
+ private:
653
+ _ValExpr __expr_;
654
+ size_t __start_;
655
+ size_t __size_;
656
+ size_t __stride_;
657
+
658
+ _LIBCPP_INLINE_VISIBILITY
659
+ __slice_expr(const slice& __sl, const _RmExpr& __e)
660
+ : __expr_(__e),
661
+ __start_(__sl.start()),
662
+ __size_(__sl.size()),
663
+ __stride_(__sl.stride())
664
+ {}
665
+ public:
666
+
667
+ _LIBCPP_INLINE_VISIBILITY
668
+ result_type operator[](size_t __i) const
669
+ {return __expr_[__start_ + __i * __stride_];}
670
+
671
+ _LIBCPP_INLINE_VISIBILITY
672
+ size_t size() const {return __size_;}
673
+
674
+ template <class> friend class _LIBCPP_TYPE_VIS valarray;
675
+ };
676
+
677
+ template <class _ValExpr>
678
+ class __mask_expr;
679
+
680
+ template <class _ValExpr>
681
+ class __indirect_expr;
682
+
683
+ template <class _ValExpr>
684
+ class __shift_expr
685
+ {
686
+ typedef typename remove_reference<_ValExpr>::type _RmExpr;
687
+ public:
688
+ typedef typename _RmExpr::value_type value_type;
689
+ typedef value_type result_type;
690
+
691
+ private:
692
+ _ValExpr __expr_;
693
+ size_t __size_;
694
+ ptrdiff_t __ul_;
695
+ ptrdiff_t __sn_;
696
+ ptrdiff_t __n_;
697
+ static const ptrdiff_t _Np = static_cast<ptrdiff_t>(
698
+ sizeof(ptrdiff_t) * __CHAR_BIT__ - 1);
699
+
700
+ _LIBCPP_INLINE_VISIBILITY
701
+ __shift_expr(int __n, const _RmExpr& __e)
702
+ : __expr_(__e),
703
+ __size_(__e.size()),
704
+ __n_(__n)
705
+ {
706
+ ptrdiff_t __neg_n = static_cast<ptrdiff_t>(__n_ >> _Np);
707
+ __sn_ = __neg_n | static_cast<ptrdiff_t>(static_cast<size_t>(-__n_) >> _Np);
708
+ __ul_ = ((__size_ - __n_) & ~__neg_n) | ((__n_ + 1) & __neg_n);
709
+ }
710
+ public:
711
+
712
+ _LIBCPP_INLINE_VISIBILITY
713
+ result_type operator[](size_t __j) const
714
+ {
715
+ ptrdiff_t __i = static_cast<ptrdiff_t>(__j);
716
+ ptrdiff_t __m = (__sn_ * __i - __ul_) >> _Np;
717
+ return (__expr_[(__i + __n_) & __m] & __m) | (value_type() & ~__m);
718
+ }
719
+
720
+ _LIBCPP_INLINE_VISIBILITY
721
+ size_t size() const {return __size_;}
722
+
723
+ template <class> friend class __val_expr;
724
+ };
725
+
726
+ template <class _ValExpr>
727
+ class __cshift_expr
728
+ {
729
+ typedef typename remove_reference<_ValExpr>::type _RmExpr;
730
+ public:
731
+ typedef typename _RmExpr::value_type value_type;
732
+ typedef value_type result_type;
733
+
734
+ private:
735
+ _ValExpr __expr_;
736
+ size_t __size_;
737
+ size_t __m_;
738
+ size_t __o1_;
739
+ size_t __o2_;
740
+
741
+ _LIBCPP_INLINE_VISIBILITY
742
+ __cshift_expr(int __n, const _RmExpr& __e)
743
+ : __expr_(__e),
744
+ __size_(__e.size())
745
+ {
746
+ __n %= static_cast<int>(__size_);
747
+ if (__n >= 0)
748
+ {
749
+ __m_ = __size_ - __n;
750
+ __o1_ = __n;
751
+ __o2_ = __n - __size_;
752
+ }
753
+ else
754
+ {
755
+ __m_ = -__n;
756
+ __o1_ = __n + __size_;
757
+ __o2_ = __n;
758
+ }
759
+ }
760
+ public:
761
+
762
+ _LIBCPP_INLINE_VISIBILITY
763
+ result_type operator[](size_t __i) const
764
+ {
765
+ if (__i < __m_)
766
+ return __expr_[__i + __o1_];
767
+ return __expr_[__i + __o2_];
768
+ }
769
+
770
+ _LIBCPP_INLINE_VISIBILITY
771
+ size_t size() const {return __size_;}
772
+
773
+ template <class> friend class __val_expr;
774
+ };
775
+
776
+ template<class _ValExpr>
777
+ class __val_expr;
778
+
779
+ template<class _ValExpr>
780
+ struct __is_val_expr : false_type {};
781
+
782
+ template<class _ValExpr>
783
+ struct __is_val_expr<__val_expr<_ValExpr> > : true_type {};
784
+
785
+ template<class _Tp>
786
+ struct __is_val_expr<valarray<_Tp> > : true_type {};
787
+
788
+ template<class _Tp>
789
+ class _LIBCPP_TYPE_VIS valarray
790
+ {
791
+ public:
792
+ typedef _Tp value_type;
793
+ typedef _Tp result_type;
794
+
795
+ private:
796
+ value_type* __begin_;
797
+ value_type* __end_;
798
+
799
+ public:
800
+ // construct/destroy:
801
+ _LIBCPP_INLINE_VISIBILITY
802
+ valarray() : __begin_(0), __end_(0) {}
803
+ explicit valarray(size_t __n);
804
+ valarray(const value_type& __x, size_t __n);
805
+ valarray(const value_type* __p, size_t __n);
806
+ valarray(const valarray& __v);
807
+ #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
808
+ valarray(valarray&& __v) _NOEXCEPT;
809
+ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
810
+ #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
811
+ valarray(initializer_list<value_type> __il);
812
+ #endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
813
+ valarray(const slice_array<value_type>& __sa);
814
+ valarray(const gslice_array<value_type>& __ga);
815
+ valarray(const mask_array<value_type>& __ma);
816
+ valarray(const indirect_array<value_type>& __ia);
817
+ ~valarray();
818
+
819
+ // assignment:
820
+ valarray& operator=(const valarray& __v);
821
+ #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
822
+ valarray& operator=(valarray&& __v) _NOEXCEPT;
823
+ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
824
+ #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
825
+ valarray& operator=(initializer_list<value_type>);
826
+ #endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
827
+ valarray& operator=(const value_type& __x);
828
+ valarray& operator=(const slice_array<value_type>& __sa);
829
+ valarray& operator=(const gslice_array<value_type>& __ga);
830
+ valarray& operator=(const mask_array<value_type>& __ma);
831
+ valarray& operator=(const indirect_array<value_type>& __ia);
832
+ template <class _ValExpr>
833
+ valarray& operator=(const __val_expr<_ValExpr>& __v);
834
+
835
+ // element access:
836
+ _LIBCPP_INLINE_VISIBILITY
837
+ const value_type& operator[](size_t __i) const {return __begin_[__i];}
838
+
839
+ _LIBCPP_INLINE_VISIBILITY
840
+ value_type& operator[](size_t __i) {return __begin_[__i];}
841
+
842
+ // subset operations:
843
+ __val_expr<__slice_expr<const valarray&> > operator[](slice __s) const;
844
+ slice_array<value_type> operator[](slice __s);
845
+ __val_expr<__indirect_expr<const valarray&> > operator[](const gslice& __gs) const;
846
+ gslice_array<value_type> operator[](const gslice& __gs);
847
+ #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
848
+ __val_expr<__indirect_expr<const valarray&> > operator[](gslice&& __gs) const;
849
+ gslice_array<value_type> operator[](gslice&& __gs);
850
+ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
851
+ __val_expr<__mask_expr<const valarray&> > operator[](const valarray<bool>& __vb) const;
852
+ mask_array<value_type> operator[](const valarray<bool>& __vb);
853
+ #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
854
+ __val_expr<__mask_expr<const valarray&> > operator[](valarray<bool>&& __vb) const;
855
+ mask_array<value_type> operator[](valarray<bool>&& __vb);
856
+ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
857
+ __val_expr<__indirect_expr<const valarray&> > operator[](const valarray<size_t>& __vs) const;
858
+ indirect_array<value_type> operator[](const valarray<size_t>& __vs);
859
+ #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
860
+ __val_expr<__indirect_expr<const valarray&> > operator[](valarray<size_t>&& __vs) const;
861
+ indirect_array<value_type> operator[](valarray<size_t>&& __vs);
862
+ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
863
+
864
+ // unary operators:
865
+ valarray operator+() const;
866
+ valarray operator-() const;
867
+ valarray operator~() const;
868
+ valarray<bool> operator!() const;
869
+
870
+ // computed assignment:
871
+ valarray& operator*= (const value_type& __x);
872
+ valarray& operator/= (const value_type& __x);
873
+ valarray& operator%= (const value_type& __x);
874
+ valarray& operator+= (const value_type& __x);
875
+ valarray& operator-= (const value_type& __x);
876
+ valarray& operator^= (const value_type& __x);
877
+ valarray& operator&= (const value_type& __x);
878
+ valarray& operator|= (const value_type& __x);
879
+ valarray& operator<<=(const value_type& __x);
880
+ valarray& operator>>=(const value_type& __x);
881
+
882
+ template <class _Expr>
883
+ typename enable_if
884
+ <
885
+ __is_val_expr<_Expr>::value,
886
+ valarray&
887
+ >::type
888
+ operator*= (const _Expr& __v);
889
+
890
+ template <class _Expr>
891
+ typename enable_if
892
+ <
893
+ __is_val_expr<_Expr>::value,
894
+ valarray&
895
+ >::type
896
+ operator/= (const _Expr& __v);
897
+
898
+ template <class _Expr>
899
+ typename enable_if
900
+ <
901
+ __is_val_expr<_Expr>::value,
902
+ valarray&
903
+ >::type
904
+ operator%= (const _Expr& __v);
905
+
906
+ template <class _Expr>
907
+ typename enable_if
908
+ <
909
+ __is_val_expr<_Expr>::value,
910
+ valarray&
911
+ >::type
912
+ operator+= (const _Expr& __v);
913
+
914
+ template <class _Expr>
915
+ typename enable_if
916
+ <
917
+ __is_val_expr<_Expr>::value,
918
+ valarray&
919
+ >::type
920
+ operator-= (const _Expr& __v);
921
+
922
+ template <class _Expr>
923
+ typename enable_if
924
+ <
925
+ __is_val_expr<_Expr>::value,
926
+ valarray&
927
+ >::type
928
+ operator^= (const _Expr& __v);
929
+
930
+ template <class _Expr>
931
+ typename enable_if
932
+ <
933
+ __is_val_expr<_Expr>::value,
934
+ valarray&
935
+ >::type
936
+ operator|= (const _Expr& __v);
937
+
938
+ template <class _Expr>
939
+ typename enable_if
940
+ <
941
+ __is_val_expr<_Expr>::value,
942
+ valarray&
943
+ >::type
944
+ operator&= (const _Expr& __v);
945
+
946
+ template <class _Expr>
947
+ typename enable_if
948
+ <
949
+ __is_val_expr<_Expr>::value,
950
+ valarray&
951
+ >::type
952
+ operator<<= (const _Expr& __v);
953
+
954
+ template <class _Expr>
955
+ typename enable_if
956
+ <
957
+ __is_val_expr<_Expr>::value,
958
+ valarray&
959
+ >::type
960
+ operator>>= (const _Expr& __v);
961
+
962
+ // member functions:
963
+ void swap(valarray& __v) _NOEXCEPT;
964
+
965
+ _LIBCPP_INLINE_VISIBILITY
966
+ size_t size() const {return static_cast<size_t>(__end_ - __begin_);}
967
+
968
+ value_type sum() const;
969
+ value_type min() const;
970
+ value_type max() const;
971
+
972
+ valarray shift (int __i) const;
973
+ valarray cshift(int __i) const;
974
+ valarray apply(value_type __f(value_type)) const;
975
+ valarray apply(value_type __f(const value_type&)) const;
976
+ void resize(size_t __n, value_type __x = value_type());
977
+
978
+ private:
979
+ template <class> friend class _LIBCPP_TYPE_VIS valarray;
980
+ template <class> friend class _LIBCPP_TYPE_VIS slice_array;
981
+ template <class> friend class _LIBCPP_TYPE_VIS gslice_array;
982
+ template <class> friend class _LIBCPP_TYPE_VIS mask_array;
983
+ template <class> friend class __mask_expr;
984
+ template <class> friend class _LIBCPP_TYPE_VIS indirect_array;
985
+ template <class> friend class __indirect_expr;
986
+ template <class> friend class __val_expr;
987
+
988
+ template <class _Up>
989
+ friend
990
+ _Up*
991
+ begin(valarray<_Up>& __v);
992
+
993
+ template <class _Up>
994
+ friend
995
+ const _Up*
996
+ begin(const valarray<_Up>& __v);
997
+
998
+ template <class _Up>
999
+ friend
1000
+ _Up*
1001
+ end(valarray<_Up>& __v);
1002
+
1003
+ template <class _Up>
1004
+ friend
1005
+ const _Up*
1006
+ end(const valarray<_Up>& __v);
1007
+ };
1008
+
1009
+ template <class _Op, class _Tp>
1010
+ struct _UnaryOp<_Op, valarray<_Tp> >
1011
+ {
1012
+ typedef typename _Op::result_type result_type;
1013
+ typedef _Tp value_type;
1014
+
1015
+ _Op __op_;
1016
+ const valarray<_Tp>& __a0_;
1017
+
1018
+ _LIBCPP_INLINE_VISIBILITY
1019
+ _UnaryOp(const _Op& __op, const valarray<_Tp>& __a0) : __op_(__op), __a0_(__a0) {}
1020
+
1021
+ _LIBCPP_INLINE_VISIBILITY
1022
+ result_type operator[](size_t __i) const {return __op_(__a0_[__i]);}
1023
+
1024
+ _LIBCPP_INLINE_VISIBILITY
1025
+ size_t size() const {return __a0_.size();}
1026
+ };
1027
+
1028
+ template <class _Op, class _Tp, class _A1>
1029
+ struct _BinaryOp<_Op, valarray<_Tp>, _A1>
1030
+ {
1031
+ typedef typename _Op::result_type result_type;
1032
+ typedef _Tp value_type;
1033
+
1034
+ _Op __op_;
1035
+ const valarray<_Tp>& __a0_;
1036
+ _A1 __a1_;
1037
+
1038
+ _LIBCPP_INLINE_VISIBILITY
1039
+ _BinaryOp(const _Op& __op, const valarray<_Tp>& __a0, const _A1& __a1)
1040
+ : __op_(__op), __a0_(__a0), __a1_(__a1) {}
1041
+
1042
+ _LIBCPP_INLINE_VISIBILITY
1043
+ value_type operator[](size_t __i) const {return __op_(__a0_[__i], __a1_[__i]);}
1044
+
1045
+ _LIBCPP_INLINE_VISIBILITY
1046
+ size_t size() const {return __a0_.size();}
1047
+ };
1048
+
1049
+ template <class _Op, class _A0, class _Tp>
1050
+ struct _BinaryOp<_Op, _A0, valarray<_Tp> >
1051
+ {
1052
+ typedef typename _Op::result_type result_type;
1053
+ typedef _Tp value_type;
1054
+
1055
+ _Op __op_;
1056
+ _A0 __a0_;
1057
+ const valarray<_Tp>& __a1_;
1058
+
1059
+ _LIBCPP_INLINE_VISIBILITY
1060
+ _BinaryOp(const _Op& __op, const _A0& __a0, const valarray<_Tp>& __a1)
1061
+ : __op_(__op), __a0_(__a0), __a1_(__a1) {}
1062
+
1063
+ _LIBCPP_INLINE_VISIBILITY
1064
+ value_type operator[](size_t __i) const {return __op_(__a0_[__i], __a1_[__i]);}
1065
+
1066
+ _LIBCPP_INLINE_VISIBILITY
1067
+ size_t size() const {return __a0_.size();}
1068
+ };
1069
+
1070
+ template <class _Op, class _Tp>
1071
+ struct _BinaryOp<_Op, valarray<_Tp>, valarray<_Tp> >
1072
+ {
1073
+ typedef typename _Op::result_type result_type;
1074
+ typedef _Tp value_type;
1075
+
1076
+ _Op __op_;
1077
+ const valarray<_Tp>& __a0_;
1078
+ const valarray<_Tp>& __a1_;
1079
+
1080
+ _LIBCPP_INLINE_VISIBILITY
1081
+ _BinaryOp(const _Op& __op, const valarray<_Tp>& __a0, const valarray<_Tp>& __a1)
1082
+ : __op_(__op), __a0_(__a0), __a1_(__a1) {}
1083
+
1084
+ _LIBCPP_INLINE_VISIBILITY
1085
+ value_type operator[](size_t __i) const {return __op_(__a0_[__i], __a1_[__i]);}
1086
+
1087
+ _LIBCPP_INLINE_VISIBILITY
1088
+ size_t size() const {return __a0_.size();}
1089
+ };
1090
+
1091
+ // slice_array
1092
+
1093
+ template <class _Tp>
1094
+ class _LIBCPP_TYPE_VIS slice_array
1095
+ {
1096
+ public:
1097
+ typedef _Tp value_type;
1098
+
1099
+ private:
1100
+ value_type* __vp_;
1101
+ size_t __size_;
1102
+ size_t __stride_;
1103
+
1104
+ public:
1105
+ template <class _Expr>
1106
+ typename enable_if
1107
+ <
1108
+ __is_val_expr<_Expr>::value,
1109
+ void
1110
+ >::type
1111
+ operator=(const _Expr& __v) const;
1112
+
1113
+ template <class _Expr>
1114
+ typename enable_if
1115
+ <
1116
+ __is_val_expr<_Expr>::value,
1117
+ void
1118
+ >::type
1119
+ operator*=(const _Expr& __v) const;
1120
+
1121
+ template <class _Expr>
1122
+ typename enable_if
1123
+ <
1124
+ __is_val_expr<_Expr>::value,
1125
+ void
1126
+ >::type
1127
+ operator/=(const _Expr& __v) const;
1128
+
1129
+ template <class _Expr>
1130
+ typename enable_if
1131
+ <
1132
+ __is_val_expr<_Expr>::value,
1133
+ void
1134
+ >::type
1135
+ operator%=(const _Expr& __v) const;
1136
+
1137
+ template <class _Expr>
1138
+ typename enable_if
1139
+ <
1140
+ __is_val_expr<_Expr>::value,
1141
+ void
1142
+ >::type
1143
+ operator+=(const _Expr& __v) const;
1144
+
1145
+ template <class _Expr>
1146
+ typename enable_if
1147
+ <
1148
+ __is_val_expr<_Expr>::value,
1149
+ void
1150
+ >::type
1151
+ operator-=(const _Expr& __v) const;
1152
+
1153
+ template <class _Expr>
1154
+ typename enable_if
1155
+ <
1156
+ __is_val_expr<_Expr>::value,
1157
+ void
1158
+ >::type
1159
+ operator^=(const _Expr& __v) const;
1160
+
1161
+ template <class _Expr>
1162
+ typename enable_if
1163
+ <
1164
+ __is_val_expr<_Expr>::value,
1165
+ void
1166
+ >::type
1167
+ operator&=(const _Expr& __v) const;
1168
+
1169
+ template <class _Expr>
1170
+ typename enable_if
1171
+ <
1172
+ __is_val_expr<_Expr>::value,
1173
+ void
1174
+ >::type
1175
+ operator|=(const _Expr& __v) const;
1176
+
1177
+ template <class _Expr>
1178
+ typename enable_if
1179
+ <
1180
+ __is_val_expr<_Expr>::value,
1181
+ void
1182
+ >::type
1183
+ operator<<=(const _Expr& __v) const;
1184
+
1185
+ template <class _Expr>
1186
+ typename enable_if
1187
+ <
1188
+ __is_val_expr<_Expr>::value,
1189
+ void
1190
+ >::type
1191
+ operator>>=(const _Expr& __v) const;
1192
+
1193
+ const slice_array& operator=(const slice_array& __sa) const;
1194
+
1195
+ void operator=(const value_type& __x) const;
1196
+
1197
+ private:
1198
+ _LIBCPP_INLINE_VISIBILITY
1199
+ slice_array(const slice& __sl, const valarray<value_type>& __v)
1200
+ : __vp_(const_cast<value_type*>(__v.__begin_ + __sl.start())),
1201
+ __size_(__sl.size()),
1202
+ __stride_(__sl.stride())
1203
+ {}
1204
+
1205
+ template <class> friend class valarray;
1206
+ template <class> friend class sliceExpr;
1207
+ };
1208
+
1209
+ template <class _Tp>
1210
+ inline _LIBCPP_INLINE_VISIBILITY
1211
+ const slice_array<_Tp>&
1212
+ slice_array<_Tp>::operator=(const slice_array& __sa) const
1213
+ {
1214
+ value_type* __t = __vp_;
1215
+ const value_type* __s = __sa.__vp_;
1216
+ for (size_t __n = __size_; __n; --__n, __t += __stride_, __s += __sa.__stride_)
1217
+ *__t = *__s;
1218
+ }
1219
+
1220
+ template <class _Tp>
1221
+ template <class _Expr>
1222
+ inline _LIBCPP_INLINE_VISIBILITY
1223
+ typename enable_if
1224
+ <
1225
+ __is_val_expr<_Expr>::value,
1226
+ void
1227
+ >::type
1228
+ slice_array<_Tp>::operator=(const _Expr& __v) const
1229
+ {
1230
+ value_type* __t = __vp_;
1231
+ for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
1232
+ *__t = __v[__i];
1233
+ }
1234
+
1235
+ template <class _Tp>
1236
+ template <class _Expr>
1237
+ inline _LIBCPP_INLINE_VISIBILITY
1238
+ typename enable_if
1239
+ <
1240
+ __is_val_expr<_Expr>::value,
1241
+ void
1242
+ >::type
1243
+ slice_array<_Tp>::operator*=(const _Expr& __v) const
1244
+ {
1245
+ value_type* __t = __vp_;
1246
+ for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
1247
+ *__t *= __v[__i];
1248
+ }
1249
+
1250
+ template <class _Tp>
1251
+ template <class _Expr>
1252
+ inline _LIBCPP_INLINE_VISIBILITY
1253
+ typename enable_if
1254
+ <
1255
+ __is_val_expr<_Expr>::value,
1256
+ void
1257
+ >::type
1258
+ slice_array<_Tp>::operator/=(const _Expr& __v) const
1259
+ {
1260
+ value_type* __t = __vp_;
1261
+ for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
1262
+ *__t /= __v[__i];
1263
+ }
1264
+
1265
+ template <class _Tp>
1266
+ template <class _Expr>
1267
+ inline _LIBCPP_INLINE_VISIBILITY
1268
+ typename enable_if
1269
+ <
1270
+ __is_val_expr<_Expr>::value,
1271
+ void
1272
+ >::type
1273
+ slice_array<_Tp>::operator%=(const _Expr& __v) const
1274
+ {
1275
+ value_type* __t = __vp_;
1276
+ for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
1277
+ *__t %= __v[__i];
1278
+ }
1279
+
1280
+ template <class _Tp>
1281
+ template <class _Expr>
1282
+ inline _LIBCPP_INLINE_VISIBILITY
1283
+ typename enable_if
1284
+ <
1285
+ __is_val_expr<_Expr>::value,
1286
+ void
1287
+ >::type
1288
+ slice_array<_Tp>::operator+=(const _Expr& __v) const
1289
+ {
1290
+ value_type* __t = __vp_;
1291
+ for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
1292
+ *__t += __v[__i];
1293
+ }
1294
+
1295
+ template <class _Tp>
1296
+ template <class _Expr>
1297
+ inline _LIBCPP_INLINE_VISIBILITY
1298
+ typename enable_if
1299
+ <
1300
+ __is_val_expr<_Expr>::value,
1301
+ void
1302
+ >::type
1303
+ slice_array<_Tp>::operator-=(const _Expr& __v) const
1304
+ {
1305
+ value_type* __t = __vp_;
1306
+ for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
1307
+ *__t -= __v[__i];
1308
+ }
1309
+
1310
+ template <class _Tp>
1311
+ template <class _Expr>
1312
+ inline _LIBCPP_INLINE_VISIBILITY
1313
+ typename enable_if
1314
+ <
1315
+ __is_val_expr<_Expr>::value,
1316
+ void
1317
+ >::type
1318
+ slice_array<_Tp>::operator^=(const _Expr& __v) const
1319
+ {
1320
+ value_type* __t = __vp_;
1321
+ for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
1322
+ *__t ^= __v[__i];
1323
+ }
1324
+
1325
+ template <class _Tp>
1326
+ template <class _Expr>
1327
+ inline _LIBCPP_INLINE_VISIBILITY
1328
+ typename enable_if
1329
+ <
1330
+ __is_val_expr<_Expr>::value,
1331
+ void
1332
+ >::type
1333
+ slice_array<_Tp>::operator&=(const _Expr& __v) const
1334
+ {
1335
+ value_type* __t = __vp_;
1336
+ for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
1337
+ *__t &= __v[__i];
1338
+ }
1339
+
1340
+ template <class _Tp>
1341
+ template <class _Expr>
1342
+ inline _LIBCPP_INLINE_VISIBILITY
1343
+ typename enable_if
1344
+ <
1345
+ __is_val_expr<_Expr>::value,
1346
+ void
1347
+ >::type
1348
+ slice_array<_Tp>::operator|=(const _Expr& __v) const
1349
+ {
1350
+ value_type* __t = __vp_;
1351
+ for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
1352
+ *__t |= __v[__i];
1353
+ }
1354
+
1355
+ template <class _Tp>
1356
+ template <class _Expr>
1357
+ inline _LIBCPP_INLINE_VISIBILITY
1358
+ typename enable_if
1359
+ <
1360
+ __is_val_expr<_Expr>::value,
1361
+ void
1362
+ >::type
1363
+ slice_array<_Tp>::operator<<=(const _Expr& __v) const
1364
+ {
1365
+ value_type* __t = __vp_;
1366
+ for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
1367
+ *__t <<= __v[__i];
1368
+ }
1369
+
1370
+ template <class _Tp>
1371
+ template <class _Expr>
1372
+ inline _LIBCPP_INLINE_VISIBILITY
1373
+ typename enable_if
1374
+ <
1375
+ __is_val_expr<_Expr>::value,
1376
+ void
1377
+ >::type
1378
+ slice_array<_Tp>::operator>>=(const _Expr& __v) const
1379
+ {
1380
+ value_type* __t = __vp_;
1381
+ for (size_t __i = 0; __i < __size_; ++__i, __t += __stride_)
1382
+ *__t >>= __v[__i];
1383
+ }
1384
+
1385
+ template <class _Tp>
1386
+ inline _LIBCPP_INLINE_VISIBILITY
1387
+ void
1388
+ slice_array<_Tp>::operator=(const value_type& __x) const
1389
+ {
1390
+ value_type* __t = __vp_;
1391
+ for (size_t __n = __size_; __n; --__n, __t += __stride_)
1392
+ *__t = __x;
1393
+ }
1394
+
1395
+ // gslice
1396
+
1397
+ class _LIBCPP_TYPE_VIS gslice
1398
+ {
1399
+ valarray<size_t> __size_;
1400
+ valarray<size_t> __stride_;
1401
+ valarray<size_t> __1d_;
1402
+
1403
+ public:
1404
+ _LIBCPP_INLINE_VISIBILITY
1405
+ gslice() {}
1406
+
1407
+ _LIBCPP_INLINE_VISIBILITY
1408
+ gslice(size_t __start, const valarray<size_t>& __size,
1409
+ const valarray<size_t>& __stride)
1410
+ : __size_(__size),
1411
+ __stride_(__stride)
1412
+ {__init(__start);}
1413
+
1414
+ #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1415
+
1416
+ _LIBCPP_INLINE_VISIBILITY
1417
+ gslice(size_t __start, const valarray<size_t>& __size,
1418
+ valarray<size_t>&& __stride)
1419
+ : __size_(__size),
1420
+ __stride_(move(__stride))
1421
+ {__init(__start);}
1422
+
1423
+ _LIBCPP_INLINE_VISIBILITY
1424
+ gslice(size_t __start, valarray<size_t>&& __size,
1425
+ const valarray<size_t>& __stride)
1426
+ : __size_(move(__size)),
1427
+ __stride_(__stride)
1428
+ {__init(__start);}
1429
+
1430
+ _LIBCPP_INLINE_VISIBILITY
1431
+ gslice(size_t __start, valarray<size_t>&& __size,
1432
+ valarray<size_t>&& __stride)
1433
+ : __size_(move(__size)),
1434
+ __stride_(move(__stride))
1435
+ {__init(__start);}
1436
+
1437
+ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1438
+
1439
+ // gslice(const gslice&) = default;
1440
+ // gslice(gslice&&) = default;
1441
+ // gslice& operator=(const gslice&) = default;
1442
+ // gslice& operator=(gslice&&) = default;
1443
+
1444
+ _LIBCPP_INLINE_VISIBILITY
1445
+ size_t start() const {return __1d_.size() ? __1d_[0] : 0;}
1446
+
1447
+ _LIBCPP_INLINE_VISIBILITY
1448
+ valarray<size_t> size() const {return __size_;}
1449
+
1450
+ _LIBCPP_INLINE_VISIBILITY
1451
+ valarray<size_t> stride() const {return __stride_;}
1452
+
1453
+ private:
1454
+ void __init(size_t __start);
1455
+
1456
+ template <class> friend class gslice_array;
1457
+ template <class> friend class valarray;
1458
+ template <class> friend class __val_expr;
1459
+ };
1460
+
1461
+ // gslice_array
1462
+
1463
+ template <class _Tp>
1464
+ class _LIBCPP_TYPE_VIS gslice_array
1465
+ {
1466
+ public:
1467
+ typedef _Tp value_type;
1468
+
1469
+ private:
1470
+ value_type* __vp_;
1471
+ valarray<size_t> __1d_;
1472
+
1473
+ public:
1474
+ template <class _Expr>
1475
+ typename enable_if
1476
+ <
1477
+ __is_val_expr<_Expr>::value,
1478
+ void
1479
+ >::type
1480
+ operator=(const _Expr& __v) const;
1481
+
1482
+ template <class _Expr>
1483
+ typename enable_if
1484
+ <
1485
+ __is_val_expr<_Expr>::value,
1486
+ void
1487
+ >::type
1488
+ operator*=(const _Expr& __v) const;
1489
+
1490
+ template <class _Expr>
1491
+ typename enable_if
1492
+ <
1493
+ __is_val_expr<_Expr>::value,
1494
+ void
1495
+ >::type
1496
+ operator/=(const _Expr& __v) const;
1497
+
1498
+ template <class _Expr>
1499
+ typename enable_if
1500
+ <
1501
+ __is_val_expr<_Expr>::value,
1502
+ void
1503
+ >::type
1504
+ operator%=(const _Expr& __v) const;
1505
+
1506
+ template <class _Expr>
1507
+ typename enable_if
1508
+ <
1509
+ __is_val_expr<_Expr>::value,
1510
+ void
1511
+ >::type
1512
+ operator+=(const _Expr& __v) const;
1513
+
1514
+ template <class _Expr>
1515
+ typename enable_if
1516
+ <
1517
+ __is_val_expr<_Expr>::value,
1518
+ void
1519
+ >::type
1520
+ operator-=(const _Expr& __v) const;
1521
+
1522
+ template <class _Expr>
1523
+ typename enable_if
1524
+ <
1525
+ __is_val_expr<_Expr>::value,
1526
+ void
1527
+ >::type
1528
+ operator^=(const _Expr& __v) const;
1529
+
1530
+ template <class _Expr>
1531
+ typename enable_if
1532
+ <
1533
+ __is_val_expr<_Expr>::value,
1534
+ void
1535
+ >::type
1536
+ operator&=(const _Expr& __v) const;
1537
+
1538
+ template <class _Expr>
1539
+ typename enable_if
1540
+ <
1541
+ __is_val_expr<_Expr>::value,
1542
+ void
1543
+ >::type
1544
+ operator|=(const _Expr& __v) const;
1545
+
1546
+ template <class _Expr>
1547
+ typename enable_if
1548
+ <
1549
+ __is_val_expr<_Expr>::value,
1550
+ void
1551
+ >::type
1552
+ operator<<=(const _Expr& __v) const;
1553
+
1554
+ template <class _Expr>
1555
+ typename enable_if
1556
+ <
1557
+ __is_val_expr<_Expr>::value,
1558
+ void
1559
+ >::type
1560
+ operator>>=(const _Expr& __v) const;
1561
+
1562
+ const gslice_array& operator=(const gslice_array& __ga) const;
1563
+
1564
+ void operator=(const value_type& __x) const;
1565
+
1566
+ // gslice_array(const gslice_array&) = default;
1567
+ // gslice_array(gslice_array&&) = default;
1568
+ // gslice_array& operator=(const gslice_array&) = default;
1569
+ // gslice_array& operator=(gslice_array&&) = default;
1570
+
1571
+ private:
1572
+ _LIBCPP_INLINE_VISIBILITY
1573
+ gslice_array(const gslice& __gs, const valarray<value_type>& __v)
1574
+ : __vp_(const_cast<value_type*>(__v.__begin_)),
1575
+ __1d_(__gs.__1d_)
1576
+ {}
1577
+
1578
+ #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1579
+
1580
+ _LIBCPP_INLINE_VISIBILITY
1581
+ gslice_array(gslice&& __gs, const valarray<value_type>& __v)
1582
+ : __vp_(const_cast<value_type*>(__v.__begin_)),
1583
+ __1d_(move(__gs.__1d_))
1584
+ {}
1585
+
1586
+ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1587
+
1588
+ template <class> friend class valarray;
1589
+ };
1590
+
1591
+ template <class _Tp>
1592
+ template <class _Expr>
1593
+ inline _LIBCPP_INLINE_VISIBILITY
1594
+ typename enable_if
1595
+ <
1596
+ __is_val_expr<_Expr>::value,
1597
+ void
1598
+ >::type
1599
+ gslice_array<_Tp>::operator=(const _Expr& __v) const
1600
+ {
1601
+ typedef const size_t* _Ip;
1602
+ size_t __j = 0;
1603
+ for (_Ip __i = __1d_.__begin_, __e = __1d_.__end_; __i != __e; ++__i, ++__j)
1604
+ __vp_[*__i] = __v[__j];
1605
+ }
1606
+
1607
+ template <class _Tp>
1608
+ template <class _Expr>
1609
+ inline _LIBCPP_INLINE_VISIBILITY
1610
+ typename enable_if
1611
+ <
1612
+ __is_val_expr<_Expr>::value,
1613
+ void
1614
+ >::type
1615
+ gslice_array<_Tp>::operator*=(const _Expr& __v) const
1616
+ {
1617
+ typedef const size_t* _Ip;
1618
+ size_t __j = 0;
1619
+ for (_Ip __i = __1d_.__begin_, __e = __1d_.__end_; __i != __e; ++__i, ++__j)
1620
+ __vp_[*__i] *= __v[__j];
1621
+ }
1622
+
1623
+ template <class _Tp>
1624
+ template <class _Expr>
1625
+ inline _LIBCPP_INLINE_VISIBILITY
1626
+ typename enable_if
1627
+ <
1628
+ __is_val_expr<_Expr>::value,
1629
+ void
1630
+ >::type
1631
+ gslice_array<_Tp>::operator/=(const _Expr& __v) const
1632
+ {
1633
+ typedef const size_t* _Ip;
1634
+ size_t __j = 0;
1635
+ for (_Ip __i = __1d_.__begin_, __e = __1d_.__end_; __i != __e; ++__i, ++__j)
1636
+ __vp_[*__i] /= __v[__j];
1637
+ }
1638
+
1639
+ template <class _Tp>
1640
+ template <class _Expr>
1641
+ inline _LIBCPP_INLINE_VISIBILITY
1642
+ typename enable_if
1643
+ <
1644
+ __is_val_expr<_Expr>::value,
1645
+ void
1646
+ >::type
1647
+ gslice_array<_Tp>::operator%=(const _Expr& __v) const
1648
+ {
1649
+ typedef const size_t* _Ip;
1650
+ size_t __j = 0;
1651
+ for (_Ip __i = __1d_.__begin_, __e = __1d_.__end_; __i != __e; ++__i, ++__j)
1652
+ __vp_[*__i] %= __v[__j];
1653
+ }
1654
+
1655
+ template <class _Tp>
1656
+ template <class _Expr>
1657
+ inline _LIBCPP_INLINE_VISIBILITY
1658
+ typename enable_if
1659
+ <
1660
+ __is_val_expr<_Expr>::value,
1661
+ void
1662
+ >::type
1663
+ gslice_array<_Tp>::operator+=(const _Expr& __v) const
1664
+ {
1665
+ typedef const size_t* _Ip;
1666
+ size_t __j = 0;
1667
+ for (_Ip __i = __1d_.__begin_, __e = __1d_.__end_; __i != __e; ++__i, ++__j)
1668
+ __vp_[*__i] += __v[__j];
1669
+ }
1670
+
1671
+ template <class _Tp>
1672
+ template <class _Expr>
1673
+ inline _LIBCPP_INLINE_VISIBILITY
1674
+ typename enable_if
1675
+ <
1676
+ __is_val_expr<_Expr>::value,
1677
+ void
1678
+ >::type
1679
+ gslice_array<_Tp>::operator-=(const _Expr& __v) const
1680
+ {
1681
+ typedef const size_t* _Ip;
1682
+ size_t __j = 0;
1683
+ for (_Ip __i = __1d_.__begin_, __e = __1d_.__end_; __i != __e; ++__i, ++__j)
1684
+ __vp_[*__i] -= __v[__j];
1685
+ }
1686
+
1687
+ template <class _Tp>
1688
+ template <class _Expr>
1689
+ inline _LIBCPP_INLINE_VISIBILITY
1690
+ typename enable_if
1691
+ <
1692
+ __is_val_expr<_Expr>::value,
1693
+ void
1694
+ >::type
1695
+ gslice_array<_Tp>::operator^=(const _Expr& __v) const
1696
+ {
1697
+ typedef const size_t* _Ip;
1698
+ size_t __j = 0;
1699
+ for (_Ip __i = __1d_.__begin_, __e = __1d_.__end_; __i != __e; ++__i, ++__j)
1700
+ __vp_[*__i] ^= __v[__j];
1701
+ }
1702
+
1703
+ template <class _Tp>
1704
+ template <class _Expr>
1705
+ inline _LIBCPP_INLINE_VISIBILITY
1706
+ typename enable_if
1707
+ <
1708
+ __is_val_expr<_Expr>::value,
1709
+ void
1710
+ >::type
1711
+ gslice_array<_Tp>::operator&=(const _Expr& __v) const
1712
+ {
1713
+ typedef const size_t* _Ip;
1714
+ size_t __j = 0;
1715
+ for (_Ip __i = __1d_.__begin_, __e = __1d_.__end_; __i != __e; ++__i, ++__j)
1716
+ __vp_[*__i] &= __v[__j];
1717
+ }
1718
+
1719
+ template <class _Tp>
1720
+ template <class _Expr>
1721
+ inline _LIBCPP_INLINE_VISIBILITY
1722
+ typename enable_if
1723
+ <
1724
+ __is_val_expr<_Expr>::value,
1725
+ void
1726
+ >::type
1727
+ gslice_array<_Tp>::operator|=(const _Expr& __v) const
1728
+ {
1729
+ typedef const size_t* _Ip;
1730
+ size_t __j = 0;
1731
+ for (_Ip __i = __1d_.__begin_, __e = __1d_.__end_; __i != __e; ++__i, ++__j)
1732
+ __vp_[*__i] |= __v[__j];
1733
+ }
1734
+
1735
+ template <class _Tp>
1736
+ template <class _Expr>
1737
+ inline _LIBCPP_INLINE_VISIBILITY
1738
+ typename enable_if
1739
+ <
1740
+ __is_val_expr<_Expr>::value,
1741
+ void
1742
+ >::type
1743
+ gslice_array<_Tp>::operator<<=(const _Expr& __v) const
1744
+ {
1745
+ typedef const size_t* _Ip;
1746
+ size_t __j = 0;
1747
+ for (_Ip __i = __1d_.__begin_, __e = __1d_.__end_; __i != __e; ++__i, ++__j)
1748
+ __vp_[*__i] <<= __v[__j];
1749
+ }
1750
+
1751
+ template <class _Tp>
1752
+ template <class _Expr>
1753
+ inline _LIBCPP_INLINE_VISIBILITY
1754
+ typename enable_if
1755
+ <
1756
+ __is_val_expr<_Expr>::value,
1757
+ void
1758
+ >::type
1759
+ gslice_array<_Tp>::operator>>=(const _Expr& __v) const
1760
+ {
1761
+ typedef const size_t* _Ip;
1762
+ size_t __j = 0;
1763
+ for (_Ip __i = __1d_.__begin_, __e = __1d_.__end_; __i != __e; ++__i, ++__j)
1764
+ __vp_[*__i] >>= __v[__j];
1765
+ }
1766
+
1767
+ template <class _Tp>
1768
+ inline _LIBCPP_INLINE_VISIBILITY
1769
+ const gslice_array<_Tp>&
1770
+ gslice_array<_Tp>::operator=(const gslice_array& __ga) const
1771
+ {
1772
+ typedef const size_t* _Ip;
1773
+ const value_type* __s = __ga.__vp_;
1774
+ for (_Ip __i = __1d_.__begin_, __e = __1d_.__end_, __j = __ga.__1d_.__begin_;
1775
+ __i != __e; ++__i, ++__j)
1776
+ __vp_[*__i] = __s[*__j];
1777
+ return *this;
1778
+ }
1779
+
1780
+ template <class _Tp>
1781
+ inline _LIBCPP_INLINE_VISIBILITY
1782
+ void
1783
+ gslice_array<_Tp>::operator=(const value_type& __x) const
1784
+ {
1785
+ typedef const size_t* _Ip;
1786
+ for (_Ip __i = __1d_.__begin_, __e = __1d_.__end_; __i != __e; ++__i)
1787
+ __vp_[*__i] = __x;
1788
+ }
1789
+
1790
+ // mask_array
1791
+
1792
+ template <class _Tp>
1793
+ class _LIBCPP_TYPE_VIS mask_array
1794
+ {
1795
+ public:
1796
+ typedef _Tp value_type;
1797
+
1798
+ private:
1799
+ value_type* __vp_;
1800
+ valarray<size_t> __1d_;
1801
+
1802
+ public:
1803
+ template <class _Expr>
1804
+ typename enable_if
1805
+ <
1806
+ __is_val_expr<_Expr>::value,
1807
+ void
1808
+ >::type
1809
+ operator=(const _Expr& __v) const;
1810
+
1811
+ template <class _Expr>
1812
+ typename enable_if
1813
+ <
1814
+ __is_val_expr<_Expr>::value,
1815
+ void
1816
+ >::type
1817
+ operator*=(const _Expr& __v) const;
1818
+
1819
+ template <class _Expr>
1820
+ typename enable_if
1821
+ <
1822
+ __is_val_expr<_Expr>::value,
1823
+ void
1824
+ >::type
1825
+ operator/=(const _Expr& __v) const;
1826
+
1827
+ template <class _Expr>
1828
+ typename enable_if
1829
+ <
1830
+ __is_val_expr<_Expr>::value,
1831
+ void
1832
+ >::type
1833
+ operator%=(const _Expr& __v) const;
1834
+
1835
+ template <class _Expr>
1836
+ typename enable_if
1837
+ <
1838
+ __is_val_expr<_Expr>::value,
1839
+ void
1840
+ >::type
1841
+ operator+=(const _Expr& __v) const;
1842
+
1843
+ template <class _Expr>
1844
+ typename enable_if
1845
+ <
1846
+ __is_val_expr<_Expr>::value,
1847
+ void
1848
+ >::type
1849
+ operator-=(const _Expr& __v) const;
1850
+
1851
+ template <class _Expr>
1852
+ typename enable_if
1853
+ <
1854
+ __is_val_expr<_Expr>::value,
1855
+ void
1856
+ >::type
1857
+ operator^=(const _Expr& __v) const;
1858
+
1859
+ template <class _Expr>
1860
+ typename enable_if
1861
+ <
1862
+ __is_val_expr<_Expr>::value,
1863
+ void
1864
+ >::type
1865
+ operator&=(const _Expr& __v) const;
1866
+
1867
+ template <class _Expr>
1868
+ typename enable_if
1869
+ <
1870
+ __is_val_expr<_Expr>::value,
1871
+ void
1872
+ >::type
1873
+ operator|=(const _Expr& __v) const;
1874
+
1875
+ template <class _Expr>
1876
+ typename enable_if
1877
+ <
1878
+ __is_val_expr<_Expr>::value,
1879
+ void
1880
+ >::type
1881
+ operator<<=(const _Expr& __v) const;
1882
+
1883
+ template <class _Expr>
1884
+ typename enable_if
1885
+ <
1886
+ __is_val_expr<_Expr>::value,
1887
+ void
1888
+ >::type
1889
+ operator>>=(const _Expr& __v) const;
1890
+
1891
+ const mask_array& operator=(const mask_array& __ma) const;
1892
+
1893
+ void operator=(const value_type& __x) const;
1894
+
1895
+ // mask_array(const mask_array&) = default;
1896
+ // mask_array(mask_array&&) = default;
1897
+ // mask_array& operator=(const mask_array&) = default;
1898
+ // mask_array& operator=(mask_array&&) = default;
1899
+
1900
+ private:
1901
+ _LIBCPP_INLINE_VISIBILITY
1902
+ mask_array(const valarray<bool>& __vb, const valarray<value_type>& __v)
1903
+ : __vp_(const_cast<value_type*>(__v.__begin_)),
1904
+ __1d_(static_cast<size_t>(count(__vb.__begin_, __vb.__end_, true)))
1905
+ {
1906
+ size_t __j = 0;
1907
+ for (size_t __i = 0; __i < __vb.size(); ++__i)
1908
+ if (__vb[__i])
1909
+ __1d_[__j++] = __i;
1910
+ }
1911
+
1912
+ template <class> friend class valarray;
1913
+ };
1914
+
1915
+ template <class _Tp>
1916
+ template <class _Expr>
1917
+ inline _LIBCPP_INLINE_VISIBILITY
1918
+ typename enable_if
1919
+ <
1920
+ __is_val_expr<_Expr>::value,
1921
+ void
1922
+ >::type
1923
+ mask_array<_Tp>::operator=(const _Expr& __v) const
1924
+ {
1925
+ size_t __n = __1d_.size();
1926
+ for (size_t __i = 0; __i < __n; ++__i)
1927
+ __vp_[__1d_[__i]] = __v[__i];
1928
+ }
1929
+
1930
+ template <class _Tp>
1931
+ template <class _Expr>
1932
+ inline _LIBCPP_INLINE_VISIBILITY
1933
+ typename enable_if
1934
+ <
1935
+ __is_val_expr<_Expr>::value,
1936
+ void
1937
+ >::type
1938
+ mask_array<_Tp>::operator*=(const _Expr& __v) const
1939
+ {
1940
+ size_t __n = __1d_.size();
1941
+ for (size_t __i = 0; __i < __n; ++__i)
1942
+ __vp_[__1d_[__i]] *= __v[__i];
1943
+ }
1944
+
1945
+ template <class _Tp>
1946
+ template <class _Expr>
1947
+ inline _LIBCPP_INLINE_VISIBILITY
1948
+ typename enable_if
1949
+ <
1950
+ __is_val_expr<_Expr>::value,
1951
+ void
1952
+ >::type
1953
+ mask_array<_Tp>::operator/=(const _Expr& __v) const
1954
+ {
1955
+ size_t __n = __1d_.size();
1956
+ for (size_t __i = 0; __i < __n; ++__i)
1957
+ __vp_[__1d_[__i]] /= __v[__i];
1958
+ }
1959
+
1960
+ template <class _Tp>
1961
+ template <class _Expr>
1962
+ inline _LIBCPP_INLINE_VISIBILITY
1963
+ typename enable_if
1964
+ <
1965
+ __is_val_expr<_Expr>::value,
1966
+ void
1967
+ >::type
1968
+ mask_array<_Tp>::operator%=(const _Expr& __v) const
1969
+ {
1970
+ size_t __n = __1d_.size();
1971
+ for (size_t __i = 0; __i < __n; ++__i)
1972
+ __vp_[__1d_[__i]] %= __v[__i];
1973
+ }
1974
+
1975
+ template <class _Tp>
1976
+ template <class _Expr>
1977
+ inline _LIBCPP_INLINE_VISIBILITY
1978
+ typename enable_if
1979
+ <
1980
+ __is_val_expr<_Expr>::value,
1981
+ void
1982
+ >::type
1983
+ mask_array<_Tp>::operator+=(const _Expr& __v) const
1984
+ {
1985
+ size_t __n = __1d_.size();
1986
+ for (size_t __i = 0; __i < __n; ++__i)
1987
+ __vp_[__1d_[__i]] += __v[__i];
1988
+ }
1989
+
1990
+ template <class _Tp>
1991
+ template <class _Expr>
1992
+ inline _LIBCPP_INLINE_VISIBILITY
1993
+ typename enable_if
1994
+ <
1995
+ __is_val_expr<_Expr>::value,
1996
+ void
1997
+ >::type
1998
+ mask_array<_Tp>::operator-=(const _Expr& __v) const
1999
+ {
2000
+ size_t __n = __1d_.size();
2001
+ for (size_t __i = 0; __i < __n; ++__i)
2002
+ __vp_[__1d_[__i]] -= __v[__i];
2003
+ }
2004
+
2005
+ template <class _Tp>
2006
+ template <class _Expr>
2007
+ inline _LIBCPP_INLINE_VISIBILITY
2008
+ typename enable_if
2009
+ <
2010
+ __is_val_expr<_Expr>::value,
2011
+ void
2012
+ >::type
2013
+ mask_array<_Tp>::operator^=(const _Expr& __v) const
2014
+ {
2015
+ size_t __n = __1d_.size();
2016
+ for (size_t __i = 0; __i < __n; ++__i)
2017
+ __vp_[__1d_[__i]] ^= __v[__i];
2018
+ }
2019
+
2020
+ template <class _Tp>
2021
+ template <class _Expr>
2022
+ inline _LIBCPP_INLINE_VISIBILITY
2023
+ typename enable_if
2024
+ <
2025
+ __is_val_expr<_Expr>::value,
2026
+ void
2027
+ >::type
2028
+ mask_array<_Tp>::operator&=(const _Expr& __v) const
2029
+ {
2030
+ size_t __n = __1d_.size();
2031
+ for (size_t __i = 0; __i < __n; ++__i)
2032
+ __vp_[__1d_[__i]] &= __v[__i];
2033
+ }
2034
+
2035
+ template <class _Tp>
2036
+ template <class _Expr>
2037
+ inline _LIBCPP_INLINE_VISIBILITY
2038
+ typename enable_if
2039
+ <
2040
+ __is_val_expr<_Expr>::value,
2041
+ void
2042
+ >::type
2043
+ mask_array<_Tp>::operator|=(const _Expr& __v) const
2044
+ {
2045
+ size_t __n = __1d_.size();
2046
+ for (size_t __i = 0; __i < __n; ++__i)
2047
+ __vp_[__1d_[__i]] |= __v[__i];
2048
+ }
2049
+
2050
+ template <class _Tp>
2051
+ template <class _Expr>
2052
+ inline _LIBCPP_INLINE_VISIBILITY
2053
+ typename enable_if
2054
+ <
2055
+ __is_val_expr<_Expr>::value,
2056
+ void
2057
+ >::type
2058
+ mask_array<_Tp>::operator<<=(const _Expr& __v) const
2059
+ {
2060
+ size_t __n = __1d_.size();
2061
+ for (size_t __i = 0; __i < __n; ++__i)
2062
+ __vp_[__1d_[__i]] <<= __v[__i];
2063
+ }
2064
+
2065
+ template <class _Tp>
2066
+ template <class _Expr>
2067
+ inline _LIBCPP_INLINE_VISIBILITY
2068
+ typename enable_if
2069
+ <
2070
+ __is_val_expr<_Expr>::value,
2071
+ void
2072
+ >::type
2073
+ mask_array<_Tp>::operator>>=(const _Expr& __v) const
2074
+ {
2075
+ size_t __n = __1d_.size();
2076
+ for (size_t __i = 0; __i < __n; ++__i)
2077
+ __vp_[__1d_[__i]] >>= __v[__i];
2078
+ }
2079
+
2080
+ template <class _Tp>
2081
+ inline _LIBCPP_INLINE_VISIBILITY
2082
+ const mask_array<_Tp>&
2083
+ mask_array<_Tp>::operator=(const mask_array& __ma) const
2084
+ {
2085
+ size_t __n = __1d_.size();
2086
+ for (size_t __i = 0; __i < __n; ++__i)
2087
+ __vp_[__1d_[__i]] = __ma.__vp_[__1d_[__i]];
2088
+ }
2089
+
2090
+ template <class _Tp>
2091
+ inline _LIBCPP_INLINE_VISIBILITY
2092
+ void
2093
+ mask_array<_Tp>::operator=(const value_type& __x) const
2094
+ {
2095
+ size_t __n = __1d_.size();
2096
+ for (size_t __i = 0; __i < __n; ++__i)
2097
+ __vp_[__1d_[__i]] = __x;
2098
+ }
2099
+
2100
+ template <class _ValExpr>
2101
+ class __mask_expr
2102
+ {
2103
+ typedef typename remove_reference<_ValExpr>::type _RmExpr;
2104
+ public:
2105
+ typedef typename _RmExpr::value_type value_type;
2106
+ typedef value_type result_type;
2107
+
2108
+ private:
2109
+ _ValExpr __expr_;
2110
+ valarray<size_t> __1d_;
2111
+
2112
+ _LIBCPP_INLINE_VISIBILITY
2113
+ __mask_expr(const valarray<bool>& __vb, const _RmExpr& __e)
2114
+ : __expr_(__e),
2115
+ __1d_(static_cast<size_t>(count(__vb.__begin_, __vb.__end_, true)))
2116
+ {
2117
+ size_t __j = 0;
2118
+ for (size_t __i = 0; __i < __vb.size(); ++__i)
2119
+ if (__vb[__i])
2120
+ __1d_[__j++] = __i;
2121
+ }
2122
+
2123
+ public:
2124
+ _LIBCPP_INLINE_VISIBILITY
2125
+ result_type operator[](size_t __i) const
2126
+ {return __expr_[__1d_[__i]];}
2127
+
2128
+ _LIBCPP_INLINE_VISIBILITY
2129
+ size_t size() const {return __1d_.size();}
2130
+
2131
+ template <class> friend class valarray;
2132
+ };
2133
+
2134
+ // indirect_array
2135
+
2136
+ template <class _Tp>
2137
+ class _LIBCPP_TYPE_VIS indirect_array
2138
+ {
2139
+ public:
2140
+ typedef _Tp value_type;
2141
+
2142
+ private:
2143
+ value_type* __vp_;
2144
+ valarray<size_t> __1d_;
2145
+
2146
+ public:
2147
+ template <class _Expr>
2148
+ typename enable_if
2149
+ <
2150
+ __is_val_expr<_Expr>::value,
2151
+ void
2152
+ >::type
2153
+ operator=(const _Expr& __v) const;
2154
+
2155
+ template <class _Expr>
2156
+ typename enable_if
2157
+ <
2158
+ __is_val_expr<_Expr>::value,
2159
+ void
2160
+ >::type
2161
+ operator*=(const _Expr& __v) const;
2162
+
2163
+ template <class _Expr>
2164
+ typename enable_if
2165
+ <
2166
+ __is_val_expr<_Expr>::value,
2167
+ void
2168
+ >::type
2169
+ operator/=(const _Expr& __v) const;
2170
+
2171
+ template <class _Expr>
2172
+ typename enable_if
2173
+ <
2174
+ __is_val_expr<_Expr>::value,
2175
+ void
2176
+ >::type
2177
+ operator%=(const _Expr& __v) const;
2178
+
2179
+ template <class _Expr>
2180
+ typename enable_if
2181
+ <
2182
+ __is_val_expr<_Expr>::value,
2183
+ void
2184
+ >::type
2185
+ operator+=(const _Expr& __v) const;
2186
+
2187
+ template <class _Expr>
2188
+ typename enable_if
2189
+ <
2190
+ __is_val_expr<_Expr>::value,
2191
+ void
2192
+ >::type
2193
+ operator-=(const _Expr& __v) const;
2194
+
2195
+ template <class _Expr>
2196
+ typename enable_if
2197
+ <
2198
+ __is_val_expr<_Expr>::value,
2199
+ void
2200
+ >::type
2201
+ operator^=(const _Expr& __v) const;
2202
+
2203
+ template <class _Expr>
2204
+ typename enable_if
2205
+ <
2206
+ __is_val_expr<_Expr>::value,
2207
+ void
2208
+ >::type
2209
+ operator&=(const _Expr& __v) const;
2210
+
2211
+ template <class _Expr>
2212
+ typename enable_if
2213
+ <
2214
+ __is_val_expr<_Expr>::value,
2215
+ void
2216
+ >::type
2217
+ operator|=(const _Expr& __v) const;
2218
+
2219
+ template <class _Expr>
2220
+ typename enable_if
2221
+ <
2222
+ __is_val_expr<_Expr>::value,
2223
+ void
2224
+ >::type
2225
+ operator<<=(const _Expr& __v) const;
2226
+
2227
+ template <class _Expr>
2228
+ typename enable_if
2229
+ <
2230
+ __is_val_expr<_Expr>::value,
2231
+ void
2232
+ >::type
2233
+ operator>>=(const _Expr& __v) const;
2234
+
2235
+ const indirect_array& operator=(const indirect_array& __ia) const;
2236
+
2237
+ void operator=(const value_type& __x) const;
2238
+
2239
+ // indirect_array(const indirect_array&) = default;
2240
+ // indirect_array(indirect_array&&) = default;
2241
+ // indirect_array& operator=(const indirect_array&) = default;
2242
+ // indirect_array& operator=(indirect_array&&) = default;
2243
+
2244
+ private:
2245
+ _LIBCPP_INLINE_VISIBILITY
2246
+ indirect_array(const valarray<size_t>& __ia, const valarray<value_type>& __v)
2247
+ : __vp_(const_cast<value_type*>(__v.__begin_)),
2248
+ __1d_(__ia)
2249
+ {}
2250
+
2251
+ #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2252
+
2253
+ _LIBCPP_INLINE_VISIBILITY
2254
+ indirect_array(valarray<size_t>&& __ia, const valarray<value_type>& __v)
2255
+ : __vp_(const_cast<value_type*>(__v.__begin_)),
2256
+ __1d_(move(__ia))
2257
+ {}
2258
+
2259
+ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2260
+
2261
+ template <class> friend class valarray;
2262
+ };
2263
+
2264
+ template <class _Tp>
2265
+ template <class _Expr>
2266
+ inline _LIBCPP_INLINE_VISIBILITY
2267
+ typename enable_if
2268
+ <
2269
+ __is_val_expr<_Expr>::value,
2270
+ void
2271
+ >::type
2272
+ indirect_array<_Tp>::operator=(const _Expr& __v) const
2273
+ {
2274
+ size_t __n = __1d_.size();
2275
+ for (size_t __i = 0; __i < __n; ++__i)
2276
+ __vp_[__1d_[__i]] = __v[__i];
2277
+ }
2278
+
2279
+ template <class _Tp>
2280
+ template <class _Expr>
2281
+ inline _LIBCPP_INLINE_VISIBILITY
2282
+ typename enable_if
2283
+ <
2284
+ __is_val_expr<_Expr>::value,
2285
+ void
2286
+ >::type
2287
+ indirect_array<_Tp>::operator*=(const _Expr& __v) const
2288
+ {
2289
+ size_t __n = __1d_.size();
2290
+ for (size_t __i = 0; __i < __n; ++__i)
2291
+ __vp_[__1d_[__i]] *= __v[__i];
2292
+ }
2293
+
2294
+ template <class _Tp>
2295
+ template <class _Expr>
2296
+ inline _LIBCPP_INLINE_VISIBILITY
2297
+ typename enable_if
2298
+ <
2299
+ __is_val_expr<_Expr>::value,
2300
+ void
2301
+ >::type
2302
+ indirect_array<_Tp>::operator/=(const _Expr& __v) const
2303
+ {
2304
+ size_t __n = __1d_.size();
2305
+ for (size_t __i = 0; __i < __n; ++__i)
2306
+ __vp_[__1d_[__i]] /= __v[__i];
2307
+ }
2308
+
2309
+ template <class _Tp>
2310
+ template <class _Expr>
2311
+ inline _LIBCPP_INLINE_VISIBILITY
2312
+ typename enable_if
2313
+ <
2314
+ __is_val_expr<_Expr>::value,
2315
+ void
2316
+ >::type
2317
+ indirect_array<_Tp>::operator%=(const _Expr& __v) const
2318
+ {
2319
+ size_t __n = __1d_.size();
2320
+ for (size_t __i = 0; __i < __n; ++__i)
2321
+ __vp_[__1d_[__i]] %= __v[__i];
2322
+ }
2323
+
2324
+ template <class _Tp>
2325
+ template <class _Expr>
2326
+ inline _LIBCPP_INLINE_VISIBILITY
2327
+ typename enable_if
2328
+ <
2329
+ __is_val_expr<_Expr>::value,
2330
+ void
2331
+ >::type
2332
+ indirect_array<_Tp>::operator+=(const _Expr& __v) const
2333
+ {
2334
+ size_t __n = __1d_.size();
2335
+ for (size_t __i = 0; __i < __n; ++__i)
2336
+ __vp_[__1d_[__i]] += __v[__i];
2337
+ }
2338
+
2339
+ template <class _Tp>
2340
+ template <class _Expr>
2341
+ inline _LIBCPP_INLINE_VISIBILITY
2342
+ typename enable_if
2343
+ <
2344
+ __is_val_expr<_Expr>::value,
2345
+ void
2346
+ >::type
2347
+ indirect_array<_Tp>::operator-=(const _Expr& __v) const
2348
+ {
2349
+ size_t __n = __1d_.size();
2350
+ for (size_t __i = 0; __i < __n; ++__i)
2351
+ __vp_[__1d_[__i]] -= __v[__i];
2352
+ }
2353
+
2354
+ template <class _Tp>
2355
+ template <class _Expr>
2356
+ inline _LIBCPP_INLINE_VISIBILITY
2357
+ typename enable_if
2358
+ <
2359
+ __is_val_expr<_Expr>::value,
2360
+ void
2361
+ >::type
2362
+ indirect_array<_Tp>::operator^=(const _Expr& __v) const
2363
+ {
2364
+ size_t __n = __1d_.size();
2365
+ for (size_t __i = 0; __i < __n; ++__i)
2366
+ __vp_[__1d_[__i]] ^= __v[__i];
2367
+ }
2368
+
2369
+ template <class _Tp>
2370
+ template <class _Expr>
2371
+ inline _LIBCPP_INLINE_VISIBILITY
2372
+ typename enable_if
2373
+ <
2374
+ __is_val_expr<_Expr>::value,
2375
+ void
2376
+ >::type
2377
+ indirect_array<_Tp>::operator&=(const _Expr& __v) const
2378
+ {
2379
+ size_t __n = __1d_.size();
2380
+ for (size_t __i = 0; __i < __n; ++__i)
2381
+ __vp_[__1d_[__i]] &= __v[__i];
2382
+ }
2383
+
2384
+ template <class _Tp>
2385
+ template <class _Expr>
2386
+ inline _LIBCPP_INLINE_VISIBILITY
2387
+ typename enable_if
2388
+ <
2389
+ __is_val_expr<_Expr>::value,
2390
+ void
2391
+ >::type
2392
+ indirect_array<_Tp>::operator|=(const _Expr& __v) const
2393
+ {
2394
+ size_t __n = __1d_.size();
2395
+ for (size_t __i = 0; __i < __n; ++__i)
2396
+ __vp_[__1d_[__i]] |= __v[__i];
2397
+ }
2398
+
2399
+ template <class _Tp>
2400
+ template <class _Expr>
2401
+ inline _LIBCPP_INLINE_VISIBILITY
2402
+ typename enable_if
2403
+ <
2404
+ __is_val_expr<_Expr>::value,
2405
+ void
2406
+ >::type
2407
+ indirect_array<_Tp>::operator<<=(const _Expr& __v) const
2408
+ {
2409
+ size_t __n = __1d_.size();
2410
+ for (size_t __i = 0; __i < __n; ++__i)
2411
+ __vp_[__1d_[__i]] <<= __v[__i];
2412
+ }
2413
+
2414
+ template <class _Tp>
2415
+ template <class _Expr>
2416
+ inline _LIBCPP_INLINE_VISIBILITY
2417
+ typename enable_if
2418
+ <
2419
+ __is_val_expr<_Expr>::value,
2420
+ void
2421
+ >::type
2422
+ indirect_array<_Tp>::operator>>=(const _Expr& __v) const
2423
+ {
2424
+ size_t __n = __1d_.size();
2425
+ for (size_t __i = 0; __i < __n; ++__i)
2426
+ __vp_[__1d_[__i]] >>= __v[__i];
2427
+ }
2428
+
2429
+ template <class _Tp>
2430
+ inline _LIBCPP_INLINE_VISIBILITY
2431
+ const indirect_array<_Tp>&
2432
+ indirect_array<_Tp>::operator=(const indirect_array& __ia) const
2433
+ {
2434
+ typedef const size_t* _Ip;
2435
+ const value_type* __s = __ia.__vp_;
2436
+ for (_Ip __i = __1d_.__begin_, __e = __1d_.__end_, __j = __ia.__1d_.__begin_;
2437
+ __i != __e; ++__i, ++__j)
2438
+ __vp_[*__i] = __s[*__j];
2439
+ return *this;
2440
+ }
2441
+
2442
+ template <class _Tp>
2443
+ inline _LIBCPP_INLINE_VISIBILITY
2444
+ void
2445
+ indirect_array<_Tp>::operator=(const value_type& __x) const
2446
+ {
2447
+ typedef const size_t* _Ip;
2448
+ for (_Ip __i = __1d_.__begin_, __e = __1d_.__end_; __i != __e; ++__i)
2449
+ __vp_[*__i] = __x;
2450
+ }
2451
+
2452
+ template <class _ValExpr>
2453
+ class __indirect_expr
2454
+ {
2455
+ typedef typename remove_reference<_ValExpr>::type _RmExpr;
2456
+ public:
2457
+ typedef typename _RmExpr::value_type value_type;
2458
+ typedef value_type result_type;
2459
+
2460
+ private:
2461
+ _ValExpr __expr_;
2462
+ valarray<size_t> __1d_;
2463
+
2464
+ _LIBCPP_INLINE_VISIBILITY
2465
+ __indirect_expr(const valarray<size_t>& __ia, const _RmExpr& __e)
2466
+ : __expr_(__e),
2467
+ __1d_(__ia)
2468
+ {}
2469
+
2470
+ #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2471
+
2472
+ _LIBCPP_INLINE_VISIBILITY
2473
+ __indirect_expr(valarray<size_t>&& __ia, const _RmExpr& __e)
2474
+ : __expr_(__e),
2475
+ __1d_(move(__ia))
2476
+ {}
2477
+
2478
+ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2479
+
2480
+ public:
2481
+ _LIBCPP_INLINE_VISIBILITY
2482
+ result_type operator[](size_t __i) const
2483
+ {return __expr_[__1d_[__i]];}
2484
+
2485
+ _LIBCPP_INLINE_VISIBILITY
2486
+ size_t size() const {return __1d_.size();}
2487
+
2488
+ template <class> friend class _LIBCPP_TYPE_VIS valarray;
2489
+ };
2490
+
2491
+ template<class _ValExpr>
2492
+ class __val_expr
2493
+ {
2494
+ typedef typename remove_reference<_ValExpr>::type _RmExpr;
2495
+
2496
+ _ValExpr __expr_;
2497
+ public:
2498
+ typedef typename _RmExpr::value_type value_type;
2499
+ typedef typename _RmExpr::result_type result_type;
2500
+
2501
+ _LIBCPP_INLINE_VISIBILITY
2502
+ explicit __val_expr(const _RmExpr& __e) : __expr_(__e) {}
2503
+
2504
+ _LIBCPP_INLINE_VISIBILITY
2505
+ result_type operator[](size_t __i) const
2506
+ {return __expr_[__i];}
2507
+
2508
+ _LIBCPP_INLINE_VISIBILITY
2509
+ __val_expr<__slice_expr<_ValExpr> > operator[](slice __s) const
2510
+ {return __val_expr<__slice_expr<_ValExpr> >(__expr_, __s);}
2511
+
2512
+ _LIBCPP_INLINE_VISIBILITY
2513
+ __val_expr<__indirect_expr<_ValExpr> > operator[](const gslice& __gs) const
2514
+ {return __val_expr<__indirect_expr<_ValExpr> >(__expr_, __gs.__1d_);}
2515
+
2516
+ _LIBCPP_INLINE_VISIBILITY
2517
+ __val_expr<__mask_expr<_ValExpr> > operator[](const valarray<bool>& __vb) const
2518
+ {return __val_expr<__mask_expr<_ValExpr> >(__expr_, __vb);}
2519
+
2520
+ _LIBCPP_INLINE_VISIBILITY
2521
+ __val_expr<__indirect_expr<_ValExpr> > operator[](const valarray<size_t>& __vs) const
2522
+ {return __val_expr<__indirect_expr<_ValExpr> >(__expr_, __vs);}
2523
+
2524
+ _LIBCPP_INLINE_VISIBILITY
2525
+ __val_expr<_UnaryOp<__unary_plus<value_type>, _ValExpr> >
2526
+ operator+() const
2527
+ {
2528
+ typedef _UnaryOp<__unary_plus<value_type>, _ValExpr> _NewExpr;
2529
+ return __val_expr<_NewExpr>(_NewExpr(__unary_plus<value_type>(), __expr_));
2530
+ }
2531
+
2532
+ _LIBCPP_INLINE_VISIBILITY
2533
+ __val_expr<_UnaryOp<negate<value_type>, _ValExpr> >
2534
+ operator-() const
2535
+ {
2536
+ typedef _UnaryOp<negate<value_type>, _ValExpr> _NewExpr;
2537
+ return __val_expr<_NewExpr>(_NewExpr(negate<value_type>(), __expr_));
2538
+ }
2539
+
2540
+ _LIBCPP_INLINE_VISIBILITY
2541
+ __val_expr<_UnaryOp<__bit_not<value_type>, _ValExpr> >
2542
+ operator~() const
2543
+ {
2544
+ typedef _UnaryOp<__bit_not<value_type>, _ValExpr> _NewExpr;
2545
+ return __val_expr<_NewExpr>(_NewExpr(__bit_not<value_type>(), __expr_));
2546
+ }
2547
+
2548
+ _LIBCPP_INLINE_VISIBILITY
2549
+ __val_expr<_UnaryOp<logical_not<value_type>, _ValExpr> >
2550
+ operator!() const
2551
+ {
2552
+ typedef _UnaryOp<logical_not<value_type>, _ValExpr> _NewExpr;
2553
+ return __val_expr<_NewExpr>(_NewExpr(logical_not<value_type>(), __expr_));
2554
+ }
2555
+
2556
+ operator valarray<result_type>() const;
2557
+
2558
+ _LIBCPP_INLINE_VISIBILITY
2559
+ size_t size() const {return __expr_.size();}
2560
+
2561
+ _LIBCPP_INLINE_VISIBILITY
2562
+ result_type sum() const
2563
+ {
2564
+ size_t __n = __expr_.size();
2565
+ result_type __r = __n ? __expr_[0] : result_type();
2566
+ for (size_t __i = 1; __i < __n; ++__i)
2567
+ __r += __expr_[__i];
2568
+ return __r;
2569
+ }
2570
+
2571
+ _LIBCPP_INLINE_VISIBILITY
2572
+ result_type min() const
2573
+ {
2574
+ size_t __n = size();
2575
+ result_type __r = __n ? (*this)[0] : result_type();
2576
+ for (size_t __i = 1; __i < __n; ++__i)
2577
+ {
2578
+ result_type __x = __expr_[__i];
2579
+ if (__x < __r)
2580
+ __r = __x;
2581
+ }
2582
+ return __r;
2583
+ }
2584
+
2585
+ _LIBCPP_INLINE_VISIBILITY
2586
+ result_type max() const
2587
+ {
2588
+ size_t __n = size();
2589
+ result_type __r = __n ? (*this)[0] : result_type();
2590
+ for (size_t __i = 1; __i < __n; ++__i)
2591
+ {
2592
+ result_type __x = __expr_[__i];
2593
+ if (__r < __x)
2594
+ __r = __x;
2595
+ }
2596
+ return __r;
2597
+ }
2598
+
2599
+ _LIBCPP_INLINE_VISIBILITY
2600
+ __val_expr<__shift_expr<_ValExpr> > shift (int __i) const
2601
+ {return __val_expr<__shift_expr<_ValExpr> >(__shift_expr<_ValExpr>(__i, __expr_));}
2602
+
2603
+ _LIBCPP_INLINE_VISIBILITY
2604
+ __val_expr<__cshift_expr<_ValExpr> > cshift(int __i) const
2605
+ {return __val_expr<__cshift_expr<_ValExpr> >(__cshift_expr<_ValExpr>(__i, __expr_));}
2606
+
2607
+ _LIBCPP_INLINE_VISIBILITY
2608
+ __val_expr<_UnaryOp<__apply_expr<value_type, value_type(*)(value_type)>, _ValExpr> >
2609
+ apply(value_type __f(value_type)) const
2610
+ {
2611
+ typedef __apply_expr<value_type, value_type(*)(value_type)> _Op;
2612
+ typedef _UnaryOp<_Op, _ValExpr> _NewExpr;
2613
+ return __val_expr<_NewExpr>(_NewExpr(_Op(__f), __expr_));
2614
+ }
2615
+
2616
+ _LIBCPP_INLINE_VISIBILITY
2617
+ __val_expr<_UnaryOp<__apply_expr<value_type, value_type(*)(const value_type&)>, _ValExpr> >
2618
+ apply(value_type __f(const value_type&)) const
2619
+ {
2620
+ typedef __apply_expr<value_type, value_type(*)(const value_type&)> _Op;
2621
+ typedef _UnaryOp<_Op, _ValExpr> _NewExpr;
2622
+ return __val_expr<_NewExpr>(_NewExpr(_Op(__f), __expr_));
2623
+ }
2624
+ };
2625
+
2626
+ template<class _ValExpr>
2627
+ __val_expr<_ValExpr>::operator valarray<result_type>() const
2628
+ {
2629
+ valarray<result_type> __r;
2630
+ size_t __n = __expr_.size();
2631
+ if (__n)
2632
+ {
2633
+ __r.__begin_ =
2634
+ __r.__end_ =
2635
+ static_cast<result_type*>(::operator new(__n * sizeof(result_type)));
2636
+ for (size_t __i = 0; __i != __n; ++__r.__end_, ++__i)
2637
+ ::new (__r.__end_) result_type(__expr_[__i]);
2638
+ }
2639
+ return __r;
2640
+ }
2641
+
2642
+ // valarray
2643
+
2644
+ template <class _Tp>
2645
+ inline _LIBCPP_INLINE_VISIBILITY
2646
+ valarray<_Tp>::valarray(size_t __n)
2647
+ : __begin_(0),
2648
+ __end_(0)
2649
+ {
2650
+ resize(__n);
2651
+ }
2652
+
2653
+ template <class _Tp>
2654
+ inline _LIBCPP_INLINE_VISIBILITY
2655
+ valarray<_Tp>::valarray(const value_type& __x, size_t __n)
2656
+ : __begin_(0),
2657
+ __end_(0)
2658
+ {
2659
+ resize(__n, __x);
2660
+ }
2661
+
2662
+ template <class _Tp>
2663
+ valarray<_Tp>::valarray(const value_type* __p, size_t __n)
2664
+ : __begin_(0),
2665
+ __end_(0)
2666
+ {
2667
+ if (__n)
2668
+ {
2669
+ __begin_ = __end_ = static_cast<value_type*>(::operator new(__n * sizeof(value_type)));
2670
+ #ifndef _LIBCPP_NO_EXCEPTIONS
2671
+ try
2672
+ {
2673
+ #endif // _LIBCPP_NO_EXCEPTIONS
2674
+ for (; __n; ++__end_, ++__p, --__n)
2675
+ ::new (__end_) value_type(*__p);
2676
+ #ifndef _LIBCPP_NO_EXCEPTIONS
2677
+ }
2678
+ catch (...)
2679
+ {
2680
+ resize(0);
2681
+ throw;
2682
+ }
2683
+ #endif // _LIBCPP_NO_EXCEPTIONS
2684
+ }
2685
+ }
2686
+
2687
+ template <class _Tp>
2688
+ valarray<_Tp>::valarray(const valarray& __v)
2689
+ : __begin_(0),
2690
+ __end_(0)
2691
+ {
2692
+ if (__v.size())
2693
+ {
2694
+ __begin_ = __end_ = static_cast<value_type*>(::operator new(__v.size() * sizeof(value_type)));
2695
+ #ifndef _LIBCPP_NO_EXCEPTIONS
2696
+ try
2697
+ {
2698
+ #endif // _LIBCPP_NO_EXCEPTIONS
2699
+ for (value_type* __p = __v.__begin_; __p != __v.__end_; ++__end_, ++__p)
2700
+ ::new (__end_) value_type(*__p);
2701
+ #ifndef _LIBCPP_NO_EXCEPTIONS
2702
+ }
2703
+ catch (...)
2704
+ {
2705
+ resize(0);
2706
+ throw;
2707
+ }
2708
+ #endif // _LIBCPP_NO_EXCEPTIONS
2709
+ }
2710
+ }
2711
+
2712
+ #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2713
+
2714
+ template <class _Tp>
2715
+ inline _LIBCPP_INLINE_VISIBILITY
2716
+ valarray<_Tp>::valarray(valarray&& __v) _NOEXCEPT
2717
+ : __begin_(__v.__begin_),
2718
+ __end_(__v.__end_)
2719
+ {
2720
+ __v.__begin_ = __v.__end_ = nullptr;
2721
+ }
2722
+
2723
+ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2724
+
2725
+ #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
2726
+
2727
+ template <class _Tp>
2728
+ valarray<_Tp>::valarray(initializer_list<value_type> __il)
2729
+ : __begin_(0),
2730
+ __end_(0)
2731
+ {
2732
+ size_t __n = __il.size();
2733
+ if (__n)
2734
+ {
2735
+ __begin_ = __end_ = static_cast<value_type*>(::operator new(__n * sizeof(value_type)));
2736
+ #ifndef _LIBCPP_NO_EXCEPTIONS
2737
+ try
2738
+ {
2739
+ #endif // _LIBCPP_NO_EXCEPTIONS
2740
+ for (const value_type* __p = __il.begin(); __n; ++__end_, ++__p, --__n)
2741
+ ::new (__end_) value_type(*__p);
2742
+ #ifndef _LIBCPP_NO_EXCEPTIONS
2743
+ }
2744
+ catch (...)
2745
+ {
2746
+ resize(0);
2747
+ throw;
2748
+ }
2749
+ #endif // _LIBCPP_NO_EXCEPTIONS
2750
+ }
2751
+ }
2752
+
2753
+ #endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
2754
+
2755
+ template <class _Tp>
2756
+ valarray<_Tp>::valarray(const slice_array<value_type>& __sa)
2757
+ : __begin_(0),
2758
+ __end_(0)
2759
+ {
2760
+ size_t __n = __sa.__size_;
2761
+ if (__n)
2762
+ {
2763
+ __begin_ = __end_ = static_cast<value_type*>(::operator new(__n * sizeof(value_type)));
2764
+ #ifndef _LIBCPP_NO_EXCEPTIONS
2765
+ try
2766
+ {
2767
+ #endif // _LIBCPP_NO_EXCEPTIONS
2768
+ for (const value_type* __p = __sa.__vp_; __n; ++__end_, __p += __sa.__stride_, --__n)
2769
+ ::new (__end_) value_type(*__p);
2770
+ #ifndef _LIBCPP_NO_EXCEPTIONS
2771
+ }
2772
+ catch (...)
2773
+ {
2774
+ resize(0);
2775
+ throw;
2776
+ }
2777
+ #endif // _LIBCPP_NO_EXCEPTIONS
2778
+ }
2779
+ }
2780
+
2781
+ template <class _Tp>
2782
+ valarray<_Tp>::valarray(const gslice_array<value_type>& __ga)
2783
+ : __begin_(0),
2784
+ __end_(0)
2785
+ {
2786
+ size_t __n = __ga.__1d_.size();
2787
+ if (__n)
2788
+ {
2789
+ __begin_ = __end_ = static_cast<value_type*>(::operator new(__n * sizeof(value_type)));
2790
+ #ifndef _LIBCPP_NO_EXCEPTIONS
2791
+ try
2792
+ {
2793
+ #endif // _LIBCPP_NO_EXCEPTIONS
2794
+ typedef const size_t* _Ip;
2795
+ const value_type* __s = __ga.__vp_;
2796
+ for (_Ip __i = __ga.__1d_.__begin_, __e = __ga.__1d_.__end_;
2797
+ __i != __e; ++__i, ++__end_)
2798
+ ::new (__end_) value_type(__s[*__i]);
2799
+ #ifndef _LIBCPP_NO_EXCEPTIONS
2800
+ }
2801
+ catch (...)
2802
+ {
2803
+ resize(0);
2804
+ throw;
2805
+ }
2806
+ #endif // _LIBCPP_NO_EXCEPTIONS
2807
+ }
2808
+ }
2809
+
2810
+ template <class _Tp>
2811
+ valarray<_Tp>::valarray(const mask_array<value_type>& __ma)
2812
+ : __begin_(0),
2813
+ __end_(0)
2814
+ {
2815
+ size_t __n = __ma.__1d_.size();
2816
+ if (__n)
2817
+ {
2818
+ __begin_ = __end_ = static_cast<value_type*>(::operator new(__n * sizeof(value_type)));
2819
+ #ifndef _LIBCPP_NO_EXCEPTIONS
2820
+ try
2821
+ {
2822
+ #endif // _LIBCPP_NO_EXCEPTIONS
2823
+ typedef const size_t* _Ip;
2824
+ const value_type* __s = __ma.__vp_;
2825
+ for (_Ip __i = __ma.__1d_.__begin_, __e = __ma.__1d_.__end_;
2826
+ __i != __e; ++__i, ++__end_)
2827
+ ::new (__end_) value_type(__s[*__i]);
2828
+ #ifndef _LIBCPP_NO_EXCEPTIONS
2829
+ }
2830
+ catch (...)
2831
+ {
2832
+ resize(0);
2833
+ throw;
2834
+ }
2835
+ #endif // _LIBCPP_NO_EXCEPTIONS
2836
+ }
2837
+ }
2838
+
2839
+ template <class _Tp>
2840
+ valarray<_Tp>::valarray(const indirect_array<value_type>& __ia)
2841
+ : __begin_(0),
2842
+ __end_(0)
2843
+ {
2844
+ size_t __n = __ia.__1d_.size();
2845
+ if (__n)
2846
+ {
2847
+ __begin_ = __end_ = static_cast<value_type*>(::operator new(__n * sizeof(value_type)));
2848
+ #ifndef _LIBCPP_NO_EXCEPTIONS
2849
+ try
2850
+ {
2851
+ #endif // _LIBCPP_NO_EXCEPTIONS
2852
+ typedef const size_t* _Ip;
2853
+ const value_type* __s = __ia.__vp_;
2854
+ for (_Ip __i = __ia.__1d_.__begin_, __e = __ia.__1d_.__end_;
2855
+ __i != __e; ++__i, ++__end_)
2856
+ ::new (__end_) value_type(__s[*__i]);
2857
+ #ifndef _LIBCPP_NO_EXCEPTIONS
2858
+ }
2859
+ catch (...)
2860
+ {
2861
+ resize(0);
2862
+ throw;
2863
+ }
2864
+ #endif // _LIBCPP_NO_EXCEPTIONS
2865
+ }
2866
+ }
2867
+
2868
+ template <class _Tp>
2869
+ inline _LIBCPP_INLINE_VISIBILITY
2870
+ valarray<_Tp>::~valarray()
2871
+ {
2872
+ resize(0);
2873
+ }
2874
+
2875
+ template <class _Tp>
2876
+ valarray<_Tp>&
2877
+ valarray<_Tp>::operator=(const valarray& __v)
2878
+ {
2879
+ if (this != &__v)
2880
+ {
2881
+ if (size() != __v.size())
2882
+ resize(__v.size());
2883
+ _VSTD::copy(__v.__begin_, __v.__end_, __begin_);
2884
+ }
2885
+ return *this;
2886
+ }
2887
+
2888
+ #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2889
+
2890
+ template <class _Tp>
2891
+ inline _LIBCPP_INLINE_VISIBILITY
2892
+ valarray<_Tp>&
2893
+ valarray<_Tp>::operator=(valarray&& __v) _NOEXCEPT
2894
+ {
2895
+ resize(0);
2896
+ __begin_ = __v.__begin_;
2897
+ __end_ = __v.__end_;
2898
+ __v.__begin_ = nullptr;
2899
+ __v.__end_ = nullptr;
2900
+ return *this;
2901
+ }
2902
+
2903
+ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2904
+
2905
+ #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
2906
+
2907
+ template <class _Tp>
2908
+ inline _LIBCPP_INLINE_VISIBILITY
2909
+ valarray<_Tp>&
2910
+ valarray<_Tp>::operator=(initializer_list<value_type> __il)
2911
+ {
2912
+ if (size() != __il.size())
2913
+ resize(__il.size());
2914
+ _VSTD::copy(__il.begin(), __il.end(), __begin_);
2915
+ return *this;
2916
+ }
2917
+
2918
+ #endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
2919
+
2920
+ template <class _Tp>
2921
+ inline _LIBCPP_INLINE_VISIBILITY
2922
+ valarray<_Tp>&
2923
+ valarray<_Tp>::operator=(const value_type& __x)
2924
+ {
2925
+ _VSTD::fill(__begin_, __end_, __x);
2926
+ return *this;
2927
+ }
2928
+
2929
+ template <class _Tp>
2930
+ inline _LIBCPP_INLINE_VISIBILITY
2931
+ valarray<_Tp>&
2932
+ valarray<_Tp>::operator=(const slice_array<value_type>& __sa)
2933
+ {
2934
+ value_type* __t = __begin_;
2935
+ const value_type* __s = __sa.__vp_;
2936
+ for (size_t __n = __sa.__size_; __n; --__n, __s += __sa.__stride_, ++__t)
2937
+ *__t = *__s;
2938
+ return *this;
2939
+ }
2940
+
2941
+ template <class _Tp>
2942
+ inline _LIBCPP_INLINE_VISIBILITY
2943
+ valarray<_Tp>&
2944
+ valarray<_Tp>::operator=(const gslice_array<value_type>& __ga)
2945
+ {
2946
+ typedef const size_t* _Ip;
2947
+ value_type* __t = __begin_;
2948
+ const value_type* __s = __ga.__vp_;
2949
+ for (_Ip __i = __ga.__1d_.__begin_, __e = __ga.__1d_.__end_;
2950
+ __i != __e; ++__i, ++__t)
2951
+ *__t = __s[*__i];
2952
+ return *this;
2953
+ }
2954
+
2955
+ template <class _Tp>
2956
+ inline _LIBCPP_INLINE_VISIBILITY
2957
+ valarray<_Tp>&
2958
+ valarray<_Tp>::operator=(const mask_array<value_type>& __ma)
2959
+ {
2960
+ typedef const size_t* _Ip;
2961
+ value_type* __t = __begin_;
2962
+ const value_type* __s = __ma.__vp_;
2963
+ for (_Ip __i = __ma.__1d_.__begin_, __e = __ma.__1d_.__end_;
2964
+ __i != __e; ++__i, ++__t)
2965
+ *__t = __s[*__i];
2966
+ return *this;
2967
+ }
2968
+
2969
+ template <class _Tp>
2970
+ inline _LIBCPP_INLINE_VISIBILITY
2971
+ valarray<_Tp>&
2972
+ valarray<_Tp>::operator=(const indirect_array<value_type>& __ia)
2973
+ {
2974
+ typedef const size_t* _Ip;
2975
+ value_type* __t = __begin_;
2976
+ const value_type* __s = __ia.__vp_;
2977
+ for (_Ip __i = __ia.__1d_.__begin_, __e = __ia.__1d_.__end_;
2978
+ __i != __e; ++__i, ++__t)
2979
+ *__t = __s[*__i];
2980
+ return *this;
2981
+ }
2982
+
2983
+ template <class _Tp>
2984
+ template <class _ValExpr>
2985
+ inline _LIBCPP_INLINE_VISIBILITY
2986
+ valarray<_Tp>&
2987
+ valarray<_Tp>::operator=(const __val_expr<_ValExpr>& __v)
2988
+ {
2989
+ size_t __n = __v.size();
2990
+ if (size() != __n)
2991
+ resize(__n);
2992
+ value_type* __t = __begin_;
2993
+ for (size_t __i = 0; __i != __n; ++__t, ++__i)
2994
+ *__t = result_type(__v[__i]);
2995
+ return *this;
2996
+ }
2997
+
2998
+ template <class _Tp>
2999
+ inline _LIBCPP_INLINE_VISIBILITY
3000
+ __val_expr<__slice_expr<const valarray<_Tp>&> >
3001
+ valarray<_Tp>::operator[](slice __s) const
3002
+ {
3003
+ return __val_expr<__slice_expr<const valarray&> >(__slice_expr<const valarray&>(__s, *this));
3004
+ }
3005
+
3006
+ template <class _Tp>
3007
+ inline _LIBCPP_INLINE_VISIBILITY
3008
+ slice_array<_Tp>
3009
+ valarray<_Tp>::operator[](slice __s)
3010
+ {
3011
+ return slice_array<value_type>(__s, *this);
3012
+ }
3013
+
3014
+ template <class _Tp>
3015
+ inline _LIBCPP_INLINE_VISIBILITY
3016
+ __val_expr<__indirect_expr<const valarray<_Tp>&> >
3017
+ valarray<_Tp>::operator[](const gslice& __gs) const
3018
+ {
3019
+ return __val_expr<__indirect_expr<const valarray&> >(__indirect_expr<const valarray&>(__gs.__1d_, *this));
3020
+ }
3021
+
3022
+ template <class _Tp>
3023
+ inline _LIBCPP_INLINE_VISIBILITY
3024
+ gslice_array<_Tp>
3025
+ valarray<_Tp>::operator[](const gslice& __gs)
3026
+ {
3027
+ return gslice_array<value_type>(__gs, *this);
3028
+ }
3029
+
3030
+ #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
3031
+
3032
+ template <class _Tp>
3033
+ inline _LIBCPP_INLINE_VISIBILITY
3034
+ __val_expr<__indirect_expr<const valarray<_Tp>&> >
3035
+ valarray<_Tp>::operator[](gslice&& __gs) const
3036
+ {
3037
+ return __val_expr<__indirect_expr<const valarray&> >(__indirect_expr<const valarray&>(move(__gs.__1d_), *this));
3038
+ }
3039
+
3040
+ template <class _Tp>
3041
+ inline _LIBCPP_INLINE_VISIBILITY
3042
+ gslice_array<_Tp>
3043
+ valarray<_Tp>::operator[](gslice&& __gs)
3044
+ {
3045
+ return gslice_array<value_type>(move(__gs), *this);
3046
+ }
3047
+
3048
+ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
3049
+
3050
+ template <class _Tp>
3051
+ inline _LIBCPP_INLINE_VISIBILITY
3052
+ __val_expr<__mask_expr<const valarray<_Tp>&> >
3053
+ valarray<_Tp>::operator[](const valarray<bool>& __vb) const
3054
+ {
3055
+ return __val_expr<__mask_expr<const valarray&> >(__mask_expr<const valarray&>(__vb, *this));
3056
+ }
3057
+
3058
+ template <class _Tp>
3059
+ inline _LIBCPP_INLINE_VISIBILITY
3060
+ mask_array<_Tp>
3061
+ valarray<_Tp>::operator[](const valarray<bool>& __vb)
3062
+ {
3063
+ return mask_array<value_type>(__vb, *this);
3064
+ }
3065
+
3066
+ #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
3067
+
3068
+ template <class _Tp>
3069
+ inline _LIBCPP_INLINE_VISIBILITY
3070
+ __val_expr<__mask_expr<const valarray<_Tp>&> >
3071
+ valarray<_Tp>::operator[](valarray<bool>&& __vb) const
3072
+ {
3073
+ return __val_expr<__mask_expr<const valarray&> >(__mask_expr<const valarray&>(move(__vb), *this));
3074
+ }
3075
+
3076
+ template <class _Tp>
3077
+ inline _LIBCPP_INLINE_VISIBILITY
3078
+ mask_array<_Tp>
3079
+ valarray<_Tp>::operator[](valarray<bool>&& __vb)
3080
+ {
3081
+ return mask_array<value_type>(move(__vb), *this);
3082
+ }
3083
+
3084
+ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
3085
+
3086
+ template <class _Tp>
3087
+ inline _LIBCPP_INLINE_VISIBILITY
3088
+ __val_expr<__indirect_expr<const valarray<_Tp>&> >
3089
+ valarray<_Tp>::operator[](const valarray<size_t>& __vs) const
3090
+ {
3091
+ return __val_expr<__indirect_expr<const valarray&> >(__indirect_expr<const valarray&>(__vs, *this));
3092
+ }
3093
+
3094
+ template <class _Tp>
3095
+ inline _LIBCPP_INLINE_VISIBILITY
3096
+ indirect_array<_Tp>
3097
+ valarray<_Tp>::operator[](const valarray<size_t>& __vs)
3098
+ {
3099
+ return indirect_array<value_type>(__vs, *this);
3100
+ }
3101
+
3102
+ #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
3103
+
3104
+ template <class _Tp>
3105
+ inline _LIBCPP_INLINE_VISIBILITY
3106
+ __val_expr<__indirect_expr<const valarray<_Tp>&> >
3107
+ valarray<_Tp>::operator[](valarray<size_t>&& __vs) const
3108
+ {
3109
+ return __val_expr<__indirect_expr<const valarray&> >(__indirect_expr<const valarray&>(move(__vs), *this));
3110
+ }
3111
+
3112
+ template <class _Tp>
3113
+ inline _LIBCPP_INLINE_VISIBILITY
3114
+ indirect_array<_Tp>
3115
+ valarray<_Tp>::operator[](valarray<size_t>&& __vs)
3116
+ {
3117
+ return indirect_array<value_type>(move(__vs), *this);
3118
+ }
3119
+
3120
+ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
3121
+
3122
+ template <class _Tp>
3123
+ valarray<_Tp>
3124
+ valarray<_Tp>::operator+() const
3125
+ {
3126
+ valarray<value_type> __r;
3127
+ size_t __n = size();
3128
+ if (__n)
3129
+ {
3130
+ __r.__begin_ =
3131
+ __r.__end_ =
3132
+ static_cast<value_type*>(::operator new(__n * sizeof(value_type)));
3133
+ for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
3134
+ ::new (__r.__end_) value_type(+*__p);
3135
+ }
3136
+ return __r;
3137
+ }
3138
+
3139
+ template <class _Tp>
3140
+ valarray<_Tp>
3141
+ valarray<_Tp>::operator-() const
3142
+ {
3143
+ valarray<value_type> __r;
3144
+ size_t __n = size();
3145
+ if (__n)
3146
+ {
3147
+ __r.__begin_ =
3148
+ __r.__end_ =
3149
+ static_cast<value_type*>(::operator new(__n * sizeof(value_type)));
3150
+ for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
3151
+ ::new (__r.__end_) value_type(-*__p);
3152
+ }
3153
+ return __r;
3154
+ }
3155
+
3156
+ template <class _Tp>
3157
+ valarray<_Tp>
3158
+ valarray<_Tp>::operator~() const
3159
+ {
3160
+ valarray<value_type> __r;
3161
+ size_t __n = size();
3162
+ if (__n)
3163
+ {
3164
+ __r.__begin_ =
3165
+ __r.__end_ =
3166
+ static_cast<value_type*>(::operator new(__n * sizeof(value_type)));
3167
+ for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
3168
+ ::new (__r.__end_) value_type(~*__p);
3169
+ }
3170
+ return __r;
3171
+ }
3172
+
3173
+ template <class _Tp>
3174
+ valarray<bool>
3175
+ valarray<_Tp>::operator!() const
3176
+ {
3177
+ valarray<bool> __r;
3178
+ size_t __n = size();
3179
+ if (__n)
3180
+ {
3181
+ __r.__begin_ =
3182
+ __r.__end_ =
3183
+ static_cast<bool*>(::operator new(__n * sizeof(bool)));
3184
+ for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
3185
+ ::new (__r.__end_) bool(!*__p);
3186
+ }
3187
+ return __r;
3188
+ }
3189
+
3190
+ template <class _Tp>
3191
+ inline _LIBCPP_INLINE_VISIBILITY
3192
+ valarray<_Tp>&
3193
+ valarray<_Tp>::operator*=(const value_type& __x)
3194
+ {
3195
+ for (value_type* __p = __begin_; __p != __end_; ++__p)
3196
+ *__p *= __x;
3197
+ return *this;
3198
+ }
3199
+
3200
+ template <class _Tp>
3201
+ inline _LIBCPP_INLINE_VISIBILITY
3202
+ valarray<_Tp>&
3203
+ valarray<_Tp>::operator/=(const value_type& __x)
3204
+ {
3205
+ for (value_type* __p = __begin_; __p != __end_; ++__p)
3206
+ *__p /= __x;
3207
+ return *this;
3208
+ }
3209
+
3210
+ template <class _Tp>
3211
+ inline _LIBCPP_INLINE_VISIBILITY
3212
+ valarray<_Tp>&
3213
+ valarray<_Tp>::operator%=(const value_type& __x)
3214
+ {
3215
+ for (value_type* __p = __begin_; __p != __end_; ++__p)
3216
+ *__p %= __x;
3217
+ return *this;
3218
+ }
3219
+
3220
+ template <class _Tp>
3221
+ inline _LIBCPP_INLINE_VISIBILITY
3222
+ valarray<_Tp>&
3223
+ valarray<_Tp>::operator+=(const value_type& __x)
3224
+ {
3225
+ for (value_type* __p = __begin_; __p != __end_; ++__p)
3226
+ *__p += __x;
3227
+ return *this;
3228
+ }
3229
+
3230
+ template <class _Tp>
3231
+ inline _LIBCPP_INLINE_VISIBILITY
3232
+ valarray<_Tp>&
3233
+ valarray<_Tp>::operator-=(const value_type& __x)
3234
+ {
3235
+ for (value_type* __p = __begin_; __p != __end_; ++__p)
3236
+ *__p -= __x;
3237
+ return *this;
3238
+ }
3239
+
3240
+ template <class _Tp>
3241
+ inline _LIBCPP_INLINE_VISIBILITY
3242
+ valarray<_Tp>&
3243
+ valarray<_Tp>::operator^=(const value_type& __x)
3244
+ {
3245
+ for (value_type* __p = __begin_; __p != __end_; ++__p)
3246
+ *__p ^= __x;
3247
+ return *this;
3248
+ }
3249
+
3250
+ template <class _Tp>
3251
+ inline _LIBCPP_INLINE_VISIBILITY
3252
+ valarray<_Tp>&
3253
+ valarray<_Tp>::operator&=(const value_type& __x)
3254
+ {
3255
+ for (value_type* __p = __begin_; __p != __end_; ++__p)
3256
+ *__p &= __x;
3257
+ return *this;
3258
+ }
3259
+
3260
+ template <class _Tp>
3261
+ inline _LIBCPP_INLINE_VISIBILITY
3262
+ valarray<_Tp>&
3263
+ valarray<_Tp>::operator|=(const value_type& __x)
3264
+ {
3265
+ for (value_type* __p = __begin_; __p != __end_; ++__p)
3266
+ *__p |= __x;
3267
+ return *this;
3268
+ }
3269
+
3270
+ template <class _Tp>
3271
+ inline _LIBCPP_INLINE_VISIBILITY
3272
+ valarray<_Tp>&
3273
+ valarray<_Tp>::operator<<=(const value_type& __x)
3274
+ {
3275
+ for (value_type* __p = __begin_; __p != __end_; ++__p)
3276
+ *__p <<= __x;
3277
+ return *this;
3278
+ }
3279
+
3280
+ template <class _Tp>
3281
+ inline _LIBCPP_INLINE_VISIBILITY
3282
+ valarray<_Tp>&
3283
+ valarray<_Tp>::operator>>=(const value_type& __x)
3284
+ {
3285
+ for (value_type* __p = __begin_; __p != __end_; ++__p)
3286
+ *__p >>= __x;
3287
+ return *this;
3288
+ }
3289
+
3290
+ template <class _Tp>
3291
+ template <class _Expr>
3292
+ inline _LIBCPP_INLINE_VISIBILITY
3293
+ typename enable_if
3294
+ <
3295
+ __is_val_expr<_Expr>::value,
3296
+ valarray<_Tp>&
3297
+ >::type
3298
+ valarray<_Tp>::operator*=(const _Expr& __v)
3299
+ {
3300
+ size_t __i = 0;
3301
+ for (value_type* __t = __begin_; __t != __end_ ; ++__t, ++__i)
3302
+ *__t *= __v[__i];
3303
+ return *this;
3304
+ }
3305
+
3306
+ template <class _Tp>
3307
+ template <class _Expr>
3308
+ inline _LIBCPP_INLINE_VISIBILITY
3309
+ typename enable_if
3310
+ <
3311
+ __is_val_expr<_Expr>::value,
3312
+ valarray<_Tp>&
3313
+ >::type
3314
+ valarray<_Tp>::operator/=(const _Expr& __v)
3315
+ {
3316
+ size_t __i = 0;
3317
+ for (value_type* __t = __begin_; __t != __end_ ; ++__t, ++__i)
3318
+ *__t /= __v[__i];
3319
+ return *this;
3320
+ }
3321
+
3322
+ template <class _Tp>
3323
+ template <class _Expr>
3324
+ inline _LIBCPP_INLINE_VISIBILITY
3325
+ typename enable_if
3326
+ <
3327
+ __is_val_expr<_Expr>::value,
3328
+ valarray<_Tp>&
3329
+ >::type
3330
+ valarray<_Tp>::operator%=(const _Expr& __v)
3331
+ {
3332
+ size_t __i = 0;
3333
+ for (value_type* __t = __begin_; __t != __end_ ; ++__t, ++__i)
3334
+ *__t %= __v[__i];
3335
+ return *this;
3336
+ }
3337
+
3338
+ template <class _Tp>
3339
+ template <class _Expr>
3340
+ inline _LIBCPP_INLINE_VISIBILITY
3341
+ typename enable_if
3342
+ <
3343
+ __is_val_expr<_Expr>::value,
3344
+ valarray<_Tp>&
3345
+ >::type
3346
+ valarray<_Tp>::operator+=(const _Expr& __v)
3347
+ {
3348
+ size_t __i = 0;
3349
+ for (value_type* __t = __begin_; __t != __end_ ; ++__t, ++__i)
3350
+ *__t += __v[__i];
3351
+ return *this;
3352
+ }
3353
+
3354
+ template <class _Tp>
3355
+ template <class _Expr>
3356
+ inline _LIBCPP_INLINE_VISIBILITY
3357
+ typename enable_if
3358
+ <
3359
+ __is_val_expr<_Expr>::value,
3360
+ valarray<_Tp>&
3361
+ >::type
3362
+ valarray<_Tp>::operator-=(const _Expr& __v)
3363
+ {
3364
+ size_t __i = 0;
3365
+ for (value_type* __t = __begin_; __t != __end_ ; ++__t, ++__i)
3366
+ *__t -= __v[__i];
3367
+ return *this;
3368
+ }
3369
+
3370
+ template <class _Tp>
3371
+ template <class _Expr>
3372
+ inline _LIBCPP_INLINE_VISIBILITY
3373
+ typename enable_if
3374
+ <
3375
+ __is_val_expr<_Expr>::value,
3376
+ valarray<_Tp>&
3377
+ >::type
3378
+ valarray<_Tp>::operator^=(const _Expr& __v)
3379
+ {
3380
+ size_t __i = 0;
3381
+ for (value_type* __t = __begin_; __t != __end_ ; ++__t, ++__i)
3382
+ *__t ^= __v[__i];
3383
+ return *this;
3384
+ }
3385
+
3386
+ template <class _Tp>
3387
+ template <class _Expr>
3388
+ inline _LIBCPP_INLINE_VISIBILITY
3389
+ typename enable_if
3390
+ <
3391
+ __is_val_expr<_Expr>::value,
3392
+ valarray<_Tp>&
3393
+ >::type
3394
+ valarray<_Tp>::operator|=(const _Expr& __v)
3395
+ {
3396
+ size_t __i = 0;
3397
+ for (value_type* __t = __begin_; __t != __end_ ; ++__t, ++__i)
3398
+ *__t |= __v[__i];
3399
+ return *this;
3400
+ }
3401
+
3402
+ template <class _Tp>
3403
+ template <class _Expr>
3404
+ inline _LIBCPP_INLINE_VISIBILITY
3405
+ typename enable_if
3406
+ <
3407
+ __is_val_expr<_Expr>::value,
3408
+ valarray<_Tp>&
3409
+ >::type
3410
+ valarray<_Tp>::operator&=(const _Expr& __v)
3411
+ {
3412
+ size_t __i = 0;
3413
+ for (value_type* __t = __begin_; __t != __end_ ; ++__t, ++__i)
3414
+ *__t &= __v[__i];
3415
+ return *this;
3416
+ }
3417
+
3418
+ template <class _Tp>
3419
+ template <class _Expr>
3420
+ inline _LIBCPP_INLINE_VISIBILITY
3421
+ typename enable_if
3422
+ <
3423
+ __is_val_expr<_Expr>::value,
3424
+ valarray<_Tp>&
3425
+ >::type
3426
+ valarray<_Tp>::operator<<=(const _Expr& __v)
3427
+ {
3428
+ size_t __i = 0;
3429
+ for (value_type* __t = __begin_; __t != __end_ ; ++__t, ++__i)
3430
+ *__t <<= __v[__i];
3431
+ return *this;
3432
+ }
3433
+
3434
+ template <class _Tp>
3435
+ template <class _Expr>
3436
+ inline _LIBCPP_INLINE_VISIBILITY
3437
+ typename enable_if
3438
+ <
3439
+ __is_val_expr<_Expr>::value,
3440
+ valarray<_Tp>&
3441
+ >::type
3442
+ valarray<_Tp>::operator>>=(const _Expr& __v)
3443
+ {
3444
+ size_t __i = 0;
3445
+ for (value_type* __t = __begin_; __t != __end_ ; ++__t, ++__i)
3446
+ *__t >>= __v[__i];
3447
+ return *this;
3448
+ }
3449
+
3450
+ template <class _Tp>
3451
+ inline _LIBCPP_INLINE_VISIBILITY
3452
+ void
3453
+ valarray<_Tp>::swap(valarray& __v) _NOEXCEPT
3454
+ {
3455
+ _VSTD::swap(__begin_, __v.__begin_);
3456
+ _VSTD::swap(__end_, __v.__end_);
3457
+ }
3458
+
3459
+ template <class _Tp>
3460
+ inline _LIBCPP_INLINE_VISIBILITY
3461
+ _Tp
3462
+ valarray<_Tp>::sum() const
3463
+ {
3464
+ if (__begin_ == __end_)
3465
+ return value_type();
3466
+ const value_type* __p = __begin_;
3467
+ _Tp __r = *__p;
3468
+ for (++__p; __p != __end_; ++__p)
3469
+ __r += *__p;
3470
+ return __r;
3471
+ }
3472
+
3473
+ template <class _Tp>
3474
+ inline _LIBCPP_INLINE_VISIBILITY
3475
+ _Tp
3476
+ valarray<_Tp>::min() const
3477
+ {
3478
+ if (__begin_ == __end_)
3479
+ return value_type();
3480
+ return *_VSTD::min_element(__begin_, __end_);
3481
+ }
3482
+
3483
+ template <class _Tp>
3484
+ inline _LIBCPP_INLINE_VISIBILITY
3485
+ _Tp
3486
+ valarray<_Tp>::max() const
3487
+ {
3488
+ if (__begin_ == __end_)
3489
+ return value_type();
3490
+ return *_VSTD::max_element(__begin_, __end_);
3491
+ }
3492
+
3493
+ template <class _Tp>
3494
+ valarray<_Tp>
3495
+ valarray<_Tp>::shift(int __i) const
3496
+ {
3497
+ valarray<value_type> __r;
3498
+ size_t __n = size();
3499
+ if (__n)
3500
+ {
3501
+ __r.__begin_ =
3502
+ __r.__end_ =
3503
+ static_cast<value_type*>(::operator new(__n * sizeof(value_type)));
3504
+ const value_type* __sb;
3505
+ value_type* __tb;
3506
+ value_type* __te;
3507
+ if (__i >= 0)
3508
+ {
3509
+ __i = _VSTD::min(__i, static_cast<int>(__n));
3510
+ __sb = __begin_ + __i;
3511
+ __tb = __r.__begin_;
3512
+ __te = __r.__begin_ + (__n - __i);
3513
+ }
3514
+ else
3515
+ {
3516
+ __i = _VSTD::min(-__i, static_cast<int>(__n));
3517
+ __sb = __begin_;
3518
+ __tb = __r.__begin_ + __i;
3519
+ __te = __r.__begin_ + __n;
3520
+ }
3521
+ for (; __r.__end_ != __tb; ++__r.__end_)
3522
+ ::new (__r.__end_) value_type();
3523
+ for (; __r.__end_ != __te; ++__r.__end_, ++__sb)
3524
+ ::new (__r.__end_) value_type(*__sb);
3525
+ for (__te = __r.__begin_ + __n; __r.__end_ != __te; ++__r.__end_)
3526
+ ::new (__r.__end_) value_type();
3527
+ }
3528
+ return __r;
3529
+ }
3530
+
3531
+ template <class _Tp>
3532
+ valarray<_Tp>
3533
+ valarray<_Tp>::cshift(int __i) const
3534
+ {
3535
+ valarray<value_type> __r;
3536
+ size_t __n = size();
3537
+ if (__n)
3538
+ {
3539
+ __r.__begin_ =
3540
+ __r.__end_ =
3541
+ static_cast<value_type*>(::operator new(__n * sizeof(value_type)));
3542
+ __i %= static_cast<int>(__n);
3543
+ const value_type* __m = __i >= 0 ? __begin_ + __i : __end_ + __i;
3544
+ for (const value_type* __s = __m; __s != __end_; ++__r.__end_, ++__s)
3545
+ ::new (__r.__end_) value_type(*__s);
3546
+ for (const value_type* __s = __begin_; __s != __m; ++__r.__end_, ++__s)
3547
+ ::new (__r.__end_) value_type(*__s);
3548
+ }
3549
+ return __r;
3550
+ }
3551
+
3552
+ template <class _Tp>
3553
+ valarray<_Tp>
3554
+ valarray<_Tp>::apply(value_type __f(value_type)) const
3555
+ {
3556
+ valarray<value_type> __r;
3557
+ size_t __n = size();
3558
+ if (__n)
3559
+ {
3560
+ __r.__begin_ =
3561
+ __r.__end_ =
3562
+ static_cast<value_type*>(::operator new(__n * sizeof(value_type)));
3563
+ for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
3564
+ ::new (__r.__end_) value_type(__f(*__p));
3565
+ }
3566
+ return __r;
3567
+ }
3568
+
3569
+ template <class _Tp>
3570
+ valarray<_Tp>
3571
+ valarray<_Tp>::apply(value_type __f(const value_type&)) const
3572
+ {
3573
+ valarray<value_type> __r;
3574
+ size_t __n = size();
3575
+ if (__n)
3576
+ {
3577
+ __r.__begin_ =
3578
+ __r.__end_ =
3579
+ static_cast<value_type*>(::operator new(__n * sizeof(value_type)));
3580
+ for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
3581
+ ::new (__r.__end_) value_type(__f(*__p));
3582
+ }
3583
+ return __r;
3584
+ }
3585
+
3586
+ template <class _Tp>
3587
+ void
3588
+ valarray<_Tp>::resize(size_t __n, value_type __x)
3589
+ {
3590
+ if (__begin_ != nullptr)
3591
+ {
3592
+ while (__end_ != __begin_)
3593
+ (--__end_)->~value_type();
3594
+ ::operator delete(__begin_);
3595
+ __begin_ = __end_ = nullptr;
3596
+ }
3597
+ if (__n)
3598
+ {
3599
+ __begin_ = __end_ = static_cast<value_type*>(::operator new(__n * sizeof(value_type)));
3600
+ #ifndef _LIBCPP_NO_EXCEPTIONS
3601
+ try
3602
+ {
3603
+ #endif // _LIBCPP_NO_EXCEPTIONS
3604
+ for (; __n; --__n, ++__end_)
3605
+ ::new (__end_) value_type(__x);
3606
+ #ifndef _LIBCPP_NO_EXCEPTIONS
3607
+ }
3608
+ catch (...)
3609
+ {
3610
+ resize(0);
3611
+ throw;
3612
+ }
3613
+ #endif // _LIBCPP_NO_EXCEPTIONS
3614
+ }
3615
+ }
3616
+
3617
+ template<class _Tp>
3618
+ inline _LIBCPP_INLINE_VISIBILITY
3619
+ void
3620
+ swap(valarray<_Tp>& __x, valarray<_Tp>& __y) _NOEXCEPT
3621
+ {
3622
+ __x.swap(__y);
3623
+ }
3624
+
3625
+ template<class _Expr1, class _Expr2>
3626
+ inline _LIBCPP_INLINE_VISIBILITY
3627
+ typename enable_if
3628
+ <
3629
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
3630
+ __val_expr<_BinaryOp<multiplies<typename _Expr1::value_type>, _Expr1, _Expr2> >
3631
+ >::type
3632
+ operator*(const _Expr1& __x, const _Expr2& __y)
3633
+ {
3634
+ typedef typename _Expr1::value_type value_type;
3635
+ typedef _BinaryOp<multiplies<value_type>, _Expr1, _Expr2> _Op;
3636
+ return __val_expr<_Op>(_Op(multiplies<value_type>(), __x, __y));
3637
+ }
3638
+
3639
+ template<class _Expr>
3640
+ inline _LIBCPP_INLINE_VISIBILITY
3641
+ typename enable_if
3642
+ <
3643
+ __is_val_expr<_Expr>::value,
3644
+ __val_expr<_BinaryOp<multiplies<typename _Expr::value_type>,
3645
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
3646
+ >::type
3647
+ operator*(const _Expr& __x, const typename _Expr::value_type& __y)
3648
+ {
3649
+ typedef typename _Expr::value_type value_type;
3650
+ typedef _BinaryOp<multiplies<value_type>, _Expr, __scalar_expr<value_type> > _Op;
3651
+ return __val_expr<_Op>(_Op(multiplies<value_type>(),
3652
+ __x, __scalar_expr<value_type>(__y, __x.size())));
3653
+ }
3654
+
3655
+ template<class _Expr>
3656
+ inline _LIBCPP_INLINE_VISIBILITY
3657
+ typename enable_if
3658
+ <
3659
+ __is_val_expr<_Expr>::value,
3660
+ __val_expr<_BinaryOp<multiplies<typename _Expr::value_type>,
3661
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
3662
+ >::type
3663
+ operator*(const typename _Expr::value_type& __x, const _Expr& __y)
3664
+ {
3665
+ typedef typename _Expr::value_type value_type;
3666
+ typedef _BinaryOp<multiplies<value_type>, __scalar_expr<value_type>, _Expr> _Op;
3667
+ return __val_expr<_Op>(_Op(multiplies<value_type>(),
3668
+ __scalar_expr<value_type>(__x, __y.size()), __y));
3669
+ }
3670
+
3671
+ template<class _Expr1, class _Expr2>
3672
+ inline _LIBCPP_INLINE_VISIBILITY
3673
+ typename enable_if
3674
+ <
3675
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
3676
+ __val_expr<_BinaryOp<divides<typename _Expr1::value_type>, _Expr1, _Expr2> >
3677
+ >::type
3678
+ operator/(const _Expr1& __x, const _Expr2& __y)
3679
+ {
3680
+ typedef typename _Expr1::value_type value_type;
3681
+ typedef _BinaryOp<divides<value_type>, _Expr1, _Expr2> _Op;
3682
+ return __val_expr<_Op>(_Op(divides<value_type>(), __x, __y));
3683
+ }
3684
+
3685
+ template<class _Expr>
3686
+ inline _LIBCPP_INLINE_VISIBILITY
3687
+ typename enable_if
3688
+ <
3689
+ __is_val_expr<_Expr>::value,
3690
+ __val_expr<_BinaryOp<divides<typename _Expr::value_type>,
3691
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
3692
+ >::type
3693
+ operator/(const _Expr& __x, const typename _Expr::value_type& __y)
3694
+ {
3695
+ typedef typename _Expr::value_type value_type;
3696
+ typedef _BinaryOp<divides<value_type>, _Expr, __scalar_expr<value_type> > _Op;
3697
+ return __val_expr<_Op>(_Op(divides<value_type>(),
3698
+ __x, __scalar_expr<value_type>(__y, __x.size())));
3699
+ }
3700
+
3701
+ template<class _Expr>
3702
+ inline _LIBCPP_INLINE_VISIBILITY
3703
+ typename enable_if
3704
+ <
3705
+ __is_val_expr<_Expr>::value,
3706
+ __val_expr<_BinaryOp<divides<typename _Expr::value_type>,
3707
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
3708
+ >::type
3709
+ operator/(const typename _Expr::value_type& __x, const _Expr& __y)
3710
+ {
3711
+ typedef typename _Expr::value_type value_type;
3712
+ typedef _BinaryOp<divides<value_type>, __scalar_expr<value_type>, _Expr> _Op;
3713
+ return __val_expr<_Op>(_Op(divides<value_type>(),
3714
+ __scalar_expr<value_type>(__x, __y.size()), __y));
3715
+ }
3716
+
3717
+ template<class _Expr1, class _Expr2>
3718
+ inline _LIBCPP_INLINE_VISIBILITY
3719
+ typename enable_if
3720
+ <
3721
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
3722
+ __val_expr<_BinaryOp<modulus<typename _Expr1::value_type>, _Expr1, _Expr2> >
3723
+ >::type
3724
+ operator%(const _Expr1& __x, const _Expr2& __y)
3725
+ {
3726
+ typedef typename _Expr1::value_type value_type;
3727
+ typedef _BinaryOp<modulus<value_type>, _Expr1, _Expr2> _Op;
3728
+ return __val_expr<_Op>(_Op(modulus<value_type>(), __x, __y));
3729
+ }
3730
+
3731
+ template<class _Expr>
3732
+ inline _LIBCPP_INLINE_VISIBILITY
3733
+ typename enable_if
3734
+ <
3735
+ __is_val_expr<_Expr>::value,
3736
+ __val_expr<_BinaryOp<modulus<typename _Expr::value_type>,
3737
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
3738
+ >::type
3739
+ operator%(const _Expr& __x, const typename _Expr::value_type& __y)
3740
+ {
3741
+ typedef typename _Expr::value_type value_type;
3742
+ typedef _BinaryOp<modulus<value_type>, _Expr, __scalar_expr<value_type> > _Op;
3743
+ return __val_expr<_Op>(_Op(modulus<value_type>(),
3744
+ __x, __scalar_expr<value_type>(__y, __x.size())));
3745
+ }
3746
+
3747
+ template<class _Expr>
3748
+ inline _LIBCPP_INLINE_VISIBILITY
3749
+ typename enable_if
3750
+ <
3751
+ __is_val_expr<_Expr>::value,
3752
+ __val_expr<_BinaryOp<modulus<typename _Expr::value_type>,
3753
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
3754
+ >::type
3755
+ operator%(const typename _Expr::value_type& __x, const _Expr& __y)
3756
+ {
3757
+ typedef typename _Expr::value_type value_type;
3758
+ typedef _BinaryOp<modulus<value_type>, __scalar_expr<value_type>, _Expr> _Op;
3759
+ return __val_expr<_Op>(_Op(modulus<value_type>(),
3760
+ __scalar_expr<value_type>(__x, __y.size()), __y));
3761
+ }
3762
+
3763
+ template<class _Expr1, class _Expr2>
3764
+ inline _LIBCPP_INLINE_VISIBILITY
3765
+ typename enable_if
3766
+ <
3767
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
3768
+ __val_expr<_BinaryOp<plus<typename _Expr1::value_type>, _Expr1, _Expr2> >
3769
+ >::type
3770
+ operator+(const _Expr1& __x, const _Expr2& __y)
3771
+ {
3772
+ typedef typename _Expr1::value_type value_type;
3773
+ typedef _BinaryOp<plus<value_type>, _Expr1, _Expr2> _Op;
3774
+ return __val_expr<_Op>(_Op(plus<value_type>(), __x, __y));
3775
+ }
3776
+
3777
+ template<class _Expr>
3778
+ inline _LIBCPP_INLINE_VISIBILITY
3779
+ typename enable_if
3780
+ <
3781
+ __is_val_expr<_Expr>::value,
3782
+ __val_expr<_BinaryOp<plus<typename _Expr::value_type>,
3783
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
3784
+ >::type
3785
+ operator+(const _Expr& __x, const typename _Expr::value_type& __y)
3786
+ {
3787
+ typedef typename _Expr::value_type value_type;
3788
+ typedef _BinaryOp<plus<value_type>, _Expr, __scalar_expr<value_type> > _Op;
3789
+ return __val_expr<_Op>(_Op(plus<value_type>(),
3790
+ __x, __scalar_expr<value_type>(__y, __x.size())));
3791
+ }
3792
+
3793
+ template<class _Expr>
3794
+ inline _LIBCPP_INLINE_VISIBILITY
3795
+ typename enable_if
3796
+ <
3797
+ __is_val_expr<_Expr>::value,
3798
+ __val_expr<_BinaryOp<plus<typename _Expr::value_type>,
3799
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
3800
+ >::type
3801
+ operator+(const typename _Expr::value_type& __x, const _Expr& __y)
3802
+ {
3803
+ typedef typename _Expr::value_type value_type;
3804
+ typedef _BinaryOp<plus<value_type>, __scalar_expr<value_type>, _Expr> _Op;
3805
+ return __val_expr<_Op>(_Op(plus<value_type>(),
3806
+ __scalar_expr<value_type>(__x, __y.size()), __y));
3807
+ }
3808
+
3809
+ template<class _Expr1, class _Expr2>
3810
+ inline _LIBCPP_INLINE_VISIBILITY
3811
+ typename enable_if
3812
+ <
3813
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
3814
+ __val_expr<_BinaryOp<minus<typename _Expr1::value_type>, _Expr1, _Expr2> >
3815
+ >::type
3816
+ operator-(const _Expr1& __x, const _Expr2& __y)
3817
+ {
3818
+ typedef typename _Expr1::value_type value_type;
3819
+ typedef _BinaryOp<minus<value_type>, _Expr1, _Expr2> _Op;
3820
+ return __val_expr<_Op>(_Op(minus<value_type>(), __x, __y));
3821
+ }
3822
+
3823
+ template<class _Expr>
3824
+ inline _LIBCPP_INLINE_VISIBILITY
3825
+ typename enable_if
3826
+ <
3827
+ __is_val_expr<_Expr>::value,
3828
+ __val_expr<_BinaryOp<minus<typename _Expr::value_type>,
3829
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
3830
+ >::type
3831
+ operator-(const _Expr& __x, const typename _Expr::value_type& __y)
3832
+ {
3833
+ typedef typename _Expr::value_type value_type;
3834
+ typedef _BinaryOp<minus<value_type>, _Expr, __scalar_expr<value_type> > _Op;
3835
+ return __val_expr<_Op>(_Op(minus<value_type>(),
3836
+ __x, __scalar_expr<value_type>(__y, __x.size())));
3837
+ }
3838
+
3839
+ template<class _Expr>
3840
+ inline _LIBCPP_INLINE_VISIBILITY
3841
+ typename enable_if
3842
+ <
3843
+ __is_val_expr<_Expr>::value,
3844
+ __val_expr<_BinaryOp<minus<typename _Expr::value_type>,
3845
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
3846
+ >::type
3847
+ operator-(const typename _Expr::value_type& __x, const _Expr& __y)
3848
+ {
3849
+ typedef typename _Expr::value_type value_type;
3850
+ typedef _BinaryOp<minus<value_type>, __scalar_expr<value_type>, _Expr> _Op;
3851
+ return __val_expr<_Op>(_Op(minus<value_type>(),
3852
+ __scalar_expr<value_type>(__x, __y.size()), __y));
3853
+ }
3854
+
3855
+ template<class _Expr1, class _Expr2>
3856
+ inline _LIBCPP_INLINE_VISIBILITY
3857
+ typename enable_if
3858
+ <
3859
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
3860
+ __val_expr<_BinaryOp<bit_xor<typename _Expr1::value_type>, _Expr1, _Expr2> >
3861
+ >::type
3862
+ operator^(const _Expr1& __x, const _Expr2& __y)
3863
+ {
3864
+ typedef typename _Expr1::value_type value_type;
3865
+ typedef _BinaryOp<bit_xor<value_type>, _Expr1, _Expr2> _Op;
3866
+ return __val_expr<_Op>(_Op(bit_xor<value_type>(), __x, __y));
3867
+ }
3868
+
3869
+ template<class _Expr>
3870
+ inline _LIBCPP_INLINE_VISIBILITY
3871
+ typename enable_if
3872
+ <
3873
+ __is_val_expr<_Expr>::value,
3874
+ __val_expr<_BinaryOp<bit_xor<typename _Expr::value_type>,
3875
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
3876
+ >::type
3877
+ operator^(const _Expr& __x, const typename _Expr::value_type& __y)
3878
+ {
3879
+ typedef typename _Expr::value_type value_type;
3880
+ typedef _BinaryOp<bit_xor<value_type>, _Expr, __scalar_expr<value_type> > _Op;
3881
+ return __val_expr<_Op>(_Op(bit_xor<value_type>(),
3882
+ __x, __scalar_expr<value_type>(__y, __x.size())));
3883
+ }
3884
+
3885
+ template<class _Expr>
3886
+ inline _LIBCPP_INLINE_VISIBILITY
3887
+ typename enable_if
3888
+ <
3889
+ __is_val_expr<_Expr>::value,
3890
+ __val_expr<_BinaryOp<bit_xor<typename _Expr::value_type>,
3891
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
3892
+ >::type
3893
+ operator^(const typename _Expr::value_type& __x, const _Expr& __y)
3894
+ {
3895
+ typedef typename _Expr::value_type value_type;
3896
+ typedef _BinaryOp<bit_xor<value_type>, __scalar_expr<value_type>, _Expr> _Op;
3897
+ return __val_expr<_Op>(_Op(bit_xor<value_type>(),
3898
+ __scalar_expr<value_type>(__x, __y.size()), __y));
3899
+ }
3900
+
3901
+ template<class _Expr1, class _Expr2>
3902
+ inline _LIBCPP_INLINE_VISIBILITY
3903
+ typename enable_if
3904
+ <
3905
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
3906
+ __val_expr<_BinaryOp<bit_and<typename _Expr1::value_type>, _Expr1, _Expr2> >
3907
+ >::type
3908
+ operator&(const _Expr1& __x, const _Expr2& __y)
3909
+ {
3910
+ typedef typename _Expr1::value_type value_type;
3911
+ typedef _BinaryOp<bit_and<value_type>, _Expr1, _Expr2> _Op;
3912
+ return __val_expr<_Op>(_Op(bit_and<value_type>(), __x, __y));
3913
+ }
3914
+
3915
+ template<class _Expr>
3916
+ inline _LIBCPP_INLINE_VISIBILITY
3917
+ typename enable_if
3918
+ <
3919
+ __is_val_expr<_Expr>::value,
3920
+ __val_expr<_BinaryOp<bit_and<typename _Expr::value_type>,
3921
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
3922
+ >::type
3923
+ operator&(const _Expr& __x, const typename _Expr::value_type& __y)
3924
+ {
3925
+ typedef typename _Expr::value_type value_type;
3926
+ typedef _BinaryOp<bit_and<value_type>, _Expr, __scalar_expr<value_type> > _Op;
3927
+ return __val_expr<_Op>(_Op(bit_and<value_type>(),
3928
+ __x, __scalar_expr<value_type>(__y, __x.size())));
3929
+ }
3930
+
3931
+ template<class _Expr>
3932
+ inline _LIBCPP_INLINE_VISIBILITY
3933
+ typename enable_if
3934
+ <
3935
+ __is_val_expr<_Expr>::value,
3936
+ __val_expr<_BinaryOp<bit_and<typename _Expr::value_type>,
3937
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
3938
+ >::type
3939
+ operator&(const typename _Expr::value_type& __x, const _Expr& __y)
3940
+ {
3941
+ typedef typename _Expr::value_type value_type;
3942
+ typedef _BinaryOp<bit_and<value_type>, __scalar_expr<value_type>, _Expr> _Op;
3943
+ return __val_expr<_Op>(_Op(bit_and<value_type>(),
3944
+ __scalar_expr<value_type>(__x, __y.size()), __y));
3945
+ }
3946
+
3947
+ template<class _Expr1, class _Expr2>
3948
+ inline _LIBCPP_INLINE_VISIBILITY
3949
+ typename enable_if
3950
+ <
3951
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
3952
+ __val_expr<_BinaryOp<bit_or<typename _Expr1::value_type>, _Expr1, _Expr2> >
3953
+ >::type
3954
+ operator|(const _Expr1& __x, const _Expr2& __y)
3955
+ {
3956
+ typedef typename _Expr1::value_type value_type;
3957
+ typedef _BinaryOp<bit_or<value_type>, _Expr1, _Expr2> _Op;
3958
+ return __val_expr<_Op>(_Op(bit_or<value_type>(), __x, __y));
3959
+ }
3960
+
3961
+ template<class _Expr>
3962
+ inline _LIBCPP_INLINE_VISIBILITY
3963
+ typename enable_if
3964
+ <
3965
+ __is_val_expr<_Expr>::value,
3966
+ __val_expr<_BinaryOp<bit_or<typename _Expr::value_type>,
3967
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
3968
+ >::type
3969
+ operator|(const _Expr& __x, const typename _Expr::value_type& __y)
3970
+ {
3971
+ typedef typename _Expr::value_type value_type;
3972
+ typedef _BinaryOp<bit_or<value_type>, _Expr, __scalar_expr<value_type> > _Op;
3973
+ return __val_expr<_Op>(_Op(bit_or<value_type>(),
3974
+ __x, __scalar_expr<value_type>(__y, __x.size())));
3975
+ }
3976
+
3977
+ template<class _Expr>
3978
+ inline _LIBCPP_INLINE_VISIBILITY
3979
+ typename enable_if
3980
+ <
3981
+ __is_val_expr<_Expr>::value,
3982
+ __val_expr<_BinaryOp<bit_or<typename _Expr::value_type>,
3983
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
3984
+ >::type
3985
+ operator|(const typename _Expr::value_type& __x, const _Expr& __y)
3986
+ {
3987
+ typedef typename _Expr::value_type value_type;
3988
+ typedef _BinaryOp<bit_or<value_type>, __scalar_expr<value_type>, _Expr> _Op;
3989
+ return __val_expr<_Op>(_Op(bit_or<value_type>(),
3990
+ __scalar_expr<value_type>(__x, __y.size()), __y));
3991
+ }
3992
+
3993
+ template<class _Expr1, class _Expr2>
3994
+ inline _LIBCPP_INLINE_VISIBILITY
3995
+ typename enable_if
3996
+ <
3997
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
3998
+ __val_expr<_BinaryOp<__bit_shift_left<typename _Expr1::value_type>, _Expr1, _Expr2> >
3999
+ >::type
4000
+ operator<<(const _Expr1& __x, const _Expr2& __y)
4001
+ {
4002
+ typedef typename _Expr1::value_type value_type;
4003
+ typedef _BinaryOp<__bit_shift_left<value_type>, _Expr1, _Expr2> _Op;
4004
+ return __val_expr<_Op>(_Op(__bit_shift_left<value_type>(), __x, __y));
4005
+ }
4006
+
4007
+ template<class _Expr>
4008
+ inline _LIBCPP_INLINE_VISIBILITY
4009
+ typename enable_if
4010
+ <
4011
+ __is_val_expr<_Expr>::value,
4012
+ __val_expr<_BinaryOp<__bit_shift_left<typename _Expr::value_type>,
4013
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
4014
+ >::type
4015
+ operator<<(const _Expr& __x, const typename _Expr::value_type& __y)
4016
+ {
4017
+ typedef typename _Expr::value_type value_type;
4018
+ typedef _BinaryOp<__bit_shift_left<value_type>, _Expr, __scalar_expr<value_type> > _Op;
4019
+ return __val_expr<_Op>(_Op(__bit_shift_left<value_type>(),
4020
+ __x, __scalar_expr<value_type>(__y, __x.size())));
4021
+ }
4022
+
4023
+ template<class _Expr>
4024
+ inline _LIBCPP_INLINE_VISIBILITY
4025
+ typename enable_if
4026
+ <
4027
+ __is_val_expr<_Expr>::value,
4028
+ __val_expr<_BinaryOp<__bit_shift_left<typename _Expr::value_type>,
4029
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
4030
+ >::type
4031
+ operator<<(const typename _Expr::value_type& __x, const _Expr& __y)
4032
+ {
4033
+ typedef typename _Expr::value_type value_type;
4034
+ typedef _BinaryOp<__bit_shift_left<value_type>, __scalar_expr<value_type>, _Expr> _Op;
4035
+ return __val_expr<_Op>(_Op(__bit_shift_left<value_type>(),
4036
+ __scalar_expr<value_type>(__x, __y.size()), __y));
4037
+ }
4038
+
4039
+ template<class _Expr1, class _Expr2>
4040
+ inline _LIBCPP_INLINE_VISIBILITY
4041
+ typename enable_if
4042
+ <
4043
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
4044
+ __val_expr<_BinaryOp<__bit_shift_right<typename _Expr1::value_type>, _Expr1, _Expr2> >
4045
+ >::type
4046
+ operator>>(const _Expr1& __x, const _Expr2& __y)
4047
+ {
4048
+ typedef typename _Expr1::value_type value_type;
4049
+ typedef _BinaryOp<__bit_shift_right<value_type>, _Expr1, _Expr2> _Op;
4050
+ return __val_expr<_Op>(_Op(__bit_shift_right<value_type>(), __x, __y));
4051
+ }
4052
+
4053
+ template<class _Expr>
4054
+ inline _LIBCPP_INLINE_VISIBILITY
4055
+ typename enable_if
4056
+ <
4057
+ __is_val_expr<_Expr>::value,
4058
+ __val_expr<_BinaryOp<__bit_shift_right<typename _Expr::value_type>,
4059
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
4060
+ >::type
4061
+ operator>>(const _Expr& __x, const typename _Expr::value_type& __y)
4062
+ {
4063
+ typedef typename _Expr::value_type value_type;
4064
+ typedef _BinaryOp<__bit_shift_right<value_type>, _Expr, __scalar_expr<value_type> > _Op;
4065
+ return __val_expr<_Op>(_Op(__bit_shift_right<value_type>(),
4066
+ __x, __scalar_expr<value_type>(__y, __x.size())));
4067
+ }
4068
+
4069
+ template<class _Expr>
4070
+ inline _LIBCPP_INLINE_VISIBILITY
4071
+ typename enable_if
4072
+ <
4073
+ __is_val_expr<_Expr>::value,
4074
+ __val_expr<_BinaryOp<__bit_shift_right<typename _Expr::value_type>,
4075
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
4076
+ >::type
4077
+ operator>>(const typename _Expr::value_type& __x, const _Expr& __y)
4078
+ {
4079
+ typedef typename _Expr::value_type value_type;
4080
+ typedef _BinaryOp<__bit_shift_right<value_type>, __scalar_expr<value_type>, _Expr> _Op;
4081
+ return __val_expr<_Op>(_Op(__bit_shift_right<value_type>(),
4082
+ __scalar_expr<value_type>(__x, __y.size()), __y));
4083
+ }
4084
+
4085
+ template<class _Expr1, class _Expr2>
4086
+ inline _LIBCPP_INLINE_VISIBILITY
4087
+ typename enable_if
4088
+ <
4089
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
4090
+ __val_expr<_BinaryOp<logical_and<typename _Expr1::value_type>, _Expr1, _Expr2> >
4091
+ >::type
4092
+ operator&&(const _Expr1& __x, const _Expr2& __y)
4093
+ {
4094
+ typedef typename _Expr1::value_type value_type;
4095
+ typedef _BinaryOp<logical_and<value_type>, _Expr1, _Expr2> _Op;
4096
+ return __val_expr<_Op>(_Op(logical_and<value_type>(), __x, __y));
4097
+ }
4098
+
4099
+ template<class _Expr>
4100
+ inline _LIBCPP_INLINE_VISIBILITY
4101
+ typename enable_if
4102
+ <
4103
+ __is_val_expr<_Expr>::value,
4104
+ __val_expr<_BinaryOp<logical_and<typename _Expr::value_type>,
4105
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
4106
+ >::type
4107
+ operator&&(const _Expr& __x, const typename _Expr::value_type& __y)
4108
+ {
4109
+ typedef typename _Expr::value_type value_type;
4110
+ typedef _BinaryOp<logical_and<value_type>, _Expr, __scalar_expr<value_type> > _Op;
4111
+ return __val_expr<_Op>(_Op(logical_and<value_type>(),
4112
+ __x, __scalar_expr<value_type>(__y, __x.size())));
4113
+ }
4114
+
4115
+ template<class _Expr>
4116
+ inline _LIBCPP_INLINE_VISIBILITY
4117
+ typename enable_if
4118
+ <
4119
+ __is_val_expr<_Expr>::value,
4120
+ __val_expr<_BinaryOp<logical_and<typename _Expr::value_type>,
4121
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
4122
+ >::type
4123
+ operator&&(const typename _Expr::value_type& __x, const _Expr& __y)
4124
+ {
4125
+ typedef typename _Expr::value_type value_type;
4126
+ typedef _BinaryOp<logical_and<value_type>, __scalar_expr<value_type>, _Expr> _Op;
4127
+ return __val_expr<_Op>(_Op(logical_and<value_type>(),
4128
+ __scalar_expr<value_type>(__x, __y.size()), __y));
4129
+ }
4130
+
4131
+ template<class _Expr1, class _Expr2>
4132
+ inline _LIBCPP_INLINE_VISIBILITY
4133
+ typename enable_if
4134
+ <
4135
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
4136
+ __val_expr<_BinaryOp<logical_or<typename _Expr1::value_type>, _Expr1, _Expr2> >
4137
+ >::type
4138
+ operator||(const _Expr1& __x, const _Expr2& __y)
4139
+ {
4140
+ typedef typename _Expr1::value_type value_type;
4141
+ typedef _BinaryOp<logical_or<value_type>, _Expr1, _Expr2> _Op;
4142
+ return __val_expr<_Op>(_Op(logical_or<value_type>(), __x, __y));
4143
+ }
4144
+
4145
+ template<class _Expr>
4146
+ inline _LIBCPP_INLINE_VISIBILITY
4147
+ typename enable_if
4148
+ <
4149
+ __is_val_expr<_Expr>::value,
4150
+ __val_expr<_BinaryOp<logical_or<typename _Expr::value_type>,
4151
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
4152
+ >::type
4153
+ operator||(const _Expr& __x, const typename _Expr::value_type& __y)
4154
+ {
4155
+ typedef typename _Expr::value_type value_type;
4156
+ typedef _BinaryOp<logical_or<value_type>, _Expr, __scalar_expr<value_type> > _Op;
4157
+ return __val_expr<_Op>(_Op(logical_or<value_type>(),
4158
+ __x, __scalar_expr<value_type>(__y, __x.size())));
4159
+ }
4160
+
4161
+ template<class _Expr>
4162
+ inline _LIBCPP_INLINE_VISIBILITY
4163
+ typename enable_if
4164
+ <
4165
+ __is_val_expr<_Expr>::value,
4166
+ __val_expr<_BinaryOp<logical_or<typename _Expr::value_type>,
4167
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
4168
+ >::type
4169
+ operator||(const typename _Expr::value_type& __x, const _Expr& __y)
4170
+ {
4171
+ typedef typename _Expr::value_type value_type;
4172
+ typedef _BinaryOp<logical_or<value_type>, __scalar_expr<value_type>, _Expr> _Op;
4173
+ return __val_expr<_Op>(_Op(logical_or<value_type>(),
4174
+ __scalar_expr<value_type>(__x, __y.size()), __y));
4175
+ }
4176
+
4177
+ template<class _Expr1, class _Expr2>
4178
+ inline _LIBCPP_INLINE_VISIBILITY
4179
+ typename enable_if
4180
+ <
4181
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
4182
+ __val_expr<_BinaryOp<equal_to<typename _Expr1::value_type>, _Expr1, _Expr2> >
4183
+ >::type
4184
+ operator==(const _Expr1& __x, const _Expr2& __y)
4185
+ {
4186
+ typedef typename _Expr1::value_type value_type;
4187
+ typedef _BinaryOp<equal_to<value_type>, _Expr1, _Expr2> _Op;
4188
+ return __val_expr<_Op>(_Op(equal_to<value_type>(), __x, __y));
4189
+ }
4190
+
4191
+ template<class _Expr>
4192
+ inline _LIBCPP_INLINE_VISIBILITY
4193
+ typename enable_if
4194
+ <
4195
+ __is_val_expr<_Expr>::value,
4196
+ __val_expr<_BinaryOp<equal_to<typename _Expr::value_type>,
4197
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
4198
+ >::type
4199
+ operator==(const _Expr& __x, const typename _Expr::value_type& __y)
4200
+ {
4201
+ typedef typename _Expr::value_type value_type;
4202
+ typedef _BinaryOp<equal_to<value_type>, _Expr, __scalar_expr<value_type> > _Op;
4203
+ return __val_expr<_Op>(_Op(equal_to<value_type>(),
4204
+ __x, __scalar_expr<value_type>(__y, __x.size())));
4205
+ }
4206
+
4207
+ template<class _Expr>
4208
+ inline _LIBCPP_INLINE_VISIBILITY
4209
+ typename enable_if
4210
+ <
4211
+ __is_val_expr<_Expr>::value,
4212
+ __val_expr<_BinaryOp<equal_to<typename _Expr::value_type>,
4213
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
4214
+ >::type
4215
+ operator==(const typename _Expr::value_type& __x, const _Expr& __y)
4216
+ {
4217
+ typedef typename _Expr::value_type value_type;
4218
+ typedef _BinaryOp<equal_to<value_type>, __scalar_expr<value_type>, _Expr> _Op;
4219
+ return __val_expr<_Op>(_Op(equal_to<value_type>(),
4220
+ __scalar_expr<value_type>(__x, __y.size()), __y));
4221
+ }
4222
+
4223
+ template<class _Expr1, class _Expr2>
4224
+ inline _LIBCPP_INLINE_VISIBILITY
4225
+ typename enable_if
4226
+ <
4227
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
4228
+ __val_expr<_BinaryOp<not_equal_to<typename _Expr1::value_type>, _Expr1, _Expr2> >
4229
+ >::type
4230
+ operator!=(const _Expr1& __x, const _Expr2& __y)
4231
+ {
4232
+ typedef typename _Expr1::value_type value_type;
4233
+ typedef _BinaryOp<not_equal_to<value_type>, _Expr1, _Expr2> _Op;
4234
+ return __val_expr<_Op>(_Op(not_equal_to<value_type>(), __x, __y));
4235
+ }
4236
+
4237
+ template<class _Expr>
4238
+ inline _LIBCPP_INLINE_VISIBILITY
4239
+ typename enable_if
4240
+ <
4241
+ __is_val_expr<_Expr>::value,
4242
+ __val_expr<_BinaryOp<not_equal_to<typename _Expr::value_type>,
4243
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
4244
+ >::type
4245
+ operator!=(const _Expr& __x, const typename _Expr::value_type& __y)
4246
+ {
4247
+ typedef typename _Expr::value_type value_type;
4248
+ typedef _BinaryOp<not_equal_to<value_type>, _Expr, __scalar_expr<value_type> > _Op;
4249
+ return __val_expr<_Op>(_Op(not_equal_to<value_type>(),
4250
+ __x, __scalar_expr<value_type>(__y, __x.size())));
4251
+ }
4252
+
4253
+ template<class _Expr>
4254
+ inline _LIBCPP_INLINE_VISIBILITY
4255
+ typename enable_if
4256
+ <
4257
+ __is_val_expr<_Expr>::value,
4258
+ __val_expr<_BinaryOp<not_equal_to<typename _Expr::value_type>,
4259
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
4260
+ >::type
4261
+ operator!=(const typename _Expr::value_type& __x, const _Expr& __y)
4262
+ {
4263
+ typedef typename _Expr::value_type value_type;
4264
+ typedef _BinaryOp<not_equal_to<value_type>, __scalar_expr<value_type>, _Expr> _Op;
4265
+ return __val_expr<_Op>(_Op(not_equal_to<value_type>(),
4266
+ __scalar_expr<value_type>(__x, __y.size()), __y));
4267
+ }
4268
+
4269
+ template<class _Expr1, class _Expr2>
4270
+ inline _LIBCPP_INLINE_VISIBILITY
4271
+ typename enable_if
4272
+ <
4273
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
4274
+ __val_expr<_BinaryOp<less<typename _Expr1::value_type>, _Expr1, _Expr2> >
4275
+ >::type
4276
+ operator<(const _Expr1& __x, const _Expr2& __y)
4277
+ {
4278
+ typedef typename _Expr1::value_type value_type;
4279
+ typedef _BinaryOp<less<value_type>, _Expr1, _Expr2> _Op;
4280
+ return __val_expr<_Op>(_Op(less<value_type>(), __x, __y));
4281
+ }
4282
+
4283
+ template<class _Expr>
4284
+ inline _LIBCPP_INLINE_VISIBILITY
4285
+ typename enable_if
4286
+ <
4287
+ __is_val_expr<_Expr>::value,
4288
+ __val_expr<_BinaryOp<less<typename _Expr::value_type>,
4289
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
4290
+ >::type
4291
+ operator<(const _Expr& __x, const typename _Expr::value_type& __y)
4292
+ {
4293
+ typedef typename _Expr::value_type value_type;
4294
+ typedef _BinaryOp<less<value_type>, _Expr, __scalar_expr<value_type> > _Op;
4295
+ return __val_expr<_Op>(_Op(less<value_type>(),
4296
+ __x, __scalar_expr<value_type>(__y, __x.size())));
4297
+ }
4298
+
4299
+ template<class _Expr>
4300
+ inline _LIBCPP_INLINE_VISIBILITY
4301
+ typename enable_if
4302
+ <
4303
+ __is_val_expr<_Expr>::value,
4304
+ __val_expr<_BinaryOp<less<typename _Expr::value_type>,
4305
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
4306
+ >::type
4307
+ operator<(const typename _Expr::value_type& __x, const _Expr& __y)
4308
+ {
4309
+ typedef typename _Expr::value_type value_type;
4310
+ typedef _BinaryOp<less<value_type>, __scalar_expr<value_type>, _Expr> _Op;
4311
+ return __val_expr<_Op>(_Op(less<value_type>(),
4312
+ __scalar_expr<value_type>(__x, __y.size()), __y));
4313
+ }
4314
+
4315
+ template<class _Expr1, class _Expr2>
4316
+ inline _LIBCPP_INLINE_VISIBILITY
4317
+ typename enable_if
4318
+ <
4319
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
4320
+ __val_expr<_BinaryOp<greater<typename _Expr1::value_type>, _Expr1, _Expr2> >
4321
+ >::type
4322
+ operator>(const _Expr1& __x, const _Expr2& __y)
4323
+ {
4324
+ typedef typename _Expr1::value_type value_type;
4325
+ typedef _BinaryOp<greater<value_type>, _Expr1, _Expr2> _Op;
4326
+ return __val_expr<_Op>(_Op(greater<value_type>(), __x, __y));
4327
+ }
4328
+
4329
+ template<class _Expr>
4330
+ inline _LIBCPP_INLINE_VISIBILITY
4331
+ typename enable_if
4332
+ <
4333
+ __is_val_expr<_Expr>::value,
4334
+ __val_expr<_BinaryOp<greater<typename _Expr::value_type>,
4335
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
4336
+ >::type
4337
+ operator>(const _Expr& __x, const typename _Expr::value_type& __y)
4338
+ {
4339
+ typedef typename _Expr::value_type value_type;
4340
+ typedef _BinaryOp<greater<value_type>, _Expr, __scalar_expr<value_type> > _Op;
4341
+ return __val_expr<_Op>(_Op(greater<value_type>(),
4342
+ __x, __scalar_expr<value_type>(__y, __x.size())));
4343
+ }
4344
+
4345
+ template<class _Expr>
4346
+ inline _LIBCPP_INLINE_VISIBILITY
4347
+ typename enable_if
4348
+ <
4349
+ __is_val_expr<_Expr>::value,
4350
+ __val_expr<_BinaryOp<greater<typename _Expr::value_type>,
4351
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
4352
+ >::type
4353
+ operator>(const typename _Expr::value_type& __x, const _Expr& __y)
4354
+ {
4355
+ typedef typename _Expr::value_type value_type;
4356
+ typedef _BinaryOp<greater<value_type>, __scalar_expr<value_type>, _Expr> _Op;
4357
+ return __val_expr<_Op>(_Op(greater<value_type>(),
4358
+ __scalar_expr<value_type>(__x, __y.size()), __y));
4359
+ }
4360
+
4361
+ template<class _Expr1, class _Expr2>
4362
+ inline _LIBCPP_INLINE_VISIBILITY
4363
+ typename enable_if
4364
+ <
4365
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
4366
+ __val_expr<_BinaryOp<less_equal<typename _Expr1::value_type>, _Expr1, _Expr2> >
4367
+ >::type
4368
+ operator<=(const _Expr1& __x, const _Expr2& __y)
4369
+ {
4370
+ typedef typename _Expr1::value_type value_type;
4371
+ typedef _BinaryOp<less_equal<value_type>, _Expr1, _Expr2> _Op;
4372
+ return __val_expr<_Op>(_Op(less_equal<value_type>(), __x, __y));
4373
+ }
4374
+
4375
+ template<class _Expr>
4376
+ inline _LIBCPP_INLINE_VISIBILITY
4377
+ typename enable_if
4378
+ <
4379
+ __is_val_expr<_Expr>::value,
4380
+ __val_expr<_BinaryOp<less_equal<typename _Expr::value_type>,
4381
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
4382
+ >::type
4383
+ operator<=(const _Expr& __x, const typename _Expr::value_type& __y)
4384
+ {
4385
+ typedef typename _Expr::value_type value_type;
4386
+ typedef _BinaryOp<less_equal<value_type>, _Expr, __scalar_expr<value_type> > _Op;
4387
+ return __val_expr<_Op>(_Op(less_equal<value_type>(),
4388
+ __x, __scalar_expr<value_type>(__y, __x.size())));
4389
+ }
4390
+
4391
+ template<class _Expr>
4392
+ inline _LIBCPP_INLINE_VISIBILITY
4393
+ typename enable_if
4394
+ <
4395
+ __is_val_expr<_Expr>::value,
4396
+ __val_expr<_BinaryOp<less_equal<typename _Expr::value_type>,
4397
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
4398
+ >::type
4399
+ operator<=(const typename _Expr::value_type& __x, const _Expr& __y)
4400
+ {
4401
+ typedef typename _Expr::value_type value_type;
4402
+ typedef _BinaryOp<less_equal<value_type>, __scalar_expr<value_type>, _Expr> _Op;
4403
+ return __val_expr<_Op>(_Op(less_equal<value_type>(),
4404
+ __scalar_expr<value_type>(__x, __y.size()), __y));
4405
+ }
4406
+
4407
+ template<class _Expr1, class _Expr2>
4408
+ inline _LIBCPP_INLINE_VISIBILITY
4409
+ typename enable_if
4410
+ <
4411
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
4412
+ __val_expr<_BinaryOp<greater_equal<typename _Expr1::value_type>, _Expr1, _Expr2> >
4413
+ >::type
4414
+ operator>=(const _Expr1& __x, const _Expr2& __y)
4415
+ {
4416
+ typedef typename _Expr1::value_type value_type;
4417
+ typedef _BinaryOp<greater_equal<value_type>, _Expr1, _Expr2> _Op;
4418
+ return __val_expr<_Op>(_Op(greater_equal<value_type>(), __x, __y));
4419
+ }
4420
+
4421
+ template<class _Expr>
4422
+ inline _LIBCPP_INLINE_VISIBILITY
4423
+ typename enable_if
4424
+ <
4425
+ __is_val_expr<_Expr>::value,
4426
+ __val_expr<_BinaryOp<greater_equal<typename _Expr::value_type>,
4427
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
4428
+ >::type
4429
+ operator>=(const _Expr& __x, const typename _Expr::value_type& __y)
4430
+ {
4431
+ typedef typename _Expr::value_type value_type;
4432
+ typedef _BinaryOp<greater_equal<value_type>, _Expr, __scalar_expr<value_type> > _Op;
4433
+ return __val_expr<_Op>(_Op(greater_equal<value_type>(),
4434
+ __x, __scalar_expr<value_type>(__y, __x.size())));
4435
+ }
4436
+
4437
+ template<class _Expr>
4438
+ inline _LIBCPP_INLINE_VISIBILITY
4439
+ typename enable_if
4440
+ <
4441
+ __is_val_expr<_Expr>::value,
4442
+ __val_expr<_BinaryOp<greater_equal<typename _Expr::value_type>,
4443
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
4444
+ >::type
4445
+ operator>=(const typename _Expr::value_type& __x, const _Expr& __y)
4446
+ {
4447
+ typedef typename _Expr::value_type value_type;
4448
+ typedef _BinaryOp<greater_equal<value_type>, __scalar_expr<value_type>, _Expr> _Op;
4449
+ return __val_expr<_Op>(_Op(greater_equal<value_type>(),
4450
+ __scalar_expr<value_type>(__x, __y.size()), __y));
4451
+ }
4452
+
4453
+ template<class _Expr>
4454
+ inline _LIBCPP_INLINE_VISIBILITY
4455
+ typename enable_if
4456
+ <
4457
+ __is_val_expr<_Expr>::value,
4458
+ __val_expr<_UnaryOp<__abs_expr<typename _Expr::value_type>, _Expr> >
4459
+ >::type
4460
+ abs(const _Expr& __x)
4461
+ {
4462
+ typedef typename _Expr::value_type value_type;
4463
+ typedef _UnaryOp<__abs_expr<value_type>, _Expr> _Op;
4464
+ return __val_expr<_Op>(_Op(__abs_expr<value_type>(), __x));
4465
+ }
4466
+
4467
+ template<class _Expr>
4468
+ inline _LIBCPP_INLINE_VISIBILITY
4469
+ typename enable_if
4470
+ <
4471
+ __is_val_expr<_Expr>::value,
4472
+ __val_expr<_UnaryOp<__acos_expr<typename _Expr::value_type>, _Expr> >
4473
+ >::type
4474
+ acos(const _Expr& __x)
4475
+ {
4476
+ typedef typename _Expr::value_type value_type;
4477
+ typedef _UnaryOp<__acos_expr<value_type>, _Expr> _Op;
4478
+ return __val_expr<_Op>(_Op(__acos_expr<value_type>(), __x));
4479
+ }
4480
+
4481
+ template<class _Expr>
4482
+ inline _LIBCPP_INLINE_VISIBILITY
4483
+ typename enable_if
4484
+ <
4485
+ __is_val_expr<_Expr>::value,
4486
+ __val_expr<_UnaryOp<__asin_expr<typename _Expr::value_type>, _Expr> >
4487
+ >::type
4488
+ asin(const _Expr& __x)
4489
+ {
4490
+ typedef typename _Expr::value_type value_type;
4491
+ typedef _UnaryOp<__asin_expr<value_type>, _Expr> _Op;
4492
+ return __val_expr<_Op>(_Op(__asin_expr<value_type>(), __x));
4493
+ }
4494
+
4495
+ template<class _Expr>
4496
+ inline _LIBCPP_INLINE_VISIBILITY
4497
+ typename enable_if
4498
+ <
4499
+ __is_val_expr<_Expr>::value,
4500
+ __val_expr<_UnaryOp<__atan_expr<typename _Expr::value_type>, _Expr> >
4501
+ >::type
4502
+ atan(const _Expr& __x)
4503
+ {
4504
+ typedef typename _Expr::value_type value_type;
4505
+ typedef _UnaryOp<__atan_expr<value_type>, _Expr> _Op;
4506
+ return __val_expr<_Op>(_Op(__atan_expr<value_type>(), __x));
4507
+ }
4508
+
4509
+ template<class _Expr1, class _Expr2>
4510
+ inline _LIBCPP_INLINE_VISIBILITY
4511
+ typename enable_if
4512
+ <
4513
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
4514
+ __val_expr<_BinaryOp<__atan2_expr<typename _Expr1::value_type>, _Expr1, _Expr2> >
4515
+ >::type
4516
+ atan2(const _Expr1& __x, const _Expr2& __y)
4517
+ {
4518
+ typedef typename _Expr1::value_type value_type;
4519
+ typedef _BinaryOp<__atan2_expr<value_type>, _Expr1, _Expr2> _Op;
4520
+ return __val_expr<_Op>(_Op(__atan2_expr<value_type>(), __x, __y));
4521
+ }
4522
+
4523
+ template<class _Expr>
4524
+ inline _LIBCPP_INLINE_VISIBILITY
4525
+ typename enable_if
4526
+ <
4527
+ __is_val_expr<_Expr>::value,
4528
+ __val_expr<_BinaryOp<__atan2_expr<typename _Expr::value_type>,
4529
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
4530
+ >::type
4531
+ atan2(const _Expr& __x, const typename _Expr::value_type& __y)
4532
+ {
4533
+ typedef typename _Expr::value_type value_type;
4534
+ typedef _BinaryOp<__atan2_expr<value_type>, _Expr, __scalar_expr<value_type> > _Op;
4535
+ return __val_expr<_Op>(_Op(__atan2_expr<value_type>(),
4536
+ __x, __scalar_expr<value_type>(__y, __x.size())));
4537
+ }
4538
+
4539
+ template<class _Expr>
4540
+ inline _LIBCPP_INLINE_VISIBILITY
4541
+ typename enable_if
4542
+ <
4543
+ __is_val_expr<_Expr>::value,
4544
+ __val_expr<_BinaryOp<__atan2_expr<typename _Expr::value_type>,
4545
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
4546
+ >::type
4547
+ atan2(const typename _Expr::value_type& __x, const _Expr& __y)
4548
+ {
4549
+ typedef typename _Expr::value_type value_type;
4550
+ typedef _BinaryOp<__atan2_expr<value_type>, __scalar_expr<value_type>, _Expr> _Op;
4551
+ return __val_expr<_Op>(_Op(__atan2_expr<value_type>(),
4552
+ __scalar_expr<value_type>(__x, __y.size()), __y));
4553
+ }
4554
+
4555
+ template<class _Expr>
4556
+ inline _LIBCPP_INLINE_VISIBILITY
4557
+ typename enable_if
4558
+ <
4559
+ __is_val_expr<_Expr>::value,
4560
+ __val_expr<_UnaryOp<__cos_expr<typename _Expr::value_type>, _Expr> >
4561
+ >::type
4562
+ cos(const _Expr& __x)
4563
+ {
4564
+ typedef typename _Expr::value_type value_type;
4565
+ typedef _UnaryOp<__cos_expr<value_type>, _Expr> _Op;
4566
+ return __val_expr<_Op>(_Op(__cos_expr<value_type>(), __x));
4567
+ }
4568
+
4569
+ template<class _Expr>
4570
+ inline _LIBCPP_INLINE_VISIBILITY
4571
+ typename enable_if
4572
+ <
4573
+ __is_val_expr<_Expr>::value,
4574
+ __val_expr<_UnaryOp<__cosh_expr<typename _Expr::value_type>, _Expr> >
4575
+ >::type
4576
+ cosh(const _Expr& __x)
4577
+ {
4578
+ typedef typename _Expr::value_type value_type;
4579
+ typedef _UnaryOp<__cosh_expr<value_type>, _Expr> _Op;
4580
+ return __val_expr<_Op>(_Op(__cosh_expr<value_type>(), __x));
4581
+ }
4582
+
4583
+ template<class _Expr>
4584
+ inline _LIBCPP_INLINE_VISIBILITY
4585
+ typename enable_if
4586
+ <
4587
+ __is_val_expr<_Expr>::value,
4588
+ __val_expr<_UnaryOp<__exp_expr<typename _Expr::value_type>, _Expr> >
4589
+ >::type
4590
+ exp(const _Expr& __x)
4591
+ {
4592
+ typedef typename _Expr::value_type value_type;
4593
+ typedef _UnaryOp<__exp_expr<value_type>, _Expr> _Op;
4594
+ return __val_expr<_Op>(_Op(__exp_expr<value_type>(), __x));
4595
+ }
4596
+
4597
+ template<class _Expr>
4598
+ inline _LIBCPP_INLINE_VISIBILITY
4599
+ typename enable_if
4600
+ <
4601
+ __is_val_expr<_Expr>::value,
4602
+ __val_expr<_UnaryOp<__log_expr<typename _Expr::value_type>, _Expr> >
4603
+ >::type
4604
+ log(const _Expr& __x)
4605
+ {
4606
+ typedef typename _Expr::value_type value_type;
4607
+ typedef _UnaryOp<__log_expr<value_type>, _Expr> _Op;
4608
+ return __val_expr<_Op>(_Op(__log_expr<value_type>(), __x));
4609
+ }
4610
+
4611
+ template<class _Expr>
4612
+ inline _LIBCPP_INLINE_VISIBILITY
4613
+ typename enable_if
4614
+ <
4615
+ __is_val_expr<_Expr>::value,
4616
+ __val_expr<_UnaryOp<__log10_expr<typename _Expr::value_type>, _Expr> >
4617
+ >::type
4618
+ log10(const _Expr& __x)
4619
+ {
4620
+ typedef typename _Expr::value_type value_type;
4621
+ typedef _UnaryOp<__log10_expr<value_type>, _Expr> _Op;
4622
+ return __val_expr<_Op>(_Op(__log10_expr<value_type>(), __x));
4623
+ }
4624
+
4625
+ template<class _Expr1, class _Expr2>
4626
+ inline _LIBCPP_INLINE_VISIBILITY
4627
+ typename enable_if
4628
+ <
4629
+ __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value,
4630
+ __val_expr<_BinaryOp<__pow_expr<typename _Expr1::value_type>, _Expr1, _Expr2> >
4631
+ >::type
4632
+ pow(const _Expr1& __x, const _Expr2& __y)
4633
+ {
4634
+ typedef typename _Expr1::value_type value_type;
4635
+ typedef _BinaryOp<__pow_expr<value_type>, _Expr1, _Expr2> _Op;
4636
+ return __val_expr<_Op>(_Op(__pow_expr<value_type>(), __x, __y));
4637
+ }
4638
+
4639
+ template<class _Expr>
4640
+ inline _LIBCPP_INLINE_VISIBILITY
4641
+ typename enable_if
4642
+ <
4643
+ __is_val_expr<_Expr>::value,
4644
+ __val_expr<_BinaryOp<__pow_expr<typename _Expr::value_type>,
4645
+ _Expr, __scalar_expr<typename _Expr::value_type> > >
4646
+ >::type
4647
+ pow(const _Expr& __x, const typename _Expr::value_type& __y)
4648
+ {
4649
+ typedef typename _Expr::value_type value_type;
4650
+ typedef _BinaryOp<__pow_expr<value_type>, _Expr, __scalar_expr<value_type> > _Op;
4651
+ return __val_expr<_Op>(_Op(__pow_expr<value_type>(),
4652
+ __x, __scalar_expr<value_type>(__y, __x.size())));
4653
+ }
4654
+
4655
+ template<class _Expr>
4656
+ inline _LIBCPP_INLINE_VISIBILITY
4657
+ typename enable_if
4658
+ <
4659
+ __is_val_expr<_Expr>::value,
4660
+ __val_expr<_BinaryOp<__pow_expr<typename _Expr::value_type>,
4661
+ __scalar_expr<typename _Expr::value_type>, _Expr> >
4662
+ >::type
4663
+ pow(const typename _Expr::value_type& __x, const _Expr& __y)
4664
+ {
4665
+ typedef typename _Expr::value_type value_type;
4666
+ typedef _BinaryOp<__pow_expr<value_type>, __scalar_expr<value_type>, _Expr> _Op;
4667
+ return __val_expr<_Op>(_Op(__pow_expr<value_type>(),
4668
+ __scalar_expr<value_type>(__x, __y.size()), __y));
4669
+ }
4670
+
4671
+ template<class _Expr>
4672
+ inline _LIBCPP_INLINE_VISIBILITY
4673
+ typename enable_if
4674
+ <
4675
+ __is_val_expr<_Expr>::value,
4676
+ __val_expr<_UnaryOp<__sin_expr<typename _Expr::value_type>, _Expr> >
4677
+ >::type
4678
+ sin(const _Expr& __x)
4679
+ {
4680
+ typedef typename _Expr::value_type value_type;
4681
+ typedef _UnaryOp<__sin_expr<value_type>, _Expr> _Op;
4682
+ return __val_expr<_Op>(_Op(__sin_expr<value_type>(), __x));
4683
+ }
4684
+
4685
+ template<class _Expr>
4686
+ inline _LIBCPP_INLINE_VISIBILITY
4687
+ typename enable_if
4688
+ <
4689
+ __is_val_expr<_Expr>::value,
4690
+ __val_expr<_UnaryOp<__sinh_expr<typename _Expr::value_type>, _Expr> >
4691
+ >::type
4692
+ sinh(const _Expr& __x)
4693
+ {
4694
+ typedef typename _Expr::value_type value_type;
4695
+ typedef _UnaryOp<__sinh_expr<value_type>, _Expr> _Op;
4696
+ return __val_expr<_Op>(_Op(__sinh_expr<value_type>(), __x));
4697
+ }
4698
+
4699
+ template<class _Expr>
4700
+ inline _LIBCPP_INLINE_VISIBILITY
4701
+ typename enable_if
4702
+ <
4703
+ __is_val_expr<_Expr>::value,
4704
+ __val_expr<_UnaryOp<__sqrt_expr<typename _Expr::value_type>, _Expr> >
4705
+ >::type
4706
+ sqrt(const _Expr& __x)
4707
+ {
4708
+ typedef typename _Expr::value_type value_type;
4709
+ typedef _UnaryOp<__sqrt_expr<value_type>, _Expr> _Op;
4710
+ return __val_expr<_Op>(_Op(__sqrt_expr<value_type>(), __x));
4711
+ }
4712
+
4713
+ template<class _Expr>
4714
+ inline _LIBCPP_INLINE_VISIBILITY
4715
+ typename enable_if
4716
+ <
4717
+ __is_val_expr<_Expr>::value,
4718
+ __val_expr<_UnaryOp<__tan_expr<typename _Expr::value_type>, _Expr> >
4719
+ >::type
4720
+ tan(const _Expr& __x)
4721
+ {
4722
+ typedef typename _Expr::value_type value_type;
4723
+ typedef _UnaryOp<__tan_expr<value_type>, _Expr> _Op;
4724
+ return __val_expr<_Op>(_Op(__tan_expr<value_type>(), __x));
4725
+ }
4726
+
4727
+ template<class _Expr>
4728
+ inline _LIBCPP_INLINE_VISIBILITY
4729
+ typename enable_if
4730
+ <
4731
+ __is_val_expr<_Expr>::value,
4732
+ __val_expr<_UnaryOp<__tanh_expr<typename _Expr::value_type>, _Expr> >
4733
+ >::type
4734
+ tanh(const _Expr& __x)
4735
+ {
4736
+ typedef typename _Expr::value_type value_type;
4737
+ typedef _UnaryOp<__tanh_expr<value_type>, _Expr> _Op;
4738
+ return __val_expr<_Op>(_Op(__tanh_expr<value_type>(), __x));
4739
+ }
4740
+
4741
+ template <class _Tp>
4742
+ inline _LIBCPP_INLINE_VISIBILITY
4743
+ _Tp*
4744
+ begin(valarray<_Tp>& __v)
4745
+ {
4746
+ return __v.__begin_;
4747
+ }
4748
+
4749
+ template <class _Tp>
4750
+ inline _LIBCPP_INLINE_VISIBILITY
4751
+ const _Tp*
4752
+ begin(const valarray<_Tp>& __v)
4753
+ {
4754
+ return __v.__begin_;
4755
+ }
4756
+
4757
+ template <class _Tp>
4758
+ inline _LIBCPP_INLINE_VISIBILITY
4759
+ _Tp*
4760
+ end(valarray<_Tp>& __v)
4761
+ {
4762
+ return __v.__end_;
4763
+ }
4764
+
4765
+ template <class _Tp>
4766
+ inline _LIBCPP_INLINE_VISIBILITY
4767
+ const _Tp*
4768
+ end(const valarray<_Tp>& __v)
4769
+ {
4770
+ return __v.__end_;
4771
+ }
4772
+
4773
+ _LIBCPP_EXTERN_TEMPLATE(valarray<size_t>::valarray(size_t))
4774
+ _LIBCPP_EXTERN_TEMPLATE(valarray<size_t>::~valarray())
4775
+ _LIBCPP_EXTERN_TEMPLATE(void valarray<size_t>::resize(size_t, size_t))
4776
+
4777
+ _LIBCPP_END_NAMESPACE_STD
4778
+
4779
+ #endif // _LIBCPP_VALARRAY