spatialquery.js 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../node_modules/.pnpm/flatqueue@3.0.0/node_modules/flatqueue/index.js","../../node_modules/.pnpm/flatbush@4.5.1/node_modules/flatbush/index.js","../../node_modules/.pnpm/d3-array@2.12.1/node_modules/d3-array/src/extent.js","../../src/assert.ts","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/define-property/lib/define_property.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/define-property/lib/has_define_property_support.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/define-property/lib/builtin.js","../../node_modules/.pnpm/@stdlib+string@0.4.1/node_modules/@stdlib/string/base/format-interpolate/lib/is_number.js","../../node_modules/.pnpm/@stdlib+string@0.4.1/node_modules/@stdlib/string/base/format-interpolate/lib/zero_pad.js","../../node_modules/.pnpm/@stdlib+string@0.4.1/node_modules/@stdlib/string/base/format-interpolate/lib/format_integer.js","../../node_modules/.pnpm/@stdlib+string@0.4.1/node_modules/@stdlib/string/base/format-interpolate/lib/is_string.js","../../node_modules/.pnpm/@stdlib+string@0.4.1/node_modules/@stdlib/string/base/format-interpolate/lib/format_double.js","../../node_modules/.pnpm/@stdlib+string@0.4.1/node_modules/@stdlib/string/base/format-interpolate/lib/space_pad.js","../../node_modules/.pnpm/@stdlib+string@0.4.1/node_modules/@stdlib/string/base/format-interpolate/lib/main.js","../../node_modules/.pnpm/@stdlib+string@0.4.1/node_modules/@stdlib/string/base/format-interpolate/lib/index.js","../../node_modules/.pnpm/@stdlib+string@0.4.1/node_modules/@stdlib/string/base/format-tokenize/lib/main.js","../../node_modules/.pnpm/@stdlib+string@0.4.1/node_modules/@stdlib/string/base/format-tokenize/lib/index.js","../../node_modules/.pnpm/@stdlib+string@0.4.1/node_modules/@stdlib/string/format/lib/is_string.js","../../node_modules/.pnpm/@stdlib+string@0.4.1/node_modules/@stdlib/string/format/lib/main.js","../../node_modules/.pnpm/@stdlib+string@0.4.1/node_modules/@stdlib/string/format/lib/index.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/define-property/lib/polyfill.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/define-property/lib/index.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/define-nonenumerable-read-only-property/lib/main.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/define-nonenumerable-read-only-property/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-number/lib/primitive.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-symbol-support/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-symbol-support/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-tostringtag-support/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-tostringtag-support/lib/index.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/native-class/lib/tostring.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/native-class/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-own-property/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-own-property/lib/index.js","../../node_modules/.pnpm/@stdlib+symbol@0.4.1/node_modules/@stdlib/symbol/ctor/lib/main.js","../../node_modules/.pnpm/@stdlib+symbol@0.4.1/node_modules/@stdlib/symbol/ctor/lib/index.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/native-class/lib/tostringtag.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/native-class/lib/polyfill.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/native-class/lib/index.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/ctor/lib/main.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/ctor/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-number/lib/tostring.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-number/lib/try2serialize.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-number/lib/object.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-number/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-number/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-probability/lib/primitive.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-probability/lib/object.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-probability/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-probability/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/floor/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/floor/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/assert/is-integer/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/assert/is-integer/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/array/max-array-length/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-array-like/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-array-like/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/tools/array-like-function/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/tools/array-like-function/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-probability-array/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/float64/pinf/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/float64/ninf/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-integer/lib/integer.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-integer/lib/primitive.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-integer/lib/object.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-integer/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-integer/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-string/lib/primitive.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-string/lib/valueof.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-string/lib/try2valueof.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-string/lib/object.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-string/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-string/lib/index.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/padjust/lib/bonferroni.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/assert/is-negative-zero/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/assert/is-negative-zero/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/assert/is-nan/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/assert/is-nan/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/min/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/min/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/assert/is-positive-zero/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/assert/is-positive-zero/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/max/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/max/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-float64array/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-float64array/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-float64array-support/lib/float64array.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-float64array-support/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-float64array-support/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/float64/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/float64/lib/polyfill.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/float64/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-int32array/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-int32array/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/int32/max/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/int32/min/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-int32array-support/lib/int32array.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-int32array-support/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-int32array-support/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/int32/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/int32/lib/polyfill.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/int32/lib/index.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/padjust/lib/order.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/padjust/lib/hommel.js","../../node_modules/.pnpm/@stdlib+strided@0.4.1/node_modules/@stdlib/strided/base/stride2offset/lib/main.js","../../node_modules/.pnpm/@stdlib+strided@0.4.1/node_modules/@stdlib/strided/base/stride2offset/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/assert/is-accessor-array/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/assert/is-accessor-array/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/getter/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/getter/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/setter/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/setter/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/accessor-getter/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/accessor-getter/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/accessor-setter/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/accessor-setter/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-array/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-array/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/tools/array-function/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/tools/array-function/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-object-like/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-object-like/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-buffer/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-buffer/lib/index.js","../../node_modules/.pnpm/@stdlib+regexp@0.4.1/node_modules/@stdlib/regexp/function-name/lib/main.js","../../node_modules/.pnpm/@stdlib+regexp@0.4.1/node_modules/@stdlib/regexp/function-name/lib/regexp.js","../../node_modules/.pnpm/@stdlib+regexp@0.4.1/node_modules/@stdlib/regexp/function-name/lib/index.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/constructor-name/lib/main.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/constructor-name/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/dtype/lib/ctor2dtype.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-float32array/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-float32array/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-float32array-support/lib/float32array.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-float32array-support/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-float32array-support/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/float32/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/float32/lib/polyfill.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/float32/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-uint32array/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-uint32array/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/uint32/max/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-uint32array-support/lib/uint32array.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-uint32array-support/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-uint32array-support/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/uint32/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/uint32/lib/polyfill.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/uint32/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-uint16array/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-uint16array/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/uint16/max/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-uint16array-support/lib/uint16array.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-uint16array-support/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-uint16array-support/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/uint16/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/uint16/lib/polyfill.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/uint16/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-int16array/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-int16array/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/int16/max/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/int16/min/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-int16array-support/lib/int16array.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-int16array-support/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-int16array-support/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/int16/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/int16/lib/polyfill.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/int16/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-uint8array/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-uint8array/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/uint8/max/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-uint8array-support/lib/uint8array.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-uint8array-support/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-uint8array-support/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/uint8/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/uint8/lib/polyfill.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/uint8/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-uint8clampedarray/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-uint8clampedarray/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-uint8clampedarray-support/lib/uint8clampedarray.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-uint8clampedarray-support/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-uint8clampedarray-support/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/uint8c/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/uint8c/lib/polyfill.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/uint8c/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-int8array/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-int8array/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/int8/max/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/int8/min/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-int8array-support/lib/int8array.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-int8array-support/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-int8array-support/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/int8/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/int8/lib/polyfill.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/int8/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-nonnegative-integer/lib/primitive.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-nonnegative-integer/lib/object.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-nonnegative-integer/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-nonnegative-integer/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-array-like-object/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-array-like-object/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/array/max-typed-array-length/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-collection/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-collection/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-arraybuffer/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-arraybuffer/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-object/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-object/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-string-array/lib/index.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/type-of/lib/fixtures/re.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-boolean/lib/primitive.js","../../node_modules/.pnpm/@stdlib+boolean@0.4.1/node_modules/@stdlib/boolean/ctor/lib/main.js","../../node_modules/.pnpm/@stdlib+boolean@0.4.1/node_modules/@stdlib/boolean/ctor/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-boolean/lib/tostring.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-boolean/lib/try2serialize.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-boolean/lib/object.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-boolean/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-boolean/lib/index.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/global/lib/codegen.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/global/lib/self.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/global/lib/window.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/global/lib/global_this.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/global/lib/browser.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/type-of/lib/fixtures/nodelist.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/type-of/lib/fixtures/typedarray.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/type-of/lib/check.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/type-of/lib/main.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/type-of/lib/polyfill.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/type-of/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-function/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-function/lib/index.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/define-read-only-property/lib/main.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/define-read-only-property/lib/index.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float64/ctor/lib/tostring.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float64/ctor/lib/tojson.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float64/ctor/lib/main.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float64/ctor/lib/index.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/to-float32/lib/main.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/to-float32/lib/polyfill.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/to-float32/lib/index.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float32/ctor/lib/tostring.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float32/ctor/lib/tojson.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float32/ctor/lib/main.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float32/ctor/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-complex-like/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-complex-like/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/assert/is-even/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/assert/is-even/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/assert/is-complex64array/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/assert/is-complex64array/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/assert/is-complex128array/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/assert/is-complex128array/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-iterator-symbol-support/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/has-iterator-symbol-support/lib/index.js","../../node_modules/.pnpm/@stdlib+symbol@0.4.1/node_modules/@stdlib/symbol/iterator/lib/main.js","../../node_modules/.pnpm/@stdlib+symbol@0.4.1/node_modules/@stdlib/symbol/iterator/lib/index.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/define-nonenumerable-read-only-accessor/lib/main.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/define-nonenumerable-read-only-accessor/lib/index.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float32/real/lib/main.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float32/real/lib/index.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float32/imag/lib/main.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float32/imag/lib/index.js","../../node_modules/.pnpm/@stdlib+strided@0.4.1/node_modules/@stdlib/strided/base/reinterpret-complex64/lib/main.js","../../node_modules/.pnpm/@stdlib+strided@0.4.1/node_modules/@stdlib/strided/base/reinterpret-complex64/lib/index.js","../../node_modules/.pnpm/@stdlib+strided@0.4.1/node_modules/@stdlib/strided/base/reinterpret-complex128/lib/main.js","../../node_modules/.pnpm/@stdlib+strided@0.4.1/node_modules/@stdlib/strided/base/reinterpret-complex128/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/complex64/lib/from_iterator.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/complex64/lib/from_iterator_map.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/complex64/lib/from_array.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/complex64/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/complex64/lib/index.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float64/real/lib/main.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float64/real/lib/index.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float64/imag/lib/main.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float64/imag/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/complex128/lib/from_iterator.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/complex128/lib/from_iterator_map.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/complex128/lib/from_array.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/complex128/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/complex128/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/bool/lib/from_iterator.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/bool/lib/from_iterator_map.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/bool/lib/from_array.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/bool/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/bool/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/dtype/lib/ctors.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/dtype/lib/dtypes.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/dtype/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/dtype/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/arraylike2object/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/arraylike2object/lib/index.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/cumax/lib/accessors.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/cumax/lib/ndarray.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/cumax/lib/main.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/cumax/lib/index.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/padjust/lib/holm.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/cumin/lib/accessors.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/cumin/lib/ndarray.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/cumin/lib/main.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/cumin/lib/index.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/padjust/lib/bh.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/padjust/lib/by.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/padjust/lib/main.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/padjust/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-accessor-array/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-accessor-array/lib/index.js","../../node_modules/.pnpm/@stdlib+strided@0.4.1/node_modules/@stdlib/strided/base/reinterpret-complex/lib/main.js","../../node_modules/.pnpm/@stdlib+strided@0.4.1/node_modules/@stdlib/strided/base/reinterpret-complex/lib/index.js","../../node_modules/.pnpm/@stdlib+strided@0.4.1/node_modules/@stdlib/strided/base/reinterpret-boolean/lib/main.js","../../node_modules/.pnpm/@stdlib+strided@0.4.1/node_modules/@stdlib/strided/base/reinterpret-boolean/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/assert/is-complex-typed-array/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/assert/is-complex-typed-array/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/assert/is-booleanarray/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/assert/is-booleanarray/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/resolve-getter/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/resolve-getter/lib/index.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/assert/is-same-value/lib/main.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/assert/is-same-value/lib/index.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float64/reim/lib/main.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float64/reim/lib/index.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float64/base/assert/is-same-value/lib/main.js","../../node_modules/.pnpm/@stdlib+complex@0.4.1/node_modules/@stdlib/complex/float64/base/assert/is-same-value/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-same-value/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-same-value/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/index-of-same-value/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/index-of-same-value/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/contains/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/contains/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/filled/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/filled/lib/index.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/zeros/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/zeros/lib/index.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/ranks/lib/sum.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/ranks/lib/order.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/ranks/lib/is_missing.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/assert/contains/lib/main.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/assert/contains/lib/factory.js","../../node_modules/.pnpm/@stdlib+array@0.5.1/node_modules/@stdlib/array/base/assert/contains/lib/index.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/ranks/lib/validate.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/ranks/lib/main.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/ranks/lib/index.js","../../node_modules/.pnpm/@stdlib+blas@0.4.1/node_modules/@stdlib/blas/ext/base/gsumpw/lib/accessors.js","../../node_modules/.pnpm/@stdlib+blas@0.4.1/node_modules/@stdlib/blas/ext/base/gsumpw/lib/ndarray.js","../../node_modules/.pnpm/@stdlib+blas@0.4.1/node_modules/@stdlib/blas/ext/base/gsumpw/lib/main.js","../../node_modules/.pnpm/@stdlib+blas@0.4.1/node_modules/@stdlib/blas/ext/base/gsumpw/lib/index.js","../../node_modules/.pnpm/@stdlib+blas@0.4.1/node_modules/@stdlib/blas/ext/base/gapxsumpw/lib/ndarray.js","../../node_modules/.pnpm/@stdlib+blas@0.4.1/node_modules/@stdlib/blas/ext/base/gapxsumpw/lib/main.js","../../node_modules/.pnpm/@stdlib+blas@0.4.1/node_modules/@stdlib/blas/ext/base/gapxsumpw/lib/index.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/strided/meanpn/lib/accessors.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/strided/meanpn/lib/ndarray.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/strided/meanpn/lib/meanpn.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/strided/meanpn/lib/main.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/strided/meanpn/lib/index.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/strided/mean/lib/mean.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/strided/mean/lib/ndarray.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/strided/mean/lib/main.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/strided/mean/lib/index.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/strided/mediansorted/lib/accessors.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/strided/mediansorted/lib/ndarray.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/strided/mediansorted/lib/mediansorted.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/strided/mediansorted/lib/main.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/strided/mediansorted/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/assert/is-nonnegative-integer/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/assert/is-nonnegative-integer/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/ceil/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/ceil/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/trunc/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/trunc/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/float64/exponent-bias/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/float64/max-base2-exponent/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/float64/max-base2-exponent-subnormal/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/float64/min-base2-exponent-subnormal/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/assert/is-infinite/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/assert/is-infinite/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/float64/high-word-sign-mask/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/float64/high-word-abs-mask/lib/index.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-little-endian/lib/ctors.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-little-endian/lib/main.js","../../node_modules/.pnpm/@stdlib+assert@0.4.1/node_modules/@stdlib/assert/is-little-endian/lib/index.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/to-words/lib/indices.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/to-words/lib/assign.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/to-words/lib/main.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/to-words/lib/index.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/get-high-word/lib/high.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/get-high-word/lib/main.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/get-high-word/lib/index.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/from-words/lib/indices.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/from-words/lib/main.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/from-words/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/copysign/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/copysign/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/float64/smallest-normal/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/abs/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/abs/lib/index.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/normalize/lib/assign.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/normalize/lib/main.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/normalize/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/float64/high-word-exponent-mask/lib/index.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/exponent/lib/main.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/exponent/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/ldexp/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/ldexp/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/exp/lib/polyval_p.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/exp/lib/expmulti.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/exp/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/exp/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/assert/is-negative-integer/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/assert/is-negative-integer/lib/index.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/set-high-word/lib/high.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/set-high-word/lib/main.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/set-high-word/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/ln/lib/polyval_p.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/ln/lib/polyval_q.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/ln/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/ln/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/kernel-cos/lib/polyval_c13.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/kernel-cos/lib/polyval_c46.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/kernel-cos/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/kernel-cos/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/kernel-sin/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/kernel-sin/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/float64/high-word-significand-mask/lib/index.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/get-low-word/lib/low.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/get-low-word/lib/main.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/get-low-word/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/rempio2/lib/kernel_rempio2.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/round/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/round/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/rempio2/lib/rempio2_medium.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/rempio2/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/rempio2/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/cos/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/cos/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/sin/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/sin/lib/index.js","../../node_modules/.pnpm/@stdlib+constants@0.4.1/node_modules/@stdlib/constants/float64/pi/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/sinpi/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/sinpi/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/gammaln/lib/polyval_a1.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/gammaln/lib/polyval_a2.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/gammaln/lib/polyval_r.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/gammaln/lib/polyval_s.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/gammaln/lib/polyval_t1.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/gammaln/lib/polyval_t2.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/gammaln/lib/polyval_t3.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/gammaln/lib/polyval_u.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/gammaln/lib/polyval_v.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/gammaln/lib/polyval_w.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/gammaln/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/gammaln/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/factorialln/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/factorialln/lib/index.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/dists/hypergeometric/pmf/lib/main.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/constant-function/lib/main.js","../../node_modules/.pnpm/@stdlib+utils@0.4.1/node_modules/@stdlib/utils/constant-function/lib/index.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/dists/hypergeometric/pmf/lib/factory.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/dists/hypergeometric/pmf/lib/index.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/dists/hypergeometric/cdf/lib/sum.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/dists/hypergeometric/cdf/lib/main.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/dists/hypergeometric/cdf/lib/factory.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/dists/hypergeometric/cdf/lib/index.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/dists/hypergeometric/mean/lib/main.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/dists/hypergeometric/mean/lib/index.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/set-low-word/lib/low.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/set-low-word/lib/main.js","../../node_modules/.pnpm/@stdlib+number@0.4.1/node_modules/@stdlib/number/float64/base/set-low-word/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/erfc/lib/polyval_pp.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/erfc/lib/polyval_qq.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/erfc/lib/polyval_pa.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/erfc/lib/polyval_qa.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/erfc/lib/polyval_ra.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/erfc/lib/polyval_sa.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/erfc/lib/polyval_rb.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/erfc/lib/polyval_sb.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/erfc/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/erfc/lib/index.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/sqrt/lib/main.js","../../node_modules/.pnpm/@stdlib+math@0.4.1/node_modules/@stdlib/math/base/special/sqrt/lib/index.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/dists/normal/cdf/lib/main.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/dists/degenerate/cdf/lib/main.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/dists/degenerate/cdf/lib/factory.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/dists/degenerate/cdf/lib/index.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/dists/normal/cdf/lib/factory.js","../../node_modules/.pnpm/@stdlib+stats@0.4.1/node_modules/@stdlib/stats/base/dists/normal/cdf/lib/index.js","../../src/stats.ts","../../node_modules/.pnpm/events@1.1.1/node_modules/events/events.js","../../node_modules/.pnpm/node-fpgrowth@1.2.1/node_modules/node-fpgrowth/dist/fpnode.js","../../node_modules/.pnpm/node-fpgrowth@1.2.1/node_modules/node-fpgrowth/dist/fptree.js","../../node_modules/.pnpm/node-fpgrowth@1.2.1/node_modules/node-fpgrowth/dist/fpgrowth.js","../../src/fpgrowth.ts","../../src/nested.ts","../../src/single-fov.ts","../../src/multi-fov.ts"],"sourcesContent":["\n/** @template T */\nexport default class FlatQueue {\n\n constructor() {\n /** @type T[] */\n this.ids = [];\n\n /** @type number[] */\n this.values = [];\n\n /** Number of items in the queue. */\n this.length = 0;\n }\n\n /** Removes all items from the queue. */\n clear() {\n this.length = 0;\n }\n\n /**\n * Adds `item` to the queue with the specified `priority`.\n *\n * `priority` must be a number. Items are sorted and returned from low to high priority. Multiple items\n * with the same priority value can be added to the queue, but there is no guaranteed order between these items.\n *\n * @param {T} item\n * @param {number} priority\n */\n push(item, priority) {\n let pos = this.length++;\n\n while (pos > 0) {\n const parent = (pos - 1) >> 1;\n const parentValue = this.values[parent];\n if (priority >= parentValue) break;\n this.ids[pos] = this.ids[parent];\n this.values[pos] = parentValue;\n pos = parent;\n }\n\n this.ids[pos] = item;\n this.values[pos] = priority;\n }\n\n /**\n * Removes and returns the item from the head of this queue, which is one of\n * the items with the lowest priority. If this queue is empty, returns `undefined`.\n */\n pop() {\n if (this.length === 0) return undefined;\n\n const ids = this.ids,\n values = this.values,\n top = ids[0],\n last = --this.length;\n\n if (last > 0) {\n const id = ids[last];\n const value = values[last];\n let pos = 0;\n const halfLen = last >> 1;\n\n while (pos < halfLen) {\n const left = (pos << 1) + 1;\n const right = left + 1;\n const child = left + (+(right < last) & +(values[right] < values[left]));\n if (values[child] >= value) break;\n ids[pos] = ids[child];\n values[pos] = values[child];\n pos = child;\n }\n\n ids[pos] = id;\n values[pos] = value;\n }\n\n return top;\n }\n\n /** Returns the item from the head of this queue without removing it. If this queue is empty, returns `undefined`. */\n peek() {\n return this.length > 0 ? this.ids[0] : undefined;\n }\n\n /**\n * Returns the priority value of the item at the head of this queue without\n * removing it. If this queue is empty, returns `undefined`.\n */\n peekValue() {\n return this.length > 0 ? this.values[0] : undefined;\n }\n\n /**\n * Shrinks the internal arrays to `this.length`.\n *\n * `pop()` and `clear()` calls don't free memory automatically to avoid unnecessary resize operations.\n * This also means that items that have been added to the queue can't be garbage collected until\n * a new item is pushed in their place, or this method is called.\n */\n shrink() {\n this.ids.length = this.values.length = this.length;\n }\n}\n","import FlatQueue from 'flatqueue';\n\nconst ARRAY_TYPES = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array];\nconst VERSION = 3; // serialized format version\n\n/** @typedef {Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor} TypedArrayConstructor */\n\nexport default class Flatbush {\n\n /**\n * Recreate a Flatbush index from raw `ArrayBuffer` or `SharedArrayBuffer` data.\n * @param {ArrayBufferLike} data\n * @param {number} [byteOffset=0] byte offset to the start of the Flatbush buffer in the referenced ArrayBuffer.\n * @returns {Flatbush} index\n */\n static from(data, byteOffset = 0) {\n if (byteOffset % 8 !== 0) {\n throw new Error('byteOffset must be 8-byte aligned.');\n }\n\n // @ts-expect-error duck typing array buffers\n if (!data || data.byteLength === undefined || data.buffer) {\n throw new Error('Data must be an instance of ArrayBuffer or SharedArrayBuffer.');\n }\n\n const [magic, versionAndType] = new Uint8Array(data, byteOffset + 0, 2);\n if (magic !== 0xfb) {\n throw new Error('Data does not appear to be in a Flatbush format.');\n }\n const version = versionAndType >> 4;\n if (version !== VERSION) {\n throw new Error(`Got v${version} data when expected v${VERSION}.`);\n }\n const ArrayType = ARRAY_TYPES[versionAndType & 0x0f];\n if (!ArrayType) {\n throw new Error('Unrecognized array type.');\n }\n const [nodeSize] = new Uint16Array(data, byteOffset + 2, 1);\n const [numItems] = new Uint32Array(data, byteOffset + 4, 1);\n\n return new Flatbush(numItems, nodeSize, ArrayType, undefined, data, byteOffset);\n }\n\n /**\n * Create a Flatbush index that will hold a given number of items.\n * @param {number} numItems\n * @param {number} [nodeSize=16] Size of the tree node (16 by default).\n * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).\n * @param {ArrayBufferConstructor | SharedArrayBufferConstructor} [ArrayBufferType=ArrayBuffer] The array buffer type used to store data (`ArrayBuffer` by default).\n * @param {ArrayBufferLike} [data] (Only used internally)\n * @param {number} [byteOffset=0] (Only used internally)\n */\n constructor(numItems, nodeSize = 16, ArrayType = Float64Array, ArrayBufferType = ArrayBuffer, data, byteOffset = 0) {\n if (numItems === undefined) throw new Error('Missing required argument: numItems.');\n if (isNaN(numItems) || numItems <= 0) throw new Error(`Unexpected numItems value: ${numItems}.`);\n\n this.numItems = +numItems;\n this.nodeSize = Math.min(Math.max(+nodeSize, 2), 65535);\n this.byteOffset = byteOffset;\n\n // calculate the total number of nodes in the R-tree to allocate space for\n // and the index of each tree level (used in search later)\n let n = numItems;\n let numNodes = n;\n this._levelBounds = [n * 4];\n do {\n n = Math.ceil(n / this.nodeSize);\n numNodes += n;\n this._levelBounds.push(numNodes * 4);\n } while (n !== 1);\n\n this.ArrayType = ArrayType;\n this.IndexArrayType = numNodes < 16384 ? Uint16Array : Uint32Array;\n\n const arrayTypeIndex = ARRAY_TYPES.indexOf(ArrayType);\n const nodesByteSize = numNodes * 4 * ArrayType.BYTES_PER_ELEMENT;\n\n if (arrayTypeIndex < 0) {\n throw new Error(`Unexpected typed array class: ${ArrayType}.`);\n }\n\n if (data) {\n this.data = data;\n // @ts-expect-error TS can't handle SharedArraBuffer overloads\n this._boxes = new ArrayType(data, byteOffset + 8, numNodes * 4);\n // @ts-expect-error TS can't handle SharedArraBuffer overloads\n this._indices = new this.IndexArrayType(data, byteOffset + 8 + nodesByteSize, numNodes);\n\n this._pos = numNodes * 4;\n this.minX = this._boxes[this._pos - 4];\n this.minY = this._boxes[this._pos - 3];\n this.maxX = this._boxes[this._pos - 2];\n this.maxY = this._boxes[this._pos - 1];\n\n } else {\n const data = this.data = new ArrayBufferType(8 + nodesByteSize + numNodes * this.IndexArrayType.BYTES_PER_ELEMENT);\n // @ts-expect-error TS can't handle SharedArraBuffer overloads\n this._boxes = new ArrayType(data, 8, numNodes * 4);\n // @ts-expect-error TS can't handle SharedArraBuffer overloads\n this._indices = new this.IndexArrayType(data, 8 + nodesByteSize, numNodes);\n this._pos = 0;\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = -Infinity;\n this.maxY = -Infinity;\n\n new Uint8Array(data, 0, 2).set([0xfb, (VERSION << 4) + arrayTypeIndex]);\n new Uint16Array(data, 2, 1)[0] = nodeSize;\n new Uint32Array(data, 4, 1)[0] = numItems;\n }\n\n // a priority queue for k-nearest-neighbors queries\n /** @type FlatQueue<number> */\n this._queue = new FlatQueue();\n }\n\n /**\n * Add a given rectangle to the index.\n * @param {number} minX\n * @param {number} minY\n * @param {number} maxX\n * @param {number} maxY\n * @returns {number} A zero-based, incremental number that represents the newly added rectangle.\n */\n add(minX, minY, maxX = minX, maxY = minY) {\n const index = this._pos >> 2;\n const boxes = this._boxes;\n this._indices[index] = index;\n boxes[this._pos++] = minX;\n boxes[this._pos++] = minY;\n boxes[this._pos++] = maxX;\n boxes[this._pos++] = maxY;\n\n if (minX < this.minX) this.minX = minX;\n if (minY < this.minY) this.minY = minY;\n if (maxX > this.maxX) this.maxX = maxX;\n if (maxY > this.maxY) this.maxY = maxY;\n\n return index;\n }\n\n /** Perform indexing of the added rectangles. */\n finish() {\n if (this._pos >> 2 !== this.numItems) {\n throw new Error(`Added ${this._pos >> 2} items when expected ${this.numItems}.`);\n }\n const boxes = this._boxes;\n\n if (this.numItems <= this.nodeSize) {\n // only one node, skip sorting and just fill the root box\n boxes[this._pos++] = this.minX;\n boxes[this._pos++] = this.minY;\n boxes[this._pos++] = this.maxX;\n boxes[this._pos++] = this.maxY;\n return;\n }\n\n const width = (this.maxX - this.minX) || 1;\n const height = (this.maxY - this.minY) || 1;\n const hilbertValues = new Uint32Array(this.numItems);\n const hilbertMax = (1 << 16) - 1;\n\n // map item centers into Hilbert coordinate space and calculate Hilbert values\n for (let i = 0, pos = 0; i < this.numItems; i++) {\n const minX = boxes[pos++];\n const minY = boxes[pos++];\n const maxX = boxes[pos++];\n const maxY = boxes[pos++];\n const x = Math.floor(hilbertMax * ((minX + maxX) / 2 - this.minX) / width);\n const y = Math.floor(hilbertMax * ((minY + maxY) / 2 - this.minY) / height);\n hilbertValues[i] = hilbert(x, y);\n }\n\n // sort items by their Hilbert value (for packing later)\n sort(hilbertValues, boxes, this._indices, 0, this.numItems - 1, this.nodeSize);\n\n // generate nodes at each tree level, bottom-up\n for (let i = 0, pos = 0; i < this._levelBounds.length - 1; i++) {\n const end = this._levelBounds[i];\n\n // generate a parent node for each block of consecutive <nodeSize> nodes\n while (pos < end) {\n const nodeIndex = pos;\n\n // calculate bbox for the new node\n let nodeMinX = boxes[pos++];\n let nodeMinY = boxes[pos++];\n let nodeMaxX = boxes[pos++];\n let nodeMaxY = boxes[pos++];\n for (let j = 1; j < this.nodeSize && pos < end; j++) {\n nodeMinX = Math.min(nodeMinX, boxes[pos++]);\n nodeMinY = Math.min(nodeMinY, boxes[pos++]);\n nodeMaxX = Math.max(nodeMaxX, boxes[pos++]);\n nodeMaxY = Math.max(nodeMaxY, boxes[pos++]);\n }\n\n // add the new node to the tree data\n this._indices[this._pos >> 2] = nodeIndex;\n boxes[this._pos++] = nodeMinX;\n boxes[this._pos++] = nodeMinY;\n boxes[this._pos++] = nodeMaxX;\n boxes[this._pos++] = nodeMaxY;\n }\n }\n }\n\n /**\n * Search the index by a bounding box.\n * @param {number} minX\n * @param {number} minY\n * @param {number} maxX\n * @param {number} maxY\n * @param {(index: number, x0: number, y0: number, x1: number, y1: number) => boolean} [filterFn] An optional function that is called on every found item; if supplied, only items for which this function returns true will be included in the results array.\n * @returns {number[]} An array of indices of items intersecting or touching the given bounding box.\n */\n search(minX, minY, maxX, maxY, filterFn) {\n if (this._pos !== this._boxes.length) {\n throw new Error('Data not yet indexed - call index.finish().');\n }\n\n /** @type number | undefined */\n let nodeIndex = this._boxes.length - 4;\n const queue = [];\n const results = [];\n\n while (nodeIndex !== undefined) {\n // find the end index of the node\n const end = Math.min(nodeIndex + this.nodeSize * 4, upperBound(nodeIndex, this._levelBounds));\n\n // search through child nodes\n for (let /** @type number */ pos = nodeIndex; pos < end; pos += 4) {\n // check if node bbox intersects with query bbox\n const x0 = this._boxes[pos];\n if (maxX < x0) continue;\n const y0 = this._boxes[pos + 1];\n if (maxY < y0) continue;\n const x1 = this._boxes[pos + 2];\n if (minX > x1) continue;\n const y1 = this._boxes[pos + 3];\n if (minY > y1) continue;\n\n const index = this._indices[pos >> 2] | 0;\n\n if (nodeIndex >= this.numItems * 4) {\n queue.push(index); // node; add it to the search queue\n\n } else if (filterFn === undefined || filterFn(index, x0, y0, x1, y1)) {\n results.push(index); // leaf item\n }\n }\n\n nodeIndex = queue.pop();\n }\n\n return results;\n }\n\n /**\n * Search items in order of distance from the given point.\n * @param {number} x\n * @param {number} y\n * @param {number} [maxResults=Infinity]\n * @param {number} [maxDistance=Infinity]\n * @param {(index: number) => boolean} [filterFn] An optional function for filtering the results.\n * @returns {number[]} An array of indices of items found.\n */\n neighbors(x, y, maxResults = Infinity, maxDistance = Infinity, filterFn) {\n if (this._pos !== this._boxes.length) {\n throw new Error('Data not yet indexed - call index.finish().');\n }\n\n /** @type number | undefined */\n let nodeIndex = this._boxes.length - 4;\n const q = this._queue;\n const results = [];\n const maxDistSquared = maxDistance * maxDistance;\n\n /* eslint-disable no-labels */\n outer: while (nodeIndex !== undefined) {\n // find the end index of the node\n const end = Math.min(nodeIndex + this.nodeSize * 4, upperBound(nodeIndex, this._levelBounds));\n\n // add child nodes to the queue\n for (let pos = nodeIndex; pos < end; pos += 4) {\n const index = this._indices[pos >> 2] | 0;\n const minX = this._boxes[pos];\n const minY = this._boxes[pos + 1];\n const maxX = this._boxes[pos + 2];\n const maxY = this._boxes[pos + 3];\n const dx = x < minX ? minX - x : x > maxX ? x - maxX : 0;\n const dy = y < minY ? minY - y : y > maxY ? y - maxY : 0;\n const dist = dx * dx + dy * dy;\n if (dist > maxDistSquared) continue;\n\n if (nodeIndex >= this.numItems * 4) {\n q.push(index << 1, dist); // node (use even id)\n\n } else if (filterFn === undefined || filterFn(index)) {\n q.push((index << 1) + 1, dist); // leaf item (use odd id)\n }\n }\n\n // pop items from the queue\n // @ts-expect-error q.length check eliminates undefined values\n while (q.length && (q.peek() & 1)) {\n const dist = q.peekValue();\n // @ts-expect-error\n if (dist > maxDistSquared) break outer;\n // @ts-expect-error\n results.push(q.pop() >> 1);\n if (results.length === maxResults) break outer;\n }\n\n // @ts-expect-error\n nodeIndex = q.length ? q.pop() >> 1 : undefined;\n }\n\n q.clear();\n return results;\n }\n}\n\n/**\n * Binary search for the first value in the array bigger than the given.\n * @param {number} value\n * @param {number[]} arr\n */\nfunction upperBound(value, arr) {\n let i = 0;\n let j = arr.length - 1;\n while (i < j) {\n const m = (i + j) >> 1;\n if (arr[m] > value) {\n j = m;\n } else {\n i = m + 1;\n }\n }\n return arr[i];\n}\n\n/**\n * Custom quicksort that partially sorts bbox data alongside the hilbert values.\n * @param {Uint32Array} values\n * @param {InstanceType<TypedArrayConstructor>} boxes\n * @param {Uint16Array | Uint32Array} indices\n * @param {number} left\n * @param {number} right\n * @param {number} nodeSize\n */\nfunction sort(values, boxes, indices, left, right, nodeSize) {\n const stack = [left, right];\n\n while (stack.length) {\n const r = stack.pop() || 0;\n const l = stack.pop() || 0;\n\n if (r - l <= nodeSize && Math.floor(l / nodeSize) >= Math.floor(r / nodeSize)) continue;\n\n const a = values[l];\n const b = values[(l + r) >> 1];\n const c = values[r];\n const pivot = ((a > b) !== (a > c)) ? a :\n ((b < a) !== (b < c)) ? b : c;\n\n let i = l - 1;\n let j = r + 1;\n\n while (true) {\n do i++; while (values[i] < pivot);\n do j--; while (values[j] > pivot);\n if (i >= j) break;\n swap(values, boxes, indices, i, j);\n }\n\n stack.push(l, j, j + 1, r);\n }\n}\n\n/**\n * Swap two values and two corresponding boxes.\n * @param {Uint32Array} values\n * @param {InstanceType<TypedArrayConstructor>} boxes\n * @param {Uint16Array | Uint32Array} indices\n * @param {number} i\n * @param {number} j\n */\nfunction swap(values, boxes, indices, i, j) {\n const temp = values[i];\n values[i] = values[j];\n values[j] = temp;\n\n const k = 4 * i;\n const m = 4 * j;\n\n const a = boxes[k];\n const b = boxes[k + 1];\n const c = boxes[k + 2];\n const d = boxes[k + 3];\n boxes[k] = boxes[m];\n boxes[k + 1] = boxes[m + 1];\n boxes[k + 2] = boxes[m + 2];\n boxes[k + 3] = boxes[m + 3];\n boxes[m] = a;\n boxes[m + 1] = b;\n boxes[m + 2] = c;\n boxes[m + 3] = d;\n\n const e = indices[i];\n indices[i] = indices[j];\n indices[j] = e;\n}\n\n/**\n * Fast Hilbert curve algorithm by http://threadlocalmutex.com/\n * Ported from C++ https://github.com/rawrunprotected/hilbert_curves (public domain)\n * @param {number} x\n * @param {number} y\n */\nfunction hilbert(x, y) {\n let a = x ^ y;\n let b = 0xFFFF ^ a;\n let c = 0xFFFF ^ (x | y);\n let d = x & (y ^ 0xFFFF);\n\n let A = a | (b >> 1);\n let B = (a >> 1) ^ a;\n let C = ((c >> 1) ^ (b & (d >> 1))) ^ c;\n let D = ((a & (c >> 1)) ^ (d >> 1)) ^ d;\n\n a = A; b = B; c = C; d = D;\n A = ((a & (a >> 2)) ^ (b & (b >> 2)));\n B = ((a & (b >> 2)) ^ (b & ((a ^ b) >> 2)));\n C ^= ((a & (c >> 2)) ^ (b & (d >> 2)));\n D ^= ((b & (c >> 2)) ^ ((a ^ b) & (d >> 2)));\n\n a = A; b = B; c = C; d = D;\n A = ((a & (a >> 4)) ^ (b & (b >> 4)));\n B = ((a & (b >> 4)) ^ (b & ((a ^ b) >> 4)));\n C ^= ((a & (c >> 4)) ^ (b & (d >> 4)));\n D ^= ((b & (c >> 4)) ^ ((a ^ b) & (d >> 4)));\n\n a = A; b = B; c = C; d = D;\n C ^= ((a & (c >> 8)) ^ (b & (d >> 8)));\n D ^= ((b & (c >> 8)) ^ ((a ^ b) & (d >> 8)));\n\n a = C ^ (C >> 1);\n b = D ^ (D >> 1);\n\n let i0 = x ^ y;\n let i1 = b | (0xFFFF ^ (i0 | a));\n\n i0 = (i0 | (i0 << 8)) & 0x00FF00FF;\n i0 = (i0 | (i0 << 4)) & 0x0F0F0F0F;\n i0 = (i0 | (i0 << 2)) & 0x33333333;\n i0 = (i0 | (i0 << 1)) & 0x55555555;\n\n i1 = (i1 | (i1 << 8)) & 0x00FF00FF;\n i1 = (i1 | (i1 << 4)) & 0x0F0F0F0F;\n i1 = (i1 | (i1 << 2)) & 0x33333333;\n i1 = (i1 | (i1 << 1)) & 0x55555555;\n\n return ((i1 << 1) | i0) >>> 0;\n}\n","export default function(values, valueof) {\n let min;\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n }\n return [min, max];\n}\n","// Reference: https://github.com/hms-dbmi/vizarr/blob/82756a8604b1612aa35bb8a292c1451ee9647b70/src/utils.ts#L434\n/**\n * Error thrown when an assertion fails.\n */\nexport class AssertionError extends Error {\n /** @param message The error message. */\n constructor(message: string) {\n super(message);\n this.name = \"AssertionError\";\n }\n}\n\n\n/**\n * Make an assertion. An error is thrown if `expr` does not have truthy value.\n *\n * @param expr The expression to test.\n * @param msg The message to display if the assertion fails.\n */\nexport function assert(expr: unknown, msg = \"\"): asserts expr {\n if (!expr) {\n throw new AssertionError(msg);\n }\n}\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Object.defineProperty === 'function' ) ? Object.defineProperty : null;\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './define_property.js' );\n\n\n// MAIN //\n\n/**\n* Tests for `Object.defineProperty` support.\n*\n* @private\n* @returns {boolean} boolean indicating if an environment has `Object.defineProperty` support\n*\n* @example\n* var bool = hasDefinePropertySupport();\n* // returns <boolean>\n*/\nfunction hasDefinePropertySupport() {\n\t// Test basic support...\n\ttry {\n\t\tdefineProperty( {}, 'x', {} );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasDefinePropertySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @name defineProperty\n* @type {Function}\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nvar defineProperty = Object.defineProperty;\n\n\n// EXPORTS //\n\nmodule.exports = defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( typeof value === 'number' ); // NOTE: we inline the `isNumber.isPrimitive` function from `@stdlib/assert/is-number` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nmodule.exports = isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Tests if a string starts with a minus sign (`-`).\n*\n* @private\n* @param {string} str - input string\n* @returns {boolean} boolean indicating if a string starts with a minus sign (`-`)\n*/\nfunction startsWithMinus( str ) {\n\treturn str[ 0 ] === '-';\n}\n\n/**\n* Returns a string of `n` zeros.\n*\n* @private\n* @param {number} n - number of zeros\n* @returns {string} string of zeros\n*/\nfunction zeros( n ) {\n\tvar out = '';\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout += '0';\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Pads a token with zeros to the specified width.\n*\n* @private\n* @param {string} str - token argument\n* @param {number} width - token width\n* @param {boolean} [right=false] - boolean indicating whether to pad to the right\n* @returns {string} padded token argument\n*/\nfunction zeroPad( str, width, right ) {\n\tvar negative = false;\n\tvar pad = width - str.length;\n\tif ( pad < 0 ) {\n\t\treturn str;\n\t}\n\tif ( startsWithMinus( str ) ) {\n\t\tnegative = true;\n\t\tstr = str.substr( 1 );\n\t}\n\tstr = ( right ) ?\n\t\tstr + zeros( pad ) :\n\t\tzeros( pad ) + str;\n\tif ( negative ) {\n\t\tstr = '-' + str;\n\t}\n\treturn str;\n}\n\n\n// EXPORTS //\n\nmodule.exports = zeroPad;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( './is_number.js' );\nvar zeroPad = require( './zero_pad.js' );\n\n// NOTE: for the following, we explicitly avoid using stdlib packages in this particular package in order to avoid circular dependencies.\nvar lowercase = String.prototype.toLowerCase;\nvar uppercase = String.prototype.toUpperCase;\n\n\n// MAIN //\n\n/**\n* Formats a token object argument as an integer.\n*\n* @private\n* @param {Object} token - token object\n* @throws {Error} must provide a valid integer\n* @returns {string} formatted token argument\n*/\nfunction formatInteger( token ) {\n\tvar base;\n\tvar out;\n\tvar i;\n\n\tswitch ( token.specifier ) {\n\tcase 'b':\n\t\t// Case: %b (binary)\n\t\tbase = 2;\n\t\tbreak;\n\tcase 'o':\n\t\t// Case: %o (octal)\n\t\tbase = 8;\n\t\tbreak;\n\tcase 'x':\n\tcase 'X':\n\t\t// Case: %x, %X (hexadecimal)\n\t\tbase = 16;\n\t\tbreak;\n\tcase 'd':\n\tcase 'i':\n\tcase 'u':\n\tdefault:\n\t\t// Case: %d, %i, %u (decimal)\n\t\tbase = 10;\n\t\tbreak;\n\t}\n\tout = token.arg;\n\ti = parseInt( out, 10 );\n\tif ( !isFinite( i ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.\n\t\tif ( !isNumber( out ) ) {\n\t\t\tthrow new Error( 'invalid integer. Value: ' + out );\n\t\t}\n\t\ti = 0;\n\t}\n\tif ( i < 0 && ( token.specifier === 'u' || base !== 10 ) ) {\n\t\ti = 0xffffffff + i + 1;\n\t}\n\tif ( i < 0 ) {\n\t\tout = ( -i ).toString( base );\n\t\tif ( token.precision ) {\n\t\t\tout = zeroPad( out, token.precision, token.padRight );\n\t\t}\n\t\tout = '-' + out;\n\t} else {\n\t\tout = i.toString( base );\n\t\tif ( !i && !token.precision ) {\n\t\t\tout = '';\n\t\t} else if ( token.precision ) {\n\t\t\tout = zeroPad( out, token.precision, token.padRight );\n\t\t}\n\t\tif ( token.sign ) {\n\t\t\tout = token.sign + out;\n\t\t}\n\t}\n\tif ( base === 16 ) {\n\t\tif ( token.alternate ) {\n\t\t\tout = '0x' + out;\n\t\t}\n\t\tout = ( token.specifier === uppercase.call( token.specifier ) ) ?\n\t\t\tuppercase.call( out ) :\n\t\t\tlowercase.call( out );\n\t}\n\tif ( base === 8 ) {\n\t\tif ( token.alternate && out.charAt( 0 ) !== '0' ) {\n\t\t\tout = '0' + out;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = formatInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nmodule.exports = isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\n// NOTE: for the following, we explicitly avoid using stdlib packages in this particular package in order to avoid circular dependencies.\nvar abs = Math.abs; // eslint-disable-line stdlib/no-builtin-math\nvar lowercase = String.prototype.toLowerCase;\nvar uppercase = String.prototype.toUpperCase;\nvar replace = String.prototype.replace;\n\n\n// VARIABLES //\n\nvar RE_EXP_POS_DIGITS = /e\\+(\\d)$/;\nvar RE_EXP_NEG_DIGITS = /e-(\\d)$/;\nvar RE_ONLY_DIGITS = /^(\\d+)$/;\nvar RE_DIGITS_BEFORE_EXP = /^(\\d+)e/;\nvar RE_TRAILING_PERIOD_ZERO = /\\.0$/;\nvar RE_PERIOD_ZERO_EXP = /\\.0*e/;\nvar RE_ZERO_BEFORE_EXP = /(\\..*[^0])0*e/;\n\n\n// MAIN //\n\n/**\n* Formats a token object argument as a floating-point number.\n*\n* @private\n* @param {number} f - parsed number\n* @param {Object} token - token object\n* @throws {Error} must provide a valid floating-point number\n* @returns {string} formatted token argument\n*/\nfunction formatDouble( f, token ) {\n\tvar digits;\n\tvar out;\n\n\tswitch ( token.specifier ) {\n\tcase 'e':\n\tcase 'E':\n\t\tout = f.toExponential( token.precision );\n\t\tbreak;\n\tcase 'f':\n\tcase 'F':\n\t\tout = f.toFixed( token.precision );\n\t\tbreak;\n\tcase 'g':\n\tcase 'G':\n\t\tif ( abs( f ) < 0.0001 ) {\n\t\t\tdigits = token.precision;\n\t\t\tif ( digits > 0 ) {\n\t\t\t\tdigits -= 1;\n\t\t\t}\n\t\t\tout = f.toExponential( digits );\n\t\t} else {\n\t\t\tout = f.toPrecision( token.precision );\n\t\t}\n\t\tif ( !token.alternate ) {\n\t\t\tout = replace.call( out, RE_ZERO_BEFORE_EXP, '$1e' );\n\t\t\tout = replace.call( out, RE_PERIOD_ZERO_EXP, 'e' );\n\t\t\tout = replace.call( out, RE_TRAILING_PERIOD_ZERO, '' );\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tthrow new Error( 'invalid double notation. Value: ' + token.specifier );\n\t}\n\tout = replace.call( out, RE_EXP_POS_DIGITS, 'e+0$1' );\n\tout = replace.call( out, RE_EXP_NEG_DIGITS, 'e-0$1' );\n\tif ( token.alternate ) {\n\t\tout = replace.call( out, RE_ONLY_DIGITS, '$1.' );\n\t\tout = replace.call( out, RE_DIGITS_BEFORE_EXP, '$1.e' );\n\t}\n\tif ( f >= 0 && token.sign ) {\n\t\tout = token.sign + out;\n\t}\n\tout = ( token.specifier === uppercase.call( token.specifier ) ) ?\n\t\tuppercase.call( out ) :\n\t\tlowercase.call( out );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = formatDouble;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Returns `n` spaces.\n*\n* @private\n* @param {number} n - number of spaces\n* @returns {string} string of spaces\n*/\nfunction spaces( n ) {\n\tvar out = '';\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout += ' ';\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Pads a token with spaces to the specified width.\n*\n* @private\n* @param {string} str - token argument\n* @param {number} width - token width\n* @param {boolean} [right=false] - boolean indicating whether to pad to the right\n* @returns {string} padded token argument\n*/\nfunction spacePad( str, width, right ) {\n\tvar pad = width - str.length;\n\tif ( pad < 0 ) {\n\t\treturn str;\n\t}\n\tstr = ( right ) ?\n\t\tstr + spaces( pad ) :\n\t\tspaces( pad ) + str;\n\treturn str;\n}\n\n\n// EXPORTS //\n\nmodule.exports = spacePad;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar formatInteger = require( './format_integer.js' );\nvar isString = require( './is_string.js' );\nvar isNumber = require( './is_number.js' );\nvar formatDouble = require( './format_double.js' );\nvar spacePad = require( './space_pad.js' );\nvar zeroPad = require( './zero_pad.js' );\n\n\n// VARIABLES //\n\nvar fromCharCode = String.fromCharCode;\nvar isArray = Array.isArray; // NOTE: We use the global `Array.isArray` function here instead of `@stdlib/assert/is-array` to avoid circular dependencies.\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating whether a value is `NaN`.\n*\n* @private\n* @param {*} value - input value\n* @returns {boolean} boolean indicating whether a value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 4 );\n* // returns false\n*/\nfunction isnan( value ) { // explicitly define a function here instead of `@stdlib/math/base/assert/is-nan` in order to avoid circular dependencies\n\treturn ( value !== value );\n}\n\n/**\n* Initializes token object with properties of supplied format identifier object or default values if not present.\n*\n* @private\n* @param {Object} token - format identifier object\n* @returns {Object} token object\n*/\nfunction initialize( token ) {\n\tvar out = {};\n\tout.specifier = token.specifier;\n\tout.precision = ( token.precision === void 0 ) ? 1 : token.precision;\n\tout.width = token.width;\n\tout.flags = token.flags || '';\n\tout.mapping = token.mapping;\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates string from a token array by interpolating values.\n*\n* @param {Array} tokens - string parts and format identifier objects\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be an array\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var tokens = [ 'beep ', { 'specifier': 's' } ];\n* var out = formatInterpolate( tokens, 'boop' );\n* // returns 'beep boop'\n*/\nfunction formatInterpolate( tokens ) {\n\tvar hasPeriod;\n\tvar flags;\n\tvar token;\n\tvar flag;\n\tvar num;\n\tvar out;\n\tvar pos;\n\tvar f;\n\tvar i;\n\tvar j;\n\n\tif ( !isArray( tokens ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be an array. Value: `' + tokens + '`.' );\n\t}\n\tout = '';\n\tpos = 1;\n\tfor ( i = 0; i < tokens.length; i++ ) {\n\t\ttoken = tokens[ i ];\n\t\tif ( isString( token ) ) {\n\t\t\tout += token;\n\t\t} else {\n\t\t\thasPeriod = token.precision !== void 0;\n\t\t\ttoken = initialize( token );\n\t\t\tif ( !token.specifier ) {\n\t\t\t\tthrow new TypeError( 'invalid argument. Token is missing `specifier` property. Index: `'+ i +'`. Value: `' + token + '`.' );\n\t\t\t}\n\t\t\tif ( token.mapping ) {\n\t\t\t\tpos = token.mapping;\n\t\t\t}\n\t\t\tflags = token.flags;\n\t\t\tfor ( j = 0; j < flags.length; j++ ) {\n\t\t\t\tflag = flags.charAt( j );\n\t\t\t\tswitch ( flag ) {\n\t\t\t\tcase ' ':\n\t\t\t\t\ttoken.sign = ' ';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+':\n\t\t\t\t\ttoken.sign = '+';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '0':\n\t\t\t\t\ttoken.padZeros = flags.indexOf( '-' ) < 0; // NOTE: We use built-in `Array.prototype.indexOf` here instead of `@stdlib/assert/contains` in order to avoid circular dependencies.\n\t\t\t\t\tbreak;\n\t\t\t\tcase '#':\n\t\t\t\t\ttoken.alternate = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error( 'invalid flag: ' + flag );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( token.width === '*' ) {\n\t\t\t\ttoken.width = parseInt( arguments[ pos ], 10 );\n\t\t\t\tpos += 1;\n\t\t\t\tif ( isnan( token.width ) ) {\n\t\t\t\t\tthrow new TypeError( 'the argument for * width at position ' + pos + ' is not a number. Value: `' + token.width + '`.' );\n\t\t\t\t}\n\t\t\t\tif ( token.width < 0 ) {\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.width = -token.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( hasPeriod ) {\n\t\t\t\tif ( token.precision === '*' ) {\n\t\t\t\t\ttoken.precision = parseInt( arguments[ pos ], 10 );\n\t\t\t\t\tpos += 1;\n\t\t\t\t\tif ( isnan( token.precision ) ) {\n\t\t\t\t\t\tthrow new TypeError( 'the argument for * precision at position ' + pos + ' is not a number. Value: `' + token.precision + '`.' );\n\t\t\t\t\t}\n\t\t\t\t\tif ( token.precision < 0 ) {\n\t\t\t\t\t\ttoken.precision = 1;\n\t\t\t\t\t\thasPeriod = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttoken.arg = arguments[ pos ];\n\t\t\tswitch ( token.specifier ) {\n\t\t\tcase 'b':\n\t\t\tcase 'o':\n\t\t\tcase 'x':\n\t\t\tcase 'X':\n\t\t\tcase 'd':\n\t\t\tcase 'i':\n\t\t\tcase 'u':\n\t\t\t\t// Case: %b (binary), %o (octal), %x, %X (hexadecimal), %d, %i (decimal), %u (unsigned decimal)\n\t\t\t\tif ( hasPeriod ) {\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatInteger( token );\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\t// Case: %s (string)\n\t\t\t\ttoken.maxWidth = ( hasPeriod ) ? token.precision : -1;\n\t\t\t\ttoken.arg = String( token.arg );\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\t// Case: %c (character)\n\t\t\t\tif ( !isnan( token.arg ) ) {\n\t\t\t\t\tnum = parseInt( token.arg, 10 );\n\t\t\t\t\tif ( num < 0 || num > 127 ) {\n\t\t\t\t\t\tthrow new Error( 'invalid character code. Value: ' + token.arg );\n\t\t\t\t\t}\n\t\t\t\t\ttoken.arg = ( isnan( num ) ) ? String( token.arg ) : fromCharCode( num ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'e':\n\t\t\tcase 'E':\n\t\t\tcase 'f':\n\t\t\tcase 'F':\n\t\t\tcase 'g':\n\t\t\tcase 'G':\n\t\t\t\t// Case: %e, %E (scientific notation), %f, %F (decimal floating point), %g, %G (uses the shorter of %e/E or %f/F)\n\t\t\t\tif ( !hasPeriod ) {\n\t\t\t\t\ttoken.precision = 6;\n\t\t\t\t}\n\t\t\t\tf = parseFloat( token.arg );\n\t\t\t\tif ( !isFinite( f ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.\n\t\t\t\t\tif ( !isNumber( token.arg ) ) {\n\t\t\t\t\t\tthrow new Error( 'invalid floating-point number. Value: ' + out );\n\t\t\t\t\t}\n\t\t\t\t\t// Case: NaN, Infinity, or -Infinity\n\t\t\t\t\tf = token.arg;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatDouble( f, token );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'invalid specifier: ' + token.specifier );\n\t\t\t}\n\t\t\t// Fit argument into field width...\n\t\t\tif ( token.maxWidth >= 0 && token.arg.length > token.maxWidth ) {\n\t\t\t\ttoken.arg = token.arg.substring( 0, token.maxWidth );\n\t\t\t}\n\t\t\tif ( token.padZeros ) {\n\t\t\t\ttoken.arg = zeroPad( token.arg, token.width || token.precision, token.padRight ); // eslint-disable-line max-len\n\t\t\t} else if ( token.width ) {\n\t\t\t\ttoken.arg = spacePad( token.arg, token.width, token.padRight );\n\t\t\t}\n\t\t\tout += token.arg || '';\n\t\t\tpos += 1;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = formatInterpolate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generate string from a token array by interpolating values.\n*\n* @module @stdlib/string/base/format-interpolate\n*\n* @example\n* var formatInterpolate = require( '@stdlib/string/base/format-interpolate' );\n*\n* var tokens = ['Hello ', { 'specifier': 's' }, '!' ];\n* var out = formatInterpolate( tokens, 'World' );\n* // returns 'Hello World!'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar RE = /%(?:([1-9]\\d*)\\$)?([0 +\\-#]*)(\\*|\\d+)?(?:(\\.)(\\*|\\d+)?)?[hlL]?([%A-Za-z])/g;\n\n\n// FUNCTIONS //\n\n/**\n* Parses a delimiter.\n*\n* @private\n* @param {Array} match - regular expression match\n* @returns {Object} delimiter token object\n*/\nfunction parse( match ) {\n\tvar token = {\n\t\t'mapping': ( match[ 1 ] ) ? parseInt( match[ 1 ], 10 ) : void 0,\n\t\t'flags': match[ 2 ],\n\t\t'width': match[ 3 ],\n\t\t'precision': match[ 5 ],\n\t\t'specifier': match[ 6 ]\n\t};\n\tif ( match[ 4 ] === '.' && match[ 5 ] === void 0 ) {\n\t\ttoken.precision = '1';\n\t}\n\treturn token;\n}\n\n\n// MAIN //\n\n/**\n* Tokenizes a string into an array of string parts and format identifier objects.\n*\n* @param {string} str - input string\n* @returns {Array} tokens\n*\n* @example\n* var tokens = formatTokenize( 'Hello %s!' );\n* // returns [ 'Hello ', {...}, '!' ]\n*/\nfunction formatTokenize( str ) {\n\tvar content;\n\tvar tokens;\n\tvar match;\n\tvar prev;\n\n\ttokens = [];\n\tprev = 0;\n\tmatch = RE.exec( str );\n\twhile ( match ) {\n\t\tcontent = str.slice( prev, RE.lastIndex - match[ 0 ].length );\n\t\tif ( content.length ) {\n\t\t\ttokens.push( content );\n\t\t}\n\t\t// Check for an escaped percent sign `%%`...\n\t\tif ( match[ 6 ] === '%' ) {\n\t\t\ttokens.push( '%' );\n\t\t} else {\n\t\t\ttokens.push( parse( match ) );\n\t\t}\n\t\tprev = RE.lastIndex;\n\t\tmatch = RE.exec( str );\n\t}\n\tcontent = str.slice( prev );\n\tif ( content.length ) {\n\t\ttokens.push( content );\n\t}\n\treturn tokens;\n}\n\n\n// EXPORTS //\n\nmodule.exports = formatTokenize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tokenize a string into an array of string parts and format identifier objects.\n*\n* @module @stdlib/string/base/format-tokenize\n*\n* @example\n* var formatTokenize = require( '@stdlib/string/base/format-tokenize' );\n*\n* var str = 'Hello %s!';\n* var tokens = formatTokenize( str );\n* // returns [ 'Hello ', {...}, '!' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nmodule.exports = isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar interpolate = require( './../../base/format-interpolate' );\nvar tokenize = require( './../../base/format-tokenize' );\nvar isString = require( './is_string.js' );\n\n\n// MAIN //\n\n/**\n* Inserts supplied variable values into a format string.\n*\n* @param {string} str - input string\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be a string\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var str = format( 'Hello %s!', 'world' );\n* // returns 'Hello world!'\n*\n* @example\n* var str = format( 'Pi: ~%.2f', 3.141592653589793 );\n* // returns 'Pi: ~3.14'\n*/\nfunction format( str ) {\n\tvar args;\n\tvar i;\n\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\targs = [ tokenize( str ) ];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn interpolate.apply( null, args );\n}\n\n\n// EXPORTS //\n\nmodule.exports = format;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Insert supplied variable values into a format string.\n*\n* @module @stdlib/string/format\n*\n* @example\n* var format = require( '@stdlib/string/format' );\n*\n* var out = format( '%s %s!', 'Hello', 'World' );\n* // returns 'Hello World!'\n*\n* out = format( 'Pi: ~%.2f', 3.141592653589793 );\n* // returns 'Pi: ~3.14'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, no-proto */\n\n'use strict';\n\n// MODULES //\n\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar objectProtoype = Object.prototype;\nvar toStr = objectProtoype.toString;\nvar defineGetter = objectProtoype.__defineGetter__;\nvar defineSetter = objectProtoype.__defineSetter__;\nvar lookupGetter = objectProtoype.__lookupGetter__;\nvar lookupSetter = objectProtoype.__lookupSetter__;\n\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @param {Object} obj - object on which to define the property\n* @param {string} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nfunction defineProperty( obj, prop, descriptor ) {\n\tvar prototype;\n\tvar hasValue;\n\tvar hasGet;\n\tvar hasSet;\n\n\tif ( typeof obj !== 'object' || obj === null || toStr.call( obj ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( typeof descriptor !== 'object' || descriptor === null || toStr.call( descriptor ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Property descriptor must be an object. Value: `%s`.', descriptor ) );\n\t}\n\thasValue = ( 'value' in descriptor );\n\tif ( hasValue ) {\n\t\tif (\n\t\t\tlookupGetter.call( obj, prop ) ||\n\t\t\tlookupSetter.call( obj, prop )\n\t\t) {\n\t\t\t// Override `__proto__` to avoid touching inherited accessors:\n\t\t\tprototype = obj.__proto__;\n\t\t\tobj.__proto__ = objectProtoype;\n\n\t\t\t// Delete property as existing getters/setters prevent assigning value to specified property:\n\t\t\tdelete obj[ prop ];\n\t\t\tobj[ prop ] = descriptor.value;\n\n\t\t\t// Restore original prototype:\n\t\t\tobj.__proto__ = prototype;\n\t\t} else {\n\t\t\tobj[ prop ] = descriptor.value;\n\t\t}\n\t}\n\thasGet = ( 'get' in descriptor );\n\thasSet = ( 'set' in descriptor );\n\n\tif ( hasValue && ( hasGet || hasSet ) ) {\n\t\tthrow new Error( 'invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.' );\n\t}\n\n\tif ( hasGet && defineGetter ) {\n\t\tdefineGetter.call( obj, prop, descriptor.get );\n\t}\n\tif ( hasSet && defineSetter ) {\n\t\tdefineSetter.call( obj, prop, descriptor.set );\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nmodule.exports = defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define (or modify) an object property.\n*\n* @module @stdlib/utils/define-property\n*\n* @example\n* var defineProperty = require( '@stdlib/utils/define-property' );\n*\n* var obj = {};\n* defineProperty( obj, 'foo', {\n* 'value': 'bar',\n* 'writable': false,\n* 'configurable': false,\n* 'enumerable': false\n* });\n* obj.foo = 'boop'; // => throws\n*/\n\n// MODULES //\n\nvar hasDefinePropertySupport = require( './has_define_property_support.js' );\nvar builtin = require( './builtin.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar defineProperty;\nif ( hasDefinePropertySupport() ) {\n\tdefineProperty = builtin;\n} else {\n\tdefineProperty = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setNonEnumerableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setNonEnumerableReadOnly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a non-enumerable read-only property.\n*\n* @module @stdlib/utils/define-nonenumerable-read-only-property\n*\n* @example\n* var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\n*\n* var obj = {};\n*\n* setNonEnumerableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( typeof value === 'number' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests for native `Symbol` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol` support\n*\n* @example\n* var bool = hasSymbolSupport();\n* // returns <boolean>\n*/\nfunction hasSymbolSupport() {\n\treturn (\n\t\ttypeof Symbol === 'function' &&\n\t\ttypeof Symbol( 'foo' ) === 'symbol'\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasSymbolSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test for native `Symbol` support.\n*\n* @module @stdlib/assert/has-symbol-support\n*\n* @example\n* var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' );\n*\n* var bool = hasSymbolSupport();\n* // returns <boolean>\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasSymbols = require( './../../has-symbol-support' );\n\n\n// VARIABLES //\n\nvar FLG = hasSymbols();\n\n\n// MAIN //\n\n/**\n* Tests for native `Symbol.toStringTag` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol.toStringTag` support\n*\n* @example\n* var bool = hasToStringTagSupport();\n* // returns <boolean>\n*/\nfunction hasToStringTagSupport() {\n\treturn ( FLG && typeof Symbol.toStringTag === 'symbol' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasToStringTagSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test for native `toStringTag` support.\n*\n* @module @stdlib/assert/has-tostringtag-support\n*\n* @example\n* var hasToStringTagSupport = require( '@stdlib/assert/has-tostringtag-support' );\n*\n* var bool = hasToStringTagSupport();\n* // returns <boolean>\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar toStr = Object.prototype.toString;\n\n\n// EXPORTS //\n\nmodule.exports = toStr;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar toStr = require( './tostring.js' );\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification (via the internal property `[[Class]]`) of an object.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\treturn toStr.call( v );\n}\n\n\n// EXPORTS //\n\nmodule.exports = nativeClass;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\nvar has = Object.prototype.hasOwnProperty;\n\n\n// MAIN //\n\n/**\n* Tests if an object has a specified property.\n*\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object has a specified property\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'bap' );\n* // returns false\n*/\nfunction hasOwnProp( value, property ) {\n\tif (\n\t\tvalue === void 0 ||\n\t\tvalue === null\n\t) {\n\t\treturn false;\n\t}\n\treturn has.call( value, property );\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasOwnProp;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether an object has a specified property.\n*\n* @module @stdlib/assert/has-own-property\n*\n* @example\n* var hasOwnProp = require( '@stdlib/assert/has-own-property' );\n*\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'boop' );\n* // returns true\n*\n* bool = hasOwnProp( beep, 'bop' );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar Sym = ( typeof Symbol === 'function' ) ? Symbol : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = Sym;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Symbol factory.\n*\n* @module @stdlib/symbol/ctor\n*\n* @example\n* var Symbol = require( '@stdlib/symbol/ctor' );\n*\n* var s = Symbol( 'beep' );\n* // returns <symbol>\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Symbol = require( '@stdlib/symbol/ctor' );\n\n\n// MAIN //\n\nvar toStrTag = ( typeof Symbol === 'function' ) ? Symbol.toStringTag : '';\n\n\n// EXPORTS //\n\nmodule.exports = toStrTag;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar toStringTag = require( './tostringtag.js' );\nvar toStr = require( './tostring.js' );\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification of an object in environments supporting `Symbol.toStringTag`.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\tvar isOwn;\n\tvar tag;\n\tvar out;\n\n\tif ( v === null || v === void 0 ) {\n\t\treturn toStr.call( v );\n\t}\n\ttag = v[ toStringTag ];\n\tisOwn = hasOwnProp( v, toStringTag );\n\n\t// Attempt to override the `toStringTag` property. For built-ins having a `Symbol.toStringTag` property (e.g., `JSON`, `Math`, etc), the `Symbol.toStringTag` property is read-only (e.g., , so we need to wrap in a `try/catch`.\n\ttry {\n\t\tv[ toStringTag ] = void 0;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn toStr.call( v );\n\t}\n\tout = toStr.call( v );\n\n\tif ( isOwn ) {\n\t\tv[ toStringTag ] = tag;\n\t} else {\n\t\tdelete v[ toStringTag ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = nativeClass;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a string value indicating a specification defined classification of an object.\n*\n* @module @stdlib/utils/native-class\n*\n* @example\n* var nativeClass = require( '@stdlib/utils/native-class' );\n*\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* function Beep() {\n* return this;\n* }\n* str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\n\n// MODULES //\n\nvar hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar main;\nif ( hasToStringTag() ) {\n\tmain = polyfill;\n} else {\n\tmain = builtin;\n}\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// EXPORTS //\n\nmodule.exports = Number; // eslint-disable-line stdlib/require-globals\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Constructor which returns a `Number` object.\n*\n* @module @stdlib/number/ctor\n*\n* @example\n* var Number = require( '@stdlib/number/ctor' );\n*\n* var v = new Number( 10.0 );\n* // returns <Number>\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Number = require( '@stdlib/number/ctor' );\n\n\n// MAIN //\n\n// eslint-disable-next-line stdlib/no-redeclare\nvar toString = Number.prototype.toString; // non-generic\n\n\n// EXPORTS //\n\nmodule.exports = toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar toString = require( './tostring.js' ); // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to serialize a value to a string.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value can be serialized\n*/\nfunction test( value ) {\n\ttry {\n\t\ttoString.call( value );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasToStringTag = require( './../../has-tostringtag-support' );\nvar nativeClass = require( '@stdlib/utils/native-class' );\nvar Number = require( '@stdlib/number/ctor' );\nvar test = require( './try2serialize.js' );\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*/\nfunction isNumber( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof Number ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( FLG ) {\n\t\t\treturn test( value );\n\t\t}\n\t\treturn ( nativeClass( value ) === '[object Number]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPrimitive = require( './primitive.js' );\nvar isObject = require( './object.js' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a number\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( null );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a number.\n*\n* @module @stdlib/assert/is-number\n*\n* @example\n* var isNumber = require( '@stdlib/assert/is-number' );\n*\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*\n* bool = isNumber( NaN );\n* // returns true\n*\n* bool = isNumber( null );\n* // returns false\n*\n* @example\n* var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\n*\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* bool = isNumber( NaN );\n* // returns true\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*\n* @example\n* var isNumber = require( '@stdlib/assert/is-number' ).isObject;\n*\n* var bool = isNumber( 3.14 );\n* // returns false\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar isPrimitive = require( './primitive.js' );\nvar isObject = require( './object.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( './../../is-number' ).isPrimitive;\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having a value which is a probability.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having a value which is a probability\n*\n* @example\n* var bool = isProbability( 0.66 );\n* // returns true\n*\n* @example\n* var bool = isProbability( new Number( 0.66 ) );\n* // returns false\n*/\nfunction isProbability( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tvalue >= 0.0 &&\n\t\tvalue <= 1.0\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isProbability;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( './../../is-number' ).isObject;\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a value which is a probability.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a value which is a probability\n*\n* @example\n* var bool = isProbability( 0.5 );\n* // returns false\n*\n* @example\n* var bool = isProbability( new Number( 0.5 ) );\n* // returns true\n*/\nfunction isProbability( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tvalue.valueOf() >= 0.0 &&\n\t\tvalue.valueOf() <= 1.0\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isProbability;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPrimitive = require( './primitive.js' );\nvar isObject = require( './object.js' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is a probability.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a probability\n*\n* @example\n* var bool = isProbability( 0.5 );\n* // returns true\n*\n* @example\n* var bool = isProbability( new Number( 0.5 ) );\n* // returns true\n*\n* @example\n* var bool = isProbability( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isProbability( -5.0 );\n* // returns false\n*\n* @example\n* var bool = isProbability( null );\n* // returns false\n*/\nfunction isProbability( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isProbability;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a probability.\n*\n* @module @stdlib/assert/is-probability\n*\n* @example\n* var isProbability = require( '@stdlib/assert/is-probability' );\n*\n* var bool = isProbability( 0.5 );\n* // returns true\n*\n* bool = isProbability( new Number( 0.5 ) );\n* // returns true\n*\n* bool = isProbability( 3.14 );\n* // returns false\n*\n* bool = isProbability( -5.0 );\n* // returns false\n*\n* bool = isProbability( null );\n* // returns false\n*\n* @example\n* var isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\n*\n* var bool = isProbability( 0.3 );\n* // returns true\n*\n* bool = isProbability( new Number( 0.3 ) );\n* // returns false\n*\n* @example\n* var isProbability = require( '@stdlib/assert/is-probability' ).isObject;\n*\n* var bool = isProbability( 0.77 );\n* // returns false\n*\n* bool = isProbability( new Number( 0.77 ) );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar isPrimitive = require( './primitive.js' );\nvar isObject = require( './object.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: implementation (?)\n\n/**\n* Rounds a double-precision floating-point number toward negative infinity.\n*\n* @param {number} x - input value\n* @returns {number} rounded value\n*\n* @example\n* var v = floor( -4.2 );\n* // returns -5.0\n*\n* @example\n* var v = floor( 9.99999 );\n* // returns 9.0\n*\n* @example\n* var v = floor( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = floor( NaN );\n* // returns NaN\n*/\nvar floor = Math.floor; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nmodule.exports = floor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Round a double-precision floating-point number toward negative infinity.\n*\n* @module @stdlib/math/base/special/floor\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var v = floor( -4.2 );\n* // returns -5.0\n*\n* v = floor( 9.99999 );\n* // returns 9.0\n*\n* v = floor( 0.0 );\n* // returns 0.0\n*\n* v = floor( NaN );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( './../../../../base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Tests if a finite double-precision floating-point number is an integer.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an integer\n*\n* @example\n* var bool = isInteger( 1.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( 3.14 );\n* // returns false\n*/\nfunction isInteger( x ) {\n\treturn (floor(x) === x);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a finite double-precision floating-point number is an integer.\n*\n* @module @stdlib/math/base/assert/is-integer\n*\n* @example\n* var isInteger = require( '@stdlib/math/base/assert/is-integer' );\n*\n* var bool = isInteger( 1.0 );\n* // returns true\n*\n* bool = isInteger( 3.14 );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum length of a generic array.\n*\n* @module @stdlib/constants/array/max-array-length\n*\n* @example\n* var MAX_ARRAY_LENGTH = require( '@stdlib/constants/array/max-array-length' );\n* // returns 4294967295\n*/\n\n// MAIN //\n\n/**\n* Maximum length of a generic array.\n*\n* ```tex\n* 2^{32} - 1\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 4294967295\n*/\nvar MAX_ARRAY_LENGTH = 4294967295>>>0; // asm type annotation\n\n\n// EXPORTS //\n\nmodule.exports = MAX_ARRAY_LENGTH;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isInteger = require( '@stdlib/math/base/assert/is-integer' );\nvar MAX_LENGTH = require( '@stdlib/constants/array/max-array-length' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is array-like.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is array-like\n*\n* @example\n* var bool = isArrayLike( [] );\n* // returns true\n*\n* @example\n* var bool = isArrayLike( { 'length': 10 } );\n* // returns true\n*/\nfunction isArrayLike( value ) {\n\treturn (\n\t\tvalue !== void 0 &&\n\t\tvalue !== null &&\n\t\ttypeof value !== 'function' &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isArrayLike;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is array-like.\n*\n* @module @stdlib/assert/is-array-like\n*\n* @example\n* var isArrayLike = require( '@stdlib/assert/is-array-like' );\n*\n* var bool = isArrayLike( [] );\n* // returns true\n*\n* bool = isArrayLike( { 'length': 10 } );\n* // returns true\n*\n* bool = isArrayLike( 'beep' );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLike = require( './../../../is-array-like' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function which tests if every element in an array-like object passes a test condition.\n*\n* @param {Function} predicate - function to apply\n* @throws {TypeError} must provide a function\n* @returns {Function} an array-like object function\n*\n* @example\n* var isOdd = require( '@stdlib/assert/is-odd' );\n*\n* var arr1 = [ 1, 3, 5, 7 ];\n* var arr2 = [ 3, 5, 8 ];\n*\n* var validate = arraylikefcn( isOdd );\n*\n* var bool = validate( arr1 );\n* // returns true\n*\n* bool = validate( arr2 );\n* // returns false\n*/\nfunction arraylikefcn( predicate ) {\n\tif ( typeof predicate !== 'function' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', predicate ) );\n\t}\n\treturn every;\n\n\t/**\n\t* Tests if every element in an array-like object passes a test condition.\n\t*\n\t* @private\n\t* @param {*} value - value to test\n\t* @returns {boolean} boolean indicating whether a value is an array-like object for which all elements pass a test condition\n\t*/\n\tfunction every( value ) {\n\t\tvar len;\n\t\tvar i;\n\t\tif ( !isArrayLike( value ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tlen = value.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn false;\n\t\t}\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( predicate( value[ i ] ) === false ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = arraylikefcn;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a function which tests if every element in an array-like object passes a test condition.\n*\n* @module @stdlib/assert/tools/array-like-function\n*\n* @example\n* var isOdd = require( '@stdlib/assert/is-odd' );\n* var arraylikefcn = require( '@stdlib/assert/tools/array-like-function' );\n*\n* var arr1 = [ 1, 3, 5, 7 ];\n* var arr2 = [ 3, 5, 8 ];\n*\n* var validate = arraylikefcn( isOdd );\n*\n* var bool = validate( arr1 );\n* // returns true\n*\n* bool = validate( arr2 );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an array-like object containing only probabilities.\n*\n* @module @stdlib/assert/is-probability-array\n*\n* @example\n* var isNonNegativeNumberArray = require( '@stdlib/assert/is-probability-array' );\n*\n* var bool = isProbabilityArray( [ 0.5, new Number(0.8) ] );\n* // returns true\n*\n* bool = isProbabilityArray( [ 0.8, 1.2 ] );\n* // returns false\n*\n* bool = isProbabilityArray( [ 0.8, '0.2' ] );\n* // returns false\n*\n* @example\n* var isProbabilityArray = require( '@stdlib/assert/is-probability-array' ).primitives;\n*\n* var bool = isProbabilityArray( [ 1.0, 0.0, 0.5 ] );\n* // returns true\n*\n* bool = isProbabilityArray( [ 0.3, new Number(0.4) ] );\n* // returns false\n*\n* @example\n* var isProbabilityArray = require( '@stdlib/assert/is-probability-array' ).objects;\n*\n* var bool = isProbabilityArray( [ new Number(0.7), new Number(1.0) ] );\n* // returns true\n*\n* bool = isProbabilityArray( [ 1.0, 0.0, new Number(0.7) ] );\n* // returns false\n*/\n\n// MODULES //\n\nvar isProbability = require( './../../is-probability' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar arrayfun = require( './../../tools/array-like-function' );\n\n\n// VARIABLES //\n\nvar isPrimitiveArray = arrayfun( isProbability.isPrimitive );\nvar isObjectArray = arrayfun( isProbability.isObject );\n\n\n// MAIN //\n\nvar isProbabilityArray = arrayfun( isProbability );\nsetReadOnly( isProbabilityArray, 'primitives', isPrimitiveArray );\nsetReadOnly( isProbabilityArray, 'objects', isObjectArray );\n\n\n// EXPORTS //\n\nmodule.exports = isProbabilityArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Double-precision floating-point positive infinity.\n*\n* @module @stdlib/constants/float64/pinf\n* @type {number}\n*\n* @example\n* var FLOAT64_PINF = require( '@stdlib/constants/float64/pinf' );\n* // returns Infinity\n*/\n\n\n// MAIN //\n\n/**\n* Double-precision floating-point positive infinity.\n*\n* ## Notes\n*\n* Double-precision floating-point positive infinity has the bit sequence\n*\n* ```binarystring\n* 0 11111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default Number.POSITIVE_INFINITY\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_PINF = Number.POSITIVE_INFINITY; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = FLOAT64_PINF;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Double-precision floating-point negative infinity.\n*\n* @module @stdlib/constants/float64/ninf\n* @type {number}\n*\n* @example\n* var FLOAT64_NINF = require( '@stdlib/constants/float64/ninf' );\n* // returns -Infinity\n*/\n\n// MODULES //\n\nvar Number = require( '@stdlib/number/ctor' );\n\n\n// MAIN //\n\n/**\n* Double-precision floating-point negative infinity.\n*\n* ## Notes\n*\n* Double-precision floating-point negative infinity has the bit sequence\n*\n* ```binarystring\n* 1 11111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default Number.NEGATIVE_INFINITY\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_NINF = Number.NEGATIVE_INFINITY;\n\n\n// EXPORTS //\n\nmodule.exports = FLOAT64_NINF;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar NINF = require( '@stdlib/constants/float64/ninf' );\nvar isInt = require( '@stdlib/math/base/assert/is-integer' );\n\n\n// MAIN //\n\n/**\n* Tests if a number primitive is an integer value.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a number primitive is an integer value\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tvalue < PINF &&\n\t\tvalue > NINF &&\n\t\tisInt( value )\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( './../../is-number' ).isPrimitive;\nvar isInt = require( './integer.js' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having an integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having an integer value\n*\n* @example\n* var bool = isInteger( -3.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( new Number( -3.0 ) );\n* // returns false\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisInt( value )\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( './../../is-number' ).isObject;\nvar isInt = require( './integer.js' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having an integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having an integer value\n*\n* @example\n* var bool = isInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisInt( value.valueOf() )\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPrimitive = require( './primitive.js' );\nvar isObject = require( './object.js' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is an integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an integer\n*\n* @example\n* var bool = isInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isInteger( -3.14 );\n* // returns false\n*\n* @example\n* var bool = isInteger( null );\n* // returns false\n*/\nfunction isInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an integer.\n*\n* @module @stdlib/assert/is-integer\n*\n* @example\n* var isInteger = require( '@stdlib/assert/is-integer' );\n*\n* var bool = isInteger( 5.0 );\n* // returns true\n*\n* bool = isInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isInteger( -3.14 );\n* // returns false\n*\n* bool = isInteger( null );\n* // returns false\n*\n* @example\n* // Use interface to check for integer primitives...\n* var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\n*\n* var bool = isInteger( -3.0 );\n* // returns true\n*\n* bool = isInteger( new Number( -3.0 ) );\n* // returns false\n*\n* @example\n* // Use interface to check for integer objects...\n* var isInteger = require( '@stdlib/assert/is-integer' ).isObject;\n*\n* var bool = isInteger( 3.0 );\n* // returns false\n*\n* bool = isInteger( new Number( 3.0 ) );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar isPrimitive = require( './primitive.js' );\nvar isObject = require( './object.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// eslint-disable-next-line stdlib/no-redeclare\nvar valueOf = String.prototype.valueOf; // non-generic\n\n\n// EXPORTS //\n\nmodule.exports = valueOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar valueOf = require( './valueof.js' ); // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to extract a string value.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a string can be extracted\n*/\nfunction test( value ) {\n\ttry {\n\t\tvalueOf.call( value );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasToStringTag = require( './../../has-tostringtag-support' );\nvar nativeClass = require( '@stdlib/utils/native-class' );\nvar test = require( './try2valueof.js' );\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a string object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string object\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns false\n*/\nfunction isString( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof String ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( FLG ) {\n\t\t\treturn test( value );\n\t\t}\n\t\treturn ( nativeClass( value ) === '[object String]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPrimitive = require( './primitive.js' );\nvar isObject = require( './object.js' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is a string.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a string\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*/\nfunction isString( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a string.\n*\n* @module @stdlib/assert/is-string\n*\n* @example\n* var isString = require( '@stdlib/assert/is-string' );\n*\n* var bool = isString( 'beep' );\n* // returns true\n*\n* bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* bool = isString( 5 );\n* // returns false\n*\n* @example\n* var isString = require( '@stdlib/assert/is-string' ).isObject;\n*\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* bool = isString( 'beep' );\n* // returns false\n*\n* @example\n* var isString = require( '@stdlib/assert/is-string' ).isPrimitive;\n*\n* var bool = isString( 'beep' );\n* // returns true\n*\n* bool = isString( new String( 'beep' ) );\n* // returns false\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar isPrimitive = require( './primitive.js' );\nvar isObject = require( './object.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adjusts the p-values via the Bonferroni method.\n*\n* @private\n* @param {ProbabilityArray} pvalues - p-values to be adjusted\n* @param {PositiveInteger} comparisons - number of comparisons\n* @returns {ProbabilityArray} adjusted p-values\n*/\nfunction bonferroni( pvalues, comparisons ) {\n\tvar pval;\n\tvar i;\n\tfor ( i = 0; i < pvalues.length; i++ ) {\n\t\tpval = pvalues[ i ];\n\t\tpvalues[ i ] = ( comparisons * pval > 1 ) ? 1 : comparisons * pval;\n\t}\n\treturn pvalues;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bonferroni;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar NINF = require( '@stdlib/constants/float64/ninf' );\n\n\n// MAIN //\n\n/**\n* Tests if a double-precision floating-point numeric value is negative zero.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is negative zero\n*\n* @example\n* var bool = isNegativeZero( -0.0 );\n* // returns true\n*\n* @example\n* var bool = isNegativeZero( 0.0 );\n* // returns false\n*/\nfunction isNegativeZero( x ) {\n\treturn (x === 0.0 && 1.0/x === NINF);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isNegativeZero;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a double-precision floating-point numeric value is negative zero.\n*\n* @module @stdlib/math/base/assert/is-negative-zero\n*\n* @example\n* var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\n*\n* var bool = isNegativeZero( -0.0 );\n* // returns true\n*\n* bool = isNegativeZero( 0.0 );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests if a double-precision floating-point numeric value is `NaN`.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 7.0 );\n* // returns false\n*/\nfunction isnan( x ) {\n\treturn ( x !== x );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isnan;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a double-precision floating-point numeric value is `NaN`.\n*\n* @module @stdlib/math/base/assert/is-nan\n*\n* @example\n* var isnan = require( '@stdlib/math/base/assert/is-nan' );\n*\n* var bool = isnan( NaN );\n* // returns true\n*\n* bool = isnan( 7.0 );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( './../../../../base/assert/is-negative-zero' );\nvar isnan = require( './../../../../base/assert/is-nan' );\nvar NINF = require( '@stdlib/constants/float64/ninf' );\n\n\n// MAIN //\n\n/**\n* Returns the minimum value.\n*\n* @param {number} x - first number\n* @param {number} y - second number\n* @returns {number} minimum value\n*\n* @example\n* var v = min( 3.14, 4.2 );\n* // returns 3.14\n*\n* @example\n* var v = min( 3.14, NaN );\n* // returns NaN\n*\n* @example\n* var v = min( +0.0, -0.0 );\n* // returns -0.0\n*/\nfunction min( x, y ) {\n\tif ( isnan( x ) || isnan( y ) ) {\n\t\treturn NaN;\n\t}\n\tif ( x === NINF || y === NINF ) {\n\t\treturn NINF;\n\t}\n\tif ( x === y && x === 0.0 ) {\n\t\tif ( isNegativeZero( x ) ) {\n\t\t\treturn x;\n\t\t}\n\t\treturn y;\n\t}\n\tif ( x < y ) {\n\t\treturn x;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = min;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the minimum value.\n*\n* @module @stdlib/math/base/special/min\n*\n* @example\n* var min = require( '@stdlib/math/base/special/min' );\n*\n* var v = min( 3.14, 4.2 );\n* // returns 3.14\n*\n* v = min( 3.14, NaN );\n* // returns NaN\n*\n* v = min( +0.0, -0.0 );\n* // returns -0.0\n*/\n\n// MODULES //\n\nvar min = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = min;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar PINF = require( '@stdlib/constants/float64/pinf' );\n\n\n// MAIN //\n\n/**\n* Tests if a double-precision floating-point numeric value is positive zero.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is positive zero\n*\n* @example\n* var bool = isPositiveZero( 0.0 );\n* // returns true\n*\n* @example\n* var bool = isPositiveZero( -0.0 );\n* // returns false\n*/\nfunction isPositiveZero( x ) {\n\treturn (x === 0.0 && 1.0/x === PINF);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isPositiveZero;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a double-precision floating-point numeric value is positive zero.\n*\n* @module @stdlib/math/base/assert/is-positive-zero\n*\n* @example\n* var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\n*\n* var bool = isPositiveZero( 0.0 );\n* // returns true\n*\n* bool = isPositiveZero( -0.0 );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( './../../../../base/assert/is-positive-zero' );\nvar isnan = require( './../../../../base/assert/is-nan' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\n\n\n// MAIN //\n\n/**\n* Returns the maximum value.\n*\n* @param {number} x - first number\n* @param {number} y - second number\n* @returns {number} maximum value\n*\n* @example\n* var v = max( 3.14, 4.2 );\n* // returns 4.2\n*\n* @example\n* var v = max( 3.14, NaN );\n* // returns NaN\n*\n* @example\n* var v = max( +0.0, -0.0 );\n* // returns +0.0\n*/\nfunction max( x, y ) {\n\tif ( isnan( x ) || isnan( y ) ) {\n\t\treturn NaN;\n\t}\n\tif ( x === PINF || y === PINF ) {\n\t\treturn PINF;\n\t}\n\tif ( x === y && x === 0.0 ) {\n\t\tif ( isPositiveZero( x ) ) {\n\t\t\treturn x;\n\t\t}\n\t\treturn y;\n\t}\n\tif ( x > y ) {\n\t\treturn x;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = max;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the maximum value.\n*\n* @module @stdlib/math/base/special/max\n*\n* @example\n* var max = require( '@stdlib/math/base/special/max' );\n*\n* var v = max( 3.14, 4.2 );\n* // returns 4.2\n*\n* v = max( 3.14, NaN );\n* // returns NaN\n*\n* v = max( +0.0, -0.0 );\n* // returns +0.0\n*/\n\n// MODULES //\n\nvar max = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = max;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nativeClass = require( '@stdlib/utils/native-class' );\n\n\n// VARIABLES //\n\nvar hasFloat64Array = ( typeof Float64Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Float64Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Float64Array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var bool = isFloat64Array( new Float64Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isFloat64Array( [] );\n* // returns false\n*/\nfunction isFloat64Array( value ) {\n\treturn (\n\t\t( hasFloat64Array && value instanceof Float64Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Float64Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isFloat64Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a Float64Array.\n*\n* @module @stdlib/assert/is-float64array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var isFloat64Array = require( '@stdlib/assert/is-float64array' );\n*\n* var bool = isFloat64Array( new Float64Array( 10 ) );\n* // returns true\n*\n* bool = isFloat64Array( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar isFloat64Array = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = isFloat64Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Float64Array === 'function' ) ? Float64Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFloat64Array = require( './../../is-float64array' );\nvar GlobalFloat64Array = require( './float64array.js' );\n\n\n// MAIN //\n\n/**\n* Tests for native `Float64Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Float64Array` support\n*\n* @example\n* var bool = hasFloat64ArraySupport();\n* // returns <boolean>\n*/\nfunction hasFloat64ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalFloat64Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalFloat64Array( [ 1.0, 3.14, -3.14, NaN ] );\n\t\tbool = (\n\t\t\tisFloat64Array( arr ) &&\n\t\t\tarr[ 0 ] === 1.0 &&\n\t\t\tarr[ 1 ] === 3.14 &&\n\t\t\tarr[ 2 ] === -3.14 &&\n\t\t\tarr[ 3 ] !== arr[ 3 ]\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasFloat64ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test for native `Float64Array` support.\n*\n* @module @stdlib/assert/has-float64array-support\n*\n* @example\n* var hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' );\n*\n* var bool = hasFloat64ArraySupport();\n* // returns <boolean>\n*/\n\n// MODULES //\n\nvar hasFloat64ArraySupport = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = hasFloat64ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Float64Array === 'function' ) ? Float64Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of double-precision floating-point numbers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array/float64\n*\n* @example\n* var ctor = require( '@stdlib/array/float64' );\n*\n* var arr = new ctor( 10 );\n* // returns <Float64Array>\n*/\n\n// MODULES //\n\nvar hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat64ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nativeClass = require( '@stdlib/utils/native-class' );\n\n\n// VARIABLES //\n\nvar hasInt32Array = ( typeof Int32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int32Array\n*\n* @example\n* var Int32Array = require( '@stdlib/array/int32' );\n*\n* var bool = isInt32Array( new Int32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt32Array( [] );\n* // returns false\n*/\nfunction isInt32Array( value ) {\n\treturn (\n\t\t( hasInt32Array && value instanceof Int32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isInt32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an Int32Array.\n*\n* @module @stdlib/assert/is-int32array\n*\n* @example\n* var Int32Array = require( '@stdlib/array/int32' );\n* var isInt32Array = require( '@stdlib/assert/is-int32array' );\n*\n* var bool = isInt32Array( new Int32Array( 10 ) );\n* // returns true\n*\n* bool = isInt32Array( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar isInt32Array = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = isInt32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum signed 32-bit integer.\n*\n* @module @stdlib/constants/int32/max\n* @type {integer32}\n*\n* @example\n* var INT32_MAX = require( '@stdlib/constants/int32/max' );\n* // returns 2147483647\n*/\n\n\n// MAIN //\n\n/**\n* Maximum signed 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{31} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 01111111111111111111111111111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 2147483647\n*/\nvar INT32_MAX = 2147483647|0; // asm type annotation\n\n\n// EXPORTS //\n\nmodule.exports = INT32_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Minimum signed 32-bit integer.\n*\n* @module @stdlib/constants/int32/min\n* @type {integer32}\n*\n* @example\n* var INT32_MIN = require( '@stdlib/constants/int32/min' );\n* // returns -2147483648\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* -(2^{31})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 10000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -2147483648\n*/\nvar INT32_MIN = -2147483648|0; // asm type annotation\n\n\n// EXPORTS //\n\nmodule.exports = INT32_MIN;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Int32Array === 'function' ) ? Int32Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isInt32Array = require( './../../is-int32array' );\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar INT32_MIN = require( '@stdlib/constants/int32/min' );\nvar GlobalInt32Array = require( './int32array.js' );\n\n\n// MAIN //\n\n/**\n* Tests for native `Int32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int32Array` support\n*\n* @example\n* var bool = hasInt32ArraySupport();\n* // returns <boolean>\n*/\nfunction hasInt32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt32Array( [ 1, 3.14, -3.14, INT32_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT32_MIN // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasInt32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test for native `Int32Array` support.\n*\n* @module @stdlib/assert/has-int32array-support\n*\n* @example\n* var hasInt32ArraySupport = require( '@stdlib/assert/has-int32array-support' );\n*\n* var bool = hasInt32ArraySupport();\n* // returns <boolean>\n*/\n\n// MODULES //\n\nvar hasInt32ArraySupport = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = hasInt32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Int32Array === 'function' ) ? Int32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 32-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 32-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array/int32\n*\n* @example\n* var ctor = require( '@stdlib/array/int32' );\n*\n* var arr = new ctor( 10 );\n* // returns <Int32Array>\n*/\n\n// MODULES //\n\nvar hasInt32ArraySupport = require( '@stdlib/assert/has-int32array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Int32Array = require( '@stdlib/array/int32' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a comparison result. If `-1`, `a` comes before `b`. If `1`, `b` comes before `a`. If `0`, the order stays the same.\n*\n* @private\n* @param {number} a - first number\n* @param {number} b - second number\n* @returns {boolean} comparison result\n*/\nfunction ascending( a, b ) {\n\tif ( a < b ) {\n\t\treturn -1;\n\t}\n\tif ( a > b ) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\n/**\n* Returns a comparison result. If `-1`, `a` comes before `b`. If `1`, `b` comes before `a`. If `0`, the order stays the same.\n*\n* @private\n* @param {number} a - first number\n* @param {number} b - second number\n* @returns {boolean} comparison result\n*/\nfunction descending( a, b ) {\n\tif ( a < b ) {\n\t\treturn 1;\n\t}\n\tif ( a > b ) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\n\n// MAIN //\n\n/**\n* Returns a permutation which rearranges input array.\n*\n* @private\n* @param {ArrayLike} x - input array-like object\n* @param {boolean} invert - controls whether to permutation that sorts input array in descending order\n* @returns {Array} permutation array\n*/\nfunction order( x, invert ) {\n\tvar comparator;\n\tvar arr;\n\tvar i;\n\n\tcomparator = ( invert ) ? descending : ascending;\n\tarr = new Int32Array( x.length );\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\tarr[ i ] = i;\n\t}\n\treturn arr.sort( compare );\n\n\t/**\n\t* Compare the elements of the input array.\n\t*\n\t* @private\n\t* @param {number} a - first number\n\t* @param {number} b - second number\n\t* @returns {boolean} comparison result\n\t*/\n\tfunction compare( a, b ) {\n\t\treturn comparator( x[a], x[b] );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = order;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar min = require( '@stdlib/math/base/special/min' );\nvar max = require( '@stdlib/math/base/special/max' );\nvar Float64Array = require( '@stdlib/array/float64' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar order = require( './order.js' );\n\n\n// VARIABLES //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Adjusts the p-values via Hommel's method.\n*\n* @private\n* @param {ProbabilityArray} pvalues - p-values to be adjusted\n* @param {PositiveInteger} comparisons - number of comparisons\n* @returns {ProbabilityArray} adjusted p-values\n*/\nfunction hommel( pvalues, comparisons ) {\n\tvar indices;\n\tvar diff;\n\tvar adj;\n\tvar idx;\n\tvar len;\n\tvar out;\n\tvar mq;\n\tvar m;\n\tvar i;\n\tvar j;\n\tvar k;\n\tvar q;\n\tvar v;\n\n\tlen = pvalues.length;\n\tdiff = comparisons - len;\n\tif ( diff > 0 ) {\n\t\tpvalues = slice.call( pvalues );\n\t\twhile ( diff > 0 ) {\n\t\t\tpvalues.push( 1.0 );\n\t\t\tdiff -= 1;\n\t\t}\n\t}\n\tindices = order( pvalues );\n\tm = PINF;\n\tfor ( i = 0; i < comparisons; i++ ) {\n\t\tv = comparisons * pvalues[ i ] / ( i+1 );\n\t\tif ( v < m ) {\n\t\t\tm = v;\n\t\t}\n\t}\n\tq = new Float64Array( comparisons );\n\tadj = new Float64Array( comparisons );\n\tfor ( i = comparisons - 1; i > 1; i-- ) {\n\t\tmq = PINF;\n\t\tfor ( k = comparisons - i + 1; k <= comparisons; k++ ) {\n\t\t\tv = i * pvalues[ indices[ k ] ] / ( 2 + k - comparisons + i - 1 );\n\t\t\tif ( v < mq ) {\n\t\t\t\tmq = v;\n\t\t\t}\n\t\t}\n\t\tfor ( j = 0; j < comparisons - i + 1; j++ ) {\n\t\t\tq[ j ] = min( i * pvalues[ indices[ j ] ], mq );\n\t\t}\n\t\tfor ( k = comparisons - i + 1; k <= comparisons; k++ ) {\n\t\t\tq[ k ] = q[ comparisons - i ];\n\t\t}\n\t\tfor ( j = 0; j < adj.length; j++ ) {\n\t\t\tadj[ j ] = max( q[ j ], adj[ j ] );\n\t\t}\n\t}\n\tout = new Array( len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tidx = indices[ i ];\n\t\tv = max( adj[ i ], pvalues[ idx ] );\n\t\tout[ idx ] = v;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hommel;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the index offset which specifies the location of the first indexed value in a strided array.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {integer} stride - index increment\n* @returns {NonNegativeInteger} offset - offset\n*\n* @example\n* var offset = stride2offset( 10, -10 );\n* // returns 90\n*/\nfunction stride2offset( N, stride ) {\n\tif ( stride > 0 ) {\n\t\treturn 0;\n\t}\n\treturn ( 1 - N ) * stride;\n}\n\n\n// EXPORTS //\n\nmodule.exports = stride2offset;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Determine the index offset which specifies the location of the first indexed value in a strided array.\n*\n* @module @stdlib/strided/base/stride2offset\n*\n* @example\n* var stride2offset = require( '@stdlib/strided/base/stride2offset' );\n*\n* var offset = stride2offset( 10, -10 );\n* // returns 90\n*/\n\n// MODULES //\n\nvar stride2offset = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = stride2offset;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar TYPE = 'function';\n\n\n// MAIN //\n\n/**\n* Tests if an array-like object supports the accessor (get/set) protocol.\n*\n* @param {Object} value - value to test\n* @returns {boolean} boolean indicating whether a value is an accessor array\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isAccessorArray( [] );\n* // returns false\n*/\nfunction isAccessorArray( value ) {\n\treturn ( typeof value.get === TYPE && typeof value.set === TYPE ); // eslint-disable-line valid-typeof\n}\n\n\n// EXPORTS //\n\nmodule.exports = isAccessorArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if an array-like object supports the accessor (get/set) protocol.\n*\n* @module @stdlib/array/base/assert/is-accessor-array\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n* var isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* bool = isAccessorArray( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar GETTERS = {\n\t'float64': getFloat64,\n\t'float32': getFloat32,\n\t'int32': getInt32,\n\t'int16': getInt16,\n\t'int8': getInt8,\n\t'uint32': getUint32,\n\t'uint16': getUint16,\n\t'uint8': getUint8,\n\t'uint8c': getUint8c,\n\t'generic': getGeneric,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat64( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat64( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var arr = new Float32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat32( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat32( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Int32Array = require( '@stdlib/array/int32' );\n*\n* var arr = new Int32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt32( arr, 2 );\n* // returns 3\n*/\nfunction getInt32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Int16Array = require( '@stdlib/array/int16' );\n*\n* var arr = new Int16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt16( arr, 2 );\n* // returns 3\n*/\nfunction getInt16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Int8Array = require( '@stdlib/array/int8' );\n*\n* var arr = new Int8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt8( arr, 2 );\n* // returns 3\n*/\nfunction getInt8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Uint32Array = require( '@stdlib/array/uint32' );\n*\n* var arr = new Uint32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint32( arr, 2 );\n* // returns 3\n*/\nfunction getUint32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Uint16Array = require( '@stdlib/array/uint16' );\n*\n* var arr = new Uint16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint16( arr, 2 );\n* // returns 3\n*/\nfunction getUint16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Uint8Array = require( '@stdlib/array/uint8' );\n*\n* var arr = new Uint8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8( arr, 2 );\n* // returns 3\n*/\nfunction getUint8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Uint8ClampedArray = require( '@stdlib/array/uint8c' );\n*\n* var arr = new Uint8ClampedArray( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8c( arr, 2 );\n* // returns 3\n*/\nfunction getUint8c( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getGeneric( arr, 2 );\n* // returns 3\n*/\nfunction getGeneric( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* var dtype = require( '@stdlib/array/dtype' );\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 2 );\n* // returns 3\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an accessor function for retrieving an element from an indexed array-like object.\n*\n* @module @stdlib/array/base/getter\n*\n* @example\n* var dtype = require( '@stdlib/array/dtype' );\n* var getter = require( '@stdlib/array/base/getter' );\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 2 );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar SETTERS = {\n\t'float64': setFloat64,\n\t'float32': setFloat32,\n\t'int32': setInt32,\n\t'int16': setInt16,\n\t'int8': setInt8,\n\t'uint32': setUint32,\n\t'uint16': setUint16,\n\t'uint8': setUint8,\n\t'uint8c': setUint8c,\n\t'generic': setGeneric,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var arr = new Float64Array( 4 );\n*\n* setFloat64( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat64( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var arr = new Float32Array( 4 );\n*\n* setFloat32( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Int32Array = require( '@stdlib/array/int32' );\n*\n* var arr = new Int32Array( 4 );\n*\n* setInt32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Int16Array = require( '@stdlib/array/int16' );\n*\n* var arr = new Int16Array( 4 );\n*\n* setInt16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Int8Array = require( '@stdlib/array/int8' );\n*\n* var arr = new Int8Array( 4 );\n*\n* setInt8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Uint32Array = require( '@stdlib/array/uint32' );\n*\n* var arr = new Uint32Array( 4 );\n*\n* setUint32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Uint16Array = require( '@stdlib/array/uint16' );\n*\n* var arr = new Uint16Array( 4 );\n*\n* setUint16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Uint8Array = require( '@stdlib/array/uint8' );\n*\n* var arr = new Uint8Array( 4 );\n*\n* setUint8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* var Uint8ClampedArray = require( '@stdlib/array/uint8c' );\n*\n* var arr = new Uint8ClampedArray( 4 );\n*\n* setUint8c( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8c( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setGeneric( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setGeneric( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setArrayLike( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* var dtype = require( '@stdlib/array/dtype' );\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nmodule.exports = setter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an accessor function for setting an element in an indexed array-like object.\n*\n* @module @stdlib/array/base/setter\n*\n* @example\n* var dtype = require( '@stdlib/array/dtype' );\n* var setter = require( '@stdlib/array/base/setter' );\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 2, 10 );\n*\n* var v = arr[ 2 ];\n* // returns 10\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar GETTERS = {\n\t'complex128': getComplex128,\n\t'complex64': getComplex64,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex128( arr, 1 );\n* // returns <Complex128>[ 3.0, 4.0 ]\n*/\nfunction getComplex128( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex64( arr, 1 );\n* // returns <Complex64>[ 3.0, 4.0 ]\n*/\nfunction getComplex64( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var dtype = require( '@stdlib/array/dtype' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 1 );\n* // returns <Complex64>[ 3.0, 4.0 ]\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an accessor function for retrieving an element from an array-like object supporting the get/set protocol.\n*\n* @module @stdlib/array/base/accessor-getter\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var dtype = require( '@stdlib/array/dtype' );\n* var getter = require( '@stdlib/array/base/accessor-getter' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 1 );\n* // returns <Complex64>[ 3.0, 4.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar SETTERS = {\n\t'complex128': setComplex128,\n\t'complex64': setComplex64,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex128( arr, 1, new Complex128( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns <Complex128>[ 10.0, 11.0 ]\n*/\nfunction setComplex128( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex64( arr, 1, new Complex64( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns <Complex64>[ 10.0, 11.0 ]\n*/\nfunction setComplex64( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* setArrayLike( arr, 2, 10 );\n*\n* var v = arr[ 2 ];\n* // returns 10\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n* var dtype = require( '@stdlib/array/dtype' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 1, new Complex64( 10.0, 11.0 ) );\n*\n* var v = arr.get( 1 );\n* // returns <Complex64>[ 10.0, 11.0 ]\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nmodule.exports = setter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an accessor function for setting an element in an array-like object supporting the get/set protocol.\n*\n* @module @stdlib/array/base/accessor-setter\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n* var dtype = require( '@stdlib/array/dtype' );\n* var setter = require( '@stdlib/array/base/accessor-setter' );\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 1, new Complex64( 10.0, 11.0 ) );\n*\n* var v = arr.get( 1 );\n* // returns <Complex64>[ 10.0, 11.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nativeClass = require( '@stdlib/utils/native-class' );\n\n\n// VARIABLES //\n\nvar f;\n\n\n// FUNCTIONS //\n\n/**\n* Tests if a value is an array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an array\n*\n* @example\n* var bool = isArray( [] );\n* // returns true\n*\n* @example\n* var bool = isArray( {} );\n* // returns false\n*/\nfunction isArray( value ) {\n\treturn ( nativeClass( value ) === '[object Array]' );\n}\n\n\n// MAIN //\n\nif ( Array.isArray ) {\n\tf = Array.isArray;\n} else {\n\tf = isArray;\n}\n\n\n// EXPORTS //\n\nmodule.exports = f;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an array.\n*\n* @module @stdlib/assert/is-array\n*\n* @example\n* var isArray = require( '@stdlib/assert/is-array' );\n*\n* var bool = isArray( [] );\n* // returns true\n*\n* bool = isArray( {} );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( './../../../is-array' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function which tests if every element in an array passes a test condition.\n*\n* @param {Function} predicate - function to apply\n* @throws {TypeError} must provide a function\n* @returns {Function} an array function\n*\n* @example\n* var isOdd = require( '@stdlib/assert/is-odd' );\n*\n* var arr1 = [ 1, 3, 5, 7 ];\n* var arr2 = [ 3, 5, 8 ];\n*\n* var validate = arrayfcn( isOdd );\n*\n* var bool = validate( arr1 );\n* // returns true\n*\n* bool = validate( arr2 );\n* // returns false\n*/\nfunction arrayfcn( predicate ) {\n\tif ( typeof predicate !== 'function' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', predicate ) );\n\t}\n\treturn every;\n\n\t/**\n\t* Tests if every element in an array passes a test condition.\n\t*\n\t* @private\n\t* @param {*} value - value to test\n\t* @returns {boolean} boolean indicating whether a value is an array for which all elements pass a test condition\n\t*/\n\tfunction every( value ) {\n\t\tvar len;\n\t\tvar i;\n\t\tif ( !isArray( value ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tlen = value.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn false;\n\t\t}\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( predicate( value[ i ] ) === false ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = arrayfcn;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a function which tests if every element in an array passes a test condition.\n*\n* @module @stdlib/assert/tools/array-function\n*\n* @example\n* var isOdd = require( '@stdlib/assert/is-odd' );\n* var arrayfcn = require( '@stdlib/assert/tools/array-function' );\n*\n* var arr1 = [ 1, 3, 5, 7 ];\n* var arr2 = [ 3, 5, 8 ];\n*\n* var validate = arrayfcn( isOdd );\n*\n* var bool = validate( arr1 );\n* // returns true\n*\n* bool = validate( arr2 );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is object-like.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is object-like\n*\n* @example\n* var bool = isObjectLike( {} );\n* // returns true\n*\n* @example\n* var bool = isObjectLike( [] );\n* // returns true\n*\n* @example\n* var bool = isObjectLike( null );\n* // returns false\n*/\nfunction isObjectLike( value ) {\n\treturn (\n\t\tvalue !== null &&\n\t\ttypeof value === 'object'\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isObjectLike;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is object-like.\n*\n* @module @stdlib/assert/is-object-like\n*\n* @example\n* var isObjectLike = require( '@stdlib/assert/is-object-like' );\n*\n* var bool = isObjectLike( {} );\n* // returns true\n*\n* bool = isObjectLike( [] );\n* // returns true\n*\n* bool = isObjectLike( null );\n* // returns false\n*\n* @example\n* var isObjectLike = require( '@stdlib/assert/is-object-like' ).isObjectLikeArray;\n*\n* var bool = isObjectLike( [ {}, [] ] );\n* // returns true\n*\n* bool = isObjectLike( [ {}, '3.0' ] );\n* // returns false\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar arrayfun = require( './../../tools/array-function' );\nvar main = require( './main.js' );\n\n\n// VARIABLES //\n\nvar isObjectLikeArray = arrayfun( main );\n\n\n// MAIN //\n\nsetReadOnly( main, 'isObjectLikeArray', isObjectLikeArray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObjectLike = require( './../../is-object-like' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Buffer instance.\n*\n* @param {*} value - value to validate\n* @returns {boolean} boolean indicating if a value is a Buffer instance\n*\n* @example\n* var v = isBuffer( new Buffer( 'beep' ) );\n* // returns true\n*\n* @example\n* var v = isBuffer( new Buffer( [1,2,3,4] ) );\n* // returns true\n*\n* @example\n* var v = isBuffer( {} );\n* // returns false\n*\n* @example\n* var v = isBuffer( [] );\n* // returns false\n*/\nfunction isBuffer( value ) {\n\treturn (\n\t\tisObjectLike( value ) &&\n\t\t(\n\t\t\t// eslint-disable-next-line no-underscore-dangle\n\t\t\tvalue._isBuffer || // for envs missing Object.prototype.constructor (e.g., Safari 5-7)\n\t\t\t(\n\t\t\t\tvalue.constructor &&\n\n\t\t\t\t// WARNING: `typeof` is not a foolproof check, as certain envs consider RegExp and NodeList instances to be functions\n\t\t\t\ttypeof value.constructor.isBuffer === 'function' &&\n\t\t\t\tvalue.constructor.isBuffer( value )\n\t\t\t)\n\t\t)\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isBuffer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a Buffer instance.\n*\n* @module @stdlib/assert/is-buffer\n*\n* @example\n* var isBuffer = require( '@stdlib/assert/is-buffer' );\n*\n* var v = isBuffer( new Buffer( 'beep' ) );\n* // returns true\n*\n* v = isBuffer( {} );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* @returns {RegExp} regular expression\n*\n* @example\n* var RE_FUNCTION_NAME = reFunctionName();\n*\n* function fname( fcn ) {\n* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];\n* }\n*\n* var fn = fname( Math.sqrt );\n* // returns 'sqrt'\n*\n* fn = fname( Int8Array );\n* // returns 'Int8Array'\n*\n* fn = fname( Object.prototype.toString );\n* // returns 'toString'\n*\n* fn = fname( function(){} );\n* // returns ''\n*/\nfunction reFunctionName() {\n\treturn /^\\s*function\\s*([^(]*)/i;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reFunctionName;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar reFunctionName = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Captures everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* Regular expression: `/^\\s*function\\s*([^(]*)/i`\n*\n* - `/^\\s*`\n* - Match zero or more spaces at beginning\n*\n* - `function`\n* - Match the word `function`\n*\n* - `\\s*`\n* - Match zero or more spaces after the word `function`\n*\n* - `()`\n* - Capture\n*\n* - `[^(]*`\n* - Match anything except a left parenthesis `(` zero or more times\n*\n* - `/i`\n* - ignore case\n*\n* @constant\n* @type {RegExp}\n* @default /^\\s*function\\s*([^(]*)/i\n*/\nvar RE_FUNCTION_NAME = reFunctionName();\n\n\n// EXPORTS //\n\nmodule.exports = RE_FUNCTION_NAME;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* @module @stdlib/regexp/function-name\n*\n* @example\n* var reFunctionName = require( '@stdlib/regexp/function-name' );\n* var RE_FUNCTION_NAME = reFunctionName();\n*\n* function fname( fcn ) {\n* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];\n* }\n*\n* var fn = fname( Math.sqrt );\n* // returns 'sqrt'\n*\n* fn = fname( Int8Array );\n* // returns 'Int8Array'\n*\n* fn = fname( Object.prototype.toString );\n* // returns 'toString'\n*\n* fn = fname( function(){} );\n* // returns ''\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar REGEXP = require( './regexp.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'REGEXP', REGEXP );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nativeClass = require( './../../native-class' );\nvar RE = require( '@stdlib/regexp/function-name' ).REGEXP;\nvar isBuffer = require( '@stdlib/assert/is-buffer' );\n\n\n// MAIN //\n\n/**\n* Determines the name of a value's constructor.\n*\n* @param {*} v - input value\n* @returns {string} name of a value's constructor\n*\n* @example\n* var v = constructorName( 'a' );\n* // returns 'String'\n*\n* @example\n* var v = constructorName( 5 );\n* // returns 'Number'\n*\n* @example\n* var v = constructorName( null );\n* // returns 'Null'\n*\n* @example\n* var v = constructorName( undefined );\n* // returns 'Undefined'\n*\n* @example\n* var v = constructorName( function noop() {} );\n* // returns 'Function'\n*/\nfunction constructorName( v ) {\n\tvar match;\n\tvar name;\n\tvar ctor;\n\tname = nativeClass( v ).slice( 8, -1 );\n\tif ( (name === 'Object' || name === 'Error') && v.constructor ) {\n\t\tctor = v.constructor;\n\t\tif ( typeof ctor.name === 'string' ) {\n\t\t\treturn ctor.name;\n\t\t}\n\t\tmatch = RE.exec( ctor.toString() );\n\t\tif ( match ) {\n\t\t\treturn match[ 1 ];\n\t\t}\n\t}\n\tif ( isBuffer( v ) ) {\n\t\treturn 'Buffer';\n\t}\n\treturn name;\n}\n\n\n// EXPORTS //\n\nmodule.exports = constructorName;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Determine the name of a value's constructor.\n*\n* @module @stdlib/utils/constructor-name\n*\n* @example\n* var constructorName = require( '@stdlib/utils/constructor-name' );\n*\n* var v = constructorName( 'a' );\n* // returns 'String'\n*\n* v = constructorName( {} );\n* // returns 'Object'\n*\n* v = constructorName( true );\n* // returns 'Boolean'\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Mapping from array constructors to data types...\nvar ctor2dtypes = {\n\t'Float32Array': 'float32',\n\t'Float64Array': 'float64',\n\t'Array': 'generic',\n\t'Int16Array': 'int16',\n\t'Int32Array': 'int32',\n\t'Int8Array': 'int8',\n\t'Uint16Array': 'uint16',\n\t'Uint32Array': 'uint32',\n\t'Uint8Array': 'uint8',\n\t'Uint8ClampedArray': 'uint8c',\n\t'Complex64Array': 'complex64',\n\t'Complex128Array': 'complex128',\n\t'BooleanArray': 'bool'\n};\n\n\n// EXPORTS //\n\nmodule.exports = ctor2dtypes;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nativeClass = require( '@stdlib/utils/native-class' );\n\n\n// VARIABLES //\n\nvar hasFloat32Array = ( typeof Float32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Float32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Float32Array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var bool = isFloat32Array( new Float32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isFloat32Array( [] );\n* // returns false\n*/\nfunction isFloat32Array( value ) {\n\treturn (\n\t\t( hasFloat32Array && value instanceof Float32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Float32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isFloat32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a Float32Array.\n*\n* @module @stdlib/assert/is-float32array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var isFloat32Array = require( '@stdlib/assert/is-float32array' );\n*\n* var bool = isFloat32Array( new Float32Array( 10 ) );\n* // returns true\n*\n* bool = isFloat32Array( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar isFloat32Array = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = isFloat32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Float32Array === 'function' ) ? Float32Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFloat32Array = require( './../../is-float32array' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar GlobalFloat32Array = require( './float32array.js' );\n\n\n// MAIN //\n\n/**\n* Tests for native `Float32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Float32Array` support\n*\n* @example\n* var bool = hasFloat32ArraySupport();\n* // returns <boolean>\n*/\nfunction hasFloat32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalFloat32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalFloat32Array( [ 1.0, 3.14, -3.14, 5.0e40 ] );\n\t\tbool = (\n\t\t\tisFloat32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1.0 &&\n\t\t\tarr[ 1 ] === 3.140000104904175 &&\n\t\t\tarr[ 2 ] === -3.140000104904175 &&\n\t\t\tarr[ 3 ] === PINF\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasFloat32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test for native `Float32Array` support.\n*\n* @module @stdlib/assert/has-float32array-support\n*\n* @example\n* var hasFloat32ArraySupport = require( '@stdlib/assert/has-float32array-support' );\n*\n* var bool = hasFloat32ArraySupport();\n* // returns <boolean>\n*/\n\n// MODULES //\n\nvar hasFloat32ArraySupport = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = hasFloat32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Float32Array === 'function' ) ? Float32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of single-precision floating-point numbers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of single-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array/float32\n*\n* @example\n* var ctor = require( '@stdlib/array/float32' );\n*\n* var arr = new ctor( 10 );\n* // returns <Float32Array>\n*/\n\n// MODULES //\n\nvar hasFloat32ArraySupport = require( '@stdlib/assert/has-float32array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nativeClass = require( '@stdlib/utils/native-class' );\n\n\n// VARIABLES //\n\nvar hasUint32Array = ( typeof Uint32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint32Array\n*\n* @example\n* var Uint32Array = require( '@stdlib/array/uint32' );\n*\n* var bool = isUint32Array( new Uint32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint32Array( [] );\n* // returns false\n*/\nfunction isUint32Array( value ) {\n\treturn (\n\t\t( hasUint32Array && value instanceof Uint32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isUint32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a Uint32Array.\n*\n* @module @stdlib/assert/is-uint32array\n*\n* @example\n* var Uint32Array = require( '@stdlib/array/uint32' );\n* var isUint32Array = require( '@stdlib/assert/is-uint32array' );\n*\n* var bool = isUint32Array( new Uint32Array( 10 ) );\n* // returns true\n*\n* bool = isUint32Array( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar isUint32Array = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = isUint32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum unsigned 32-bit integer.\n*\n* @module @stdlib/constants/uint32/max\n* @type {uinteger32}\n*\n* @example\n* var UINT32_MAX = require( '@stdlib/constants/uint32/max' );\n* // returns 4294967295\n*/\n\n\n// MAIN //\n\n/**\n* Maximum unsigned 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{32} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 11111111111111111111111111111111\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 4294967295\n*/\nvar UINT32_MAX = 4294967295;\n\n\n// EXPORTS //\n\nmodule.exports = UINT32_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint32Array === 'function' ) ? Uint32Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isUint32Array = require( './../../is-uint32array' );\nvar UINT32_MAX = require( '@stdlib/constants/uint32/max' );\nvar GlobalUint32Array = require( './uint32array.js' );\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint32Array` support\n*\n* @example\n* var bool = hasUint32ArraySupport();\n* // returns <boolean>\n*/\nfunction hasUint32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT32_MAX+1, UINT32_MAX+2 ];\n\t\tarr = new GlobalUint32Array( arr );\n\t\tbool = (\n\t\t\tisUint32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT32_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasUint32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test for native `Uint32Array` support.\n*\n* @module @stdlib/assert/has-uint32array-support\n*\n* @example\n* var hasUint32ArraySupport = require( '@stdlib/assert/has-uint32array-support' );\n*\n* var bool = hasUint32ArraySupport();\n* // returns <boolean>\n*/\n\n// MODULES //\n\nvar hasUint32ArraySupport = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = hasUint32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint32Array === 'function' ) ? Uint32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 32-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 32-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array/uint32\n*\n* @example\n* var ctor = require( '@stdlib/array/uint32' );\n*\n* var arr = new ctor( 10 );\n* // returns <Uint32Array>\n*/\n\n// MODULES //\n\nvar hasUint32ArraySupport = require( '@stdlib/assert/has-uint32array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nativeClass = require( '@stdlib/utils/native-class' );\n\n\n// VARIABLES //\n\nvar hasUint16Array = ( typeof Uint16Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint16Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint16Array\n*\n* @example\n* var Uint16Array = require( '@stdlib/array/uint16' );\n*\n* var bool = isUint16Array( new Uint16Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint16Array( [] );\n* // returns false\n*/\nfunction isUint16Array( value ) {\n\treturn (\n\t\t( hasUint16Array && value instanceof Uint16Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint16Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isUint16Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a Uint16Array.\n*\n* @module @stdlib/assert/is-uint16array\n*\n* @example\n* var Uint16Array = require( '@stdlib/array/uint16' );\n* var isUint16Array = require( '@stdlib/assert/is-uint16array' );\n*\n* var bool = isUint16Array( new Uint16Array( 10 ) );\n* // returns true\n*\n* bool = isUint16Array( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar isUint16Array = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = isUint16Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum unsigned 16-bit integer.\n*\n* @module @stdlib/constants/uint16/max\n* @type {integer32}\n*\n* @example\n* var UINT16_MAX = require( '@stdlib/constants/uint16/max' );\n* // returns 65535\n*/\n\n\n// MAIN //\n\n/**\n* Maximum unsigned 16-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{16} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 1111111111111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 65535\n*/\nvar UINT16_MAX = 65535|0; // asm type annotation\n\n\n// EXPORTS //\n\nmodule.exports = UINT16_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint16Array === 'function' ) ? Uint16Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isUint16Array = require( './../../is-uint16array' );\nvar UINT16_MAX = require( '@stdlib/constants/uint16/max' );\nvar GlobalUint16Array = require( './uint16array.js' );\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint16Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint16Array` support\n*\n* @example\n* var bool = hasUint16ArraySupport();\n* // returns <boolean>\n*/\nfunction hasUint16ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint16Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT16_MAX+1, UINT16_MAX+2 ];\n\t\tarr = new GlobalUint16Array( arr );\n\t\tbool = (\n\t\t\tisUint16Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT16_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasUint16ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test for native `Uint16Array` support.\n*\n* @module @stdlib/assert/has-uint16array-support\n*\n* @example\n* var hasUint16ArraySupport = require( '@stdlib/assert/has-uint16array-support' );\n*\n* var bool = hasUint16ArraySupport();\n* // returns <boolean>\n*/\n\n// MODULES //\n\nvar hasUint16ArraySupport = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = hasUint16ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint16Array === 'function' ) ? Uint16Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 16-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 16-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array/uint16\n*\n* @example\n* var ctor = require( '@stdlib/array/uint16' );\n*\n* var arr = new ctor( 10 );\n* // returns <Uint16Array>\n*/\n\n// MODULES //\n\nvar hasUint16ArraySupport = require( '@stdlib/assert/has-uint16array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint16ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nativeClass = require( '@stdlib/utils/native-class' );\n\n\n// VARIABLES //\n\nvar hasInt16Array = ( typeof Int16Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int16Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int16Array\n*\n* @example\n* var Int16Array = require( '@stdlib/array/int16' );\n*\n* var bool = isInt16Array( new Int16Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt16Array( [] );\n* // returns false\n*/\nfunction isInt16Array( value ) {\n\treturn (\n\t\t( hasInt16Array && value instanceof Int16Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int16Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isInt16Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an Int16Array.\n*\n* @module @stdlib/assert/is-int16array\n*\n* @example\n* var Int16Array = require( '@stdlib/array/int16' );\n* var isInt16Array = require( '@stdlib/assert/is-int16array' );\n*\n* var bool = isInt16Array( new Int16Array( 10 ) );\n* // returns true\n*\n* bool = isInt16Array( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar isInt16Array = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = isInt16Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum signed 16-bit integer.\n*\n* @module @stdlib/constants/int16/max\n* @type {integer32}\n*\n* @example\n* var INT16_MAX = require( '@stdlib/constants/int16/max' );\n* // returns 32767\n*/\n\n\n// MAIN //\n\n/**\n* Maximum signed 16-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{15} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 0111111111111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 32767\n*/\nvar INT16_MAX = 32767|0; // asm type annotation\n\n\n// EXPORTS //\n\nmodule.exports = INT16_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Minimum signed 16-bit integer.\n*\n* @module @stdlib/constants/int16/min\n* @type {integer32}\n*\n* @example\n* var INT16_MIN = require( '@stdlib/constants/int16/min' );\n* // returns -32768\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 16-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* -(2^{15})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 1000000000000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -32768\n*/\nvar INT16_MIN = -32768|0; // asm type annotation\n\n\n// EXPORTS //\n\nmodule.exports = INT16_MIN;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Int16Array === 'function' ) ? Int16Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isInt16Array = require( './../../is-int16array' );\nvar INT16_MAX = require( '@stdlib/constants/int16/max' );\nvar INT16_MIN = require( '@stdlib/constants/int16/min' );\nvar GlobalInt16Array = require( './int16array.js' );\n\n\n// MAIN //\n\n/**\n* Tests for native `Int16Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int16Array` support\n*\n* @example\n* var bool = hasInt16ArraySupport();\n* // returns <boolean>\n*/\nfunction hasInt16ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt16Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt16Array( [ 1, 3.14, -3.14, INT16_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt16Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT16_MIN // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasInt16ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test for native `Int16Array` support.\n*\n* @module @stdlib/assert/has-int16array-support\n*\n* @example\n* var hasInt16ArraySupport = require( '@stdlib/assert/has-int16array-support' );\n*\n* var bool = hasInt16ArraySupport();\n* // returns <boolean>\n*/\n\n// MODULES //\n\nvar hasInt16ArraySupport = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = hasInt16ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Int16Array === 'function' ) ? Int16Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 16-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 16-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array/int16\n*\n* @example\n* var ctor = require( '@stdlib/array/int16' );\n*\n* var arr = new ctor( 10 );\n* // returns <Int16Array>\n*/\n\n// MODULES //\n\nvar hasInt16ArraySupport = require( '@stdlib/assert/has-int16array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt16ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nativeClass = require( '@stdlib/utils/native-class' );\n\n\n// VARIABLES //\n\nvar hasUint8Array = ( typeof Uint8Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint8Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint8Array\n*\n* @example\n* var Uint8Array = require( '@stdlib/array/uint8' );\n*\n* var bool = isUint8Array( new Uint8Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint8Array( [] );\n* // returns false\n*/\nfunction isUint8Array( value ) {\n\treturn (\n\t\t( hasUint8Array && value instanceof Uint8Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint8Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isUint8Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a Uint8Array.\n*\n* @module @stdlib/assert/is-uint8array\n*\n* @example\n* var Uint8Array = require( '@stdlib/array/uint8' );\n* var isUint8Array = require( '@stdlib/assert/is-uint8array' );\n*\n* var bool = isUint8Array( new Uint8Array( 10 ) );\n* // returns true\n*\n* bool = isUint8Array( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar isUint8Array = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = isUint8Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum unsigned 8-bit integer.\n*\n* @module @stdlib/constants/uint8/max\n* @type {integer32}\n*\n* @example\n* var UINT8_MAX = require( '@stdlib/constants/uint8/max' );\n* // returns 255\n*/\n\n\n// MAIN //\n\n/**\n* Maximum unsigned 8-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{8} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 11111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 255\n*/\nvar UINT8_MAX = 255|0; // asm type annotation\n\n\n// EXPORTS //\n\nmodule.exports = UINT8_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint8Array === 'function' ) ? Uint8Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isUint8Array = require( './../../is-uint8array' );\nvar UINT8_MAX = require( '@stdlib/constants/uint8/max' );\nvar GlobalUint8Array = require( './uint8array.js' );\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint8Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint8Array` support\n*\n* @example\n* var bool = hasUint8ArraySupport();\n* // returns <boolean>\n*/\nfunction hasUint8ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint8Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT8_MAX+1, UINT8_MAX+2 ];\n\t\tarr = new GlobalUint8Array( arr );\n\t\tbool = (\n\t\t\tisUint8Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT8_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasUint8ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test for native `Uint8Array` support.\n*\n* @module @stdlib/assert/has-uint8array-support\n*\n* @example\n* var hasUint8ArraySupport = require( '@stdlib/assert/has-uint8array-support' );\n*\n* var bool = hasUint8ArraySupport();\n* // returns <boolean>\n*/\n\n// MODULES //\n\nvar hasUint8ArraySupport = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = hasUint8ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint8Array === 'function' ) ? Uint8Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 8-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array/uint8\n*\n* @example\n* var ctor = require( '@stdlib/array/uint8' );\n*\n* var arr = new ctor( 10 );\n* // returns <Uint8Array>\n*/\n\n// MODULES //\n\nvar hasUint8ArraySupport = require( '@stdlib/assert/has-uint8array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nativeClass = require( '@stdlib/utils/native-class' );\n\n\n// VARIABLES //\n\nvar hasUint8ClampedArray = ( typeof Uint8ClampedArray === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint8ClampedArray.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint8ClampedArray\n*\n* @example\n* var Uint8ClampedArray = require( '@stdlib/array/uint8c' );\n*\n* var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint8ClampedArray( [] );\n* // returns false\n*/\nfunction isUint8ClampedArray( value ) {\n\treturn (\n\t\t( hasUint8ClampedArray && value instanceof Uint8ClampedArray ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint8ClampedArray]'\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isUint8ClampedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a Uint8ClampedArray.\n*\n* @module @stdlib/assert/is-uint8clampedarray\n*\n* @example\n* var Uint8ClampedArray = require( '@stdlib/array/uint8c' );\n* var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' );\n*\n* var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) );\n* // returns true\n*\n* bool = isUint8ClampedArray( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar isUint8ClampedArray = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = isUint8ClampedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isUint8ClampedArray = require( './../../is-uint8clampedarray' );\nvar GlobalUint8ClampedArray = require( './uint8clampedarray.js' );\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint8ClampedArray` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint8ClampedArray` support\n*\n* @example\n* var bool = hasUint8ClampedArraySupport();\n* // returns <boolean>\n*/\nfunction hasUint8ClampedArraySupport() { // eslint-disable-line id-length\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint8ClampedArray !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalUint8ClampedArray( [ -1, 0, 1, 3.14, 4.99, 255, 256 ] );\n\t\tbool = (\n\t\t\tisUint8ClampedArray( arr ) &&\n\t\t\tarr[ 0 ] === 0 && // clamped\n\t\t\tarr[ 1 ] === 0 &&\n\t\t\tarr[ 2 ] === 1 &&\n\t\t\tarr[ 3 ] === 3 && // round to nearest\n\t\t\tarr[ 4 ] === 5 && // round to nearest\n\t\t\tarr[ 5 ] === 255 &&\n\t\t\tarr[ 6 ] === 255 // clamped\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasUint8ClampedArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test for native `Uint8ClampedArray` support.\n*\n* @module @stdlib/assert/has-uint8clampedarray-support\n*\n* @example\n* var hasUint8ClampedArraySupport = require( '@stdlib/assert/has-uint8clampedarray-support' );\n*\n* var bool = hasUint8ClampedArraySupport();\n* // returns <boolean>\n*/\n\n// MODULES //\n\nvar hasUint8ClampedArraySupport = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = hasUint8ClampedArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.\n*\n* @module @stdlib/array/uint8c\n*\n* @example\n* var ctor = require( '@stdlib/array/uint8c' );\n*\n* var arr = new ctor( 10 );\n* // returns <Uint8ClampedArray>\n*/\n\n// MODULES //\n\nvar hasUint8ClampedArraySupport = require( '@stdlib/assert/has-uint8clampedarray-support' ); // eslint-disable-line id-length\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ClampedArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nativeClass = require( '@stdlib/utils/native-class' );\n\n\n// VARIABLES //\n\nvar hasInt8Array = ( typeof Int8Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int8Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int8Array\n*\n* @example\n* var Int8Array = require( '@stdlib/array/int8' );\n*\n* var bool = isInt8Array( new Int8Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt8Array( [] );\n* // returns false\n*/\nfunction isInt8Array( value ) {\n\treturn (\n\t\t( hasInt8Array && value instanceof Int8Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int8Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isInt8Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an Int8Array.\n*\n* @module @stdlib/assert/is-int8array\n*\n* @example\n* var Int8Array = require( '@stdlib/array/int8' );\n* var isInt8Array = require( '@stdlib/assert/is-int8array' );\n*\n* var bool = isInt8Array( new Int8Array( 10 ) );\n* // returns true\n*\n* bool = isInt8Array( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar isInt8Array = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = isInt8Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum signed 8-bit integer.\n*\n* @module @stdlib/constants/int8/max\n* @type {integer32}\n*\n* @example\n* var INT8_MAX = require( '@stdlib/constants/int8/max' );\n* // returns 127\n*/\n\n\n// MAIN //\n\n/**\n* Maximum signed 8-bit integer.\n*\n* ## Notes\n*\n* The number is given by\n*\n* ```tex\n* 2^{7} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 01111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 127\n*/\nvar INT8_MAX = 127|0; // asm type annotation\n\n\n// EXPORTS //\n\nmodule.exports = INT8_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Minimum signed 8-bit integer.\n*\n* @module @stdlib/constants/int8/min\n* @type {integer32}\n*\n* @example\n* var INT8_MIN = require( '@stdlib/constants/int8/min' );\n* // returns -128\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 8-bit integer.\n*\n* ## Notes\n*\n* The number is given by\n*\n* ```tex\n* -(2^{7})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 10000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -128\n*/\nvar INT8_MIN = -128|0; // asm type annotation\n\n\n// EXPORTS //\n\nmodule.exports = INT8_MIN;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Int8Array === 'function' ) ? Int8Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isInt8Array = require( './../../is-int8array' );\nvar INT8_MAX = require( '@stdlib/constants/int8/max' );\nvar INT8_MIN = require( '@stdlib/constants/int8/min' );\nvar GlobalInt8Array = require( './int8array.js' );\n\n\n// MAIN //\n\n/**\n* Tests for native `Int8Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int8Array` support\n*\n* @example\n* var bool = hasInt8ArraySupport();\n* // returns <boolean>\n*/\nfunction hasInt8ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt8Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt8Array( [ 1, 3.14, -3.14, INT8_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt8Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT8_MIN // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasInt8ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test for native `Int8Array` support.\n*\n* @module @stdlib/assert/has-int8array-support\n*\n* @example\n* var hasInt8ArraySupport = require( '@stdlib/assert/has-int8array-support' );\n*\n* var bool = hasInt8ArraySupport();\n* // returns <boolean>\n*/\n\n// MODULES //\n\nvar hasInt8ArraySupport = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = hasInt8ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Int8Array === 'function' ) ? Int8Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 8-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 8-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array/int8\n*\n* @example\n* var ctor = require( '@stdlib/array/int8' );\n*\n* var arr = new ctor( 10 );\n* // returns <Int8Array>\n*/\n\n// MODULES //\n\nvar hasInt8ArraySupport = require( '@stdlib/assert/has-int8array-support' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt8ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isInteger = require( './../../is-integer' ).isPrimitive;\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having a nonnegative integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having a nonnegative integer value\n*\n* @example\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns false\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue >= 0\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isInteger = require( './../../is-integer' ).isObject;\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a nonnegative integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a nonnegative integer value\n*\n* @example\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue.valueOf() >= 0\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPrimitive = require( './primitive.js' );\nvar isObject = require( './object.js' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is a nonnegative integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a nonnegative integer\n*\n* @example\n* var bool = isNonNegativeInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( -5.0 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( null );\n* // returns false\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a nonnegative integer.\n*\n* @module @stdlib/assert/is-nonnegative-integer\n*\n* @example\n* var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );\n*\n* var bool = isNonNegativeInteger( 5.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isNonNegativeInteger( -5.0 );\n* // returns false\n*\n* bool = isNonNegativeInteger( 3.14 );\n* // returns false\n*\n* bool = isNonNegativeInteger( null );\n* // returns false\n*\n* @example\n* var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\n*\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns false\n*\n* @example\n* var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isObject;\n*\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns false\n*\n* bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar isPrimitive = require( './primitive.js' );\nvar isObject = require( './object.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isInteger = require( '@stdlib/math/base/assert/is-integer' );\nvar MAX_LENGTH = require( '@stdlib/constants/array/max-array-length' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is an array-like object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is an array-like object\n*\n* @example\n* var bool = isArrayLikeObject( [] );\n* // returns true\n*\n* @example\n* var bool = isArrayLikeObject( { 'length': 10 } );\n* // returns true\n*\n* @example\n* var bool = isArrayLikeObject( 'beep' );\n* // returns false\n*/\nfunction isArrayLikeObject( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isArrayLikeObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an array-like object.\n*\n* @module @stdlib/assert/is-array-like-object\n*\n* @example\n* var isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\n*\n* var bool = isArrayLikeObject( [] );\n* // returns true\n*\n* bool = isArrayLikeObject( { 'length':10 } );\n* // returns true\n*\n* bool = isArrayLikeObject( 'beep' );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum length of a typed array.\n*\n* @module @stdlib/constants/array/max-typed-array-length\n*\n* @example\n* var MAX_TYPED_ARRAY_LENGTH = require( '@stdlib/constants/array/max-typed-array-length' );\n* // returns 9007199254740991\n*/\n\n// MAIN //\n\n/**\n* Maximum length of a typed array.\n*\n* ```tex\n* 2^{53} - 1\n* ```\n*\n* @constant\n* @type {number}\n* @default 9007199254740991\n*/\nvar MAX_TYPED_ARRAY_LENGTH = 9007199254740991;\n\n\n// EXPORTS //\n\nmodule.exports = MAX_TYPED_ARRAY_LENGTH;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isInteger = require( '@stdlib/math/base/assert/is-integer' );\nvar MAX_LENGTH = require( '@stdlib/constants/array/max-typed-array-length' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is a collection.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is a collection\n*\n* @example\n* var bool = isCollection( [] );\n* // returns true\n*\n* @example\n* var bool = isCollection( {} );\n* // returns false\n*/\nfunction isCollection( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isCollection;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a collection.\n*\n* @module @stdlib/assert/is-collection\n*\n* @example\n* var isCollection = require( '@stdlib/assert/is-collection' );\n*\n* var bool = isCollection( [] );\n* // returns true\n*\n* bool = isCollection( {} );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nativeClass = require( '@stdlib/utils/native-class' );\n\n\n// VARIABLES //\n\nvar hasArrayBuffer = ( typeof ArrayBuffer === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an ArrayBuffer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an ArrayBuffer\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var bool = isArrayBuffer( new ArrayBuffer( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isArrayBuffer( [] );\n* // returns false\n*/\nfunction isArrayBuffer( value ) {\n\treturn (\n\t\t( hasArrayBuffer && value instanceof ArrayBuffer ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object ArrayBuffer]'\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isArrayBuffer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an ArrayBuffer.\n*\n* @module @stdlib/assert/is-arraybuffer\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' );\n*\n* var bool = isArrayBuffer( new ArrayBuffer( 10 ) );\n* // returns true\n*\n* bool = isArrayBuffer( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArray = require( './../../is-array' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is an object; e.g., `{}`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an object\n*\n* @example\n* var bool = isObject( {} );\n* // returns true\n*\n* @example\n* var bool = isObject( null );\n* // returns false\n*/\nfunction isObject( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t!isArray( value )\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an object.\n*\n* @module @stdlib/assert/is-object\n*\n* @example\n* var isObject = require( '@stdlib/assert/is-object' );\n*\n* var bool = isObject( {} );\n* // returns true\n*\n* bool = isObject( true );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an array of strings.\n*\n* @module @stdlib/assert/is-string-array\n*\n* @example\n* var isStringArray = require( '@stdlib/assert/is-string-array' );\n*\n* var bool = isStringArray( [ 'abc', 'def' ] );\n* // returns true\n*\n* bool = isStringArray( [ 'abc', 123 ] );\n* // returns false\n*\n* @example\n* var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\n*\n* var bool = isStringArray( [ 'abc', 'def' ] );\n* // returns true\n*\n* bool = isStringArray( [ 'abc', new String( 'def' ) ] );\n* // returns false\n*\n* @example\n* var isStringArray = require( '@stdlib/assert/is-string-array' ).objects;\n*\n* var bool = isStringArray( [ new String( 'abc' ), new String( 'def' ) ] );\n* // returns true\n*\n* bool = isStringArray( [ new String( 'abc' ), 'def' ] );\n* // returns false\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar arrayfun = require( './../../tools/array-function' );\nvar isString = require( './../../is-string' );\n\n\n// VARIABLES //\n\nvar isPrimitiveArray = arrayfun( isString.isPrimitive );\nvar isObjectArray = arrayfun( isString.isObject );\n\n\n// MAIN //\n\nvar isStringArray = arrayfun( isString );\nsetReadOnly( isStringArray, 'primitives', isPrimitiveArray );\nsetReadOnly( isStringArray, 'objects', isObjectArray );\n\n\n// EXPORTS //\n\nmodule.exports = isStringArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\nvar RE = /./;\n\n\n// EXPORTS //\n\nmodule.exports = RE;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a boolean primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a boolean primitive\n*\n* @example\n* var bool = isBoolean( true );\n* // returns true\n*\n* @example\n* var bool = isBoolean( false );\n* // returns true\n*\n* @example\n* var Boolean = require( '@stdlib/boolean/ctor' );\n*\n* var bool = isBoolean( new Boolean( true ) );\n* // returns false\n*/\nfunction isBoolean( value ) {\n\treturn ( typeof value === 'boolean' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a boolean.\n*\n* @name Boolean\n* @constructor\n* @type {Function}\n* @param {*} value - input value\n* @returns {(boolean|Boolean)} boolean\n*\n* @example\n* var b = Boolean( null );\n* // returns false\n*\n* b = Boolean( [] );\n* // returns true\n*\n* b = Boolean( {} );\n* // returns true\n*\n* @example\n* var b = new Boolean( false );\n* // returns <Boolean>\n*/\nvar Bool = Boolean; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = Bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Boolean constructor.\n*\n* @module @stdlib/boolean/ctor\n*\n* @example\n* var Boolean = require( '@stdlib/boolean/ctor' );\n*\n* var b = Boolean( null );\n* // returns false\n*\n* b = Boolean( [] );\n* // returns true\n*\n* b = Boolean( {} );\n* // returns true\n*\n* @example\n* var Boolean = require( '@stdlib/boolean/ctor' );\n*\n* var b = new Boolean( false );\n* // returns <Boolean>\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// eslint-disable-next-line stdlib/no-redeclare\nvar toString = Boolean.prototype.toString; // non-generic\n\n\n// EXPORTS //\n\nmodule.exports = toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar toString = require( './tostring.js' ); // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to serialize a value to a string.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value can be serialized\n*/\nfunction test( value ) {\n\ttry {\n\t\ttoString.call( value );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasToStringTag = require( './../../has-tostringtag-support' );\nvar nativeClass = require( '@stdlib/utils/native-class' );\nvar Boolean = require( '@stdlib/boolean/ctor' );\nvar test = require( './try2serialize.js' );\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a boolean object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a boolean object\n*\n* @example\n* var bool = isBoolean( true );\n* // returns false\n*\n* @example\n* var Boolean = require( '@stdlib/boolean/ctor' );\n*\n* var bool = isBoolean( new Boolean( false ) );\n* // returns true\n*/\nfunction isBoolean( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof Boolean ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( FLG ) {\n\t\t\treturn test( value );\n\t\t}\n\t\treturn ( nativeClass( value ) === '[object Boolean]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = isBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPrimitive = require( './primitive.js' );\nvar isObject = require( './object.js' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is a boolean.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a boolean\n*\n* @example\n* var bool = isBoolean( false );\n* // returns true\n*\n* @example\n* var bool = isBoolean( true );\n* // returns true\n*\n* @example\n* var Boolean = require( '@stdlib/boolean/ctor' );\n*\n* var bool = isBoolean( new Boolean( false ) );\n* // returns true\n*\n* @example\n* var Boolean = require( '@stdlib/boolean/ctor' );\n*\n* var bool = isBoolean( new Boolean( true ) );\n* // returns true\n*/\nfunction isBoolean( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a boolean.\n*\n* @module @stdlib/assert/is-boolean\n*\n* @example\n* var Boolean = require( '@stdlib/boolean/ctor' );\n* var isBoolean = require( '@stdlib/assert/is-boolean' );\n*\n* var bool = isBoolean( false );\n* // returns true\n*\n* bool = isBoolean( new Boolean( false ) );\n* // returns true\n*\n* @example\n* var Boolean = require( '@stdlib/boolean/ctor' );\n* var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\n*\n* var bool = isBoolean( false );\n* // returns true\n*\n* bool = isBoolean( new Boolean( true ) );\n* // returns false\n*\n* @example\n* var Boolean = require( '@stdlib/boolean/ctor' );\n* var isBoolean = require( '@stdlib/assert/is-boolean' ).isObject;\n*\n* var bool = isBoolean( true );\n* // returns false\n*\n* bool = isBoolean( new Boolean( false ) );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar isPrimitive = require( './primitive.js' );\nvar isObject = require( './object.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the global object using code generation.\n*\n* @private\n* @returns {Object} global object\n*/\nfunction getGlobal() {\n\treturn new Function( 'return this;' )(); // eslint-disable-line no-new-func, stdlib/require-globals\n}\n\n\n// EXPORTS //\n\nmodule.exports = getGlobal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof self === 'object' ) ? self : null;\n\n\n// EXPORTS //\n\nmodule.exports = obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof window === 'object' ) ? window : null;\n\n\n// EXPORTS //\n\nmodule.exports = obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof globalThis === 'object' ) ? globalThis : null; // eslint-disable-line no-undef\n\n\n// EXPORTS //\n\nmodule.exports = obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar getThis = require( './codegen.js' );\nvar Self = require( './self.js' );\nvar Win = require( './window.js' );\nvar GlobalThis = require( './global_this.js' );\n\n\n// MAIN //\n\n/**\n* Returns the global object.\n*\n* ## Notes\n*\n* - Using code generation is the **most** reliable way to resolve the global object; however, doing so is likely to violate content security policies (CSPs) in, e.g., Chrome Apps and elsewhere.\n*\n* @private\n* @param {boolean} [codegen=false] - boolean indicating whether to use code generation to resolve the global object\n* @throws {TypeError} must provide a boolean\n* @throws {Error} unable to resolve global object\n* @returns {Object} global object\n*\n* @example\n* var g = getGlobal();\n* // returns {...}\n*/\nfunction getGlobal( codegen ) {\n\tif ( arguments.length ) {\n\t\tif ( !isBoolean( codegen ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a boolean. Value: `%s`.', codegen ) );\n\t\t}\n\t\tif ( codegen ) {\n\t\t\treturn getThis();\n\t\t}\n\t\t// Fall through...\n\t}\n\t// Case: 2020 revision of ECMAScript standard\n\tif ( GlobalThis ) {\n\t\treturn GlobalThis;\n\t}\n\t// Case: browsers and web workers\n\tif ( Self ) {\n\t\treturn Self;\n\t}\n\t// Case: browsers\n\tif ( Win ) {\n\t\treturn Win;\n\t}\n\t// Case: unknown\n\tthrow new Error( 'unexpected error. Unable to resolve global object.' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getGlobal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getGlobal = require( './../../../global' );\n\n\n// MAIN //\n\nvar root = getGlobal();\nvar nodeList = root.document && root.document.childNodes;\n\n\n// EXPORTS //\n\nmodule.exports = nodeList;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\nvar typedarray = Int8Array; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nmodule.exports = typedarray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar RE = require( './fixtures/re.js' );\nvar nodeList = require( './fixtures/nodelist.js' );\nvar typedarray = require( './fixtures/typedarray.js' );\n\n\n// MAIN //\n\n/**\n* Checks whether a polyfill is needed when using the `typeof` operator.\n*\n* @private\n* @returns {boolean} boolean indicating whether a polyfill is needed\n*/\nfunction check() {\n\tif (\n\t\t// Chrome 1-12 returns 'function' for regular expression instances (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof):\n\t\ttypeof RE === 'function' ||\n\n\t\t// Safari 8 returns 'object' for typed array and weak map constructors (underscore #1929):\n\t\ttypeof typedarray === 'object' ||\n\n\t\t// PhantomJS 1.9 returns 'function' for `NodeList` instances (underscore #2236):\n\t\ttypeof nodeList === 'function'\n\t) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = check;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ctorName = require( './../../constructor-name' );\n\n\n// NOTES //\n\n/*\n* Built-in `typeof` operator behavior:\n*\n* ```text\n* typeof null => 'object'\n* typeof undefined => 'undefined'\n* typeof 'a' => 'string'\n* typeof 5 => 'number'\n* typeof NaN => 'number'\n* typeof true => 'boolean'\n* typeof false => 'boolean'\n* typeof {} => 'object'\n* typeof [] => 'object'\n* typeof function foo(){} => 'function'\n* typeof function* foo(){} => 'object'\n* typeof Symbol() => 'symbol'\n* ```\n*\n*/\n\n\n// MAIN //\n\n/**\n* Determines a value's type.\n*\n* @param {*} v - input value\n* @returns {string} string indicating the value's type\n*/\nfunction typeOf( v ) {\n\tvar type;\n\n\t// Address `typeof null` => `object` (see http://wiki.ecmascript.org/doku.php?id=harmony:typeof_null):\n\tif ( v === null ) {\n\t\treturn 'null';\n\t}\n\ttype = typeof v;\n\n\t// If the `typeof` operator returned something other than `object`, we are done. Otherwise, we need to check for an internal class name or search for a constructor.\n\tif ( type === 'object' ) {\n\t\treturn ctorName( v ).toLowerCase();\n\t}\n\treturn type;\n}\n\n\n// EXPORTS //\n\nmodule.exports = typeOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ctorName = require( './../../constructor-name' );\n\n\n// MAIN //\n\n/**\n* Determines a value's type.\n*\n* @param {*} v - input value\n* @returns {string} string indicating the value's type\n*/\nfunction typeOf( v ) {\n\treturn ctorName( v ).toLowerCase();\n}\n\n\n// EXPORTS //\n\nmodule.exports = typeOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Determine a value's type.\n*\n* @module @stdlib/utils/type-of\n*\n* @example\n* var typeOf = require( '@stdlib/utils/type-of' );\n*\n* var str = typeOf( 'a' );\n* // returns 'string'\n*\n* str = typeOf( 5 );\n* // returns 'number'\n*/\n\n// MODULES //\n\nvar usePolyfill = require( './check.js' );\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar main = ( usePolyfill() ) ? polyfill : builtin;\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar typeOf = require( '@stdlib/utils/type-of' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is a function.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a function\n*\n* @example\n* function beep() {\n* return 'beep';\n* }\n*\n* var bool = isFunction( beep );\n* // returns true\n*/\nfunction isFunction( value ) {\n\t// Note: cannot use `typeof` directly, as various browser engines incorrectly return `'function'` when operating on non-function objects, such as regular expressions and NodeLists.\n\treturn ( typeOf( value ) === 'function' );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isFunction;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a function.\n*\n* @module @stdlib/assert/is-function\n*\n* @example\n* var isFunction = require( '@stdlib/assert/is-function' );\n*\n* function beep() {\n* return 'beep';\n* }\n*\n* var bool = isFunction( beep );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setReadOnly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a read-only property.\n*\n* @module @stdlib/utils/define-read-only-property\n*\n* @example\n* var setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n*\n* var obj = {};\n*\n* setReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a string.\n*\n* @private\n* @returns {string} serialized complex number\n*/\nfunction toString() { // eslint-disable-line stdlib/no-redeclare\n\t/* eslint-disable no-invalid-this */\n\tvar str = '' + this.re;\n\tif ( this.im < 0 ) {\n\t\tstr += ' - ' + (-this.im);\n\t} else {\n\t\tstr += ' + ' + this.im;\n\t}\n\tstr += 'i';\n\treturn str;\n}\n\n\n// EXPORTS //\n\nmodule.exports = toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* @private\n* @returns {Object} JSON representation\n*/\nfunction toJSON() {\n\t/* eslint-disable no-invalid-this */\n\tvar out = {};\n\tout.type = 'Complex128';\n\tout.re = this.re;\n\tout.im = this.im;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = toJSON;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar setEnumerableReadOnly = require( '@stdlib/utils/define-read-only-property' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar format = require( '@stdlib/string/format' );\nvar toStr = require( './tostring.js' );\nvar toJSON = require( './tojson.js' );\n\n\n// MAIN //\n\n/**\n* 128-bit complex number constructor.\n*\n* @constructor\n* @param {number} real - real component\n* @param {number} imag - imaginary component\n* @throws {TypeError} must invoke using the `new` keyword\n* @throws {TypeError} real component must be a number\n* @throws {TypeError} imaginary component must be a number\n* @returns {Complex128} 128-bit complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n* // returns <Complex128>\n*/\nfunction Complex128( real, imag ) {\n\tif ( !( this instanceof Complex128 ) ) {\n\t\tthrow new TypeError( 'invalid invocation. Constructor must be called with the `new` keyword.' );\n\t}\n\tif ( !isNumber( real ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Real component must be a number. Value: `%s`.', real ) );\n\t}\n\tif ( !isNumber( imag ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Imaginary component must be a number. Value: `%s`.', imag ) );\n\t}\n\tsetEnumerableReadOnly( this, 're', real );\n\tsetEnumerableReadOnly( this, 'im', imag );\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex128\n* @readonly\n* @type {string}\n* @default 'Complex128'\n*\n* @example\n* var name = Complex128.name;\n* // returns 'Complex128'\n*/\nsetReadOnly( Complex128, 'name', 'Complex128' );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var nbytes = Complex128.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex128, 'BYTES_PER_ELEMENT', 8 );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128.prototype\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var nbytes = z.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex128.prototype, 'BYTES_PER_ELEMENT', 8 );\n\n/**\n* Length (in bytes) of a complex number.\n*\n* @name byteLength\n* @memberof Complex128.prototype\n* @type {integer}\n* @returns {integer} byte length\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var nbytes = z.byteLength;\n* // returns 16\n*/\nsetReadOnly( Complex128.prototype, 'byteLength', 16 );\n\n/**\n* Serializes a complex number as a string.\n*\n* @name toString\n* @memberof Complex128.prototype\n* @type {Function}\n* @returns {string} serialized complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var str = z.toString();\n* // returns '5 + 3i'\n*/\nsetReadOnly( Complex128.prototype, 'toString', toStr );\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `Complex128` instance.\n*\n* @name toJSON\n* @memberof Complex128.prototype\n* @type {Function}\n* @returns {Object} serialized complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var obj = z.toJSON();\n* // returns { 'type': 'Complex128', 're': 5.0, 'im': 3.0 }\n*/\nsetReadOnly( Complex128.prototype, 'toJSON', toJSON );\n\n\n// EXPORTS //\n\nmodule.exports = Complex128;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* 128-bit complex number constructor.\n*\n* @module @stdlib/complex/float64/ctor\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n*\n* var z = new Complex128( 5.0, 3.0 );\n* // returns <Complex128>\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar fround = ( typeof Math.fround === 'function' ) ? Math.fround : null; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nmodule.exports = fround;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Float32Array = require( '@stdlib/array/float32' );\n\n\n// VARIABLES //\n\nvar FLOAT32_VIEW = new Float32Array( 1 );\n\n\n// MAIN //\n\n/**\n* Converts a double-precision floating-point number to the nearest single-precision floating-point number.\n*\n* @param {number} x - double-precision floating-point number\n* @returns {number} nearest single-precision floating-point number\n*\n* @example\n* var y = float64ToFloat32( 1.337 );\n* // returns 1.3370000123977661\n*/\nfunction float64ToFloat32( x ) {\n\tFLOAT32_VIEW[ 0 ] = x;\n\treturn FLOAT32_VIEW[ 0 ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = float64ToFloat32;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert a double-precision floating-point number to the nearest single-precision floating-point number.\n*\n* @module @stdlib/number/float64/base/to-float32\n*\n* @example\n* var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n*\n* var y = float64ToFloat32( 1.337 );\n* // returns 1.3370000123977661\n*/\n\n// MODULES //\n\nvar builtin = require( './main.js' );\nvar polyfill = require( './polyfill.js' );\n\n\n// MAIN //\n\nvar float64ToFloat32;\nif ( typeof builtin === 'function' ) {\n\tfloat64ToFloat32 = builtin;\n} else {\n\tfloat64ToFloat32 = polyfill;\n}\n\n\n// EXPORTS //\n\nmodule.exports = float64ToFloat32;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a string.\n*\n* @private\n* @returns {string} serialized complex number\n*/\nfunction toString() { // eslint-disable-line stdlib/no-redeclare\n\t/* eslint-disable no-invalid-this */\n\tvar str = '' + this.re;\n\tif ( this.im < 0 ) {\n\t\tstr += ' - ' + (-this.im);\n\t} else {\n\t\tstr += ' + ' + this.im;\n\t}\n\tstr += 'i';\n\treturn str;\n}\n\n\n// EXPORTS //\n\nmodule.exports = toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* @private\n* @returns {Object} JSON representation\n*/\nfunction toJSON() {\n\t/* eslint-disable no-invalid-this */\n\tvar out = {};\n\tout.type = 'Complex64';\n\tout.re = this.re;\n\tout.im = this.im;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = toJSON;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar setEnumerableReadOnly = require( '@stdlib/utils/define-read-only-property' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar format = require( '@stdlib/string/format' );\nvar toStr = require( './tostring.js' );\nvar toJSON = require( './tojson.js' );\n\n\n// MAIN //\n\n/**\n* 64-bit complex number constructor.\n*\n* @constructor\n* @param {number} real - real component\n* @param {number} imag - imaginary component\n* @throws {TypeError} must invoke using the `new` keyword\n* @throws {TypeError} real component must be a number\n* @throws {TypeError} imaginary component must be a number\n* @returns {Complex64} 64-bit complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n* // returns <Complex64>\n*/\nfunction Complex64( real, imag ) {\n\tif ( !( this instanceof Complex64 ) ) {\n\t\tthrow new TypeError( 'invalid invocation. Constructor must be called with the `new` keyword.' );\n\t}\n\tif ( !isNumber( real ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Real component must be a number. Value: `%s`.', real ) );\n\t}\n\tif ( !isNumber( imag ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Imaginary component must be a number. Value: `%s`.', imag ) );\n\t}\n\tsetEnumerableReadOnly( this, 're', float64ToFloat32( real ) );\n\tsetEnumerableReadOnly( this, 'im', float64ToFloat32( imag ) );\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex64\n* @readonly\n* @type {string}\n* @default 'Complex64'\n*\n* @example\n* var name = Complex64.name;\n* // returns 'Complex64'\n*/\nsetReadOnly( Complex64, 'name', 'Complex64' );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var nbytes = Complex64.BYTES_PER_ELEMENT;\n* // returns 4\n*/\nsetReadOnly( Complex64, 'BYTES_PER_ELEMENT', 4 );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64.prototype\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var nbytes = z.BYTES_PER_ELEMENT;\n* // returns 4\n*/\nsetReadOnly( Complex64.prototype, 'BYTES_PER_ELEMENT', 4 );\n\n/**\n* Length (in bytes) of a complex number.\n*\n* @name byteLength\n* @memberof Complex64.prototype\n* @type {integer}\n* @returns {integer} byte length\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var nbytes = z.byteLength;\n* // returns 8\n*/\nsetReadOnly( Complex64.prototype, 'byteLength', 8 );\n\n/**\n* Serializes a complex number as a string.\n*\n* @name toString\n* @memberof Complex64.prototype\n* @type {Function}\n* @returns {string} serialized complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var str = z.toString();\n* // returns '5 + 3i'\n*/\nsetReadOnly( Complex64.prototype, 'toString', toStr );\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `Complex64` instance.\n*\n* @name toJSON\n* @memberof Complex64.prototype\n* @type {Function}\n* @returns {Object} serialized complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var obj = z.toJSON();\n* // returns { 'type': 'Complex64', 're': 5.0, 'im': 3.0 }\n*/\nsetReadOnly( Complex64.prototype, 'toJSON', toJSON );\n\n\n// EXPORTS //\n\nmodule.exports = Complex64;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* 64-bit complex number constructor.\n*\n* @module @stdlib/complex/float32/ctor\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n*\n* var z = new Complex64( 5.0, 3.0 );\n* // returns <Complex64>\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Complex128 = require( '@stdlib/complex/float64/ctor' );\nvar Complex64 = require( '@stdlib/complex/float32/ctor' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is a complex number-like object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex number-like object.\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n*\n* var x = new Complex128( 4.0, 2.0 );\n* var bool = isComplexLike( x );\n* // returns true\n*\n* x = new Complex64( 4.0, 2.0 );\n* bool = isComplexLike( x );\n* // returns true\n*/\nfunction isComplexLike( value ) {\n\tif ( value instanceof Complex128 || value instanceof Complex64 ) {\n\t\treturn true;\n\t}\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.re === 'number' &&\n\t\ttypeof value.im === 'number'\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isComplexLike;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a complex number-like object.\n*\n* @module @stdlib/assert/is-complex-like\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n* var isComplexLike = require( '@stdlib/assert/is-complex-like' );\n*\n* var x = new Complex128( 4.0, 2.0 );\n* var bool = isComplexLike( x );\n* // returns true\n*\n* x = new Complex64( 4.0, 2.0 );\n* bool = isComplexLike( x );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isInteger = require( './../../../../base/assert/is-integer' );\n\n\n// MAIN //\n\n/**\n* Tests if a finite numeric value is an even number.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an even number\n*\n* @example\n* var bool = isEven( 5.0 );\n* // returns false\n*\n* @example\n* var bool = isEven( -2.0 );\n* // returns true\n*\n* @example\n* var bool = isEven( 0.0 );\n* // returns true\n*\n* @example\n* var bool = isEven( NaN );\n* // returns false\n*/\nfunction isEven( x ) {\n\treturn isInteger( x/2.0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = isEven;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a finite numeric value is an even number.\n*\n* @module @stdlib/math/base/assert/is-even\n*\n* @example\n* var isEven = require( '@stdlib/math/base/assert/is-even' );\n*\n* var bool = isEven( 5.0 );\n* // returns false\n*\n* bool = isEven( -2.0 );\n* // returns true\n*\n* bool = isEven( 0.0 );\n* // returns true\n*\n* bool = isEven( NaN );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = 8; // 4 bytes per float32 x (1 real + 1 imag component)\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a `Complex64Array`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex64Array`\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var bool = isComplex64Array( new Complex64Array( 10 ) );\n* // returns true\n*\n* bool = isComplex64Array( [] );\n* // returns false\n*/\nfunction isComplex64Array( value ) {\n\t// Note: the following is not robust and that is intentional. In this case, we are seeking a lower cost way to reasonably determine whether an input value is a `Complex64Array` in order to avoid walking the prototype chain and resolving constructors, which is necessary for robust identification of cross-realm instances. For more robust validation, see `@stdlib/assert/is-complex64array`.\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex64Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isComplex64Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a `Complex64Array`.\n*\n* @module @stdlib/array/base/assert/is-complex64array\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var isComplex64Array = require( '@stdlib/array/base/assert/is-complex64array' );\n*\n* var bool = isComplex64Array( new Complex64Array( 10 ) );\n* // returns true\n*\n* bool = isComplex64Array( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = 16; // 8 bytes per float64 x (1 real + 1 imag component)\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a `Complex128Array`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex128Array`\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var bool = isComplex128Array( new Complex128Array( 10 ) );\n* // returns true\n*\n* bool = isComplex128Array( [] );\n* // returns false\n*/\nfunction isComplex128Array( value ) {\n\t// Note: the following is not robust and that is intentional. In this case, we are seeking a lower cost way to reasonably determine whether an input value is a `Complex128Array` in order to avoid walking the prototype chain and resolving constructors, which is necessary for robust identification of cross-realm instances. For more robust validation, see `@stdlib/assert/is-complex128array`.\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex128Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isComplex128Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a `Complex128Array`.\n*\n* @module @stdlib/array/base/assert/is-complex128array\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n* var isComplex128Array = require( '@stdlib/array/base/assert/is-complex128array' );\n*\n* var bool = isComplex128Array( new Complex128Array( 10 ) );\n* // returns true\n*\n* bool = isComplex128Array( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( './../../has-own-property' );\nvar Symbol = require( '@stdlib/symbol/ctor' );\n\n\n// MAIN //\n\n/**\n* Tests for native `Symbol.iterator` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol.iterator` support\n*\n* @example\n* var bool = hasIteratorSymbolSupport();\n* // returns <boolean>\n*/\nfunction hasIteratorSymbolSupport() {\n\treturn (\n\t\ttypeof Symbol === 'function' &&\n\t\ttypeof Symbol( 'foo' ) === 'symbol' &&\n\t\thasOwnProp( Symbol, 'iterator' ) &&\n\t\ttypeof Symbol.iterator === 'symbol'\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasIteratorSymbolSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test for native `Symbol.iterator` support.\n*\n* @module @stdlib/assert/has-iterator-symbol-support\n*\n* @example\n* var hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' );\n*\n* var bool = hasIteratorSymbolSupport();\n* // returns <boolean>\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' );\n\n\n// MAIN //\n\n/**\n* Iterator symbol.\n*\n* @name IteratorSymbol\n* @constant\n* @type {(symbol|null)}\n*\n* @example\n* function iterator() {\n* var it;\n* var i;\n*\n* i = -1;\n*\n* it = {};\n* it.next = next;\n* it.return = done;\n*\n* if ( IteratorSymbol ) {\n* it[ IteratorSymbol ] = iterator;\n* }\n* return it;\n*\n* function next() {\n* i += 1;\n* return {\n* 'value': i,\n* 'done': false\n* };\n* }\n*\n* function done( value ) {\n* if ( arguments.length === 0 ) {\n* return {\n* 'done': true\n* };\n* }\n* return {\n* 'value': value,\n* 'done': true\n* };\n* }\n* }\n*\n* var obj = iterator();\n*/\nvar IteratorSymbol = ( hasIteratorSymbolSupport() ) ? Symbol.iterator : null;\n\n\n// EXPORTS //\n\nmodule.exports = IteratorSymbol;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Iterator symbol.\n*\n* @module @stdlib/symbol/iterator\n*\n* @example\n* var IteratorSymbol = require( '@stdlib/symbol/iterator' );\n*\n* function iterator() {\n* var it;\n* var i;\n*\n* i = -1;\n*\n* it = {};\n* it.next = next;\n* it.return = done;\n*\n* if ( IteratorSymbol ) {\n* it[ IteratorSymbol ] = iterator;\n* }\n* return it;\n*\n* function next() {\n* i += 1;\n* return {\n* 'value': i,\n* 'done': false\n* };\n* }\n*\n* function done( value ) {\n* if ( arguments.length === 0 ) {\n* return {\n* 'done': true\n* };\n* }\n* return {\n* 'value': value,\n* 'done': true\n* };\n* }\n* }\n*\n* var obj = iterator();\n*/\n\n// MAIN //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar defineProperty = require( './../../define-property' );\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - accessor\n*\n* @example\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnlyAccessor( obj, prop, getter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'get': getter\n\t});\n}\n\n\n// EXPORTS //\n\nmodule.exports = setNonEnumerableReadOnlyAccessor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define a non-enumerable read-only accessor.\n*\n* @module @stdlib/utils/define-nonenumerable-read-only-accessor\n*\n* @example\n* var setNonEnumerableReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\n*\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the real component of a single-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} real component\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var re = real( z );\n* // returns 5.0\n*/\nfunction real( z ) {\n\treturn z.re;\n}\n\n\n// EXPORTS //\n\nmodule.exports = real;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the real component of a single-precision complex floating-point number.\n*\n* @module @stdlib/complex/float32/real\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n* var real = require( '@stdlib/complex/float32/real' );\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var re = real( z );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the imaginary component of a single-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} imaginary component\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nfunction imag( z ) {\n\treturn z.im;\n}\n\n\n// EXPORTS //\n\nmodule.exports = imag;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the imaginary component of a single-precision complex floating-point number.\n*\n* @module @stdlib/complex/float32/imag\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n* var imag = require( '@stdlib/complex/float32/imag' );\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var im = imag( z );\n* // returns 3.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Float32Array = require( '@stdlib/array/float32' );\n\n\n// MAIN //\n\n/**\n* Reinterprets a `Complex64Array` as a `Float32Array`.\n*\n* @param {Complex64Array} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} `Float32Array` view\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var x = new Complex64Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns <Float32Array>\n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Float32Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), 2*(x.length-offset) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Reinterpret a `Complex64Array` as a `Float32Array`.\n*\n* @module @stdlib/strided/base/reinterpret-complex64\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' );\n*\n* var x = new Complex64Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns <Float32Array>\n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Float64Array = require( '@stdlib/array/float64' );\n\n\n// MAIN //\n\n/**\n* Reinterprets a `Complex128Array` as a `Float64Array`.\n*\n* @param {Complex128Array} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} `Float64Array` view\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var x = new Complex128Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns <Float64Array>\n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Float64Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), 2*(x.length-offset) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Reinterpret a `Complex128Array` as a `Float64Array`.\n*\n* @module @stdlib/strided/base/reinterpret-complex128\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n* var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' );\n*\n* var x = new Complex128Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns <Float64Array>\n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar realf = require( '@stdlib/complex/float32/real' );\nvar imagf = require( '@stdlib/complex/float32/imag' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIterator;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar realf = require( '@stdlib/complex/float32/real' );\nvar imagf = require( '@stdlib/complex/float32/imag' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIteratorMap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar realf = require( '@stdlib/complex/float32/real' );\nvar imagf = require( '@stdlib/complex/float32/imag' );\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float32Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float32Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = realf( v );\n\t\tbuf[ j+1 ] = imagf( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromArray;\n","/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' );\nvar isObject = require( '@stdlib/assert/is-object' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar isEven = require( '@stdlib/math/base/assert/is-even' );\nvar isInteger = require( '@stdlib/math/base/assert/is-integer' );\nvar isComplex64Array = require( './../../base/assert/is-complex64array' );\nvar isComplex128Array = require( './../../base/assert/is-complex128array' );\nvar hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' );\nvar ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar Float32Array = require( './../../float32' );\nvar Complex64 = require( '@stdlib/complex/float32/ctor' );\nvar format = require( '@stdlib/string/format' );\nvar realf = require( '@stdlib/complex/float32/real' );\nvar imagf = require( '@stdlib/complex/float32/imag' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );\nvar reinterpret128 = require( '@stdlib/strided/base/reinterpret-complex128' );\nvar getter = require( './../../base/getter' );\nvar accessorGetter = require( './../../base/accessor-getter' );\nvar fromIterator = require( './from_iterator.js' );\nvar fromIteratorMap = require( './from_iterator_map.js' );\nvar fromArray = require( './from_array.js' );\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float32Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex64Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex64Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex128Array...\n\t\tvalue.name === 'Complex128Array'\n\t);\n}\n\n/**\n* Retrieves a complex number from a complex number array buffer.\n*\n* @private\n* @param {Float32Array} buf - array buffer\n* @param {NonNegativeInteger} idx - element index\n* @returns {Complex64} complex number\n*/\nfunction getComplex64( buf, idx ) {\n\tidx *= 2;\n\treturn new Complex64( buf[ idx ], buf[ idx+1 ] );\n}\n\n\n// MAIN //\n\n/**\n* 64-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `8`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `8`\n* @throws {TypeError} view length must be a positive multiple of `8`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} complex number array\n*\n* @example\n* var arr = new Complex64Array();\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex64Array( 2 );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex64Array( [ 1.0, -1.0 ] );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf, 8 );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex64Array( buf, 8, 2 );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex64Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex64Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex64Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex64Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex64Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex64Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float32Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float32Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float32Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float32Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float32Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) ); // FIXME: `buf` is what is returned from above, NOT the original value\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Complex64Array.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex64Array\n* @readonly\n* @type {string}\n* @default 'Complex64Array'\n*\n* @example\n* var str = Complex64Array.name;\n* // returns 'Complex64Array'\n*/\nsetReadOnly( Complex64Array, 'name', 'Complex64Array' );\n\n/**\n* Creates a new 64-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex64Array\n* @type {Function}\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.from( [ 1.0, -1.0 ] );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ] );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n* var realf = require( '@stdlib/complex/float32/real' );\n* var imagf = require( '@stdlib/complex/float32/imag' );\n*\n* function clbk( v ) {\n* return new Complex64( realf(v)*2.0, imagf(v)*2.0 );\n* }\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ], clbk );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex64Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.', 2, len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 64-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex64Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex64Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide an integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var z = arr.at( 0 );\n* // returns <Complex64>[ 0.0, 0.0 ]\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 9.0, -9.0 ], 9 );\n*\n* z = arr.at( 0 );\n* // returns <Complex64>[ 1.0, -1.0 ]\n*\n* z = arr.at( -1 );\n* // returns <Complex64>[ 9.0, -9.0 ]\n*\n* z = arr.at( 100 );\n* // returns undefined\n*\n* z = arr.at( -100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'at', function at( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx < 0 ) {\n\t\tidx += this._length;\n\t}\n\tif ( idx < 0 || idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex64( this._buffer, idx );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns <ArrayBuffer>\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array.prototype, 'BYTES_PER_ELEMENT', Complex64Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} modified array\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n*\n* var arr = new Complex64Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex64( 1.0, 1.0 ), 0 );\n* arr.set( new Complex64( 2.0, 2.0 ), 1 );\n* arr.set( new Complex64( 3.0, 3.0 ), 2 );\n* arr.set( new Complex64( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n* // arr => <Complex64Array>[ 1.0, 1.0, 2.0, 2.0, 1.0, 1.0, 2.0, 2.0 ]\n*/\nsetReadOnly( Complex64Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n*\n* var arr = [\n* new Complex64( 1.0, 1.0 ),\n* new Complex64( 2.0, 2.0 ),\n* new Complex64( 3.0, 3.0 )\n* ];\n* arr = new Complex64Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, <Complex64> ]\n*\n* v = it.next().value;\n* // returns [ 1, <Complex64> ]\n*\n* v = it.next().value;\n* // returns [ 2, <Complex64> ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'entries', function entries() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar buf;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': [ i, getComplex64( buf, i ) ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* var realf = require( '@stdlib/complex/float32/real' );\n* var imagf = require( '@stdlib/complex/float32/imag' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, getComplex64( buf, i ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {Complex64Array} modified array\n*\n* @example\n* var arr = new Complex64Array( 3 );\n*\n* arr.fill( new Complex64( 1.0, 1.0 ), 1 );\n*\n* var z = arr.get( 1 );\n* // returns <Complex64>[ 1.0, 1.0 ]\n*\n* z = arr.get( 2 );\n* // returns <Complex64>[ 1.0, 1.0 ]\n*/\nsetReadOnly( Complex64Array.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tre = realf( value );\n\tim = imagf( value );\n\tfor ( i = start; i < end; i++ ) {\n\t\tidx = 2*i;\n\t\tbuf[ idx ] = re;\n\t\tbuf[ idx+1 ] = im;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} complex number array\n*\n* @example\n* var realf = require( '@stdlib/complex/float32/real' );\n* var imagf = require( '@stdlib/complex/float32/imag' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.filter( predicate );\n* // returns <Complex64Array>[ 2.0, 2.0 ]\n*\n* var len = out.length;\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\tout.push( z );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex64|void)} array element or undefined\n*\n* @example\n* var realf = require( '@stdlib/complex/float32/real' );\n* var imagf = require( '@stdlib/complex/float32/imag' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.find( predicate );\n* // returns <Complex64>[ 1.0, 1.0 ]\n*/\nsetReadOnly( Complex64Array.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n* var realf = require( '@stdlib/complex/float32/real' );\n* var imagf = require( '@stdlib/complex/float32/imag' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var idx = arr.findIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( Complex64Array.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex64|void)} array element or undefined\n*\n* @example\n* var realf = require( '@stdlib/complex/float32/real' );\n* var imagf = require( '@stdlib/complex/float32/imag' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.findLast( predicate );\n* // returns <Complex64>[ 3.0, 3.0 ]\n*/\nsetReadOnly( Complex64Array.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n* var realf = require( '@stdlib/complex/float32/real' );\n* var imagf = require( '@stdlib/complex/float32/imag' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var idx = arr.findLastIndex( predicate );\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n*\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( Complex64Array.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tfcn.call( thisArg, z, i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns <Complex64>[ 0.0, 0.0 ]\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns <Complex64>[ 1.0, -1.0 ]\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'get', function get( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex64( this._buffer, idx );\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a provided value\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var bool = arr.includes( new Complex64( 3.0, -3.0 ) );\n* // returns true\n*\n* bool = arr.includes( new Complex64( 3.0, -3.0 ), 3 );\n* // returns false\n*\n* bool = arr.includes( new Complex64( 4.0, -4.0 ), -3 );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n*\n* var arr = new Complex64Array( 10 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var idx = arr.indexOf( new Complex64( 3.0, -3.0 ) );\n* // returns 2\n*\n* idx = arr.indexOf( new Complex64( 3.0, -3.0 ), 3 );\n* // returns -1\n*\n* idx = arr.indexOf( new Complex64( 4.0, -4.0 ), -3 );\n* // returns -1\n*/\nsetReadOnly( Complex64Array.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.join();\n* // returns '1 + 1i,2 + 2i'\n*\n* str = arr.join( '/' );\n* // returns '1 + 1i/2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'join', function join( separator ) {\n\tvar out;\n\tvar buf;\n\tvar sep;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tsep = ',';\n\t} else if ( isString( separator ) ) {\n\t\tsep = separator;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toString() );\n\t}\n\treturn out.join( sep );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex] - index at which to start searching backward (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 3.0, -3.0 ], 4 );\n*\n* var idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ) );\n* // returns 4\n*\n* idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ), 3 );\n* // returns 2\n*\n* idx = arr.lastIndexOf( new Complex64( 5.0, -5.0 ), 3 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( new Complex64( 2.0, -2.0 ), -3 );\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} complex number array\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n* var realf = require( '@stdlib/complex/float32/real' );\n* var imagf = require( '@stdlib/complex/float32/imag' );\n*\n* function scale( v, i ) {\n* return new Complex64( 2.0*realf( v ), 2.0*imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.map( scale );\n* // returns <Complex64Array>[ 2.0, -2.0, 4.0, -4.0, 6.0, -6.0 ]\n*/\nsetReadOnly( Complex64Array.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = fcn.call( thisArg, getComplex64( buf, i ), i, this );\n\t\tif ( isComplexLike( v ) ) {\n\t\t\toutbuf[ 2*i ] = realf( v );\n\t\t\toutbuf[ (2*i)+1 ] = imagf( v );\n\t\t} else if ( isArrayLikeObject( v ) && v.length === 2 ) {\n\t\t\toutbuf[ 2*i ] = v[ 0 ];\n\t\t\toutbuf[ (2*i)+1 ] = v[ 1 ];\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t}\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* var caddf = require( '@stdlib/complex/float32/base/add' );\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduce( caddf );\n* // returns <Complex64>[ 6.0, 6.0 ]\n*/\nsetReadOnly( Complex64Array.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex64( buf, 0 );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tv = getComplex64( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* var caddf = require( '@stdlib/complex/float32/base/add' );\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduceRight( caddf );\n* // returns <Complex64>[ 6.0, 6.0 ]\n*/\nsetReadOnly( Complex64Array.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len-1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex64( buf, len-1 );\n\t\ti = len-2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tv = getComplex64( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} reversed array\n*\n* @example\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.reverse();\n* // returns <Complex64Array>[ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ]\n*/\nsetReadOnly( Complex64Array.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ (2*i) ];\n\t\tbuf[ (2*i) ] = buf[ (2*j) ];\n\t\tbuf[ (2*j) ] = tmp;\n\t\ttmp = buf[ (2*i)+1 ];\n\t\tbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t\tbuf[ (2*j)+1 ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns <Complex64>[ 0.0, 0.0 ]\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns <Complex64>[ 1.0, -1.0 ]\n*/\nsetReadOnly( Complex64Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = realf( value );\n\t\tbuf[ idx+1 ] = imagf( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float32Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float32Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ]; // TODO: handle accessor arrays\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = realf( v );\n\t\t\tbuf[ idx+1 ] = imagf( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} complex number array\n*\n* @example\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var out = arr.slice();\n* // returns <Complex64Array>[ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0, 4.0, -4.0, 5.0, -5.0 ]\n*\n* out = arr.slice( 1, -2 );\n* // returns <Complex64Array>[ 2.0, -2.0, 3.0, -3.0 ]\n*/\nsetReadOnly( Complex64Array.prototype, 'slice', function slice( start, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar idx;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tstart = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( start < end ) {\n\t\toutlen = end - start;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\tidx = 2*(i+start);\n\t\toutbuf[ 2*i ] = buf[ idx ];\n\t\toutbuf[ (2*i)+1 ] = buf[ idx+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* var realf = require( '@stdlib/complex/float32/real' );\n* var imagf = require( '@stdlib/complex/float32/imag' );\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, getComplex64( buf, i ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} sorted array\n*\n* @example\n* var realf = require( '@stdlib/complex/float32/real' );\n* var imagf = require( '@stdlib/complex/float32/imag' );\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = realf( a );\n* re2 = realf( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imagf( a );\n* im2 = imagf( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns <Complex64Array>[ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0 ]\n*/\nsetReadOnly( Complex64Array.prototype, 'sort', function sort( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex64( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = 2 * i;\n\t\tbuf[ j ] = realf( tmp[i] );\n\t\tbuf[ j+1 ] = imagf( tmp[i] );\n\t}\n\treturn this;\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} [begin=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} subarray\n*\n* @example\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var subarr = arr.subarray();\n* // returns <Complex64Array>[ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0, 4.0, -4.0, 5.0, -5.0 ]\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns <Complex64Array>[ 2.0, -2.0, 3.0, -3.0 ]\n*/\nsetReadOnly( Complex64Array.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + (begin*BYTES_PER_ELEMENT);\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {(string|Array<string>)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toLocaleString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} reversed array\n*\n* @example\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.toReversed();\n* // returns <Complex64Array>[ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ]\n*/\nsetReadOnly( Complex64Array.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = len - i - 1;\n\t\toutbuf[ (2*i) ] = buf[ (2*j) ];\n\t\toutbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} sorted array\n*\n* @example\n* var realf = require( '@stdlib/complex/float32/real' );\n* var imagf = require( '@stdlib/complex/float32/imag' );\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = realf( a );\n* re2 = realf( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imagf( a );\n* im2 = imagf( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns <Complex64Array>[ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0 ]\n*/\nsetReadOnly( Complex64Array.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex64( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\treturn new Complex64Array( tmp );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toString() );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns <Complex64>[ 1.0, -1.0 ]\n*\n* v = iter.next().value;\n* // returns <Complex64>[ 2.0, -2.0 ]\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': getComplex64( buf, i ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {ComplexLike} value - new value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a complex number\n* @returns {Complex64Array} new typed array\n*\n* @example\n* var Complex64 = require( '@stdlib/complex/float32/ctor' );\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.with( 0, new Complex64( 4.0, 4.0 ) );\n* // returns <Complex64Array>[ 4.0, 4.0, 2.0, 2.0, 3.0, 3.0 ]\n*/\nsetReadOnly( Complex64Array.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tbuf[ 2*index ] = realf( value );\n\tbuf[ (2*index)+1 ] = imagf( value );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Complex64Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* 64-bit complex number array.\n*\n* @module @stdlib/array/complex64\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var arr = new Complex64Array();\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var arr = new Complex64Array( 2 );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var arr = new Complex64Array( [ 1.0, -1.0 ] );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf, 8 );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex64Array( buf, 8, 2 );\n* // returns <Complex64Array>\n*\n* var len = arr.length;\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the real component of a double-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} real component\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var re = real( z );\n* // returns 5.0\n*/\nfunction real( z ) {\n\treturn z.re;\n}\n\n\n// EXPORTS //\n\nmodule.exports = real;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the real component of a double-precision complex floating-point number.\n*\n* @module @stdlib/complex/float64/real\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n* var real = require( '@stdlib/complex/float64/real' );\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var re = real( z );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the imaginary component of a double-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} imaginary component\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nfunction imag( z ) {\n\treturn z.im;\n}\n\n\n// EXPORTS //\n\nmodule.exports = imag;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the imaginary component of a double-precision complex floating-point number.\n*\n* @module @stdlib/complex/float64/imag\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n* var imag = require( '@stdlib/complex/float64/imag' );\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var im = imag( z );\n* // returns 3.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar format = require( '@stdlib/string/format' );\nvar real = require( '@stdlib/complex/float64/real' );\nvar imag = require( '@stdlib/complex/float64/imag' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIterator;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar format = require( '@stdlib/string/format' );\nvar real = require( '@stdlib/complex/float64/real' );\nvar imag = require( '@stdlib/complex/float64/imag' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIteratorMap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar real = require( '@stdlib/complex/float64/real' );\nvar imag = require( '@stdlib/complex/float64/imag' );\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float64Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float64Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = real( v );\n\t\tbuf[ j+1 ] = imag( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromArray;\n","/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' );\nvar isObject = require( '@stdlib/assert/is-object' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isString = require( '@stdlib/assert/is-string' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar isEven = require( '@stdlib/math/base/assert/is-even' );\nvar isInteger = require( '@stdlib/math/base/assert/is-integer' );\nvar isComplex64Array = require( './../../base/assert/is-complex64array' );\nvar isComplex128Array = require( './../../base/assert/is-complex128array' );\nvar hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' );\nvar ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar Float64Array = require( './../../float64' );\nvar Complex128 = require( '@stdlib/complex/float64/ctor' );\nvar real = require( '@stdlib/complex/float64/real' );\nvar imag = require( '@stdlib/complex/float64/imag' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );\nvar reinterpret128 = require( '@stdlib/strided/base/reinterpret-complex128' );\nvar getter = require( './../../base/getter' );\nvar accessorGetter = require( './../../base/accessor-getter' );\nvar format = require( '@stdlib/string/format' );\nvar fromIterator = require( './from_iterator.js' );\nvar fromIteratorMap = require( './from_iterator_map.js' );\nvar fromArray = require( './from_array.js' );\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float64Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex128Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex128Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex64Array...\n\t\tvalue.name === 'Complex64Array'\n\t);\n}\n\n/**\n* Retrieves a complex number from a complex number array buffer.\n*\n* @private\n* @param {Float64Array} buf - array buffer\n* @param {NonNegativeInteger} idx - element index\n* @returns {Complex128} complex number\n*/\nfunction getComplex128( buf, idx ) {\n\tidx *= 2;\n\treturn new Complex128( buf[ idx ], buf[ idx+1 ] );\n}\n\n\n// MAIN //\n\n/**\n* 128-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `16`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `16`\n* @throws {TypeError} view length must be a positive multiple of `16`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} complex number array\n*\n* @example\n* var arr = new Complex128Array();\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex128Array( 2 );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex128Array( [ 1.0, -1.0 ] );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf, 16 );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 64 );\n* var arr = new Complex128Array( buf, 16, 2 );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex128Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex128Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex128Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex128Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex128Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex128Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float64Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float64Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float64Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float64Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float64Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var nbytes = Complex128Array.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex128Array\n* @readonly\n* @type {string}\n* @default 'Complex128Array'\n*\n* @example\n* var name = Complex128Array.name;\n* // returns 'Complex128Array'\n*/\nsetReadOnly( Complex128Array, 'name', 'Complex128Array' );\n\n/**\n* Creates a new 128-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex128Array\n* @type {Function}\n* @param {(Collection|Object)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.from( [ 1.0, -1.0 ] );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ] );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n* var real = require( '@stdlib/complex/float64/real' );\n* var imag = require( '@stdlib/complex/float64/imag' );\n*\n* function clbk( v ) {\n* return new Complex128( real(v)*2.0, imag(v)*2.0 );\n* }\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ], clbk );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex128Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 128-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex128Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex128Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide an integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.at( 0 );\n* // returns <Complex128>[ 0.0, 0.0 ]\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 9.0, -9.0 ], 9 );\n*\n* z = arr.at( 0 );\n* // returns <Complex128>[ 1.0, -1.0 ]\n*\n* z = arr.at( -1 );\n* // returns <Complex128>[ 9.0, -9.0 ]\n*\n* z = arr.at( 100 );\n* // returns undefined\n*\n* z = arr.at( -100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'at', function at( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx < 0 ) {\n\t\tidx += this._length;\n\t}\n\tif ( idx < 0 || idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex128( this._buffer, idx );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns <ArrayBuffer>\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 160\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array.prototype, 'BYTES_PER_ELEMENT', Complex128Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} modified array\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n*\n* var arr = new Complex128Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex128( 1.0, 1.0 ), 0 );\n* arr.set( new Complex128( 2.0, 2.0 ), 1 );\n* arr.set( new Complex128( 3.0, 3.0 ), 2 );\n* arr.set( new Complex128( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n* // arr => <Complex128Array>[ 1.0, 1.0, 2.0, 2.0, 1.0, 1.0, 2.0, 2.0 ]\n*/\nsetReadOnly( Complex128Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n*\n* var arr = [\n* new Complex128( 1.0, 1.0 ),\n* new Complex128( 2.0, 2.0 ),\n* new Complex128( 3.0, 3.0 )\n* ];\n* arr = new Complex128Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, <Complex128> ]\n*\n* v = it.next().value;\n* // returns [ 1, <Complex128> ]\n*\n* v = it.next().value;\n* // returns [ 2, <Complex128> ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'entries', function entries() {\n\tvar buffer;\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuffer = this._buffer;\n\tlen = this._length;\n\n\t// Initialize the iteration indices:\n\ti = -1;\n\tj = -2;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\tvar z;\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj += 2;\n\t\tz = new Complex128( buffer[ j ], buffer[ j+1 ] );\n\t\treturn {\n\t\t\t'value': [ i, z ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* var real = require( '@stdlib/complex/float64/real' );\n* var imag = require( '@stdlib/complex/float64/imag' );\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, getComplex128( buf, i ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {Complex128Array} modified array\n*\n* @example\n* var arr = new Complex128Array( 3 );\n*\n* arr.fill( new Complex128( 1.0, 1.0 ), 1 );\n*\n* var z = arr.get( 1 );\n* // returns <Complex128>[ 1.0, 1.0 ]\n*\n* z = arr.get( 2 );\n* // returns <Complex128>[ 1.0, 1.0 ]\n*/\nsetReadOnly( Complex128Array.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tre = real( value );\n\tim = imag( value );\n\tfor ( i = start; i < end; i++ ) {\n\t\tidx = 2*i;\n\t\tbuf[ idx ] = re;\n\t\tbuf[ idx+1 ] = im;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} complex number array\n*\n* @example\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.filter( predicate );\n* // returns <Complex128Array>\n*\n* var len = out.length;\n* // returns 1\n*\n* var z = out.get( 0 );\n* // returns <Complex128>[ 2.0, 2.0 ]\n*/\nsetReadOnly( Complex128Array.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\tout.push( z );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex128|void)} array element or undefined\n*\n* @example\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.find( predicate );\n* // returns <Complex128>[ 1.0, 1.0 ]\n*/\nsetReadOnly( Complex128Array.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* var real = require( '@stdlib/complex/float64/real' );\n* var imag = require( '@stdlib/complex/float64/imag' );\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var idx = arr.findIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( Complex128Array.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex128|void)} array element or undefined\n*\n* @example\n* var real = require( '@stdlib/complex/float64/real' );\n* var imag = require( '@stdlib/complex/float64/imag' );\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.findLast( predicate );\n* // returns <Complex128>[ 3.0, 3.0 ]\n*/\nsetReadOnly( Complex128Array.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* var real = require( '@stdlib/complex/float64/real' );\n* var imag = require( '@stdlib/complex/float64/imag' );\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var idx = arr.findLastIndex( predicate );\n* // returns 1\n*/\nsetReadOnly( Complex128Array.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n*\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( Complex128Array.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tfcn.call( thisArg, z, i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns <Complex128>[ 0.0, 0.0 ]\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns <Complex128>[ 1.0, -1.0 ]\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'get', function get( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex128( this._buffer, idx );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a provided value\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var bool = arr.includes( new Complex128( 3.0, -3.0 ) );\n* // returns true\n*\n* bool = arr.includes( new Complex128( 3.0, -3.0 ), 3 );\n* // returns false\n*\n* bool = arr.includes( new Complex128( 4.0, -4.0 ), -3 );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var idx = arr.indexOf( new Complex128( 3.0, -3.0 ) );\n* // returns 2\n*\n* idx = arr.indexOf( new Complex128( 3.0, -3.0 ), 3 );\n* // returns -1\n*\n* idx = arr.indexOf( new Complex128( 4.0, -4.0 ), -3 );\n* // returns 3\n*/\nsetReadOnly( Complex128Array.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.join();\n* // returns '1 + 1i,2 + 2i'\n*\n* str = arr.join( '/' );\n* // returns '1 + 1i/2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'join', function join( separator ) {\n\tvar out;\n\tvar buf;\n\tvar sep;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tsep = ',';\n\t} else if ( isString( separator ) ) {\n\t\tsep = separator;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toString() );\n\t}\n\treturn out.join( sep );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex] - index at which to start searching backward (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 3.0, -3.0 ], 4 );\n*\n* var idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ) );\n* // returns 4\n*\n* idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ), 3 );\n* // returns 2\n*\n* idx = arr.lastIndexOf( new Complex128( 5.0, -5.0 ), 3 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( new Complex128( 2.0, -2.0 ), -3 );\n* // returns 1\n*/\nsetReadOnly( Complex128Array.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} complex number array\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n* var real = require( '@stdlib/complex/float64/real' );\n* var imag = require( '@stdlib/complex/float64/imag' );\n*\n* function scale( v, i ) {\n* return new Complex128( 2.0*real( v ), 2.0*imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.map( scale );\n* // returns <Complex128Array>[ 2.0, -2.0, 4.0, -4.0, 6.0, -6.0 ]\n*/\nsetReadOnly( Complex128Array.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = fcn.call( thisArg, getComplex128( buf, i ), i, this );\n\t\tif ( isComplexLike( v ) ) {\n\t\t\toutbuf[ 2*i ] = real( v );\n\t\t\toutbuf[ (2*i)+1 ] = imag( v );\n\t\t} else if ( isArrayLikeObject( v ) && v.length === 2 ) {\n\t\t\toutbuf[ 2*i ] = v[ 0 ];\n\t\t\toutbuf[ (2*i)+1 ] = v[ 1 ];\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t}\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* var cadd = require( '@stdlib/complex/float64/base/add' );\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduce( cadd );\n* // returns <Complex128>[ 6.0, 6.0 ]\n*/\nsetReadOnly( Complex128Array.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex128( buf, 0 );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tv = getComplex128( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* var cadd = require( '@stdlib/complex/float64/base/add' );\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduceRight( cadd );\n* // returns <Complex128>[ 6.0, 6.0 ]\n*/\nsetReadOnly( Complex128Array.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len-1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex128( buf, len-1 );\n\t\ti = len-2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tv = getComplex128( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} reversed array\n*\n* @example\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.reverse();\n* // returns <Complex128Array>[ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ]\n*/\nsetReadOnly( Complex128Array.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ (2*i) ];\n\t\tbuf[ (2*i) ] = buf[ (2*j) ];\n\t\tbuf[ (2*j) ] = tmp;\n\t\ttmp = buf[ (2*i)+1 ];\n\t\tbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t\tbuf[ (2*j)+1 ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values as intended.\n*\n* @name set\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns <Complex128>[ 0.0, 0.0 ]\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns <Complex128>[ 1.0, -1.0 ]\n*/\nsetReadOnly( Complex128Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = real( value );\n\t\tbuf[ idx+1 ] = imag( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float64Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float64Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = real( v );\n\t\t\tbuf[ idx+1 ] = imag( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex128Array} complex number array\n*\n* @example\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var out = arr.slice();\n* // returns <Complex128Array>[ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0, 4.0, -4.0, 5.0, -5.0 ]\n*\n* out = arr.slice( 1, -2 );\n* // returns <Complex128Array>[ 2.0, -2.0, 3.0, -3.0 ]\n*/\nsetReadOnly( Complex128Array.prototype, 'slice', function slice( start, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar idx;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tstart = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( start < end ) {\n\t\toutlen = end - start;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\tidx = 2*(i+start);\n\t\toutbuf[ 2*i ] = buf[ idx ];\n\t\toutbuf[ (2*i)+1 ] = buf[ idx+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* var real = require( '@stdlib/complex/float64/real' );\n* var imag = require( '@stdlib/complex/float64/imag' );\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, getComplex128( buf, i ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} sorted array\n*\n* @example\n* var real = require( '@stdlib/complex/float64/real' );\n* var imag = require( '@stdlib/complex/float64/imag' );\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = real( a );\n* re2 = real( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imag( a );\n* im2 = imag( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns <Complex128Array>[ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0 ]\n*/\nsetReadOnly( Complex128Array.prototype, 'sort', function sort( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex128( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = 2 * i;\n\t\tbuf[ j ] = real( tmp[i] );\n\t\tbuf[ j+1 ] = imag( tmp[i] );\n\t}\n\treturn this;\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} [begin=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} subarray\n*\n* @example\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var subarr = arr.subarray();\n* // returns <Complex128Array>[ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0, 4.0, -4.0, 5.0, -5.0 ]\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns <Complex128Array>[ 2.0, -2.0, 3.0, -3.0 ]\n*/\nsetReadOnly( Complex128Array.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {(string|Array<string>)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toLocaleString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} reversed array\n*\n* @example\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.toReversed();\n* // returns <Complex128Array>[ 3.0, 3.0, 2.0, 2.0, 1.0, 1.0 ]\n*/\nsetReadOnly( Complex128Array.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = len - i - 1;\n\t\toutbuf[ (2*i) ] = buf[ (2*j) ];\n\t\toutbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} sorted array\n*\n* @example\n* var real = require( '@stdlib/complex/float64/real' );\n* var imag = require( '@stdlib/complex/float64/imag' );\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = real( a );\n* re2 = real( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imag( a );\n* im2 = imag( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns <Complex128Array>[ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0 ]\n*/\nsetReadOnly( Complex128Array.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex128( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\treturn new Complex128Array( tmp );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toString() );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns <Complex128>[ 1.0, -1.0 ]\n*\n* v = iter.next().value;\n* // returns <Complex128>[ 2.0, -2.0 ]\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': getComplex128( buf, i ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {ComplexLike} value - new value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a complex number\n* @returns {Complex128Array} new typed array\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.with( 0, new Complex128( 4.0, 4.0 ) );\n* // returns <Complex128Array>[ 4.0, 4.0, 2.0, 2.0, 3.0, 3.0 ]\n*/\nsetReadOnly( Complex128Array.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tbuf[ 2*index ] = real( value );\n\tbuf[ (2*index)+1 ] = imag( value );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Complex128Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* 128-bit complex number array.\n*\n* @module @stdlib/array/complex128\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var arr = new Complex128Array();\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var arr = new Complex128Array( 2 );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var arr = new Complex128Array( [ 1.0, -1.0 ] );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf, 16 );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var buf = new ArrayBuffer( 64 );\n* var arr = new Complex128Array( buf, 16, 2 );\n* // returns <Complex128Array>\n*\n* var len = arr.length;\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Boolean = require( '@stdlib/boolean/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {Array} output array\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tout.push( Boolean( v.value ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIterator;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Boolean = require( '@stdlib/boolean/ctor' );\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {Array} output array\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tout.push( Boolean( clbk.call( thisArg, v.value, i ) ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromIteratorMap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Boolean = require( '@stdlib/boolean/ctor' );\n\n\n// MAIN //\n\n/**\n* Fills an output array with \"boolean\" values.\n*\n* @private\n* @param {Uint8Array} buf - output array\n* @param {Array} arr - input array\n* @returns {Uint8Array} output array\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar i;\n\n\tlen = arr.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tbuf[ i ] = Boolean( arr[ i ] );\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' );\nvar isObject = require( '@stdlib/assert/is-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar hasIteratorSymbolSupport = require( '@stdlib/assert/has-iterator-symbol-support' );\nvar ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar Uint8Array = require( './../../uint8' );\nvar Boolean = require( '@stdlib/boolean/ctor' );\nvar getter = require( './../../base/getter' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar accessorGetter = require( './../../base/accessor-getter' );\nvar format = require( '@stdlib/string/format' );\nvar fromIterator = require( './from_iterator.js' );\nvar fromIteratorMap = require( './from_iterator_map.js' );\nvar fromArray = require( './from_array.js' );\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Uint8Array.BYTES_PER_ELEMENT;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a `BooleanArray`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `BooleanArray`\n*/\nfunction isBooleanArray( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'BooleanArray' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a boolean typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a boolean typed array constructor\n*/\nfunction isBooleanArrayConstructor( value ) {\n\treturn ( value === BooleanArray );\n}\n\n\n// MAIN //\n\n/**\n* Boolean array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = new BooleanArray();\n* // returns <BooleanArray>\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new BooleanArray( 2 );\n* // returns <BooleanArray>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new BooleanArray( [ true, false ] );\n* // returns <BooleanArray>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new BooleanArray( buf );\n* // returns <BooleanArray>\n*\n* var len = arr.length;\n* // returns 16\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new BooleanArray( buf, 8 );\n* // returns <BooleanArray>\n*\n* var len = arr.length;\n* // returns 8\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new BooleanArray( buf, 8, 2 );\n* // returns <BooleanArray>\n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction BooleanArray() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\tvar arg;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof BooleanArray) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new BooleanArray();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new BooleanArray( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new BooleanArray( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new BooleanArray( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Uint8Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\targ = arguments[ 0 ];\n\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\tbuf = new Uint8Array( arg );\n\t\t} else if ( isCollection( arg ) ) {\n\t\t\tbuf = fromArray( new Uint8Array( arg.length ), arg );\n\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\tbuf = new Uint8Array( arg );\n\t\t} else if ( isObject( arg ) ) {\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tbuf = new Uint8Array( fromIterator( buf ) );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tbuf = new Uint8Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Uint8Array( buf, byteOffset, len );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof BooleanArray\n* @readonly\n* @type {PositiveInteger}\n* @default 1\n*\n* @example\n* var nbytes = BooleanArray.BYTES_PER_ELEMENT;\n* // returns 1\n*/\nsetReadOnly( BooleanArray, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof BooleanArray\n* @readonly\n* @type {string}\n* @default 'BooleanArray'\n*\n* @example\n* var str = BooleanArray.name;\n* // returns 'BooleanArray'\n*/\nsetReadOnly( BooleanArray, 'name', 'BooleanArray' );\n\n/**\n* Creates a new boolean array from an array-like object or an iterable.\n*\n* @name from\n* @memberof BooleanArray\n* @type {Function}\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = BooleanArray.from( [ true, false ] );\n* // returns <BooleanArray>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* function clbk( v ) {\n* return !v;\n* }\n*\n* var arr = BooleanArray.from( [ true, false ], clbk );\n* // returns <BooleanArray>\n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( BooleanArray, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isBooleanArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf[ i ] = Boolean( clbk.call( thisArg, get( src, i ), i ) );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tlen = tmp.length;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new boolean array from a variable number of arguments.\n*\n* @name of\n* @memberof BooleanArray\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = BooleanArray.of( true, true, true, true );\n* // returns <BooleanArray>\n*\n* var len = arr.length;\n* // returns 4\n*/\nsetReadOnly( BooleanArray, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isBooleanArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element located at integer position (index) `i`, with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} must provide an integer\n* @returns {(boolean|void)} array element\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.at( 0 );\n* // returns true\n*\n* v = arr.at( -1 );\n* // returns true\n*\n* v = arr.at( 100 );\n* // returns undefined\n*/\nsetReadOnly( BooleanArray.prototype, 'at', function at( idx ) {\n\tvar buf;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tif ( idx < 0 ) {\n\t\tidx += len;\n\t}\n\tif ( idx < 0 || idx >= len ) {\n\t\treturn;\n\t}\n\treturn Boolean( buf[ idx ] );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var buf = arr.buffer;\n* // returns <ArrayBuffer>\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 10\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 1\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 1\n*/\nsetReadOnly( BooleanArray.prototype, 'BYTES_PER_ELEMENT', BooleanArray.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} modified array\n*\n* @example\n* var arr = new BooleanArray( 4 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n* arr.set( true, 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* var v = arr.get( 2 );\n* // returns true\n*\n* v = arr.get( 3 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target, start );\n\t} else {\n\t\tthis._buffer.copyWithin( target, start, arguments[2] );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var it = arr.entries();\n*\n* var v = it.next().value;\n* // returns [ 0, true ]\n*\n* v = it.next().value;\n* // returns [ 1, false ]\n*\n* v = it.next().value;\n* // returns [ 2, true ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'entries', function entries() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar buf;\n\tvar FLG;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': [ i, Boolean( buf[ i ] ) ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( true, 1 );\n* arr.set( true, 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, Boolean( buf[ i ] ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {BooleanArray} modified array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.fill( true, 1 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* v = arr.get( 1 );\n* // returns true\n*\n* v = arr.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar val;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tif ( value ) {\n\t\tval = 1;\n\t} else {\n\t\tval = 0;\n\t}\n\tfor ( i = start; i < end; i++ ) {\n\t\tbuf[ i ] = val;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} boolean array\n*\n* @example\n* function predicate( v ) {\n* return ( v === true );\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.filter( predicate );\n* // returns <BooleanArray>\n*\n* var len = out.length;\n* // returns 2\n*\n* var v = out.get( 0 );\n* // returns true\n*\n* v = out.get( 1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\tout.push( v );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {(boolean|void)} array element or undefined\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.find( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn v;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findIndex( predicate );\n* // returns 0\n*/\nsetReadOnly( BooleanArray.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {(boolean|void)} array element or undefined\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findLast( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn v;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findLastIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( BooleanArray.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tfcn.call( thisArg, Boolean( buf[ i ] ), i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(boolean|void)} array element\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* arr.set( [ true, false ], 0 );\n*\n* v = arr.get( 0 );\n* // returns true\n*\n* v = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( BooleanArray.prototype, 'get', function get( idx ) {\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn Boolean( this._buffer[ idx ] );\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a value\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( true, 3 );\n* arr.set( true, 4 );\n*\n* var bool = arr.includes( true );\n* // returns true\n*\n* bool = arr.includes( false, 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( true, 3 );\n* arr.set( true, 4 );\n*\n* var idx = arr.indexOf( true );\n* // returns 0\n*\n* idx = arr.indexOf( false, 2 );\n* // returns -1\n*\n* idx = arr.indexOf( false, -3 );\n* // returns -1\n*/\nsetReadOnly( BooleanArray.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.join();\n* // returns 'true,false,true'\n*\n* str = arr.join( '|' );\n* // returns 'true|false|true'\n*/\nsetReadOnly( BooleanArray.prototype, 'join', function join( separator ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isString( separator ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t\t}\n\t} else {\n\t\tseparator = ',';\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( buf[i] ) {\n\t\t\tout.push( 'true' );\n\t\t} else {\n\t\t\tout.push( 'false' );\n\t\t}\n\t}\n\treturn out.join( separator );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 2 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - element to find\n* @param {integer} [fromIndex] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( true, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var idx = arr.lastIndexOf( true );\n* // returns 4\n*\n* idx = arr.lastIndexOf( false, 2 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( false, -3 );\n* // returns -1\n*/\nsetReadOnly( BooleanArray.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} new boolean array\n*\n* @example\n* function invert( v ) {\n* return !v;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.map( invert );\n* // returns <BooleanArray>\n*\n* var z = out.get( 0 );\n* // returns false\n*\n* z = out.get( 1 );\n* // returns true\n*\n* z = out.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be a function. Value: `%s`.', fcn );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\toutbuf[ i ] = Boolean( fcn.call( thisArg, Boolean( buf[ i ] ), i, this ) );\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* function reducer( acc, v ) {\n* if ( v ) {\n* return acc + 1;\n* }\n* return acc;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.reduce( reducer, 0 );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar len;\n\tvar acc;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = Boolean( buf[ 0 ] );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tacc = reducer( acc, Boolean( buf[ i ] ), i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* function reducer( acc, v ) {\n* if ( v ) {\n* return acc + 1;\n* }\n* return acc;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.reduceRight( reducer, 0 );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar len;\n\tvar acc;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len - 1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = Boolean( buf[ len-1 ] );\n\t\ti = len - 2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tacc = reducer( acc, Boolean( buf[ i ] ), i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} reversed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n*\n* var out = arr.reverse();\n* // returns <BooleanArray>\n*\n* var v = out.get( 0 );\n* // returns false\n*\n* v = out.get( 1 );\n* // returns false\n*\n* v = out.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ i ];\n\t\tbuf[ i ] = buf[ j ];\n\t\tbuf[ j ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {(Collection|BooleanArray|*)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* arr.set( [ true, false ], 0 );\n*\n* v = arr.get( 0 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'set', function set( value ) {\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isCollection( value ) ) {\n\t\tN = value.length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tif ( isBooleanArray( value ) ) {\n\t\t\tsbuf = value._buffer; // eslint-disable-line no-underscore-dangle\n\t\t} else {\n\t\t\tsbuf = value;\n\t\t}\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Uint8Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ]; // TODO: handle accessor arrays\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\tbuf[ idx ] = ( sbuf[ i ] ) ? 1 : 0;\n\t\t}\n\t\treturn;\n\t}\n\tif ( idx >= this._length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t}\n\tbuf[ idx ] = ( value ) ? 1 : 0;\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} [begin] - start index (inclusive)\n* @param {integer} [end] - end index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be integer\n* @throws {TypeError} second argument must be integer\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var out = arr.slice();\n* // returns <BooleanArray>\n*\n* var len = out.length;\n* // returns 5\n*\n* var bool = out.get( 0 );\n* // returns true\n*\n* bool = out.get( len-1 );\n* // returns true\n*\n* out = arr.slice( 1, -2 );\n* // returns <BooleanArray>\n*\n* len = out.length;\n* // returns 2\n*\n* bool = out.get( 0 );\n* // returns false\n*\n* bool = out.get( len-1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'slice', function slice( begin, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar buf;\n\tvar len;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin < end ) {\n\t\toutlen = end - begin;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\toutbuf[ i ] = buf[ i+begin ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( false, 0 );\n* arr.set( true, 1 );\n* arr.set( false, 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, Boolean( buf[ i ] ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} [compareFcn] - comparison function\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} sorted array\n*\n* @example\n* function compare( a, b ) {\n* if ( a === false ) {\n* if ( b === false ) {\n* return 0;\n* }\n* return 1;\n* }\n* if ( b === true ) {\n* return 0;\n* }\n* return -1;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* arr.sort( compare );\n*\n* var v = arr.get( 0 );\n* // returns true\n*\n* v = arr.get( 1 );\n* // returns true\n*\n* v = arr.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'sort', function sort( compareFcn ) {\n\tvar buf;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length === 0 ) {\n\t\tbuf.sort();\n\t\treturn this;\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf.sort( compare );\n\treturn this;\n\n\t/**\n\t* Comparison function for sorting.\n\t*\n\t* @private\n\t* @param {boolean} a - first boolean value for comparison\n\t* @param {boolean} b - second boolean value for comparison\n\t* @returns {number} comparison result\n\t*/\n\tfunction compare( a, b ) {\n\t\treturn compareFcn( Boolean( a ), Boolean( b ) );\n\t}\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} [begin] - start index (inclusive)\n* @param {integer} [end] - end index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {BooleanArray} subarray\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var subarr = arr.subarray();\n* // returns <BooleanArray>\n*\n* var len = subarr.length;\n* // returns 5\n*\n* var bool = subarr.get( 0 );\n* // returns true\n*\n* bool = subarr.get( len-1 );\n* // returns true\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns <BooleanArray>\n*\n* len = subarr.length;\n* // returns 2\n*\n* bool = subarr.get( 0 );\n* // returns false\n*\n* bool = subarr.get( len-1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {(string|Array<string>)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.toLocaleString();\n* // returns 'true,false,true'\n*/\nsetReadOnly( BooleanArray.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( Boolean( buf[ i ] ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} reversed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n*\n* var out = arr.toReversed();\n* // returns <BooleanArray>\n*\n* var v = out.get( 0 );\n* // returns false\n*\n* v = out.get( 1 );\n* // returns false\n*\n* v = out.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\toutbuf[ i ] = buf[ len - i - 1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} [compareFcn] - comparison function\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} sorted array\n*\n* @example\n* function compare( a, b ) {\n* if ( a === false ) {\n* if ( b === false ) {\n* return 0;\n* }\n* return 1;\n* }\n* if ( b === true ) {\n* return 0;\n* }\n* return -1;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.sort( compare );\n* // returns <BooleanArray>\n*\n* var v = out.get( 0 );\n* // returns true\n*\n* v = out.get( 1 );\n* // returns true\n*\n* v = out.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\toutbuf[ i ] = buf[ i ];\n\t}\n\tif ( arguments.length === 0 ) {\n\t\toutbuf.sort();\n\t\treturn out;\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\toutbuf.sort( compare );\n\treturn out;\n\n\t/**\n\t* Comparison function for sorting.\n\t*\n\t* @private\n\t* @param {boolean} a - first boolean value for comparison\n\t* @param {boolean} b - second boolean value for comparison\n\t* @returns {number} comparison result\n\t*/\n\tfunction compare( a, b ) {\n\t\treturn compareFcn( Boolean( a ), Boolean( b ) );\n\t}\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.toString();\n* // returns 'true,false,true'\n*/\nsetReadOnly( BooleanArray.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( buf[i] ) {\n\t\t\tout.push( 'true' );\n\t\t} else {\n\t\t\tout.push( 'false' );\n\t\t}\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 2 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns true\n*\n* v = iter.next().value;\n* // returns false\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': Boolean( buf[ i ] ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {boolean} value - new value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a boolean\n* @returns {BooleanArray} new typed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.with( 0, false );\n* // returns <BooleanArray>\n*\n* var v = out.get( 0 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isBoolean( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a boolean. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tif ( value ) {\n\t\tbuf[ index ] = 1;\n\t} else {\n\t\tbuf[ index ] = 0;\n\t}\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = BooleanArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Boolean array.\n*\n* @module @stdlib/array/bool\n*\n* @example\n* var BooleanArray = require( '@stdlib/array/bool' );\n*\n* var arr = new BooleanArray();\n* // returns <BooleanArray>\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var BooleanArray = require( '@stdlib/array/bool' );\n*\n* var arr = new BooleanArray( 2 );\n* // returns <BooleanArray>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var BooleanArray = require( '@stdlib/array/bool' );\n*\n* var arr = new BooleanArray( [ true, false ] );\n* // returns <BooleanArray>\n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var BooleanArray = require( '@stdlib/array/bool' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new BooleanArray( buf );\n* // returns <BooleanArray>\n*\n* var len = arr.length;\n* // returns 16\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var BooleanArray = require( '@stdlib/array/bool' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new BooleanArray( buf, 8 );\n* // returns <BooleanArray>\n*\n* var len = arr.length;\n* // returns 8\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array/buffer' );\n* var BooleanArray = require( '@stdlib/array/bool' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new BooleanArray( buf, 8, 2 );\n* // returns <BooleanArray>\n*\n* var len = arr.length;\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Float64Array = require( './../../float64' );\nvar Float32Array = require( './../../float32' );\nvar Uint32Array = require( './../../uint32' );\nvar Int32Array = require( './../../int32' );\nvar Uint16Array = require( './../../uint16' );\nvar Int16Array = require( './../../int16' );\nvar Uint8Array = require( './../../uint8' );\nvar Uint8ClampedArray = require( './../../uint8c' );\nvar Int8Array = require( './../../int8' );\nvar Complex64Array = require( './../../complex64' );\nvar Complex128Array = require( './../../complex128' );\nvar BooleanArray = require( './../../bool' );\n\n\n// MAIN //\n\n// Note: order should match `dtypes` order\nvar CTORS = [\n\tFloat64Array,\n\tFloat32Array,\n\tInt32Array,\n\tUint32Array,\n\tInt16Array,\n\tUint16Array,\n\tInt8Array,\n\tUint8Array,\n\tUint8ClampedArray,\n\tComplex64Array,\n\tComplex128Array,\n\tBooleanArray\n];\n\n\n// EXPORTS //\n\nmodule.exports = CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Note: order should match `ctors` order\nvar DTYPES = [\n\t'float64',\n\t'float32',\n\t'int32',\n\t'uint32',\n\t'int16',\n\t'uint16',\n\t'int8',\n\t'uint8',\n\t'uint8c',\n\t'complex64',\n\t'complex128',\n\t'bool'\n];\n\n\n// EXPORTS //\n\nmodule.exports = DTYPES;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isBuffer = require( '@stdlib/assert/is-buffer' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar constructorName = require( '@stdlib/utils/constructor-name' );\nvar ctor2dtype = require( './ctor2dtype.js' );\nvar CTORS = require( './ctors.js' );\nvar DTYPES = require( './dtypes.js' );\n\n\n// VARIABLES //\n\nvar NTYPES = DTYPES.length;\n\n\n// MAIN //\n\n/**\n* Returns the data type of an array.\n*\n* @param {*} value - input value\n* @returns {(string|null)} data type\n*\n* @example\n* var dt = dtype( [ 1, 2, 3 ] );\n* // returns 'generic'\n*\n* var dt = dtype( 'beep' );\n* // returns null\n*/\nfunction dtype( value ) {\n\tvar i;\n\tif ( isArray( value ) ) {\n\t\treturn 'generic';\n\t}\n\tif ( isBuffer( value ) ) {\n\t\treturn null;\n\t}\n\tfor ( i = 0; i < NTYPES; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn DTYPES[ i ];\n\t\t}\n\t}\n\t// If the above failed, fall back to a more robust (and significantly slower) means for resolving underlying data types:\n\treturn ctor2dtype[ constructorName( value ) ] || null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dtype;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the data type of an array.\n*\n* @module @stdlib/array/dtype\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dtype = require( '@stdlib/array/dtype' );\n*\n* var arr = new Float64Array( 10 );\n*\n* var dt = dtype( arr );\n* // returns 'float64'\n*\n* dt = dtype( {} );\n* // returns null\n*\n* dt = dtype( 'beep' );\n* // returns null\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( './../../../base/assert/is-accessor-array' );\nvar getter = require( './../../../base/getter' );\nvar setter = require( './../../../base/setter' );\nvar accessorGetter = require( './../../../base/accessor-getter' );\nvar accessorSetter = require( './../../../base/accessor-setter' );\nvar dtype = require( './../../../dtype' );\n\n\n// MAIN //\n\n/**\n* Converts an array-like to an object likely to have the same \"shape\".\n*\n* ## Notes\n*\n* - This function is intended as a potential performance optimization. In V8, for example, even if two objects share common properties, if those properties were added in different orders or if one object has additional properties not shared by the other object, then those objects will have different \"hidden\" classes. If a function is provided many objects having different \"shapes\", some JavaScript VMs (e.g., V8) will consider the function \"megamorphic\" and fail to perform various runtime optimizations. Accordingly, the intent of this function is to standardize the \"shape\" of the object holding array meta data to ensure that internal functions operating on arrays are provided consistent argument \"shapes\".\n*\n* - The returned object has the following properties:\n*\n* - **data**: reference to the input array.\n* - **dtype**: array data type.\n* - **accessorProtocol**: `boolean` indicating whether the input array uses accessors for getting and setting elements.\n* - **accessors**: a two-element array whose first element is an accessor for retrieving an array element and whose second element is an accessor for setting an array element.\n*\n* @param {Collection} x - array-like object\n* @returns {Object} object containing array meta data\n*\n* @example\n* var obj = arraylike2object( [ 1, 2, 3, 4 ] );\n* // returns {...}\n*/\nfunction arraylike2object( x ) {\n\tvar dt = dtype( x );\n\tif ( isAccessorArray( x ) ) {\n\t\treturn {\n\t\t\t'data': x,\n\t\t\t'dtype': dt,\n\t\t\t'accessorProtocol': true,\n\t\t\t'accessors': [\n\t\t\t\taccessorGetter( dt ),\n\t\t\t\taccessorSetter( dt )\n\t\t\t]\n\t\t};\n\t}\n\treturn {\n\t\t'data': x,\n\t\t'dtype': dt,\n\t\t'accessorProtocol': false,\n\t\t'accessors': [\n\t\t\tgetter( dt ),\n\t\t\tsetter( dt )\n\t\t]\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = arraylike2object;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert an array-like object to an object likely to have the same \"shape\".\n*\n* @module @stdlib/array/base/arraylike2object\n*\n* @example\n* var arraylike2object = require( '@stdlib/array/base/arraylike2object' );\n*\n* var obj = arraylike2object( [ 1, 2, 3, 4 ] );\n* // returns {...}\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative maximum of a strided array.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array<Function>} x.accessors - array element accessors\n* @param {integer} strideX - stride length for `x`\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Object} y - output array object\n* @param {Collection} y.data - output array data\n* @param {Array<Function>} y.accessors - array element accessors\n* @param {integer} strideY - stride length for `y`\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Object} output array object\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );\n* var arraylike2object = require( '@stdlib/array/base/arraylike2object' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n*\n* cumax( 4, arraylike2object( toAccessorArray( x ) ), 2, 1, arraylike2object( toAccessorArray( y ) ), 1, 0 );\n* // y => [ 1.0, 1.0, 2.0, 4.0, 0.0, 0.0, 0.0, 0.0 ];\n*/\nfunction cumax( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar xget;\n\tvar yset;\n\tvar max;\n\tvar ix;\n\tvar iy;\n\tvar v;\n\tvar i;\n\n\t// Cache reference to array data:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache a reference to the element accessor:\n\txget = x.accessors[ 0 ];\n\tyset = y.accessors[ 1 ];\n\n\tix = offsetX;\n\tiy = offsetY;\n\n\tmax = xget( xbuf, ix );\n\tyset( ybuf, iy, max );\n\n\tiy += strideY;\n\ti = 1;\n\tif ( isnan( max ) === false ) {\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tix += strideX;\n\t\t\tv = xget( xbuf, ix );\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tmax = v;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( v > max || ( v === max && isPositiveZero( v ) ) ) {\n\t\t\t\tmax = v;\n\t\t\t}\n\t\t\tyset( ybuf, iy, max );\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\tif ( isnan( max ) ) {\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tyset( ybuf, iy, max );\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cumax;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative maximum of a strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} strideX - stride length for `x`\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {NumericArray} y - output array\n* @param {integer} strideY - stride length for `y`\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {NumericArray} output array\n*\n* @example\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n*\n* var v = cumax( 4, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, 1.0, 2.0, 4.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction cumax( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar max;\n\tvar ix;\n\tvar iy;\n\tvar ox;\n\tvar oy;\n\tvar v;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tox = arraylike2object( x );\n\toy = arraylike2object( y );\n\tif ( ox.accessorProtocol || oy.accessorProtocol ) {\n\t\taccessors( N, ox, strideX, offsetX, oy, strideY, offsetY );\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\tmax = x[ ix ];\n\ty[ iy ] = max;\n\n\tiy += strideY;\n\ti = 1;\n\tif ( isnan( max ) === false ) {\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tix += strideX;\n\t\t\tv = x[ ix ];\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tmax = v;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( v > max || ( v === max && isPositiveZero( v ) ) ) {\n\t\t\t\tmax = v;\n\t\t\t}\n\t\t\ty[ iy ] = max;\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\tif ( isnan( max ) ) {\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ty[ iy ] = max;\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cumax;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar stride2offset = require( '@stdlib/strided/base/stride2offset' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative maximum of a strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} strideX - stride length for `x`\n* @param {NumericArray} y - output array\n* @param {integer} strideY - stride length for `y`\n* @returns {NumericArray} output array\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* var v = cumax( 3, x, 1, y, 1 );\n* // returns [ 1.0, 1.0, 2.0 ]\n*/\nfunction cumax( N, x, strideX, y, strideY ) {\n\tvar ix = stride2offset( N, strideX );\n\tvar iy = stride2offset( N, strideY );\n\treturn ndarray( N, x, strideX, ix, y, strideY, iy );\n}\n\n\n// EXPORTS //\n\nmodule.exports = cumax;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative maximum of a strided array.\n*\n* @module @stdlib/stats/base/cumax\n*\n* @example\n* var cumax = require( '@stdlib/stats/base/cumax' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* cumax( 3, x, 1, y, 1 );\n* // y => [ 1.0, 1.0, 2.0 ]\n*\n* @example\n* var cumax = require( '@stdlib/stats/base/cumax' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n*\n* cumax.ndarray( 4, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, 1.0, 2.0, 4.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar min = require( '@stdlib/math/base/special/min' );\nvar cumax = require( './../../base/cumax' );\nvar Float64Array = require( '@stdlib/array/float64' );\nvar order = require( './order.js' );\n\n\n// MAIN //\n\n/**\n* Adjusts the p-values via the Bonferroni–Holm method.\n*\n* @private\n* @param {ProbabilityArray} pvalues - p-values to be adjusted\n* @param {PositiveInteger} comparisons - number of comparisons\n* @returns {ProbabilityArray} adjusted p-values\n*/\nfunction holm( pvalues, comparisons ) {\n\tvar indices;\n\tvar sorted;\n\tvar len;\n\tvar out;\n\tvar i;\n\n\tlen = pvalues.length;\n\tindices = order( pvalues );\n\tsorted = new Float64Array( len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tsorted[ i ] = ( comparisons - i ) * pvalues[ indices[ i ] ];\n\t}\n\tsorted = cumax( len, sorted, 1, sorted, 1 );\n\tout = new Array( len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout[ indices[ i ] ] = min( sorted[ i ], 1.0 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = holm;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative minimum of a strided array.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array<Function>} x.accessors - array element accessors\n* @param {integer} strideX - stride length for `x`\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Object} y - output array object\n* @param {Collection} y.data - output array data\n* @param {Array<Function>} y.accessors - array element accessors\n* @param {integer} strideY - stride length for `y`\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Object} output array object\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );\n* var arraylike2object = require( '@stdlib/array/base/arraylike2object' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n*\n* cumin( 4, arraylike2object( toAccessorArray( x ) ), 2, 1, arraylike2object( toAccessorArray( y ) ), 1, 0 );\n* // y => [ 1.0, -2.0, -2.0, -2.0, 0.0, 0.0, 0.0, 0.0 ];\n*/\nfunction cumin( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar xget;\n\tvar yset;\n\tvar min;\n\tvar ix;\n\tvar iy;\n\tvar v;\n\tvar i;\n\n\t// Cache references to array data:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache references to element accessors:\n\txget = x.accessors[ 0 ];\n\tyset = y.accessors[ 1 ];\n\n\tix = offsetX;\n\tiy = offsetY;\n\n\tmin = xget( xbuf, ix );\n\tyset( ybuf, iy, min );\n\n\tiy += strideY;\n\ti = 1;\n\tif ( isnan( min ) === false ) {\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tix += strideX;\n\t\t\tv = xget( xbuf, ix );\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tmin = v;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( v < min || ( v === min && isNegativeZero( v ) ) ) {\n\t\t\t\tmin = v;\n\t\t\t}\n\t\t\tyset( ybuf, iy, min );\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\tif ( isnan( min ) ) {\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tyset( ybuf, iy, min );\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cumin;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative minimum of a strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} strideX - stride length for `x`\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {NumericArray} y - output array\n* @param {integer} strideY - stride length for `y`\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {NumericArray} output array\n*\n* @example\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n*\n* var v = cumin( 4, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -2.0, -2.0, -2.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction cumin( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar min;\n\tvar ix;\n\tvar iy;\n\tvar ox;\n\tvar oy;\n\tvar v;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tox = arraylike2object( x );\n\toy = arraylike2object( y );\n\tif ( ox.accessorProtocol || oy.accessorProtocol ) {\n\t\taccessors( N, ox, strideX, offsetX, oy, strideY, offsetY );\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\tmin = x[ ix ];\n\ty[ iy ] = min;\n\n\tiy += strideY;\n\ti = 1;\n\tif ( isnan( min ) === false ) {\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tix += strideX;\n\t\t\tv = x[ ix ];\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tmin = v;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( v < min || ( v === min && isNegativeZero( v ) ) ) {\n\t\t\t\tmin = v;\n\t\t\t}\n\t\t\ty[ iy ] = min;\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\tif ( isnan( min ) ) {\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ty[ iy ] = min;\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cumin;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar stride2offset = require( '@stdlib/strided/base/stride2offset' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative minimum of a strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} strideX - stride length for `x`\n* @param {NumericArray} y - output array\n* @param {integer} strideY - stride length for `y`\n* @returns {NumericArray} output array\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n* var N = x.length;\n*\n* var v = cumin( N, x, 1, y, 1 );\n* // returns [ 1.0, -2.0, -2.0 ]\n*/\nfunction cumin( N, x, strideX, y, strideY ) {\n\tvar ix = stride2offset( N, strideX );\n\tvar iy = stride2offset( N, strideY );\n\treturn ndarray( N, x, strideX, ix, y, strideY, iy );\n}\n\n\n// EXPORTS //\n\nmodule.exports = cumin;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative minimum of a strided array.\n*\n* @module @stdlib/stats/base/cumin\n*\n* @example\n* var cumin = require( '@stdlib/stats/base/cumin' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n* var N = x.length;\n*\n* cumin( N, x, 1, y, 1 );\n* // y => [ 1.0, -2.0, -2.0 ]\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var cumin = require( '@stdlib/stats/base/cumin' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* cumin.ndarray( N, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -2.0, -2.0, -2.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar min = require( '@stdlib/math/base/special/min' );\nvar cumin = require( './../../base/cumin' );\nvar Float64Array = require( '@stdlib/array/float64' );\nvar order = require( './order.js' );\n\n\n// MAIN //\n\n/**\n* Adjusts the p-values via the Benjamini-Hochberg procedure.\n*\n* @private\n* @param {ProbabilityArray} pvalues - p-values to be adjusted\n* @param {PositiveInteger} comparisons - number of comparisons\n* @returns {ProbabilityArray} adjusted p-values\n*/\nfunction bh( pvalues, comparisons ) {\n\tvar indices;\n\tvar sorted;\n\tvar len;\n\tvar out;\n\tvar i;\n\n\tlen = pvalues.length;\n\tindices = order( pvalues, true );\n\tsorted = new Float64Array( len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tsorted[ i ] = comparisons / ( len - i ) * pvalues[ indices[ i ] ];\n\t}\n\tsorted = cumin( len, sorted, 1, sorted, 1 );\n\tout = new Array( len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout[ indices[ i ] ] = min( sorted[ i ], 1.0 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bh;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar min = require( '@stdlib/math/base/special/min' );\nvar cumin = require( './../../base/cumin' );\nvar Float64Array = require( '@stdlib/array/float64' );\nvar order = require( './order.js' );\n\n\n// MAIN //\n\n/**\n* Adjusts the p-values via the Benjamini & Yekutieli method.\n*\n* @private\n* @param {ProbabilityArray} pvalues - p-values to be adjusted\n* @param {PositiveInteger} comparisons - number of comparisons\n* @returns {ProbabilityArray} adjusted p-values\n*/\nfunction by( pvalues, comparisons ) {\n\tvar indices;\n\tvar sorted;\n\tvar len;\n\tvar out;\n\tvar i;\n\tvar q;\n\n\tlen = pvalues.length;\n\tindices = order( pvalues, true );\n\tq = 0;\n\tfor ( i = 0; i < comparisons; i++ ) {\n\t\tq += 1 / ( 1 + i );\n\t}\n\tsorted = new Float64Array( len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tsorted[ i ] = q * comparisons / ( len - i ) * pvalues[ indices[ i ] ];\n\t}\n\tsorted = cumin( len, sorted, 1, sorted, 1 );\n\tout = new Array( len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout[ indices[ i ] ] = min( sorted[ i ], 1.0 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = by;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isProbabilityArray = require( '@stdlib/assert/is-probability-array' );\nvar isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar bonferroni = require( './bonferroni.js' );\nvar hommel = require( './hommel.js' );\nvar holm = require( './holm.js' );\nvar bh = require( './bh.js' );\nvar by = require( './by.js' );\n\n\n// VARIABLES //\n\nvar METHODS = [ 'bh', 'bonferroni', 'by', 'holm', 'hommel' ];\n\n\n// MAIN //\n\n/**\n* Adjusts supplied p-values for multiple comparisons via a specified method.\n*\n* @param {ProbabilityArray} pvals - p-values to be adjusted\n* @param {string} method - correction method\n* @param {PositiveInteger} [comparisons=pvals.length] - number of comparisons\n* @throws {TypeError} first argument has to be an array-like object\n* @throws {TypeError} second argument must be a string\n* @throws {Error} second argument must be `bh`, `bonferroni`, `by`, `holm`, or `hommel`\n* @throws {RangeError} comparisons must be greater or equal to the number of p-values to be adjusted\n* @returns {ProbabilityArray} array containing the corrected p-values\n*\n* @example\n* var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];\n* var out = padjust( pvalues, 'bonferroni' );\n* // returns [ 0.04, 0.15, ..., 1, 1 ]\n*\n* @example\n* var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];\n* var out = padjust( pvalues, 'by' );\n* // returns [ ~0.091, ~0.171, ..., 1, ~0.571 ]\n*\n* @example\n* var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];\n* var out = padjust( pvalues, 'bh' );\n* // returns [ 0.04, 0.075, ..., 0.6, 0.25 ]\n*\n* @example\n* var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];\n* var out = padjust( pvalues, 'holm' );\n* // returns [ 0.04, 0.12, ..., 0.6, 0.4 ]\n*\n* @example\n* var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];\n* var out = padjust( pvalues, 'hommel' );\n* // returns [ 0.032, 0.12, ..., 0.6, 0.4 ]\n*/\nfunction padjust( pvals, method, comparisons ) {\n\tif ( !isProbabilityArray( pvals ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array of probabilities. Value: `%s`.', pvals ) );\n\t}\n\tif ( !isString( method ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a string. Value: `%s`.', method ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isInteger( comparisons ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', comparisons ) );\n\t\t}\n\t\tif ( comparisons < pvals.length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. The number of comparisons must be greater or equal to the number of p-values to be adjusted. Value: `%u`.', comparisons ) );\n\t\t}\n\t}\n\tcomparisons = comparisons || pvals.length;\n\tswitch ( method ) {\n\tcase 'bonferroni':\n\t\treturn bonferroni( pvals, comparisons );\n\tcase 'by':\n\t\treturn by( pvals, comparisons );\n\tcase 'bh':\n\t\treturn bh( pvals, comparisons );\n\tcase 'holm':\n\t\treturn holm( pvals, comparisons );\n\tcase 'hommel':\n\t\treturn hommel( pvals, comparisons );\n\tdefault:\n\t\tthrow new Error( format( 'invalid argument. Second argument must be one of the following: \"%s\". Value: `%s`.', METHODS.join( '\", \"' ), method ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = padjust;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Adjust supplied p-values for multiple comparisons via a specified method.\n*\n* @module @stdlib/stats/padjust\n*\n* @example\n* var padjust = require( '@stdlib/stats/padjust' );\n*\n* var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];\n* var out = padjust( pvalues, 'bh' );\n* // returns [ 0.04, 0.075, ~0.205, 0.6, 0.25 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( './../../is-collection' );\nvar isFunction = require( './../../is-function' );\n\n\n// MAIN //\n\n/**\n* Tests if a value is an array-like object supporting the accessor (get/set) protocol.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is an accessor array\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isAccessorArray( [] );\n* // returns false\n*\n* @example\n* var bool = isAccessorArray( {} );\n* // returns false\n*/\nfunction isAccessorArray( value ) {\n\treturn (\n\t\tisCollection( value ) &&\n\t\tisFunction( value.get ) &&\n\t\tisFunction( value.set )\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isAccessorArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an array-like object supporting the accessor (get/set) protocol.\n*\n* @module @stdlib/assert/is-accessor-array\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n* var isAccessorArray = require( '@stdlib/assert/is-accessor-array' );\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* bool = isAccessorArray( [] );\n* // returns false\n*\n* bool = isAccessorArray( {} );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isComplex128Array = require( '@stdlib/array/base/assert/is-complex128array' );\nvar isComplex64Array = require( '@stdlib/array/base/assert/is-complex64array' );\nvar reinterpret128 = require( './../../../base/reinterpret-complex128' );\nvar reinterpret64 = require( './../../../base/reinterpret-complex64' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Reinterprets a complex-valued floating-point array as a real-valued floating-point array having the same precision.\n*\n* @param {(Complex128Array|Complex64Array)} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @throws {TypeError} first argument must be a supported complex-valued floating-point array\n* @returns {(Float64Array|Float32Array)} real-valued floating-point array view\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var x = new Complex128Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns <Float64Array>\n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n*\n* var x = new Complex64Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns <Float32Array>\n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\tif ( isComplex128Array( x ) ) {\n\t\treturn reinterpret128( x, offset );\n\t}\n\tif ( isComplex64Array( x ) ) {\n\t\treturn reinterpret64( x, offset );\n\t}\n\t// Note: intentionally throw here to catch the scenario in which we add, e.g., a Complex32Array and need to explicitly add support here...\n\tthrow new TypeError( format( 'invalid argument. First argument must be a complex-valued floating-point array. Value: `%s`.', x ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Reinterpret a complex-valued floating-point point array as a real-valued floating-point array view having the same precision.\n*\n* @module @stdlib/strided/base/reinterpret-complex\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n* var reinterpret = require( '@stdlib/strided/base/reinterpret-complex' );\n*\n* var x = new Complex128Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns <Float64Array>\n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Uint8Array = require( '@stdlib/array/uint8' );\n\n\n// MAIN //\n\n/**\n* Reinterprets a `BooleanArray` as a `Uint8Array`.\n*\n* @param {BooleanArray} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Uint8Array} `Uint8Array` view\n*\n* @example\n* var BooleanArray = require( '@stdlib/array/bool' );\n*\n* var x = new BooleanArray( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns <Uint8Array>\n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Uint8Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), x.length-offset ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Reinterpret a `BooleanArray` as a `Uint8Array`.\n*\n* @module @stdlib/strided/base/reinterpret-boolean\n*\n* @example\n* var BooleanArray = require( '@stdlib/array/bool' );\n* var reinterpret = require( '@stdlib/strided/base/reinterpret-boolean' );\n*\n* var x = new BooleanArray( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns <Uint8Array>\n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar C64_BYTES_PER_ELEMENT = 8; // 4 bytes per float32 x (1 real + 1 imag component)\nvar C128_BYTES_PER_ELEMENT = 16; // 8 bytes per float64 x (1 real + 1 imag component)\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n*\n* var bool = isComplexTypedArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* bool = isComplexTypedArray( [] );\n* // returns false\n*/\nfunction isComplexTypedArray( value ) {\n\t// Note: the following is not robust and that is intentional. In this case, we are seeking a lower cost way to reasonably determine whether an input value is a `Complex128Array` in order to avoid walking the prototype chain and resolving constructors, which is necessary for robust identification of cross-realm instances. For more robust validation, see `@stdlib/assert/is-complex-typed-array`.\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t(\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex128Array' &&\n\t\t\t\tvalue.BYTES_PER_ELEMENT === C128_BYTES_PER_ELEMENT\n\t\t\t) ||\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' &&\n\t\t\t\tvalue.BYTES_PER_ELEMENT === C64_BYTES_PER_ELEMENT\n\t\t\t)\n\t\t)\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isComplexTypedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a complex typed array.\n*\n* @module @stdlib/array/base/assert/is-complex-typed-array\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n* var isComplexTypedArray = require( '@stdlib/array/base/assert/is-complex-typed-array' );\n*\n* var bool = isComplexTypedArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* bool = isComplexTypedArray( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = 1; // 1 bytes per uint8\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a `BooleanArray`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `BooleanArray`\n*\n* @example\n* var BooleanArray = require( '@stdlib/array/bool' );\n*\n* var bool = isBooleanArray( new BooleanArray( 10 ) );\n* // returns true\n*\n* bool = isBooleanArray( [] );\n* // returns false\n*/\nfunction isBooleanArray( value ) {\n\t// Note: the following is not robust and that is intentional. In this case, we are seeking a lower cost way to reasonably determine whether an input value is a `BooleanArray` in order to avoid walking the prototype chain and resolving constructors, which is necessary for robust identification of cross-realm instances. For more robust validation, see `@stdlib/assert/is-booleanarray`.\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'BooleanArray' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isBooleanArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a `BooleanArray`.\n*\n* @module @stdlib/array/base/assert/is-booleanarray\n*\n* @example\n* var BooleanArray = require( '@stdlib/array/bool' );\n* var isBooleanArray = require( '@stdlib/array/base/assert/is-booleanarray' );\n*\n* var bool = isBooleanArray( new BooleanArray( 10 ) );\n* // returns true\n*\n* bool = isBooleanArray( [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( './../../../base/assert/is-accessor-array' );\nvar accessorGetter = require( './../../../base/accessor-getter' );\nvar getter = require( './../../../base/getter' );\nvar dtype = require( './../../../dtype' );\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an array-like object.\n*\n* @param {Collection} x - input array\n* @returns {Function} accessor\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = resolveGetter( arr );\n* var v = get( arr, 2 );\n* // returns 3\n*/\nfunction resolveGetter( x ) {\n\tvar dt = dtype( x );\n\tif ( isAccessorArray( x ) ) {\n\t\treturn accessorGetter( dt );\n\t}\n\treturn getter( dt );\n}\n\n\n// EXPORTS //\n\nmodule.exports = resolveGetter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an accessor function for retrieving an element from an array-like object.\n*\n* @module @stdlib/array/base/resolve-getter\n*\n* @example\n* var resolveGetter = require( '@stdlib/array/base/resolve-getter' );\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = resolveGetter( arr );\n* var v = get( arr, 2 );\n* // returns 3\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests if two double-precision floating-point numbers are the same value.\n*\n* ## Notes\n*\n* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.\n* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.\n*\n* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12\n*\n* @param {number} a - first input value\n* @param {number} b - second input value\n* @returns {boolean} boolean indicating whether two double-precision floating-point numbers are the same value\n*\n* @example\n* var bool = isSameValue( 3.14, 3.14 );\n* // returns true\n*\n* @example\n* var bool = isSameValue( -0.0, -0.0 );\n* // returns true\n*\n* @example\n* var bool = isSameValue( -0.0, 0.0 );\n* // returns false\n*\n* @example\n* var bool = isSameValue( NaN, NaN );\n* // returns true\n*/\nfunction isSameValue( a, b ) {\n\tif ( a === b ) {\n\t\tif ( a === 0.0 ) {\n\t\t\treturn 1.0 / a === 1.0 / b; // handles +-0\n\t\t}\n\t\treturn true;\n\t}\n\treturn ( a !== a && b !== b ); // handles NaNs\n}\n\n\n// EXPORTS //\n\nmodule.exports = isSameValue;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if two double-precision floating-point numbers are the same value.\n*\n* @module @stdlib/number/float64/base/assert/is-same-value\n*\n* @example\n* var isSameValue = require( '@stdlib/number/float64/base/assert/is-same-value' );\n*\n* var bool = isSameValue( 3.14, 3.14 );\n* // returns true\n*\n* bool = isSameValue( -0.0, -0.0 );\n* // returns true\n*\n* bool = isSameValue( -0.0, 0.0 );\n* // returns false\n*\n* bool = isSameValue( NaN, NaN );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Float64Array = require( '@stdlib/array/float64' );\n\n\n// MAIN //\n\n/**\n* Returns the real and imaginary components of a double-precision complex floating-point number.\n*\n* @param {Complex128} z - complex number\n* @returns {Float64Array} real and imaginary components\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var out = reim( z );\n* // returns <Float64Array>[ 5.0, 3.0 ]\n*/\nfunction reim( z ) {\n\tvar out = new Float64Array( 2 );\n\tout[ 0 ] = z.re;\n\tout[ 1 ] = z.im;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reim;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the real and imaginary components of a double-precision complex floating-point number.\n*\n* @module @stdlib/complex/float64/reim\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n* var reim = require( '@stdlib/complex/float64/reim' );\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var out = reim( z );\n* // returns <Float64Array>[ 5.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isSame = require( '@stdlib/number/float64/base/assert/is-same-value' );\nvar reim = require( './../../../../../float64/reim' );\n\n\n// MAIN //\n\n/**\n* Tests whether two double-precision complex floating-point numbers are the same value.\n*\n* ## Notes\n*\n* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.\n* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.\n*\n* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12\n*\n* @param {Complex128} z1 - first complex number\n* @param {Complex128} z2 - second complex number\n* @returns {boolean} result\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n*\n* var z1 = new Complex128( 5.0, 3.0 );\n* var z2 = new Complex128( 5.0, 3.0 );\n*\n* var v = isSameValue( z1, z2 );\n* // returns true\n*/\nfunction isSameValue( z1, z2 ) {\n\tvar parts1 = reim( z1 );\n\tvar parts2 = reim( z2 );\n\treturn (\n\t\tisSame( parts1[ 0 ], parts2[ 0 ] ) &&\n\t\tisSame( parts1[ 1 ], parts2[ 1 ] )\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isSameValue;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether two double-precision complex floating-point numbers are the same value.\n*\n* @module @stdlib/complex/float64/base/assert/is-same-value\n*\n* @example\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n* var isSameValue = require( '@stdlib/complex/float64/base/assert/is-same-value' );\n*\n* var z1 = new Complex128( 5.0, 3.0 );\n* var z2 = new Complex128( 5.0, 3.0 );\n*\n* var v = isSameValue( z1, z2 );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isSameComplexValue = require( '@stdlib/complex/float64/base/assert/is-same-value' );\nvar isComplexLike = require( './../../is-complex-like' );\n\n\n// MAIN //\n\n/**\n* Tests if two arguments are the same value.\n*\n* ## Notes\n*\n* - The function implements the [SameValue Algorithm][ecma-262-same-value-algorithm] (as specified in ECMAScript 5), with support for complex number objects.\n* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.\n*\n* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12\n*\n* @param {*} a - first input value\n* @param {*} b - second input value\n* @returns {boolean} boolean indicating whether two arguments are the same value\n*\n* @example\n* var bool = isSameValue( true, true );\n* // returns true\n*\n* @example\n* var bool = isSameValue( 3.14, 3.14 );\n* // returns true\n*\n* @example\n* var bool = isSameValue( {}, {} );\n* // returns false\n*\n* @example\n* var bool = isSameValue( -0.0, -0.0 );\n* // returns true\n*\n* @example\n* var bool = isSameValue( -0.0, 0.0 );\n* // returns false\n*\n* @example\n* var bool = isSameValue( NaN, NaN );\n* // returns true\n*\n* @example\n* var bool = isSameValue( [], [] );\n* // returns false\n*/\nfunction isSameValue( a, b ) {\n\tif ( a === b ) {\n\t\tif ( a === 0.0 ) {\n\t\t\treturn 1.0 / a === 1.0 / b; // handles +-0\n\t\t}\n\t\treturn true;\n\t}\n\tif ( a !== a && b !== b ) { // handles NaNs\n\t\treturn true;\n\t}\n\tif ( isComplexLike( a ) && isComplexLike( b ) ) {\n\t\treturn isSameComplexValue( a, b );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = isSameValue;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if two arguments are the same value.\n*\n* @module @stdlib/assert/is-same-value\n*\n* @example\n* var isSameValue = require( '@stdlib/assert/is-same-value' );\n*\n* var bool = isSameValue( true, true );\n* // returns true\n*\n* bool = isSameValue( 3.14, 3.14 );\n* // returns true\n*\n* bool = isSameValue( {}, {} );\n* // returns false\n*\n* bool = isSameValue( -0.0, -0.0 );\n* // returns true\n*\n* bool = isSameValue( -0.0, 0.0 );\n* // returns false\n*\n* bool = isSameValue( NaN, NaN );\n* // returns true\n*\n* bool = isSameValue( [], [] );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/assert/is-accessor-array' );\nvar isComplexLike = require( '@stdlib/assert/is-complex-like' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar reinterpret = require( '@stdlib/strided/base/reinterpret-complex' );\nvar reinterpretBoolean = require( '@stdlib/strided/base/reinterpret-boolean' );\nvar isComplexTypedArray = require( './../../../base/assert/is-complex-typed-array' );\nvar isBooleanArray = require( './../../../base/assert/is-booleanarray' );\nvar resolveGetter = require( './../../../base/resolve-getter' );\nvar isSameValue = require( '@stdlib/assert/is-same-value' );\nvar real = require( '@stdlib/complex/float64/real' );\nvar imag = require( '@stdlib/complex/float64/imag' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the index of the first element which equals a provided search element according to the same value algorithm.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} searchElement - search element\n* @param {NonNegativeInteger} fromIndex - starting index (inclusive)\n* @returns {integer} index\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var idx = indexed( x, 2, 0 );\n* // returns 1\n*/\nfunction indexed( x, searchElement, fromIndex ) {\n\tvar i;\n\tfor ( i = fromIndex; i < x.length; i++ ) {\n\t\tif ( isSameValue( searchElement, x[ i ] ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n* Returns the index of the first element which equals a provided search element according to the same value algorithm.\n*\n* @private\n* @param {Collection} x - input array object\n* @param {*} searchElement - search element\n* @param {NonNegativeInteger} fromIndex - starting index (inclusive)\n* @returns {integer} index\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );\n*\n* var x = toAccessorArray( [ 1, 2, 3, 4 ] );\n*\n* var idx = accessors( x, 2, 0 );\n* // returns 1\n*/\nfunction accessors( x, searchElement, fromIndex ) {\n\tvar get;\n\tvar i;\n\n\tget = resolveGetter( x );\n\tfor ( i = fromIndex; i < x.length; i++ ) {\n\t\tif ( isSameValue( searchElement, get( x, i ) ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n* Returns the index of the first element which equals a provided search element according to the same value algorithm.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} searchElement - search element\n* @param {NonNegativeInteger} fromIndex - starting index (inclusive)\n* @returns {integer} index\n*\n* @example\n* var Complex128Array = require( '@stdlib/array/complex128' );\n* var Complex128 = require( '@stdlib/complex/float64/ctor' );\n*\n* var x = new Complex128Array( [ 1.0, 2.0, 0.0, 0.0, 3.0, 4.0, 0.0, 0.0 ] );\n*\n* var idx = complex( x, new Complex128( 3.0, 4.0 ), 1 );\n* // returns 2\n*/\nfunction complex( x, searchElement, fromIndex ) {\n\tvar view;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexLike( searchElement ) ) {\n\t\treturn -1;\n\t}\n\tview = reinterpret( x, 0 );\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tfor ( i = fromIndex*2; i < view.length; i += 2 ) {\n\t\tif ( isSameValue( view[ i ], re ) && isSameValue( view[ i+1 ], im ) ) {\n\t\t\treturn i / 2;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n* Returns the index of the first element which equals a provided search element according to the same value algorithm.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} searchElement - search element\n* @param {NonNegativeInteger} fromIndex - starting index (inclusive)\n* @returns {integer} index\n*\n* @example\n* var BooleanArray = require( '@stdlib/array/bool' );\n*\n* var x = new BooleanArray( [ true, false, true, false, true ] );\n*\n* var idx = boolean( x, true, 1 );\n* // returns 2\n*/\nfunction boolean( x, searchElement, fromIndex ) {\n\tvar view;\n\tvar v;\n\tvar i;\n\tif ( !isBoolean( searchElement ) ) {\n\t\treturn -1;\n\t}\n\tview = reinterpretBoolean( x, 0 );\n\tv = ( searchElement ) ? 1 : 0;\n\tfor ( i = fromIndex; i < view.length; i++ ) {\n\t\tif ( view[ i ] === v ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n\n// MAIN //\n\n/**\n* Returns the index of the first element which equals a provided search element according to the same value algorithm.\n*\n* ## Notes\n*\n* - The function uses the [SameValue Algorithm][ecma-262-same-value-algorithm], as specified in ECMAScript 5.\n* - In contrast to the strict equality operator `===`, `-0` and `+0` are distinguishable and `NaNs` are the same.\n* - If unable to find an element which equals a provided search element, the function returns `-1`.\n*\n* [ecma-262-same-value-algorithm]: http://ecma-international.org/ecma-262/5.1/#sec-9.12\n*\n* @param {Collection} x - input array\n* @param {*} searchElement - search element\n* @param {integer} fromIndex - starting index (inclusive)\n* @returns {integer} index\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var idx = indexOfSameValue( x, 2, 0 );\n* // returns 1\n*\n* @example\n* var Int32Array = require( '@stdlib/array/int32' );\n*\n* var x = new Int32Array( [ 1, 2, 3, 4 ] );\n*\n* var idx = indexOfSameValue( x, 2, 0 );\n* // returns 1\n*/\nfunction indexOfSameValue( x, searchElement, fromIndex ) {\n\tif ( fromIndex < 0 ) {\n\t\tfromIndex += x.length;\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex = 0;\n\t\t}\n\t}\n\tif ( isAccessorArray( x ) ) {\n\t\tif ( isComplexTypedArray( x ) ) {\n\t\t\treturn complex( x, searchElement, fromIndex );\n\t\t}\n\t\tif ( isBooleanArray( x ) ) {\n\t\t\treturn boolean( x, searchElement, fromIndex );\n\t\t}\n\t\treturn accessors( x, searchElement, fromIndex );\n\t}\n\treturn indexed( x, searchElement, fromIndex );\n}\n\n\n// EXPORTS //\n\nmodule.exports = indexOfSameValue;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return the index of the first element which equals a provided search element according to the same value algorithm.\n*\n* @module @stdlib/array/base/index-of-same-value\n*\n* @example\n* var indexOfSameValue = require( '@stdlib/array/base/index-of-same-value' );\n*\n* var x = [ 1, 2, 3, 4 ];\n*\n* var idx = indexOfSameValue( x, 2, 0 );\n* // returns 1\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( './../../is-collection' );\nvar isInteger = require( './../../is-integer' ).isPrimitive;\nvar isString = require( './../../is-string' ).isPrimitive;\nvar indexOfSameValue = require( '@stdlib/array/base/index-of-same-value' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Tests if an array-like value contains a search value.\n*\n* @param {(Collection|string)} value - input value\n* @param {*} searchValue - search value\n* @param {integer} [position=0] - position at which to start searching for `searchValue`\n* @throws {TypeError} first argument must be array-like\n* @throws {Error} must provide a search value\n* @throws {TypeError} second argument must be a string when the first argument is a string\n* @throws {TypeError} third argument must be an integer\n* @returns {boolean} boolean indicating whether one value contains another\n*\n* @example\n* var bool = contains( 'last man standing', 'stand' );\n* // returns true\n*\n* @example\n* var bool = contains( [ 1, 2, 3, 4 ], 2 );\n* // returns true\n*\n* @example\n* var bool = contains( 'presidential election', 'president' );\n* // returns true\n*\n* @example\n* var bool = contains( [ NaN, 2, 3, 4 ], NaN );\n* // returns true\n*\n* @example\n* var bool = contains( 'javaScript', 'js' );\n* // returns false\n*\n* @example\n* var bool = contains( [ 1, 2, 3, {} ], {} );\n* // returns false\n*\n* @example\n* var bool = contains( 'Hidden Treasures', '' );\n* // returns true\n*/\nfunction contains( value, searchValue, position ) {\n\tvar isStr;\n\tvar pos;\n\n\tisStr = isString( value );\n\tif ( !isCollection( value ) && !isStr ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', value ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\tthrow new Error( 'insufficient arguments. Must provide a search value.' );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isInteger( position ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', position ) );\n\t\t}\n\t\tpos = position;\n\t\tif ( pos < 0 ) {\n\t\t\tpos = 0;\n\t\t}\n\t} else {\n\t\tpos = 0;\n\t}\n\tif ( isStr ) {\n\t\tif ( !isString( searchValue ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a string. Value: `%s`.', searchValue ) );\n\t\t}\n\t\treturn value.indexOf( searchValue, pos ) !== -1;\n\t}\n\treturn indexOfSameValue( value, searchValue, pos ) !== -1;\n}\n\n\n// EXPORTS //\n\nmodule.exports = contains;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if an array-like value contains another value.\n*\n* @module @stdlib/assert/contains\n*\n* @example\n* var contains = require( '@stdlib/assert/contains' );\n*\n* var bool = contains( 'Hello World', 'World' );\n* // returns true\n*\n* bool = contains( 'Hello World', 'world' );\n* // returns false\n*\n* bool = contains( [ 1, 2, 3, 4 ], 2 );\n* // returns true\n*\n* bool = contains( [ NaN, 2, 3, 4 ], NaN );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a filled \"generic\" array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} filled array\n*\n* @example\n* var out = filled( 0.0, 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = filled( 'beep', 3 );\n* // returns [ 'beep', 'beep', 'beep' ]\n*/\nfunction filled( value, len ) {\n\tvar arr;\n\tvar i;\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tarr.push( value );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nmodule.exports = filled;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a filled \"generic\" array.\n*\n* @module @stdlib/array/base/filled\n*\n* @example\n* var filled = require( '@stdlib/array/base/filled' );\n*\n* var out = filled( 0.0, 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var filled = require( '@stdlib/array/base/filled' );\n*\n* var out = filled( 'beep', 3 );\n* // returns [ 'beep', 'beep', 'beep' ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar filled = require( './../../../base/filled' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled \"generic\" array.\n*\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} output array\n*\n* @example\n* var out = zeros( 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*/\nfunction zeros( len ) {\n\treturn filled( 0.0, len );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zeros;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a zero-filled \"generic\" array.\n*\n* @module @stdlib/array/base/zeros\n*\n* @example\n* var zeros = require( '@stdlib/array/base/zeros' );\n*\n* var out = zeros( 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Computes the sum of elements of an numeric array.\n*\n* @private\n* @param {NumericArray} arr - input array\n* @returns {number} sum\n*\n* @example\n* var arr = [ 2.0, 6.0, 10.0 ];\n* var out = sum( arr );\n* // returns 18.0\n*/\nfunction sum( arr ) {\n\tvar len;\n\tvar out;\n\tvar i;\n\n\tlen = arr.length;\n\tout = 0.0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout += arr[ i ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sum;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Returns a comparison result. If `-1`, `a` comes before `b`. If `1`, `b` comes before `a`. If `0`, the order stays the same.\n*\n* @private\n* @param {number} a - first number\n* @param {number} b - second number\n* @returns {boolean} comparison result\n*/\nfunction compareFunction( a, b ) {\n\tif ( a < b ) {\n\t\treturn -1;\n\t}\n\tif ( a > b ) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\n\n// MAIN //\n\n/**\n* Returns a permutation which rearranges input array.\n*\n* @private\n* @param {ArrayLike} x - input array-like object\n* @returns {Array} permutation array\n*/\nfunction order( x ) {\n\tvar arr;\n\tvar i;\n\n\tarr = [];\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\tarr.push( i );\n\t}\n\treturn arr.sort( compare );\n\n\t/**\n\t* Compare the elements of the input array.\n\t*\n\t* @private\n\t* @param {number} a - first number\n\t* @param {number} b - second number\n\t* @returns {boolean} comparison result\n\t*/\n\tfunction compare( a, b ) {\n\t\treturn compareFunction( x[a], x[b] );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = order;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar contains = require( '@stdlib/assert/contains' );\nvar filled = require( '@stdlib/array/base/filled' );\n\n\n// MAIN //\n\n/**\n* Computes for each array element whether it is a missing value.\n*\n* @private\n* @param {Array} arr - input array\n* @param {Array} encoding - array whose elements encode missing values\n* @returns {BooleanArray} output array\n*/\nfunction isMissing( arr, encoding ) {\n\tvar len;\n\tvar out;\n\tvar i;\n\n\tlen = arr.length;\n\tout = filled( false, len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout[ i ] = contains( encoding, arr[ i ] );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = isMissing;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( './../../../../base/assert/is-accessor-array' );\nvar accessorGetter = require( './../../../../base/accessor-getter' );\nvar getter = require( './../../../../base/getter' );\nvar dtype = require( './../../../../dtype' );\n\n\n// MAIN //\n\n/**\n* Tests if an array contains a provided search value.\n*\n* @param {Collection} x - input array\n* @param {*} value - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*\n* @example\n* var out = contains( [ 1, 2, 3 ], 2 );\n* // returns true\n*/\nfunction contains( x, value ) {\n\tvar len;\n\tvar get;\n\tvar dt;\n\tvar i;\n\n\t// Resolve the input array data type:\n\tdt = dtype( x );\n\n\t// Resolve an accessor for retrieving input array elements:\n\tif ( isAccessorArray( x ) ) {\n\t\tget = accessorGetter( dt );\n\t} else {\n\t\tget = getter( dt );\n\t}\n\t// Get the number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Loop over the elements...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif ( get( x, i ) === value ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = contains;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isAccessorArray = require( './../../../../base/assert/is-accessor-array' );\nvar accessorGetter = require( './../../../../base/accessor-getter' );\nvar dtype = require( './../../../../dtype' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a function to tests if an array contains a provided search value.\n*\n* @param {Collection} x - input array\n* @throws {TypeError} must provide an array-like object\n* @returns {Function} function to test if an array contains a search value\n*\n* @example\n* var contains = factory( [ 1, 2, 3 ] );\n* // returns <Function>\n*\n* var bool = contains( 2 );\n* // returns true\n*/\nfunction factory( x ) {\n\tvar get;\n\tvar len;\n\tvar dt;\n\n\tif ( !isCollection( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', x ) );\n\t}\n\t// Resolve the input array data type:\n\tdt = dtype( x );\n\n\t// Resolve an accessor for retrieving input array elements:\n\tif ( isAccessorArray( x ) ) {\n\t\tget = accessorGetter( dt );\n\t}\n\t// Get the number of elements over which to iterate:\n\tlen = x.length;\n\n\treturn ( get === void 0 ) ? contains : accessors;\n\t/**\n\t* Tests if an array contains a provided search value.\n\t*\n\t* @private\n\t* @param {*} value - search value\n\t* @returns {boolean} boolean indicating if an array contains a search value\n\t*\n\t* @example\n\t* var out = contains( [ 1, 2, 3 ], 2 );\n\t* // returns true\n\t*/\n\tfunction contains( value ) {\n\t\tvar i;\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( x[ i ] === value ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\t/**\n\t* Tests if an array contains a provided search value.\n\t*\n\t* @private\n\t* @param {*} value - search value\n\t* @returns {boolean} boolean indicating if an array contains a search value\n\t*/\n\tfunction accessors( value ) {\n\t\tvar i;\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( get( x, i ) === value ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if an array contains a provided search value.\n*\n* @module @stdlib/array/base/assert/contains\n*\n* @example\n* var contains = require( '@stdlib/array/base/assert/contains' );\n*\n* var out = contains( [ 1, 2, 3 ], 2 );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar contains = require( '@stdlib/array/base/assert/contains' ).factory;\nvar isArray = require( '@stdlib/assert/is-array' );\nvar isObject = require( '@stdlib/assert/is-object' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar METHODS = [ 'min', 'max', 'average', 'dense', 'ordinal' ];\nvar MISSING = [ 'last', 'first', 'remove' ];\n\nvar isMethod = contains( METHODS );\nvar isMissing = contains( MISSING );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for validated options\n* @param {Object} options - function options\n* @param {string} [options.method] - method determining how ties are treated\n* @param {string} [opts.missing] - determines where missing values go (`first`,`last`, or `remove`)\n* @param {Array} [opts.encoding] - array of values encoding missing values\n* @returns {(null|Error)} null or an error\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isArray( opts.encoding ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be an array. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'method' ) ) {\n\t\topts.method = options.method;\n\t\tif ( !isString( opts.method ) || !isMethod( opts.method ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'method', METHODS.join( '\", \"' ), opts.method ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'missing' ) ) {\n\t\topts.missing = options.missing;\n\t\tif ( !isString( opts.missing ) || !isMissing( opts.missing ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'missing', MISSING.join( '\", \"' ), opts.missing ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar contains = require( '@stdlib/assert/contains' );\nvar zeros = require( '@stdlib/array/base/zeros' );\nvar format = require( '@stdlib/string/format' );\nvar sum = require( './sum.js' );\nvar order = require( './order.js' );\nvar isMissing = require( './is_missing.js' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sample ranks for the values of an array-like object.\n*\n* @param {Collection} x - data array\n* @param {Object} [options] - options object\n* @param {string} [options.method='average'] - method name determining how ties are treated\n* @param {string} [options.missing='last'] - determines where missing values go (`first`,`last`, or `remove`)\n* @param {Array} [options.encoding=[null,NaN]] - array of values encoding missing values\n* @throws {TypeError} first argument has to be an array-like object\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Array} array containing the computed ranks for the elements of x\n*\n* @example\n* var arr = [ 1.1, 2.0, 3.5, 0.0, 2.4 ];\n* var out = ranks( arr );\n* // returns [ 2, 3, 5, 1, 4 ]\n*\n* @example\n* // Ties are averaged:\n* arr = [ 2, 2, 1, 4, 3 ];\n* out = ranks( arr );\n* // returns [ 2.5, 2.5, 1, 5, 4 ]\n*\n* @example\n* // Missing values are placed last:\n* arr = [ null, 2, 2, 1, 4, 3, NaN, NaN ];\n* out = ranks( arr );\n* // returns [ 6, 2.5, 2.5, 1, 5, 4, 7 ,8 ]\n*/\nfunction ranks( x, options ) {\n\tvar missingIndices;\n\tvar noDuplicates;\n\tvar countMissing;\n\tvar totalNoTies;\n\tvar finalRanks;\n\tvar encoding;\n\tvar iPlusOne;\n\tvar ordered;\n\tvar missing;\n\tvar tieRank;\n\tvar method;\n\tvar ranks;\n\tvar opts;\n\tvar xnew;\n\tvar err;\n\tvar n;\n\tvar i;\n\tvar j;\n\n\tif ( !isCollection( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', x ) );\n\t}\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tmethod = opts.method || 'average';\n\tencoding = opts.encoding || [ null, NaN ];\n\tmissing = opts.missing || 'last';\n\n\tn = x.length;\n\txnew = [];\n\tfor ( i = 0; i < n; i++ ) {\n\t\tif ( !contains( encoding, x[ i ] ) ) {\n\t\t\txnew.push( x[ i ] );\n\t\t}\n\t}\n\tmissingIndices = isMissing( x, encoding );\n\tn = xnew.length;\n\ttotalNoTies = 0;\n\tordered = order( xnew );\n\n\tranks = zeros( n );\n\tif ( method === 'ordinal' ) {\n\t\tfor ( i = 0; i < n; i++ ) {\n\t\t\tranks[ ordered[ i ] ] = i + 1;\n\t\t}\n\t} else {\n\t\tnoDuplicates = 0;\n\t\tfor ( i = 0; i < n; i++ ) {\n\t\t\tiPlusOne = i + 1;\n\t\t\tif (\n\t\t\t\t( i === n - 1 ) ||\n\t\t\t\t( xnew[ ordered[i] ] !== xnew[ ordered[ iPlusOne ] ] )\n\t\t\t) {\n\t\t\t\tswitch ( method ) {\n\t\t\t\tcase 'min':\n\t\t\t\t\ttieRank = iPlusOne - noDuplicates;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'max':\n\t\t\t\t\ttieRank = iPlusOne;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'dense':\n\t\t\t\t\ttieRank = iPlusOne - noDuplicates - totalNoTies;\n\t\t\t\t\ttotalNoTies += noDuplicates;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'average':\n\t\t\t\tdefault:\n\t\t\t\t\ttieRank = iPlusOne - ( 0.5 * noDuplicates );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfor ( j = i - noDuplicates; j < iPlusOne; j++ ) {\n\t\t\t\t\tranks[ ordered[ j ] ] = tieRank;\n\t\t\t\t}\n\t\t\t\tnoDuplicates = 0;\n\t\t\t} else {\n\t\t\t\tnoDuplicates += 1;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( missing === 'first' ) {\n\t\tcountMissing = sum( missingIndices );\n\t\tj = 1;\n\t\tfinalRanks = [];\n\t\tfor ( i = 0; i < missingIndices.length; i++ ) {\n\t\t\tif ( missingIndices[ i ] ) {\n\t\t\t\tfinalRanks.push( j );\n\t\t\t\tj += 1;\n\t\t\t} else {\n\t\t\t\tfinalRanks.push( ranks.shift() + countMissing );\n\t\t\t}\n\t\t}\n\t\treturn finalRanks;\n\t}\n\tif ( missing === 'last' ) {\n\t\tfinalRanks = [];\n\t\tfor ( i = 0; i < missingIndices.length; i++ ) {\n\t\t\tif ( missingIndices[ i ] ) {\n\t\t\t\tfinalRanks.push( i + ranks.length + 1 );\n\t\t\t} else {\n\t\t\t\tfinalRanks.push( ranks.shift() );\n\t\t\t}\n\t\t}\n\t\treturn finalRanks;\n\t}\n\t// Case: missing = 'remove'\n\treturn ranks;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ranks;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute ranks for the values of an array-like object.\n*\n* @module @stdlib/stats/ranks\n*\n* @example\n* var ranks = require( '@stdlib/stats/ranks' );\n*\n* var arr = [ 1.1, 2.0, 3.5, 0.0, 2.4 ];\n* var out = ranks( arr );\n* // returns [ 2, 3, 5, 1, 4 ]\n*\n* // Ties are averaged:\n* arr = [ 2, 2, 1, 4, 3 ];\n* out = ranks ( arr );\n* // returns [ 2.5, 2.5, 1, 5, 4 ];\n*\n* // Missing values are placed last:\n* arr = [ null, 2, 2, 1, 4, 3, NaN, NaN ];\n* out = ranks( arr );\n* // returns [ 6, 2.5, 2.5, 1, 5, 4, 7 ,8 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783–99. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array<Function>} x.accessors - array element accessors\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {number} sum\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );\n* var arraylike2object = require( '@stdlib/array/base/arraylike2object' );\n*\n* var x = toAccessorArray( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n*\n* var v = gsumpw( 4, arraylike2object( x ), 2, 1 );\n* // returns 5.0\n*/\nfunction gsumpw( N, x, strideX, offsetX ) {\n\tvar xbuf;\n\tvar get;\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar n;\n\tvar s;\n\tvar i;\n\n\t// Cache reference to array data:\n\txbuf = x.data;\n\n\t// Cache a reference to the element accessor:\n\tget = x.accessors[ 0 ];\n\n\tix = offsetX;\n\tif ( strideX === 0 ) {\n\t\treturn N * get( xbuf, ix );\n\t}\n\n\tif ( N <= 8 ) {\n\t\ts = get( xbuf, ix );\n\t\tix += strideX;\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\ts += get( xbuf, ix );\n\t\t\tix += strideX;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = get( xbuf, ix );\n\t\ts1 = get( xbuf, ix+strideX );\n\t\ts2 = get( xbuf, ix+(2*strideX) );\n\t\ts3 = get( xbuf, ix+(3*strideX) );\n\t\ts4 = get( xbuf, ix+(4*strideX) );\n\t\ts5 = get( xbuf, ix+(5*strideX) );\n\t\ts6 = get( xbuf, ix+(6*strideX) );\n\t\ts7 = get( xbuf, ix+(7*strideX) );\n\t\tix += 8 * strideX;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += get( xbuf, ix );\n\t\t\ts1 += get( xbuf, ix+strideX );\n\t\t\ts2 += get( xbuf, ix+(2*strideX) );\n\t\t\ts3 += get( xbuf, ix+(3*strideX) );\n\t\t\ts4 += get( xbuf, ix+(4*strideX) );\n\t\t\ts5 += get( xbuf, ix+(5*strideX) );\n\t\t\ts6 += get( xbuf, ix+(6*strideX) );\n\t\t\ts7 += get( xbuf, ix+(7*strideX) );\n\t\t\tix += 8 * strideX;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ( (s0+s1) + (s2+s3) ) + ( (s4+s5) + (s6+s7) );\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += get( xbuf, ix );\n\t\t\tix += strideX;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn gsumpw( n, x, strideX, ix ) + gsumpw( N-n, x, strideX, ix+(n*strideX) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumpw;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783–99. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {number} sum\n*\n* @example\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n*\n* var v = gsumpw( 4, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gsumpw( N, x, strideX, offsetX ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar o;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\treturn accessors( N, o, strideX, offsetX );\n\t}\n\tix = offsetX;\n\tif ( strideX === 0 ) {\n\t\treturn N * x[ ix ];\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = x[ ix ];\n\t\tix += strideX;\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += strideX;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = x[ ix ];\n\t\ts1 = x[ ix+strideX ];\n\t\ts2 = x[ ix+(2*strideX) ];\n\t\ts3 = x[ ix+(3*strideX) ];\n\t\ts4 = x[ ix+(4*strideX) ];\n\t\ts5 = x[ ix+(5*strideX) ];\n\t\ts6 = x[ ix+(6*strideX) ];\n\t\ts7 = x[ ix+(7*strideX) ];\n\t\tix += 8 * strideX;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += x[ ix ];\n\t\t\ts1 += x[ ix+strideX ];\n\t\t\ts2 += x[ ix+(2*strideX) ];\n\t\t\ts3 += x[ ix+(3*strideX) ];\n\t\t\ts4 += x[ ix+(4*strideX) ];\n\t\t\ts5 += x[ ix+(5*strideX) ];\n\t\t\ts6 += x[ ix+(6*strideX) ];\n\t\t\ts7 += x[ ix+(7*strideX) ];\n\t\t\tix += 8 * strideX;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ( (s0+s1) + (s2+s3) ) + ( (s4+s5) + (s6+s7) );\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += strideX;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn gsumpw( n, x, strideX, ix ) + gsumpw( N-n, x, strideX, ix+(n*strideX) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumpw;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar stride2offset = require( '@stdlib/strided/base/stride2offset' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783–99. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} strideX - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n*\n* var v = gsumpw( x.length, x, 1 );\n* // returns 1.0\n*/\nfunction gsumpw( N, x, strideX ) {\n\treturn ndarray( N, x, strideX, stride2offset( N, strideX ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumpw;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/gsumpw\n*\n* @example\n* var gsumpw = require( '@stdlib/blas/ext/base/gsumpw' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n*\n* var v = gsumpw( x.length, x, 1 );\n* // returns 1.0\n*\n* @example\n* var gsumpw = require( '@stdlib/blas/ext/base/gsumpw' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n*\n* var v = gsumpw.ndarray( 4, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gsumpw = require( './../../../../ext/base/gsumpw' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Adds a scalar constant to each strided array element and computes the sum using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783–99. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar constant\n* @param {NumericArray} x - input array\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {number} sum\n*\n* @example\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n*\n* var v = gapxsumpw( 4, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction gapxsumpw( N, alpha, x, strideX, offsetX ) {\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\treturn ( N * alpha ) + gsumpw( N, x, strideX, offsetX );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumpw;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar stride2offset = require( '@stdlib/strided/base/stride2offset' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Adds a scalar constant to each strided array element and computes the sum using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783–99. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar constant\n* @param {NumericArray} x - input array\n* @param {integer} strideX - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n*\n* var v = gapxsumpw( x.length, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction gapxsumpw( N, alpha, x, strideX ) {\n\treturn ndarray( N, alpha, x, strideX, stride2offset( N, strideX ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumpw;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a scalar constant to each strided array element and compute the sum using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/gapxsumpw\n*\n* @example\n* var gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n*\n* var v = gapxsumpw( x.length, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n*\n* var v = gapxsumpw.ndarray( 4, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gsumpw = require( '@stdlib/blas/ext/base/gsumpw' ).ndarray;\nvar gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the arithmetic mean of a strided array using a two-pass error correction algorithm.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Object} x - input array object\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {number} arithmetic mean\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );\n* var arraylike2object = require( '@stdlib/array/base/arraylike2object' );\n*\n* var x = toAccessorArray( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n*\n* var v = meanpn( 4, arraylike2object( x ), 2, 1 );\n* // returns 1.25\n*/\nfunction meanpn( N, x, strideX, offsetX ) {\n\tvar xbuf;\n\tvar get;\n\tvar mu;\n\tvar c;\n\n\txbuf = x.data;\n\tget = x.accessors[ 0 ];\n\n\tif ( N === 1 || strideX === 0 ) {\n\t\treturn get( xbuf, offsetX );\n\t}\n\t// Compute an estimate for the meanpn:\n\tmu = gsumpw( N, xbuf, strideX, offsetX ) / N;\n\n\t// Compute an error term:\n\tc = gapxsumpw( N, -mu, xbuf, strideX, offsetX ) / N;\n\n\treturn mu + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = meanpn;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gsumpw = require( '@stdlib/blas/ext/base/gsumpw' ).ndarray;\nvar gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' ).ndarray;\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// MAIN //\n\n/**\n* Computes the arithmetic mean of a strided array using a two-pass error correction algorithm.\n*\n* ## Method\n*\n* - This implementation uses a two-pass approach, as suggested by Neely (1966).\n*\n* ## References\n*\n* - Neely, Peter M. 1966. \"Comparison of Several Algorithms for Computation of Means, Standard Deviations and Correlation Coefficients.\" _Communications of the ACM_ 9 (7). Association for Computing Machinery: 496–99. doi:[10.1145/365719.365958](https://doi.org/10.1145/365719.365958).\n* - Schubert, Erich, and Michael Gertz. 2018. \"Numerically Stable Parallel Computation of (Co-)Variance.\" In _Proceedings of the 30th International Conference on Scientific and Statistical Database Management_. New York, NY, USA: Association for Computing Machinery. doi:[10.1145/3221269.3223036](https://doi.org/10.1145/3221269.3223036).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {number} arithmetic mean\n*\n* @example\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n*\n* var v = meanpn( 4, x, 2, 1 );\n* // returns 1.25\n*/\nfunction meanpn( N, x, strideX, offsetX ) {\n\tvar mu;\n\tvar c;\n\tvar o;\n\n\tif ( N <= 0 ) {\n\t\treturn NaN;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\treturn accessors( N, o, strideX, offsetX );\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\treturn x[ offsetX ];\n\t}\n\t// Compute an estimate for the meanpn:\n\tmu = gsumpw( N, x, strideX, offsetX ) / N;\n\n\t// Compute an error term:\n\tc = gapxsumpw( N, -mu, x, strideX, offsetX ) / N;\n\n\treturn mu + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = meanpn;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar stride2offset = require( '@stdlib/strided/base/stride2offset' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the arithmetic mean of a strided array using a two-pass error correction algorithm.\n*\n* ## Method\n*\n* - This implementation uses a two-pass approach, as suggested by Neely (1966).\n*\n* ## References\n*\n* - Neely, Peter M. 1966. \"Comparison of Several Algorithms for Computation of Means, Standard Deviations and Correlation Coefficients.\" _Communications of the ACM_ 9 (7). Association for Computing Machinery: 496–99. doi:[10.1145/365719.365958](https://doi.org/10.1145/365719.365958).\n* - Schubert, Erich, and Michael Gertz. 2018. \"Numerically Stable Parallel Computation of (Co-)Variance.\" In _Proceedings of the 30th International Conference on Scientific and Statistical Database Management_. New York, NY, USA: Association for Computing Machinery. doi:[10.1145/3221269.3223036](https://doi.org/10.1145/3221269.3223036).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} strideX - stride length\n* @returns {number} arithmetic mean\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n*\n* var v = meanpn( 3, x, 1 );\n* // returns ~0.3333\n*/\nfunction meanpn( N, x, strideX ) {\n\treturn ndarray( N, x, strideX, stride2offset( N, strideX ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = meanpn;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar meanpn = require( './meanpn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( meanpn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = meanpn;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the arithmetic mean of a strided array using a two-pass error correction algorithm.\n*\n* @module @stdlib/stats/strided/meanpn\n*\n* @example\n* var meanpn = require( '@stdlib/stats/strided/meanpn' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n*\n* var v = meanpn( 3, x, 1 );\n* // returns ~0.3333\n*\n* @example\n* var meanpn = require( '@stdlib/stats/strided/meanpn' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n*\n* var v = meanpn.ndarray( 4, x, 2, 1 );\n* // returns 1.25\n*/\n\n// MODULES //\n\nvar meanpn = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = meanpn;\n\n// exports: { \"ndarray\": \"meanpn.ndarray\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar meanpn = require( './../../../strided/meanpn' );\n\n\n// MAIN //\n\n/**\n* Computes the arithmetic mean of a strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} strideX - stride length\n* @returns {number} arithmetic mean\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n*\n* var v = mean( x.length, x, 1 );\n* // returns ~0.3333\n*/\nfunction mean( N, x, strideX ) {\n\treturn meanpn( N, x, strideX );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar meanpn = require( './../../../strided/meanpn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the arithmetic mean of a strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {number} arithmetic mean\n*\n* @example\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n*\n* var v = mean( 4, x, 2, 1 );\n* // returns 1.25\n*/\nfunction mean( N, x, strideX, offsetX ) {\n\treturn meanpn( N, x, strideX, offsetX );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar mean = require( './mean.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( mean, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = mean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the arithmetic mean of a strided array.\n*\n* @module @stdlib/stats/strided/mean\n*\n* @example\n* var mean = require( '@stdlib/stats/strided/mean' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n*\n* var v = mean( x.length, x, 1 );\n* // returns ~0.3333\n*\n* @example\n* var mean = require( '@stdlib/stats/strided/mean' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n*\n* var v = mean.ndarray( 4, x, 2, 1 );\n* // returns 1.25\n*/\n\n// MODULES //\n\nvar mean = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = mean;\n\n// exports: { \"ndarray\": \"mean.ndarray\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Computes the median value of a sorted strided array.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array<Function>} x.accessors - array element accessors\n* @param {integer} strideX - strideX length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {number} median value\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );\n* var arraylike2object = require( '@stdlib/array/base/arraylike2object' );\n*\n* var x = toAccessorArray( [ 2.0, -3.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n*\n* var v = mediansorted( 4, arraylike2object( x ), 2, 1 );\n* // returns 0.0\n*/\nfunction mediansorted( N, x, strideX, offsetX ) {\n\tvar xbuf;\n\tvar xget;\n\tvar n;\n\tvar m;\n\n\t// Cache references to array data:\n\txbuf = x.data;\n\n\t// Cache references to element accessors:\n\txget = x.accessors[ 0 ];\n\n\tif ( N <= 0 ) {\n\t\treturn NaN;\n\t}\n\tn = N / 2;\n\tm = floor( n );\n\tif ( n === m ) {\n\t\t// Even number of elements...\n\t\treturn ( xget( xbuf, offsetX+(m * strideX) ) + xget( xbuf, offsetX+((m-1) * strideX) ) ) / 2.0;\n\t}\n\t// Odd number of elements...\n\treturn xget( xbuf, offsetX+(m * strideX) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mediansorted;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// MAIN //\n\n/**\n* Computes the median value of a sorted strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - sorted input array\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {number} median value\n*\n* @example\n* var x = [ 2.0, -3.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n*\n* var v = mediansorted( 4, x, 2, 1 );\n* // returns 0.0\n*/\nfunction mediansorted( N, x, strideX, offsetX ) {\n\tvar n;\n\tvar m;\n\tvar o;\n\n\tif ( N <= 0 ) {\n\t\treturn NaN;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\treturn accessors( N, o, strideX, offsetX );\n\t}\n\tn = N / 2;\n\tm = floor( n );\n\tif ( n === m ) {\n\t\t// Even number of elements...\n\t\treturn ( x[ offsetX+(m*strideX) ] + x[ offsetX+((m-1)*strideX) ] ) / 2.0;\n\t}\n\t// Odd number of elements...\n\treturn x[ offsetX+(m*strideX) ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = mediansorted;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar stride2offset = require( '@stdlib/strided/base/stride2offset' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the median value of a sorted strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - sorted input array\n* @param {integer} strideX - strideX length\n* @returns {number} median value\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0 ];\n*\n* var v = mediansorted( x.length, x, 1 );\n* // returns 2.0\n*/\nfunction mediansorted( N, x, strideX ) {\n\treturn ndarray( N, x, strideX, stride2offset( N, strideX ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mediansorted;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar mediansorted = require( './mediansorted.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( mediansorted, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = mediansorted;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the median value of a sorted strided array.\n*\n* @module @stdlib/stats/strided/mediansorted\n*\n* @example\n* var mediansorted = require( '@stdlib/stats/strided/mediansorted' );\n*\n* var x = [ 1.0, 2.0, 3.0 ];\n*\n* var v = mediansorted( x.length, x, 1 );\n* // returns 2.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var mediansorted = require( '@stdlib/stats/strided/mediansorted' );\n*\n* var x = [ 2.0, -3.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = mediansorted.ndarray( N, x, 2, 1 );\n* // returns 0.0\n*/\n\n// MODULES //\n\nvar mediansorted = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = mediansorted;\n\n// exports: { \"ndarray\": \"mediansorted.ndarray\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( './../../../../base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Tests if a finite double-precision floating-point number is a nonnegative integer.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is a nonnegative integer\n*\n* @example\n* var bool = isNonNegativeInteger( 1.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( 0.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( -10.0 );\n* // returns false\n*/\nfunction isNonNegativeInteger( x ) {\n\treturn (floor(x) === x && x >= 0);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a finite double-precision floating-point number is a nonnegative integer.\n*\n* @module @stdlib/math/base/assert/is-nonnegative-integer\n*\n* @example\n* var isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' );\n*\n* var bool = isNonNegativeInteger( 1.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( 0.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( -10.0 );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: implementation (?)\n\n/**\n* Rounds a double-precision floating-point number toward positive infinity.\n*\n* @param {number} x - input value\n* @returns {number} rounded value\n*\n* @example\n* var v = ceil( -4.2 );\n* // returns -4.0\n*\n* @example\n* var v = ceil( 9.99999 );\n* // returns 10.0\n*\n* @example\n* var v = ceil( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = ceil( NaN );\n* // returns NaN\n*/\nvar ceil = Math.ceil; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nmodule.exports = ceil;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Round a double-precision floating-point number toward positive infinity.\n*\n* @module @stdlib/math/base/special/ceil\n*\n* @example\n* var ceil = require( '@stdlib/math/base/special/ceil' );\n*\n* var v = ceil( -4.2 );\n* // returns -4.0\n*\n* v = ceil( 9.99999 );\n* // returns 10.0\n*\n* v = ceil( 0.0 );\n* // returns 0.0\n*\n* v = ceil( NaN );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( './../../../../base/special/floor' );\nvar ceil = require( './../../../../base/special/ceil' );\n\n\n// MAIN //\n\n/**\n* Rounds a double-precision floating-point number toward zero.\n*\n* @param {number} x - input value\n* @returns {number} rounded value\n*\n* @example\n* var v = trunc( -4.2 );\n* // returns -4.0\n*\n* @example\n* var v = trunc( 9.99999 );\n* // returns 9.0\n*\n* @example\n* var v = trunc( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = trunc( -0.0 );\n* // returns -0.0\n*\n* @example\n* var v = trunc( NaN );\n* // returns NaN\n*\n* @example\n* var v = trunc( Infinity );\n* // returns Infinity\n*\n* @example\n* var v = trunc( -Infinity );\n* // returns -Infinity\n*/\nfunction trunc( x ) {\n\tif ( x < 0.0 ) {\n\t\treturn ceil( x );\n\t}\n\treturn floor( x );\n}\n\n\n// EXPORTS //\n\nmodule.exports = trunc;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Round a double-precision floating-point number toward zero.\n*\n* @module @stdlib/math/base/special/trunc\n*\n* @example\n* var trunc = require( '@stdlib/math/base/special/trunc' );\n*\n* var v = trunc( -4.2 );\n* // returns -4.0\n*\n* v = trunc( 9.99999 );\n* // returns 9.0\n*\n* v = trunc( 0.0 );\n* // returns 0.0\n*\n* v = trunc( -0.0 );\n* // returns -0.0\n*\n* v = trunc( NaN );\n* // returns NaN\n*\n* v = trunc( Infinity );\n* // returns Infinity\n*\n* v = trunc( -Infinity );\n* // returns -Infinity\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* The bias of a double-precision floating-point number's exponent.\n*\n* @module @stdlib/constants/float64/exponent-bias\n* @type {integer32}\n*\n* @example\n* var FLOAT64_EXPONENT_BIAS = require( '@stdlib/constants/float64/exponent-bias' );\n* // returns 1023\n*/\n\n\n// MAIN //\n\n/**\n* Bias of a double-precision floating-point number's exponent.\n*\n* ## Notes\n*\n* The bias can be computed via\n*\n* ```tex\n* \\mathrm{bias} = 2^{k-1} - 1\n* ```\n*\n* where \\\\(k\\\\) is the number of bits in the exponent; here, \\\\(k = 11\\\\).\n*\n* @constant\n* @type {integer32}\n* @default 1023\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_EXPONENT_BIAS = 1023|0; // asm type annotation\n\n\n// EXPORTS //\n\nmodule.exports = FLOAT64_EXPONENT_BIAS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* The maximum biased base 2 exponent for a double-precision floating-point number.\n*\n* @module @stdlib/constants/float64/max-base2-exponent\n* @type {integer32}\n*\n* @example\n* var FLOAT64_MAX_BASE2_EXPONENT = require( '@stdlib/constants/float64/max-base2-exponent' );\n* // returns 1023\n*/\n\n\n// MAIN //\n\n/**\n* The maximum biased base 2 exponent for a double-precision floating-point number.\n*\n* ```text\n* 11111111110 => 2046 - BIAS = 1023\n* ```\n*\n* where `BIAS = 1023`.\n*\n* @constant\n* @type {integer32}\n* @default 1023\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_MAX_BASE2_EXPONENT = 1023|0; // asm type annotation\n\n\n// EXPORTS //\n\nmodule.exports = FLOAT64_MAX_BASE2_EXPONENT;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* The maximum biased base 2 exponent for a subnormal double-precision floating-point number.\n*\n* @module @stdlib/constants/float64/max-base2-exponent-subnormal\n* @type {integer32}\n*\n* @example\n* var FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/max-base2-exponent-subnormal' );\n* // returns -1023\n*/\n\n\n// MAIN //\n\n/**\n* The maximum biased base 2 exponent for a subnormal double-precision floating-point number.\n*\n* ```text\n* 00000000000 => 0 - BIAS = -1023\n* ```\n*\n* where `BIAS = 1023`.\n*\n* @constant\n* @type {integer32}\n* @default -1023\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL = -1023|0; // asm type annotation\n\n\n// EXPORTS //\n\nmodule.exports = FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* The minimum biased base 2 exponent for a subnormal double-precision floating-point number.\n*\n* @module @stdlib/constants/float64/min-base2-exponent-subnormal\n* @type {integer32}\n*\n* @example\n* var FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/min-base2-exponent-subnormal' );\n* // returns -1074\n*/\n\n\n// MAIN //\n\n/**\n* The minimum biased base 2 exponent for a subnormal double-precision floating-point number.\n*\n* ```text\n* -(BIAS+(52-1)) = -(1023+51) = -1074\n* ```\n*\n* where `BIAS = 1023` and `52` is the number of digits in the significand.\n*\n* @constant\n* @type {integer32}\n* @default -1074\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL = -1074|0; // asm type annotation\n\n\n// EXPORTS //\n\nmodule.exports = FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar NINF = require( '@stdlib/constants/float64/ninf' );\n\n\n// MAIN //\n\n/**\n* Tests if a double-precision floating-point numeric value is infinite.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is infinite\n*\n* @example\n* var bool = isInfinite( Infinity );\n* // returns true\n*\n* @example\n* var bool = isInfinite( -Infinity );\n* // returns true\n*\n* @example\n* var bool = isInfinite( 5.0 );\n* // returns false\n*\n* @example\n* var bool = isInfinite( NaN );\n* // returns false\n*/\nfunction isInfinite( x ) {\n\treturn (x === PINF || x === NINF);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isInfinite;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a double-precision floating-point numeric value is infinite.\n*\n* @module @stdlib/math/base/assert/is-infinite\n*\n* @example\n* var isInfinite = require( '@stdlib/math/base/assert/is-infinite' );\n*\n* var bool = isInfinite( Infinity );\n* // returns true\n*\n* bool = isInfinite( -Infinity );\n* // returns true\n*\n* bool = isInfinite( 5.0 );\n* // returns false\n*\n* bool = isInfinite( NaN );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* High word mask for the sign bit of a double-precision floating-point number.\n*\n* @module @stdlib/constants/float64/high-word-sign-mask\n* @type {uinteger32}\n*\n* @example\n* var FLOAT64_HIGH_WORD_SIGN_MASK = require( '@stdlib/constants/float64/high-word-sign-mask' );\n* // returns 2147483648\n*/\n\n\n// MAIN //\n\n/**\n* High word mask for the sign bit of a double-precision floating-point number.\n*\n* ## Notes\n*\n* The high word mask for the sign bit of a double-precision floating-point number is an unsigned 32-bit integer with the value \\\\( 2147483648 \\\\), which corresponds to the bit sequence\n*\n* ```binarystring\n* 1 00000000000 00000000000000000000\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 0x80000000\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_HIGH_WORD_SIGN_MASK = 0x80000000>>>0; // eslint-disable-line id-length\n\n\n// EXPORTS //\n\nmodule.exports = FLOAT64_HIGH_WORD_SIGN_MASK;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* High word mask for excluding the sign bit of a double-precision floating-point number.\n*\n* @module @stdlib/constants/float64/high-word-abs-mask\n* @type {uinteger32}\n*\n* @example\n* var FLOAT64_HIGH_WORD_ABS_MASK = require( '@stdlib/constants/float64/high-word-abs-mask' );\n* // returns 2147483647\n*/\n\n\n// MAIN //\n\n/**\n* High word mask for excluding the sign bit of a double-precision floating-point number.\n*\n* ## Notes\n*\n* The high word mask for excluding the sign bit of a double-precision floating-point number is an unsigned 32-bit integer with the value \\\\( 2147483647 \\\\), which corresponds to the bit sequence\n*\n* ```binarystring\n* 0 11111111111 11111111111111111111\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 0x7fffffff\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_HIGH_WORD_ABS_MASK = 0x7fffffff>>>0; // eslint-disable-line id-length\n\n\n// EXPORTS //\n\nmodule.exports = FLOAT64_HIGH_WORD_ABS_MASK;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Uint8Array = require( '@stdlib/array/uint8' );\nvar Uint16Array = require( '@stdlib/array/uint16' );\n\n\n// MAIN //\n\nvar ctors = {\n\t'uint16': Uint16Array,\n\t'uint8': Uint8Array\n};\n\n\n// EXPORTS //\n\nmodule.exports = ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ctors = require( './ctors.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an environment is little endian.\n*\n* @private\n* @returns {boolean} boolean indicating if an environment is little endian\n*\n* @example\n* var bool = isLittleEndian();\n* // returns <boolean>\n*/\nfunction isLittleEndian() {\n\tvar uint16view;\n\tvar uint8view;\n\n\tuint16view = new ctors[ 'uint16' ]( 1 );\n\n\t/*\n\t* Set the uint16 view to a value having distinguishable lower and higher order words.\n\t*\n\t* 4660 => 0x1234 => 0x12 0x34 => '00010010 00110100' => (0x12,0x34) == (18,52)\n\t*/\n\tuint16view[ 0 ] = 0x1234;\n\n\t// Create a uint8 view on top of the uint16 buffer:\n\tuint8view = new ctors[ 'uint8' ]( uint16view.buffer );\n\n\t// If little endian, the least significant byte will be first...\n\treturn ( uint8view[ 0 ] === 0x34 );\n}\n\n\n// MAIN //\n\n/**\n* Boolean indicating if an environment is little endian.\n*\n* @constant\n* @type {boolean}\n*/\nvar bool = isLittleEndian(); // eslint-disable-line vars-on-top\n\n\n// EXPORTS //\n\nmodule.exports = bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Boolean indicating if an environment is little endian.\n*\n* @module @stdlib/assert/is-little-endian\n*\n* @example\n* var IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' );\n*\n* var bool = IS_LITTLE_ENDIAN;\n* // returns <boolean>\n*/\n\n// MODULES //\n\nvar IS_LITTLE_ENDIAN = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = IS_LITTLE_ENDIAN;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isLittleEndian = require( '@stdlib/assert/is-little-endian' );\n\n\n// MAIN //\n\nvar indices;\nvar HIGH;\nvar LOW;\n\nif ( isLittleEndian === true ) {\n\tHIGH = 1; // second index\n\tLOW = 0; // first index\n} else {\n\tHIGH = 0; // first index\n\tLOW = 1; // second index\n}\nindices = {\n\t'HIGH': HIGH,\n\t'LOW': LOW\n};\n\n\n// EXPORTS //\n\nmodule.exports = indices;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar Float64Array = require( '@stdlib/array/float64' );\nvar indices = require( './indices.js' );\n\n\n// VARIABLES //\n\nvar FLOAT64_VIEW = new Float64Array( 1 );\nvar UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );\n\nvar HIGH = indices.HIGH;\nvar LOW = indices.LOW;\n\n\n// MAIN //\n\n/**\n* Splits a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).\n*\n* ## Notes\n*\n* ```text\n* float64 (64 bits)\n* f := fraction (significand/mantissa) (52 bits)\n* e := exponent (11 bits)\n* s := sign bit (1 bit)\n*\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Float64 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Uint32 | Uint32 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* ```\n*\n* If little endian (more significant bits last):\n*\n* ```text\n* <-- lower higher -->\n* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |\n* ```\n*\n* If big endian (more significant bits first):\n*\n* ```text\n* <-- higher lower -->\n* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |\n* ```\n*\n* In which Uint32 can we find the higher order bits? If little endian, the second; if big endian, the first.\n*\n* ## References\n*\n* - [Open Group][1]\n*\n* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm\n*\n* @private\n* @param {number} x - input value\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* var Uint32Array = require( '@stdlib/array/uint32' );\n*\n* var out = new Uint32Array( 2 );\n*\n* var w = toWords( 3.14e201, out, 1, 0 );\n* // returns <Uint32Array>[ 1774486211, 2479577218 ]\n*\n* var bool = ( w === out );\n* // returns true\n*/\nfunction toWords( x, out, stride, offset ) {\n\tFLOAT64_VIEW[ 0 ] = x;\n\tout[ offset ] = UINT32_VIEW[ HIGH ];\n\tout[ offset + stride ] = UINT32_VIEW[ LOW ];\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = toWords;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar fcn = require( './assign.js' );\n\n\n// MAIN //\n\n/**\n* Splits a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).\n*\n* @param {number} x - input value\n* @returns {Array<number>} output array\n*\n* @example\n* var w = toWords( 3.14e201 );\n* // returns [ 1774486211, 2479577218 ]\n*/\nfunction toWords( x ) {\n\treturn fcn( x, [ 0>>>0, 0>>>0 ], 1, 0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = toWords;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Split a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).\n*\n* @module @stdlib/number/float64/base/to-words\n*\n* @example\n* var toWords = require( '@stdlib/number/float64/base/to-words' );\n*\n* var w = toWords( 3.14e201 );\n* // returns [ 1774486211, 2479577218 ]\n*\n* @example\n* var Uint32Array = require( '@stdlib/array/uint32' );\n* var toWords = require( '@stdlib/number/float64/base/to-words' );\n*\n* var out = new Uint32Array( 2 );\n*\n* var w = toWords.assign( 3.14e201, out, 1, 0 );\n* // returns <Uint32Array>[ 1774486211, 2479577218 ]\n*\n* var bool = ( w === out );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isLittleEndian = require( '@stdlib/assert/is-little-endian' );\n\n\n// MAIN //\n\nvar HIGH;\nif ( isLittleEndian === true ) {\n\tHIGH = 1; // second index\n} else {\n\tHIGH = 0; // first index\n}\n\n\n// EXPORTS //\n\nmodule.exports = HIGH;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar Float64Array = require( '@stdlib/array/float64' );\nvar HIGH = require( './high.js' );\n\n\n// VARIABLES //\n\nvar FLOAT64_VIEW = new Float64Array( 1 );\nvar UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );\n\n\n// MAIN //\n\n/**\n* Returns an unsigned 32-bit integer corresponding to the more significant 32 bits of a double-precision floating-point number.\n*\n* ## Notes\n*\n* ```text\n* float64 (64 bits)\n* f := fraction (significand/mantissa) (52 bits)\n* e := exponent (11 bits)\n* s := sign bit (1 bit)\n*\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Float64 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Uint32 | Uint32 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* ```\n*\n* If little endian (more significant bits last):\n*\n* ```text\n* <-- lower higher -->\n* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |\n* ```\n*\n* If big endian (more significant bits first):\n*\n* ```text\n* <-- higher lower -->\n* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |\n* ```\n*\n* In which Uint32 can we find the higher order bits? If little endian, the second; if big endian, the first.\n*\n* ## References\n*\n* - [Open Group][1]\n*\n* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm\n*\n* @param {number} x - input value\n* @returns {uinteger32} higher order word\n*\n* @example\n* var w = getHighWord( 3.14e201 ); // => 01101001110001001000001011000011\n* // returns 1774486211\n*/\nfunction getHighWord( x ) {\n\tFLOAT64_VIEW[ 0 ] = x;\n\treturn UINT32_VIEW[ HIGH ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = getHighWord;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an unsigned 32-bit integer corresponding to the more significant 32 bits of a double-precision floating-point number.\n*\n* @module @stdlib/number/float64/base/get-high-word\n*\n* @example\n* var getHighWord = require( '@stdlib/number/float64/base/get-high-word' );\n*\n* var w = getHighWord( 3.14e201 ); // => 01101001110001001000001011000011\n* // returns 1774486211\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isLittleEndian = require( '@stdlib/assert/is-little-endian' );\n\n\n// MAIN //\n\nvar indices;\nvar HIGH;\nvar LOW;\n\nif ( isLittleEndian === true ) {\n\tHIGH = 1; // second index\n\tLOW = 0; // first index\n} else {\n\tHIGH = 0; // first index\n\tLOW = 1; // second index\n}\nindices = {\n\t'HIGH': HIGH,\n\t'LOW': LOW\n};\n\n\n// EXPORTS //\n\nmodule.exports = indices;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar Float64Array = require( '@stdlib/array/float64' );\nvar indices = require( './indices.js' );\n\n\n// VARIABLES //\n\nvar FLOAT64_VIEW = new Float64Array( 1 );\nvar UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );\n\nvar HIGH = indices.HIGH;\nvar LOW = indices.LOW;\n\n\n// MAIN //\n\n/**\n* Creates a double-precision floating-point number from a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).\n*\n* ## Notes\n*\n* ```text\n* float64 (64 bits)\n* f := fraction (significand/mantissa) (52 bits)\n* e := exponent (11 bits)\n* s := sign bit (1 bit)\n*\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Float64 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Uint32 | Uint32 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* ```\n*\n* If little endian (more significant bits last):\n*\n* ```text\n* <-- lower higher -->\n* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |\n* ```\n*\n* If big endian (more significant bits first):\n*\n* ```text\n* <-- higher lower -->\n* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |\n* ```\n*\n* In which Uint32 should we place the higher order bits? If little endian, the second; if big endian, the first.\n*\n* ## References\n*\n* - [Open Group][1]\n*\n* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm\n*\n* @param {uinteger32} high - higher order word (unsigned 32-bit integer)\n* @param {uinteger32} low - lower order word (unsigned 32-bit integer)\n* @returns {number} floating-point number\n*\n* @example\n* var v = fromWords( 1774486211, 2479577218 );\n* // returns 3.14e201\n*\n* @example\n* var v = fromWords( 3221823995, 1413754136 );\n* // returns -3.141592653589793\n*\n* @example\n* var v = fromWords( 0, 0 );\n* // returns 0.0\n*\n* @example\n* var v = fromWords( 2147483648, 0 );\n* // returns -0.0\n*\n* @example\n* var v = fromWords( 2146959360, 0 );\n* // returns NaN\n*\n* @example\n* var v = fromWords( 2146435072, 0 );\n* // returns Infinity\n*\n* @example\n* var v = fromWords( 4293918720, 0 );\n* // returns -Infinity\n*/\nfunction fromWords( high, low ) {\n\tUINT32_VIEW[ HIGH ] = high;\n\tUINT32_VIEW[ LOW ] = low;\n\treturn FLOAT64_VIEW[ 0 ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = fromWords;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a double-precision floating-point number from a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).\n*\n* @module @stdlib/number/float64/base/from-words\n*\n* @example\n* var fromWords = require( '@stdlib/number/float64/base/from-words' );\n*\n* var v = fromWords( 1774486211, 2479577218 );\n* // returns 3.14e201\n*\n* v = fromWords( 3221823995, 1413754136 );\n* // returns -3.141592653589793\n*\n* v = fromWords( 0, 0 );\n* // returns 0.0\n*\n* v = fromWords( 2147483648, 0 );\n* // returns -0.0\n*\n* v = fromWords( 2146959360, 0 );\n* // returns NaN\n*\n* v = fromWords( 2146435072, 0 );\n* // returns Infinity\n*\n* v = fromWords( 4293918720, 0 );\n* // returns -Infinity\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar SIGN_MASK = require( '@stdlib/constants/float64/high-word-sign-mask' );\nvar ABS_MASK = require( '@stdlib/constants/float64/high-word-abs-mask' );\nvar toWords = require( '@stdlib/number/float64/base/to-words' );\nvar getHighWord = require( '@stdlib/number/float64/base/get-high-word' );\nvar fromWords = require( '@stdlib/number/float64/base/from-words' );\n\n\n// VARIABLES //\n\n// High/low words workspace:\nvar WORDS = [ 0, 0 ];\n\n\n// MAIN //\n\n/**\n* Returns a double-precision floating-point number with the magnitude of `x` and the sign of `y`.\n*\n* @param {number} x - number from which to derive a magnitude\n* @param {number} y - number from which to derive a sign\n* @returns {number} a double-precision floating-point number\n*\n* @example\n* var z = copysign( -3.14, 10.0 );\n* // returns 3.14\n*\n* @example\n* var z = copysign( 3.14, -1.0 );\n* // returns -3.14\n*\n* @example\n* var z = copysign( 1.0, -0.0 );\n* // returns -1.0\n*\n* @example\n* var z = copysign( -3.14, -0.0 );\n* // returns -3.14\n*\n* @example\n* var z = copysign( -0.0, 1.0 );\n* // returns 0.0\n*/\nfunction copysign( x, y ) {\n\tvar hx;\n\tvar hy;\n\n\t// Split `x` into higher and lower order words:\n\ttoWords.assign( x, WORDS, 1, 0 );\n\thx = WORDS[ 0 ];\n\n\t// Turn off the sign bit of `x`:\n\thx &= ABS_MASK;\n\n\t// Extract the higher order word from `y`:\n\thy = getHighWord( y );\n\n\t// Leave only the sign bit of `y` turned on:\n\thy &= SIGN_MASK;\n\n\t// Copy the sign bit of `y` to `x`:\n\thx |= hy;\n\n\t// Return a new value having the same magnitude as `x`, but with the sign of `y`:\n\treturn fromWords( hx, WORDS[ 1 ] );\n}\n\n\n// EXPORTS //\n\nmodule.exports = copysign;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a double-precision floating-point number with the magnitude of `x` and the sign of `y`.\n*\n* @module @stdlib/math/base/special/copysign\n*\n* @example\n* var copysign = require( '@stdlib/math/base/special/copysign' );\n*\n* var z = copysign( -3.14, 10.0 );\n* // returns 3.14\n*\n* z = copysign( 3.14, -1.0 );\n* // returns -3.14\n*\n* z = copysign( 1.0, -0.0 );\n* // returns -1.0\n*\n* z = copysign( -3.14, -0.0 );\n* // returns -3.14\n*\n* z = copysign( -0.0, 1.0 );\n* // returns 0.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Smallest positive double-precision floating-point normal number.\n*\n* @module @stdlib/constants/float64/smallest-normal\n* @type {number}\n*\n* @example\n* var FLOAT64_SMALLEST_NORMAL = require( '@stdlib/constants/float64/smallest-normal' );\n* // returns 2.2250738585072014e-308\n*/\n\n\n// MAIN //\n\n/**\n* The smallest positive double-precision floating-point normal number.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* \\frac{1}{2^{1023-1}}\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 0 00000000001 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default 2.2250738585072014e-308\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_SMALLEST_NORMAL = 2.2250738585072014e-308;\n\n\n// EXPORTS //\n\nmodule.exports = FLOAT64_SMALLEST_NORMAL;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the absolute value of a double-precision floating-point number `x`.\n*\n* @param {number} x - input value\n* @returns {number} absolute value\n*\n* @example\n* var v = abs( -1.0 );\n* // returns 1.0\n*\n* @example\n* var v = abs( 2.0 );\n* // returns 2.0\n*\n* @example\n* var v = abs( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = abs( -0.0 );\n* // returns 0.0\n*\n* @example\n* var v = abs( NaN );\n* // returns NaN\n*/\nfunction abs( x ) {\n\treturn Math.abs( x ); // eslint-disable-line stdlib/no-builtin-math\n}\n\n\n// EXPORTS //\n\nmodule.exports = abs;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute an absolute value of a double-precision floating-point number.\n*\n* @module @stdlib/math/base/special/abs\n*\n* @example\n* var abs = require( '@stdlib/math/base/special/abs' );\n*\n* var v = abs( -1.0 );\n* // returns 1.0\n*\n* v = abs( 2.0 );\n* // returns 2.0\n*\n* v = abs( 0.0 );\n* // returns 0.0\n*\n* v = abs( -0.0 );\n* // returns 0.0\n*\n* v = abs( NaN );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar FLOAT64_SMALLEST_NORMAL = require( '@stdlib/constants/float64/smallest-normal' );\nvar isInfinite = require( '@stdlib/math/base/assert/is-infinite' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// VARIABLES //\n\n// (1<<52)\nvar SCALAR = 4503599627370496;\n\n\n// MAIN //\n\n/**\n* Returns a normal number `y` and exponent `exp` satisfying \\\\(x = y \\cdot 2^\\mathrm{exp}\\\\) and assigns results to a provided output array.\n*\n* @param {number} x - input value\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* var pow = require( '@stdlib/math/base/special/pow' );\n*\n* var out = normalize( 3.14e-319, [ 0.0, 0 ], 1, 0 );\n* // returns [ 1.4141234400356668e-303, -52 ]\n*\n* var y = out[ 0 ];\n* var exp = out[ 1 ];\n*\n* var bool = ( y*pow(2.0,exp) === 3.14e-319 );\n* // returns true\n*\n* @example\n* var out = normalize( 0.0, [ 0.0, 0 ], 1, 0 );\n* // returns [ 0.0, 0 ];\n*\n* @example\n* var PINF = require( '@stdlib/constants/float64/pinf' );\n*\n* var out = normalize( PINF, [ 0.0, 0 ], 1, 0 );\n* // returns [ Infinity, 0 ]\n*\n* @example\n* var NINF = require( '@stdlib/constants/float64/ninf' );\n*\n* var out = normalize( NINF, [ 0.0, 0 ], 1, 0 );\n* // returns [ -Infinity, 0 ]\n*\n* @example\n* var out = normalize( NaN, [ 0.0, 0 ], 1, 0 );\n* // returns [ NaN, 0 ]\n*/\nfunction normalize( x, out, stride, offset ) {\n\tif ( isnan( x ) || isInfinite( x ) ) {\n\t\tout[ offset ] = x;\n\t\tout[ offset + stride ] = 0;\n\t\treturn out;\n\t}\n\tif ( x !== 0.0 && abs( x ) < FLOAT64_SMALLEST_NORMAL ) {\n\t\tout[ offset ] = x * SCALAR;\n\t\tout[ offset + stride ] = -52;\n\t\treturn out;\n\t}\n\tout[ offset ] = x;\n\tout[ offset + stride ] = 0;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = normalize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar fcn = require( './assign.js' );\n\n\n// MAIN //\n\n/**\n* Returns a normal number `y` and exponent `exp` satisfying \\\\(x = y \\cdot 2^\\mathrm{exp}\\\\).\n*\n* @param {number} x - input value\n* @returns {NumberArray} output array\n*\n* @example\n* var pow = require( '@stdlib/math/base/special/pow' );\n*\n* var out = normalize( 3.14e-319 );\n* // returns [ 1.4141234400356668e-303, -52 ]\n*\n* var y = out[ 0 ];\n* var exp = out[ 1 ];\n*\n* var bool = ( y*pow(2.0,exp) === 3.14e-319 );\n* // returns true\n*\n* @example\n* var out = normalize( 0.0 );\n* // returns [ 0.0, 0 ]\n*\n* @example\n* var PINF = require( '@stdlib/constants/float64/pinf' );\n*\n* var out = normalize( PINF );\n* // returns [ Infinity, 0 ]\n*\n* @example\n* var NINF = require( '@stdlib/constants/float64/ninf' );\n*\n* var out = normalize( NINF );\n* // returns [ -Infinity, 0 ]\n*\n* @example\n* var out = normalize( NaN );\n* // returns [ NaN, 0 ]\n*/\nfunction normalize( x ) {\n\treturn fcn( x, [ 0.0, 0 ], 1, 0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = normalize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a normal number `y` and exponent `exp` satisfying \\\\(x = y \\cdot 2^\\mathrm{exp}\\\\).\n*\n* @module @stdlib/number/float64/base/normalize\n*\n* @example\n* var pow = require( '@stdlib/math/base/special/pow' );\n* var normalize = require( '@stdlib/number/float64/base/normalize' );\n*\n* var out = normalize( 3.14e-319 );\n* // returns [ 1.4141234400356668e-303, -52 ]\n*\n* var y = out[ 0 ];\n* var exp = out[ 1 ];\n*\n* var bool = ( y*pow(2.0, exp) === 3.14e-319 );\n* // returns true\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var normalize = require( '@stdlib/number/float64/base/normalize' );\n*\n* var out = new Float64Array( 2 );\n*\n* var v = normalize.assign( 3.14e-319, out, 1, 0 );\n* // returns <Float64Array>[ 1.4141234400356668e-303, -52 ]\n*\n* var bool = ( v === out );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* High word mask for the exponent of a double-precision floating-point number.\n*\n* @module @stdlib/constants/float64/high-word-exponent-mask\n* @type {uinteger32}\n*\n* @example\n* var FLOAT64_HIGH_WORD_EXPONENT_MASK = require( '@stdlib/constants/float64/high-word-exponent-mask' );\n* // returns 2146435072\n*/\n\n\n// MAIN //\n\n/**\n* High word mask for the exponent of a double-precision floating-point number.\n*\n* ## Notes\n*\n* The high word mask for the exponent of a double-precision floating-point number is an unsigned 32-bit integer with the value \\\\( 2146435072 \\\\), which corresponds to the bit sequence\n*\n* ```binarystring\n* 0 11111111111 00000000000000000000\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 0x7ff00000\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_HIGH_WORD_EXPONENT_MASK = 0x7ff00000;\n\n\n// EXPORTS //\n\nmodule.exports = FLOAT64_HIGH_WORD_EXPONENT_MASK;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getHighWord = require( './../../../../float64/base/get-high-word' );\nvar EXP_MASK = require( '@stdlib/constants/float64/high-word-exponent-mask' );\nvar BIAS = require( '@stdlib/constants/float64/exponent-bias' );\n\n\n// MAIN //\n\n/**\n* Returns an integer corresponding to the unbiased exponent of a double-precision floating-point number.\n*\n* @param {number} x - input value\n* @returns {integer32} unbiased exponent\n*\n* @example\n* var exp = exponent( 3.14e-307 ); // => 2**-1019 ~ 1e-307\n* // returns -1019\n*\n* @example\n* var exp = exponent( -3.14 );\n* // returns 1\n*\n* @example\n* var exp = exponent( 0.0 );\n* // returns -1023\n*\n* @example\n* var exp = exponent( NaN );\n* // returns 1024\n*/\nfunction exponent( x ) {\n\t// Extract from the input value a higher order word (unsigned 32-bit integer) which contains the exponent:\n\tvar high = getHighWord( x );\n\n\t// Apply a mask to isolate only the exponent bits and then shift off all bits which are part of the fraction:\n\thigh = ( high & EXP_MASK ) >>> 20;\n\n\t// Remove the bias and return:\n\treturn (high - BIAS)|0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nmodule.exports = exponent;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an integer corresponding to the unbiased exponent of a double-precision floating-point number.\n*\n* @module @stdlib/number/float64/base/exponent\n*\n* @example\n* var exponent = require( '@stdlib/number/float64/base/exponent' );\n*\n* var exp = exponent( 3.14e-307 ); // => 2**-1019 ~ 1e-307\n* // returns -1019\n*\n* exp = exponent( -3.14 );\n* // returns 1\n*\n* exp = exponent( 0.0 );\n* // returns -1023\n*\n* exp = exponent( NaN );\n* // returns 1024\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// NOTES //\n\n/*\n* => ldexp: load exponent (see [The Open Group]{@link http://pubs.opengroup.org/onlinepubs/9699919799/functions/ldexp.html} and [cppreference]{@link http://en.cppreference.com/w/c/numeric/math/ldexp}).\n*/\n\n\n// MODULES //\n\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar NINF = require( '@stdlib/constants/float64/ninf' );\nvar BIAS = require( '@stdlib/constants/float64/exponent-bias' );\nvar MAX_EXPONENT = require( '@stdlib/constants/float64/max-base2-exponent' );\nvar MAX_SUBNORMAL_EXPONENT = require( '@stdlib/constants/float64/max-base2-exponent-subnormal' );\nvar MIN_SUBNORMAL_EXPONENT = require( '@stdlib/constants/float64/min-base2-exponent-subnormal' );\nvar isnan = require( './../../../../base/assert/is-nan' );\nvar isInfinite = require( './../../../../base/assert/is-infinite' );\nvar copysign = require( './../../../../base/special/copysign' );\nvar normalize = require( '@stdlib/number/float64/base/normalize' ).assign;\nvar floatExp = require( '@stdlib/number/float64/base/exponent' );\nvar toWords = require( '@stdlib/number/float64/base/to-words' );\nvar fromWords = require( '@stdlib/number/float64/base/from-words' );\n\n\n// VARIABLES //\n\n// 1/(1<<52) = 1/(2**52) = 1/4503599627370496\nvar TWO52_INV = 2.220446049250313e-16;\n\n// Exponent all 0s: 1 00000000000 11111111111111111111 => 2148532223\nvar CLEAR_EXP_MASK = 0x800fffff>>>0; // asm type annotation\n\n// Normalization workspace:\nvar FRAC = [ 0.0, 0.0 ];\n\n// High/low words workspace:\nvar WORDS = [ 0, 0 ];\n\n\n// MAIN //\n\n/**\n* Multiplies a double-precision floating-point number by an integer power of two.\n*\n* @param {number} frac - fraction\n* @param {integer} exp - exponent\n* @returns {number} double-precision floating-point number\n*\n* @example\n* var x = ldexp( 0.5, 3 ); // => 0.5 * 2^3 = 0.5 * 8\n* // returns 4.0\n*\n* @example\n* var x = ldexp( 4.0, -2 ); // => 4 * 2^(-2) = 4 * (1/4)\n* // returns 1.0\n*\n* @example\n* var x = ldexp( 0.0, 20 );\n* // returns 0.0\n*\n* @example\n* var x = ldexp( -0.0, 39 );\n* // returns -0.0\n*\n* @example\n* var x = ldexp( NaN, -101 );\n* // returns NaN\n*\n* @example\n* var x = ldexp( Infinity, 11 );\n* // returns Infinity\n*\n* @example\n* var x = ldexp( -Infinity, -118 );\n* // returns -Infinity\n*/\nfunction ldexp( frac, exp ) {\n\tvar high;\n\tvar m;\n\tif (\n\t\texp === 0 ||\n\t\tfrac === 0.0 || // handles +-0\n\t\tisnan( frac ) ||\n\t\tisInfinite( frac )\n\t) {\n\t\treturn frac;\n\t}\n\t// Normalize the input fraction:\n\tnormalize( frac, FRAC, 1, 0 );\n\tfrac = FRAC[ 0 ];\n\texp += FRAC[ 1 ];\n\n\t// Extract the exponent from `frac` and add it to `exp`:\n\texp += floatExp( frac );\n\n\t// Check for underflow/overflow...\n\tif ( exp < MIN_SUBNORMAL_EXPONENT ) {\n\t\treturn copysign( 0.0, frac );\n\t}\n\tif ( exp > MAX_EXPONENT ) {\n\t\tif ( frac < 0.0 ) {\n\t\t\treturn NINF;\n\t\t}\n\t\treturn PINF;\n\t}\n\t// Check for a subnormal and scale accordingly to retain precision...\n\tif ( exp <= MAX_SUBNORMAL_EXPONENT ) {\n\t\texp += 52;\n\t\tm = TWO52_INV;\n\t} else {\n\t\tm = 1.0;\n\t}\n\t// Split the fraction into higher and lower order words:\n\ttoWords.assign( frac, WORDS, 1, 0 );\n\thigh = WORDS[ 0 ];\n\n\t// Clear the exponent bits within the higher order word:\n\thigh &= CLEAR_EXP_MASK;\n\n\t// Set the exponent bits to the new exponent:\n\thigh |= ((exp+BIAS) << 20);\n\n\t// Create a new floating-point number:\n\treturn m * fromWords( high, WORDS[ 1 ] );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ldexp;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Multiply a double-precision floating-point number by an integer power of two.\n*\n* @module @stdlib/math/base/special/ldexp\n*\n* @example\n* var ldexp = require( '@stdlib/math/base/special/ldexp' );\n*\n* var x = ldexp( 0.5, 3 ); // => 0.5 * 2^3 = 0.5 * 8\n* // returns 4.0\n*\n* x = ldexp( 4.0, -2 ); // => 4 * 2^(-2) = 4 * (1/4)\n* // returns 1.0\n*\n* x = ldexp( 0.0, 20 );\n* // returns 0.0\n*\n* x = ldexp( -0.0, 39 );\n* // returns -0.0\n*\n* x = ldexp( NaN, -101 );\n* // returns NaN\n*\n* x = ldexp( Infinity, 11 );\n* // returns Infinity\n*\n* x = ldexp( -Infinity, -118 );\n* // returns -Infinity\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.16666666666666602;\n\t}\n\treturn 0.16666666666666602 + (x * (-0.0027777777777015593 + (x * (0.00006613756321437934 + (x * (-0.0000016533902205465252 + (x * 4.1381367970572385e-8))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyrights, licenses, and long comment were part of the original implementation available as part of [Go]{@link https://github.com/golang/go/blob/cb07765045aed5104a3df31507564ac99e6ddce8/src/math/exp.go}, which in turn was based on an implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/e_exp.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (c) 2009 The Go Authors. All rights reserved.\n*\n* Redistribution and use in source and binary forms, with or without\n* modification, are permitted provided that the following conditions are\n* met:\n*\n* * Redistributions of source code must retain the above copyright\n* notice, this list of conditions and the following disclaimer.\n* * Redistributions in binary form must reproduce the above\n* copyright notice, this list of conditions and the following disclaimer\n* in the documentation and/or other materials provided with the\n* distribution.\n* * Neither the name of Google Inc. nor the names of its\n* contributors may be used to endorse or promote products derived from\n* this software without specific prior written permission.\n*\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n* \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n* ```\n*\n* ```text\n* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ldexp = require( './../../../../base/special/ldexp' );\nvar polyvalP = require( './polyval_p.js' );\n\n\n// MAIN //\n\n/**\n* Computes \\\\(e^{r} 2^k\\\\) where \\\\(r = \\mathrm{hi} - \\mathrm{lo}\\\\) and \\\\(|r| \\leq \\ln(2)/2\\\\).\n*\n* @private\n* @param {number} hi - upper bound\n* @param {number} lo - lower bound\n* @param {integer} k - power of 2\n* @returns {number} function value\n*/\nfunction expmulti( hi, lo, k ) {\n\tvar r;\n\tvar t;\n\tvar c;\n\tvar y;\n\n\tr = hi - lo;\n\tt = r * r;\n\tc = r - ( t*polyvalP( t ) );\n\ty = 1.0 - ( lo - ( (r*c)/(2.0-c) ) - hi );\n\n\treturn ldexp( y, k );\n}\n\n\n// EXPORTS //\n\nmodule.exports = expmulti;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyrights, licenses, and long comment were part of the original implementation available as part of [Go]{@link https://github.com/golang/go/blob/cb07765045aed5104a3df31507564ac99e6ddce8/src/math/exp.go}, which in turn was based on an implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/e_exp.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (c) 2009 The Go Authors. All rights reserved.\n*\n* Redistribution and use in source and binary forms, with or without\n* modification, are permitted provided that the following conditions are\n* met:\n*\n* * Redistributions of source code must retain the above copyright\n* notice, this list of conditions and the following disclaimer.\n* * Redistributions in binary form must reproduce the above\n* copyright notice, this list of conditions and the following disclaimer\n* in the documentation and/or other materials provided with the\n* distribution.\n* * Neither the name of Google Inc. nor the names of its\n* contributors may be used to endorse or promote products derived from\n* this software without specific prior written permission.\n*\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n* \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n* ```\n*\n* ```text\n* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( './../../../../base/assert/is-nan' );\nvar trunc = require( './../../../../base/special/trunc' );\nvar NINF = require( '@stdlib/constants/float64/ninf' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar expmulti = require( './expmulti.js' );\n\n\n// VARIABLES //\n\nvar LN2_HI = 6.93147180369123816490e-01;\nvar LN2_LO = 1.90821492927058770002e-10;\nvar LOG2_E = 1.44269504088896338700e+00;\nvar OVERFLOW = 7.09782712893383973096e+02;\nvar UNDERFLOW = -7.45133219101941108420e+02;\nvar NEARZERO = 1.0 / (1 << 28); // 2^-28\nvar NEG_NEARZERO = -NEARZERO;\n\n\n// MAIN //\n\n/**\n* Evaluates the natural exponential function.\n*\n* ## Method\n*\n* 1. We reduce \\\\( x \\\\) to an \\\\( r \\\\) so that \\\\( |r| \\leq 0.5 \\cdot \\ln(2) \\approx 0.34658 \\\\). Given \\\\( x \\\\), we find an \\\\( r \\\\) and integer \\\\( k \\\\) such that\n*\n* ```tex\n* \\begin{align*}\n* x &= k \\cdot \\ln(2) + r \\\\\n* |r| &\\leq 0.5 \\cdot \\ln(2)\n* \\end{align*}\n* ```\n*\n* <!-- <note> -->\n*\n* \\\\( r \\\\) can be represented as \\\\( r = \\mathrm{hi} - \\mathrm{lo} \\\\) for better accuracy.\n*\n* <!-- </note> -->\n*\n* 2. We approximate of \\\\( e^{r} \\\\) by a special rational function on the interval \\\\(\\[0,0.34658]\\\\):\n*\n* ```tex\n* \\begin{align*}\n* R\\left(r^2\\right) &= r \\cdot \\frac{ e^{r}+1 }{ e^{r}-1 } \\\\\n* &= 2 + \\frac{r^2}{6} - \\frac{r^4}{360} + \\ldots\n* \\end{align*}\n* ```\n*\n* We use a special Remes algorithm on \\\\(\\[0,0.34658]\\\\) to generate a polynomial of degree \\\\(5\\\\) to approximate \\\\(R\\\\). The maximum error of this polynomial approximation is bounded by \\\\(2^{-59}\\\\). In other words,\n*\n* ```tex\n* R(z) \\sim 2 + P_1 z + P_2 z^2 + P_3 z^3 + P_4 z^4 + P_5 z^5\n* ```\n*\n* where \\\\( z = r^2 \\\\) and\n*\n* ```tex\n* \\left| 2 + P_1 z + \\ldots + P_5 z^5 - R(z) \\right| \\leq 2^{-59}\n* ```\n*\n* <!-- <note> -->\n*\n* The values of \\\\( P_1 \\\\) to \\\\( P_5 \\\\) are listed in the source code.\n*\n* <!-- </note> -->\n*\n* The computation of \\\\( e^{r} \\\\) thus becomes\n*\n* ```tex\n* \\begin{align*}\n* e^{r} &= 1 + \\frac{2r}{R-r} \\\\\n* &= 1 + r + \\frac{r \\cdot R_1(r)}{2 - R_1(r)}\\ \\text{for better accuracy}\n* \\end{align*}\n* ```\n*\n* where\n*\n* ```tex\n* R_1(r) = r - P_1\\ r^2 + P_2\\ r^4 + \\ldots + P_5\\ r^{10}\n* ```\n*\n* 3. We scale back to obtain \\\\( e^{x} \\\\). From step 1, we have\n*\n* ```tex\n* e^{x} = 2^k e^{r}\n* ```\n*\n* ## Special Cases\n*\n* ```tex\n* \\begin{align*}\n* e^\\infty &= \\infty \\\\\n* e^{-\\infty} &= 0 \\\\\n* e^{\\mathrm{NaN}} &= \\mathrm{NaN} \\\\\n* e^0 &= 1\\ \\mathrm{is\\ exact\\ for\\ finite\\ argument\\ only}\n* \\end{align*}\n* ```\n*\n* ## Notes\n*\n* - According to an error analysis, the error is always less than \\\\(1\\\\) ulp (unit in the last place).\n*\n* - For an IEEE double,\n*\n* - if \\\\(x > 7.09782712893383973096\\mbox{e+}02\\\\), then \\\\(e^{x}\\\\) overflows\n* - if \\\\(x < -7.45133219101941108420\\mbox{e+}02\\\\), then \\\\(e^{x}\\\\) underflows\n*\n* - The hexadecimal values included in the source code are the intended ones for the used constants. Decimal values may be used, provided that the compiler will convert from decimal to binary accurately enough to produce the intended hexadecimal values.\n*\n* @param {number} x - input value\n* @returns {number} function value\n*\n* @example\n* var v = exp( 4.0 );\n* // returns ~54.5982\n*\n* @example\n* var v = exp( -9.0 );\n* // returns ~1.234e-4\n*\n* @example\n* var v = exp( 0.0 );\n* // returns 1.0\n*\n* @example\n* var v = exp( NaN );\n* // returns NaN\n*/\nfunction exp( x ) {\n\tvar hi;\n\tvar lo;\n\tvar k;\n\n\tif ( isnan( x ) || x === PINF ) {\n\t\treturn x;\n\t}\n\tif ( x === NINF ) {\n\t\treturn 0.0;\n\t}\n\tif ( x > OVERFLOW ) {\n\t\treturn PINF;\n\t}\n\tif ( x < UNDERFLOW ) {\n\t\treturn 0.0;\n\t}\n\tif (\n\t\tx > NEG_NEARZERO &&\n\t\tx < NEARZERO\n\t) {\n\t\treturn 1.0 + x;\n\t}\n\t// Reduce and compute `r = hi - lo` for extra precision...\n\tif ( x < 0.0 ) {\n\t\tk = trunc( (LOG2_E*x) - 0.5 );\n\t} else {\n\t\tk = trunc( (LOG2_E*x) + 0.5 );\n\t}\n\thi = x - (k*LN2_HI);\n\tlo = k * LN2_LO;\n\n\treturn expmulti( hi, lo, k );\n}\n\n\n// EXPORTS //\n\nmodule.exports = exp;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Evaluate the natural exponential function.\n*\n* @module @stdlib/math/base/special/exp\n*\n* @example\n* var exp = require( '@stdlib/math/base/special/exp' );\n*\n* var v = exp( 4.0 );\n* // returns ~54.5982\n*\n* v = exp( -9.0 );\n* // returns ~1.234e-4\n*\n* v = exp( 0.0 );\n* // returns 1.0\n*\n* v = exp( NaN );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( './../../../../base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Tests if a finite double-precision floating-point number is a negative integer.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is a negative integer\n*\n* @example\n* var bool = isNegativeInteger( -1.0 );\n* // returns true\n*\n* @example\n* var bool = isNegativeInteger( 0.0 );\n* // returns false\n*\n* @example\n* var bool = isNegativeInteger( 10.0 );\n* // returns false\n*/\nfunction isNegativeInteger( x ) {\n\treturn (floor(x) === x && x < 0.0);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a finite double-precision floating-point number is a negative integer.\n*\n* @module @stdlib/math/base/assert/is-negative-integer\n*\n* @example\n* var isNegativeInteger = require( '@stdlib/math/base/assert/is-negative-integer' );\n*\n* var bool = isNegativeInteger( -1.0 );\n* // returns true\n*\n* bool = isNegativeInteger( 0.0 );\n* // returns false\n*\n* bool = isNegativeInteger( 10.0 );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isLittleEndian = require( '@stdlib/assert/is-little-endian' );\n\n\n// MAIN //\n\nvar HIGH;\nif ( isLittleEndian === true ) {\n\tHIGH = 1; // second index\n} else {\n\tHIGH = 0; // first index\n}\n\n\n// EXPORTS //\n\nmodule.exports = HIGH;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar Float64Array = require( '@stdlib/array/float64' );\nvar HIGH = require( './high.js' );\n\n\n// VARIABLES //\n\nvar FLOAT64_VIEW = new Float64Array( 1 );\nvar UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );\n\n\n// MAIN //\n\n/**\n* Sets the more significant 32 bits of a double-precision floating-point number.\n*\n* ## Notes\n*\n* ```text\n* float64 (64 bits)\n* f := fraction (significand/mantissa) (52 bits)\n* e := exponent (11 bits)\n* s := sign bit (1 bit)\n*\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Float64 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Uint32 | Uint32 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* ```\n*\n* If little endian (more significant bits last):\n*\n* ```text\n* <-- lower higher -->\n* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |\n* ```\n*\n* If big endian (more significant bits first):\n*\n* ```text\n* <-- higher lower -->\n* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |\n* ```\n*\n* In which Uint32 can we find the higher order bits? If little endian, the second; if big endian, the first.\n*\n* ## References\n*\n* - [Open Group][1]\n*\n* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm\n*\n* @param {number} x - double\n* @param {uinteger32} high - unsigned 32-bit integer to replace the higher order word of `x`\n* @returns {number} double having the same lower order word as `x`\n*\n* @example\n* var high = 5 >>> 0; // => 0 00000000000 00000000000000000101\n*\n* var y = setHighWord( 3.14e201, high ); // => 0 00000000000 0000000000000000010110010011110010110101100010000010\n* // returns 1.18350528745e-313\n*\n* @example\n* var PINF = require( '@stdlib/constants/float64/pinf' ); // => 0 11111111111 00000000000000000000 00000000000000000000000000000000\n*\n* var high = 1072693248 >>> 0; // => 0 01111111111 00000000000000000000\n*\n* // Set the higher order bits of `+infinity` to return `1`:\n* var y = setHighWord( PINF, high ); // => 0 01111111111 0000000000000000000000000000000000000000000000000000\n* // returns 1.0\n*/\nfunction setHighWord( x, high ) {\n\tFLOAT64_VIEW[ 0 ] = x;\n\tUINT32_VIEW[ HIGH ] = ( high >>> 0 ); // identity bit shift to ensure integer\n\treturn FLOAT64_VIEW[ 0 ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = setHighWord;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Set the more significant 32 bits of a double-precision floating-point number.\n*\n* @module @stdlib/number/float64/base/set-high-word\n*\n* @example\n* var setHighWord = require( '@stdlib/number/float64/base/set-high-word' );\n*\n* var high = 5 >>> 0; // => 0 00000000000 00000000000000000101\n*\n* var y = setHighWord( 3.14e201, high ); // => 0 00000000000 0000000000000000010110010011110010110101100010000010\n* // returns 1.18350528745e-313\n*\n* @example\n* var PINF = require( '@stdlib/constants/float64/pinf' ); // => 0 11111111111 00000000000000000000 00000000000000000000000000000000\n* var setHighWord = require( '@stdlib/number/float64/base/set-high-word' );\n*\n* var high = 1072693248 >>> 0; // => 0 01111111111 00000000000000000000\n*\n* // Set the higher order bits of `+infinity` to return `1`:\n* var y = setHighWord( PINF, high ); // => 0 01111111111 0000000000000000000000000000000000000000000000000000\n* // returns 1.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.3999999999940942;\n\t}\n\treturn 0.3999999999940942 + (x * (0.22222198432149784 + (x * 0.15313837699209373))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.6666666666666735;\n\t}\n\treturn 0.6666666666666735 + (x * (0.2857142874366239 + (x * (0.1818357216161805 + (x * 0.14798198605116586))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/e_log.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getHighWord = require( '@stdlib/number/float64/base/get-high-word' );\nvar setHighWord = require( '@stdlib/number/float64/base/set-high-word' );\nvar isnan = require( './../../../../base/assert/is-nan' );\nvar BIAS = require( '@stdlib/constants/float64/exponent-bias' );\nvar NINF = require( '@stdlib/constants/float64/ninf' );\nvar polyvalP = require( './polyval_p.js' );\nvar polyvalQ = require( './polyval_q.js' );\n\n\n// VARIABLES //\n\nvar LN2_HI = 6.93147180369123816490e-01; // 3FE62E42 FEE00000\nvar LN2_LO = 1.90821492927058770002e-10; // 3DEA39EF 35793C76\nvar TWO54 = 1.80143985094819840000e+16; // 0x43500000, 0x00000000\nvar ONE_THIRD = 0.33333333333333333;\n\n// 0x000fffff = 1048575 => 0 00000000000 11111111111111111111\nvar HIGH_SIGNIFICAND_MASK = 0x000fffff|0; // asm type annotation\n\n// 0x7ff00000 = 2146435072 => 0 11111111111 00000000000000000000 => biased exponent: 2047 = 1023+1023 => 2^1023\nvar HIGH_MAX_NORMAL_EXP = 0x7ff00000|0; // asm type annotation\n\n// 0x00100000 = 1048576 => 0 00000000001 00000000000000000000 => biased exponent: 1 = -1022+1023 => 2^-1022\nvar HIGH_MIN_NORMAL_EXP = 0x00100000|0; // asm type annotation\n\n// 0x3ff00000 = 1072693248 => 0 01111111111 00000000000000000000 => biased exponent: 1023 = 0+1023 => 2^0 = 1\nvar HIGH_BIASED_EXP_0 = 0x3ff00000|0; // asm type annotation\n\n\n// MAIN //\n\n/**\n* Evaluates the natural logarithm of a double-precision floating-point number.\n*\n* @param {NonNegativeNumber} x - input value\n* @returns {number} function value\n*\n* @example\n* var v = ln( 4.0 );\n* // returns ~1.386\n*\n* @example\n* var v = ln( 0.0 );\n* // returns -Infinity\n*\n* @example\n* var v = ln( Infinity );\n* // returns Infinity\n*\n* @example\n* var v = ln( NaN );\n* // returns NaN\n*\n* @example\n* var v = ln( -4.0 );\n* // returns NaN\n*/\nfunction ln( x ) {\n\tvar hfsq;\n\tvar hx;\n\tvar t2;\n\tvar t1;\n\tvar k;\n\tvar R;\n\tvar f;\n\tvar i;\n\tvar j;\n\tvar s;\n\tvar w;\n\tvar z;\n\n\tif ( x === 0.0 ) {\n\t\treturn NINF;\n\t}\n\tif ( isnan( x ) || x < 0.0 ) {\n\t\treturn NaN;\n\t}\n\thx = getHighWord( x );\n\tk = 0|0; // asm type annotation\n\tif ( hx < HIGH_MIN_NORMAL_EXP ) {\n\t\t// Case: 0 < x < 2**-1022\n\t\tk -= 54|0; // asm type annotation\n\n\t\t// Subnormal number, scale up `x`:\n\t\tx *= TWO54;\n\t\thx = getHighWord( x );\n\t}\n\tif ( hx >= HIGH_MAX_NORMAL_EXP ) {\n\t\treturn x + x;\n\t}\n\tk += ( ( hx>>20 ) - BIAS )|0; // asm type annotation\n\thx &= HIGH_SIGNIFICAND_MASK;\n\ti = ( (hx+0x95f64) & 0x100000 )|0; // asm type annotation\n\n\t// Normalize `x` or `x/2`...\n\tx = setHighWord( x, hx|(i^HIGH_BIASED_EXP_0) );\n\tk += ( i>>20 )|0; // asm type annotation\n\tf = x - 1.0;\n\tif ( (HIGH_SIGNIFICAND_MASK&(2+hx)) < 3 ) {\n\t\t// Case: -2**-20 <= f < 2**-20\n\t\tif ( f === 0.0 ) {\n\t\t\tif ( k === 0 ) {\n\t\t\t\treturn 0.0;\n\t\t\t}\n\t\t\treturn (k * LN2_HI) + (k * LN2_LO);\n\t\t}\n\t\tR = f * f * ( 0.5 - (ONE_THIRD*f) );\n\t\tif ( k === 0 ) {\n\t\t\treturn f - R;\n\t\t}\n\t\treturn (k * LN2_HI) - ( (R-(k*LN2_LO)) - f );\n\t}\n\ts = f / (2.0 + f);\n\tz = s * s;\n\ti = ( hx - 0x6147a )|0; // asm type annotation\n\tw = z * z;\n\tj = ( 0x6b851 - hx )|0; // asm type annotation\n\tt1 = w * polyvalP( w );\n\tt2 = z * polyvalQ( w );\n\ti |= j;\n\tR = t2 + t1;\n\tif ( i > 0 ) {\n\t\thfsq = 0.5 * f * f;\n\t\tif ( k === 0 ) {\n\t\t\treturn f - ( hfsq - (s * (hfsq+R)) );\n\t\t}\n\t\treturn (k * LN2_HI) - ( hfsq - ((s*(hfsq+R))+(k*LN2_LO)) - f );\n\t}\n\tif ( k === 0 ) {\n\t\treturn f - (s*(f-R));\n\t}\n\treturn (k * LN2_HI) - ( ( (s*(f-R)) - (k*LN2_LO) ) - f );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ln;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Evaluate the natural logarithm of a double-precision floating-point number.\n*\n* @module @stdlib/math/base/special/ln\n*\n* @example\n* var ln = require( '@stdlib/math/base/special/ln' );\n*\n* var v = ln( 4.0 );\n* // returns ~1.386\n*\n* v = ln( 0.0 );\n* // returns -Infinity\n*\n* v = ln( Infinity );\n* // returns Infinity\n*\n* v = ln( NaN );\n* // returns NaN\n*\n* v = ln( -4.0 );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.0416666666666666;\n\t}\n\treturn 0.0416666666666666 + (x * (-0.001388888888887411 + (x * 0.00002480158728947673))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn -2.7557314351390663e-7;\n\t}\n\treturn -2.7557314351390663e-7 + (x * (2.087572321298175e-9 + (x * -1.1359647557788195e-11))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright, license, and long comment were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/12.2.0/lib/msun/src/k_cos.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nvar polyval13 = require( './polyval_c13.js' );\nvar polyval46 = require( './polyval_c46.js' );\n\n\n// MAIN //\n\n/**\n* Computes the cosine on \\\\( \\[-\\pi/4, \\pi/4] \\\\), where \\\\( \\pi/4 \\approx 0.785398164 \\\\).\n*\n* ## Method\n*\n* - Since \\\\( \\cos(-x) = \\cos(x) \\\\), we need only to consider positive \\\\(x\\\\).\n*\n* - If \\\\( x < 2^{-27} \\\\), return \\\\(1\\\\) which is inexact if \\\\( x \\ne 0 \\\\).\n*\n* - \\\\( cos(x) \\\\) is approximated by a polynomial of degree \\\\(14\\\\) on \\\\( \\[0,\\pi/4] \\\\).\n*\n* ```tex\n* \\cos(x) \\approx 1 - \\frac{x \\cdot x}{2} + C_1 \\cdot x^4 + \\ldots + C_6 \\cdot x^{14}\n* ```\n*\n* where the Remez error is\n*\n* ```tex\n* \\left| \\cos(x) - \\left( 1 - \\frac{x^2}{2} + C_1x^4 + C_2x^6 + C_3x^8 + C_4x^{10} + C_5x^{12} + C_6x^{15} \\right) \\right| \\le 2^{-58}\n* ```\n*\n* - Let \\\\( C_1x^4 + C_2x^6 + C_3x^8 + C_4x^{10} + C_5x^{12} + C_6x^{14} \\\\), then\n*\n* ```tex\n* \\cos(x) \\approx 1 - \\frac{x \\cdot x}{2} + r\n* ```\n*\n* Since\n*\n* ```tex\n* \\cos(x+y) \\approx \\cos(x) - \\sin(x) \\cdot y \\approx \\cos(x) - x \\cdot y\n* ```\n*\n* a correction term is necessary in \\\\( \\cos(x) \\\\). Hence,\n*\n* ```tex\n* \\cos(x+y) = 1 - \\left( \\frac{x \\cdot x}{2} - (r - x \\cdot y) \\right)\n* ```\n*\n* For better accuracy, rearrange to\n*\n* ```tex\n* \\cos(x+y) \\approx w + \\left( t + ( r - x \\cdot y ) \\right)\n* ```\n*\n* where \\\\( w = 1 - \\frac{x \\cdot x}{2} \\\\) and \\\\( t \\\\) is a tiny correction term (\\\\( 1 - \\frac{x \\cdot x}{2} = w + t \\\\) exactly in infinite precision). The exactness of \\\\(w + t\\\\) in infinite precision depends on \\\\(w\\\\) and \\\\(t\\\\) having the same precision as \\\\(x\\\\).\n*\n* @param {number} x - input value (in radians, assumed to be bounded by ~pi/4 in magnitude)\n* @param {number} y - tail of `x`\n* @returns {number} cosine\n*\n* @example\n* var v = kernelCos( 0.0, 0.0 );\n* // returns ~1.0\n*\n* @example\n* var v = kernelCos( 3.141592653589793/6.0, 0.0 );\n* // returns ~0.866\n*\n* @example\n* var v = kernelCos( 0.785, -1.144e-17 );\n* // returns ~0.707\n*\n* @example\n* var v = kernelCos( NaN, 0.0 );\n* // returns NaN\n*/\nfunction kernelCos( x, y ) {\n\tvar hz;\n\tvar r;\n\tvar w;\n\tvar z;\n\n\tz = x * x;\n\tw = z * z;\n\tr = z * polyval13( z );\n\tr += w * w * polyval46( z );\n\thz = 0.5 * z;\n\tw = 1.0 - hz;\n\treturn w + ( ((1.0-w) - hz) + ((z*r) - (x*y)) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = kernelCos;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cosine of a number on `[-π/4, π/4]`.\n*\n* @module @stdlib/math/base/special/kernel-cos\n*\n* @example\n* var kernelCos = require( '@stdlib/math/base/special/kernel-cos' );\n*\n* var v = kernelCos( 0.0, 0.0 );\n* // returns ~1.0\n*\n* v = kernelCos( 3.141592653589793/6.0, 0.0 );\n* // returns ~0.866\n*\n* v = kernelCos( 0.785, -1.144e-17 );\n* // returns ~0.707\n*\n* v = kernelCos( NaN, 0.0 );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright, license, and long comment were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/k_sin.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar S1 = -1.66666666666666324348e-01; // 0xBFC55555, 0x55555549\nvar S2 = 8.33333333332248946124e-03; // 0x3F811111, 0x1110F8A6\nvar S3 = -1.98412698298579493134e-04; // 0xBF2A01A0, 0x19C161D5\nvar S4 = 2.75573137070700676789e-06; // 0x3EC71DE3, 0x57B1FE7D\nvar S5 = -2.50507602534068634195e-08; // 0xBE5AE5E6, 0x8A2B9CEB\nvar S6 = 1.58969099521155010221e-10; // 0x3DE5D93A, 0x5ACFD57C\n\n\n// MAIN //\n\n/**\n* Computes the sine on \\\\( \\approx \\[-\\pi/4, \\pi/4] \\\\) (except on \\\\(-0\\\\)), where \\\\( \\pi/4 \\approx 0.7854 \\\\).\n*\n* ## Method\n*\n* - Since \\\\( \\sin(-x) = -\\sin(x) \\\\), we need only to consider positive \\\\(x\\\\).\n*\n* - Callers must return \\\\( \\sin(-0) = -0 \\\\) without calling here since our odd polynomial is not evaluated in a way that preserves \\\\(-0\\\\). Callers may do the optimization \\\\( \\sin(x) \\approx x \\\\) for tiny \\\\(x\\\\).\n*\n* - \\\\( \\sin(x) \\\\) is approximated by a polynomial of degree \\\\(13\\\\) on \\\\( \\left\\[0,\\tfrac{pi}{4}\\right] \\\\)\n*\n* ```tex\n* \\sin(x) \\approx x + S_1 \\cdot x^3 + \\ldots + S_6 \\cdot x^{13}\n* ```\n*\n* where\n*\n* ```tex\n* \\left| \\frac{\\sin(x)}{x} \\left( 1 + S_1 \\cdot x + S_2 \\cdot x + S_3 \\cdot x + S_4 \\cdot x + S_5 \\cdot x + S_6 \\cdot x \\right) \\right| \\le 2^{-58}\n* ```\n*\n* - We have\n*\n* ```tex\n* \\sin(x+y) = \\sin(x) + \\sin'(x') \\cdot y \\approx \\sin(x) + (1-x*x/2) \\cdot y\n* ```\n*\n* For better accuracy, let\n*\n* ```tex\n* r = x^3 * \\left( S_2 + x^2 \\cdot \\left( S_3 + x^2 * \\left( S_4 + x^2 \\cdot ( S_5+x^2 \\cdot S_6 ) \\right) \\right) \\right)\n* ```\n*\n* then\n*\n* ```tex\n* \\sin(x) = x + \\left( S_1 \\cdot x + ( x \\cdot (r-y/2) + y ) \\right)\n* ```\n*\n* @param {number} x - input value (in radians, assumed to be bounded by `~pi/4` in magnitude)\n* @param {number} y - tail of `x`\n* @returns {number} sine\n*\n* @example\n* var v = kernelSin( 0.0, 0.0 );\n* // returns ~0.0\n*\n* @example\n* var v = kernelSin( 3.141592653589793/6.0, 0.0 );\n* // returns ~0.5\n*\n* @example\n* var v = kernelSin( 0.619, 9.279e-18 );\n* // returns ~0.58\n*\n* @example\n* var v = kernelSin( NaN, 0.0 );\n* // returns NaN\n*\n* @example\n* var v = kernelSin( 3.0, NaN );\n* // returns NaN\n*\n* @example\n* var v = kernelSin( NaN, NaN );\n* // returns NaN\n*/\nfunction kernelSin( x, y ) {\n\tvar r;\n\tvar v;\n\tvar w;\n\tvar z;\n\n\tz = x * x;\n\tw = z * z;\n\tr = S2 + (z * (S3 + (z*S4))) + (z * w * (S5 + (z*S6)));\n\tv = z * x;\n\tif ( y === 0.0 ) {\n\t\treturn x + (v * (S1 + (z*r)));\n\t}\n\treturn x - (((z*((0.5*y) - (v*r))) - y) - (v*S1));\n}\n\n\n// EXPORTS //\n\nmodule.exports = kernelSin;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sine of a number on `[-π/4, π/4]`.\n*\n* @module @stdlib/math/base/special/kernel-sin\n*\n* @example\n* var kernelSin = require( '@stdlib/math/base/special/kernel-sin' );\n*\n* var v = kernelSin( 0.0, 0.0 );\n* // returns ~0.0\n*\n* v = kernelSin( 3.141592653589793/6.0, 0.0 );\n* // returns ~0.5\n*\n* v = kernelSin( 0.619, 9.279e-18 );\n* // returns ~0.58\n*\n* v = kernelSin( NaN, 0.0 );\n* // returns NaN\n*\n* v = kernelSin( 3.0, NaN );\n* // returns NaN\n*\n* v = kernelSin( NaN, NaN );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* High word mask for the significand of a double-precision floating-point number.\n*\n* @module @stdlib/constants/float64/high-word-significand-mask\n* @type {uinteger32}\n*\n* @example\n* var FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = require( '@stdlib/constants/float64/high-word-significand-mask' );\n* // returns 1048575\n*/\n\n\n// MAIN //\n\n/**\n* High word mask for the significand of a double-precision floating-point number.\n*\n* ## Notes\n*\n* The high word mask for the significand of a double-precision floating-point number is an unsigned 32-bit integer with the value \\\\( 1048575 \\\\), which corresponds to the bit sequence\n*\n* ```binarystring\n* 0 00000000000 11111111111111111111\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 0x000fffff\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = 0x000fffff;\n\n\n// EXPORTS //\n\nmodule.exports = FLOAT64_HIGH_WORD_SIGNIFICAND_MASK;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isLittleEndian = require( '@stdlib/assert/is-little-endian' );\n\n\n// MAIN //\n\nvar LOW;\nif ( isLittleEndian === true ) {\n\tLOW = 0; // first index\n} else {\n\tLOW = 1; // second index\n}\n\n\n// EXPORTS //\n\nmodule.exports = LOW;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar Float64Array = require( '@stdlib/array/float64' );\nvar LOW = require( './low.js' );\n\n\n// VARIABLES //\n\nvar FLOAT64_VIEW = new Float64Array( 1 );\nvar UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );\n\n\n// MAIN //\n\n/**\n* Returns a 32-bit unsigned integer corresponding to the less significant 32 bits of a double-precision floating-point number.\n*\n* ## Notes\n*\n* ```text\n* float64 (64 bits)\n* f := fraction (significand/mantissa) (52 bits)\n* e := exponent (11 bits)\n* s := sign bit (1 bit)\n*\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Float64 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Uint32 | Uint32 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* ```\n*\n* If little endian (more significant bits last):\n*\n* ```text\n* <-- lower higher -->\n* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |\n* ```\n*\n* If big endian (more significant bits first):\n*\n* ```text\n* <-- higher lower -->\n* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |\n* ```\n*\n* In which Uint32 can we find the lower order bits? If little endian, the first; if big endian, the second.\n*\n* ## References\n*\n* - [Open Group][1]\n*\n* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm\n*\n* @param {number} x - input value\n* @returns {uinteger32} lower order word\n*\n* @example\n* var w = getLowWord( 3.14e201 ); // => 10010011110010110101100010000010\n* // returns 2479577218\n*/\nfunction getLowWord( x ) {\n\tFLOAT64_VIEW[ 0 ] = x;\n\treturn UINT32_VIEW[ LOW ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = getLowWord;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return an unsigned 32-bit integer corresponding to the less significant 32 bits of a double-precision floating-point number.\n*\n* @module @stdlib/number/float64/base/get-low-word\n*\n* @example\n* var getLowWord = require( '@stdlib/number/float64/base/get-low-word' );\n*\n* var w = getLowWord( 3.14e201 ); // => 10010011110010110101100010000010\n* // returns 2479577218\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/k_rem_pio2.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n/* eslint-disable array-element-newline */\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( './../../../../base/special/floor' );\nvar ldexp = require( './../../../../base/special/ldexp' );\nvar zeros = require( '@stdlib/array/base/zeros' );\n\n\n// VARIABLES //\n\n/*\n* Table of constants for `2/π` (`396` hex digits, `476` decimal).\n*\n* Integer array which contains the (`24*i`)-th to (`24*i+23`)-th bit of `2/π` after binary point. The corresponding floating value is\n*\n* ```tex\n* \\operatorname{ipio2}[i] \\cdot 2^{-24(i+1)}\n* ```\n*\n* This table must have at least `(e0-3)/24 + jk` terms. For quad precision (`e0 <= 16360`, `jk = 6`), this is `686`.\n*/\nvar IPIO2 = [\n\t0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62,\n\t0x95993C, 0x439041, 0xFE5163, 0xABDEBB, 0xC561B7, 0x246E3A,\n\t0x424DD2, 0xE00649, 0x2EEA09, 0xD1921C, 0xFE1DEB, 0x1CB129,\n\t0xA73EE8, 0x8235F5, 0x2EBB44, 0x84E99C, 0x7026B4, 0x5F7E41,\n\t0x3991D6, 0x398353, 0x39F49C, 0x845F8B, 0xBDF928, 0x3B1FF8,\n\t0x97FFDE, 0x05980F, 0xEF2F11, 0x8B5A0A, 0x6D1F6D, 0x367ECF,\n\t0x27CB09, 0xB74F46, 0x3F669E, 0x5FEA2D, 0x7527BA, 0xC7EBE5,\n\t0xF17B3D, 0x0739F7, 0x8A5292, 0xEA6BFB, 0x5FB11F, 0x8D5D08,\n\t0x560330, 0x46FC7B, 0x6BABF0, 0xCFBC20, 0x9AF436, 0x1DA9E3,\n\t0x91615E, 0xE61B08, 0x659985, 0x5F14A0, 0x68408D, 0xFFD880,\n\t0x4D7327, 0x310606, 0x1556CA, 0x73A8C9, 0x60E27B, 0xC08C6B\n];\n\n// Double precision array, obtained by cutting `π/2` into `24` bits chunks...\nvar PIO2 = [\n\t1.57079625129699707031e+00, // 0x3FF921FB, 0x40000000\n\t7.54978941586159635335e-08, // 0x3E74442D, 0x00000000\n\t5.39030252995776476554e-15, // 0x3CF84698, 0x80000000\n\t3.28200341580791294123e-22, // 0x3B78CC51, 0x60000000\n\t1.27065575308067607349e-29, // 0x39F01B83, 0x80000000\n\t1.22933308981111328932e-36, // 0x387A2520, 0x40000000\n\t2.73370053816464559624e-44, // 0x36E38222, 0x80000000\n\t2.16741683877804819444e-51 // 0x3569F31D, 0x00000000\n];\nvar TWO24 = 1.67772160000000000000e+07; // 0x41700000, 0x00000000\nvar TWON24 = 5.96046447753906250000e-08; // 0x3E700000, 0x00000000\n\n// Arrays for storing temporary values (note that, in C, this is not thread safe):\nvar F = zeros( 20 );\nvar Q = zeros( 20 );\nvar FQ = zeros( 20 );\nvar IQ = zeros( 20 );\n\n\n// FUNCTIONS //\n\n/**\n* Performs the computation for `kernelRempio2()`.\n*\n* @private\n* @param {PositiveNumber} x - input value\n* @param {(Array|TypedArray|Object)} y - output object for storing double precision numbers\n* @param {integer} jz - number of terms of `ipio2[]` used\n* @param {Array<integer>} q - array with integral values, representing the 24-bits chunk of the product of `x` and `2/π`\n* @param {integer} q0 - the corresponding exponent of `q[0]` (the exponent for `q[i]` would be `q0-24*i`)\n* @param {integer} jk - `jk+1` is the initial number of terms of `IPIO2[]` needed in the computation\n* @param {integer} jv - index for pointing to the suitable `ipio2[]` for the computation\n* @param {integer} jx - `nx - 1`\n* @param {Array<number>} f - `IPIO2[]` in floating point\n* @returns {number} last three binary digits of `N`\n*/\nfunction compute( x, y, jz, q, q0, jk, jv, jx, f ) {\n\tvar carry;\n\tvar fw;\n\tvar ih;\n\tvar jp;\n\tvar i;\n\tvar k;\n\tvar n;\n\tvar j;\n\tvar z;\n\n\t// `jp+1` is the number of terms in `PIO2[]` needed:\n\tjp = jk;\n\n\t// Distill `q[]` into `IQ[]` in reverse order...\n\tz = q[ jz ];\n\tj = jz;\n\tfor ( i = 0; j > 0; i++ ) {\n\t\tfw = ( TWON24 * z )|0;\n\t\tIQ[ i ] = ( z - (TWO24*fw) )|0;\n\t\tz = q[ j-1 ] + fw;\n\t\tj -= 1;\n\t}\n\t// Compute `n`...\n\tz = ldexp( z, q0 );\n\tz -= 8.0 * floor( z*0.125 ); // Trim off integer >= 8\n\tn = z|0;\n\tz -= n;\n\tih = 0;\n\tif ( q0 > 0 ) {\n\t\t// Need `IQ[jz-1]` to determine `n`...\n\t\ti = ( IQ[ jz-1 ] >> (24-q0) );\n\t\tn += i;\n\t\tIQ[ jz-1 ] -= ( i << (24-q0) );\n\t\tih = ( IQ[ jz-1 ] >> (23-q0) );\n\t}\n\telse if ( q0 === 0 ) {\n\t\tih = ( IQ[ jz-1 ] >> 23 );\n\t}\n\telse if ( z >= 0.5 ) {\n\t\tih = 2;\n\t}\n\t// Case: q > 0.5\n\tif ( ih > 0 ) {\n\t\tn += 1;\n\t\tcarry = 0;\n\n\t\t// Compute `1-q`:\n\t\tfor ( i = 0; i < jz; i++ ) {\n\t\t\tj = IQ[ i ];\n\t\t\tif ( carry === 0 ) {\n\t\t\t\tif ( j !== 0 ) {\n\t\t\t\t\tcarry = 1;\n\t\t\t\t\tIQ[ i ] = 0x1000000 - j;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tIQ[ i ] = 0xffffff - j;\n\t\t\t}\n\t\t}\n\t\tif ( q0 > 0 ) {\n\t\t\t// Rare case: chance is 1 in 12...\n\t\t\tswitch ( q0 ) { // eslint-disable-line default-case\n\t\t\tcase 1:\n\t\t\t\tIQ[ jz-1 ] &= 0x7fffff;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tIQ[ jz-1 ] &= 0x3fffff;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ( ih === 2 ) {\n\t\t\tz = 1.0 - z;\n\t\t\tif ( carry !== 0 ) {\n\t\t\t\tz -= ldexp( 1.0, q0 );\n\t\t\t}\n\t\t}\n\t}\n\t// Check if re-computation is needed...\n\tif ( z === 0.0 ) {\n\t\tj = 0;\n\t\tfor ( i = jz-1; i >= jk; i-- ) {\n\t\t\tj |= IQ[ i ];\n\t\t}\n\t\tif ( j === 0 ) {\n\t\t\t// Need re-computation...\n\t\t\tfor ( k = 1; IQ[ jk-k ] === 0; k++ ) {\n\t\t\t\t// `k` is the number of terms needed...\n\t\t\t}\n\t\t\tfor ( i = jz+1; i <= jz+k; i++ ) {\n\t\t\t\t// Add `q[jz+1]` to `q[jz+k]`...\n\t\t\t\tf[ jx+i ] = IPIO2[ jv+i ];\n\t\t\t\tfw = 0.0;\n\t\t\t\tfor ( j = 0; j <= jx; j++ ) {\n\t\t\t\t\tfw += x[ j ] * f[ jx + (i-j) ];\n\t\t\t\t}\n\t\t\t\tq[ i ] = fw;\n\t\t\t}\n\t\t\tjz += k;\n\t\t\treturn compute( x, y, jz, q, q0, jk, jv, jx, f );\n\t\t}\n\t\t// Chop off zero terms...\n\t\tjz -= 1;\n\t\tq0 -= 24;\n\t\twhile ( IQ[ jz ] === 0 ) {\n\t\t\tjz -= 1;\n\t\t\tq0 -= 24;\n\t\t}\n\t} else {\n\t\t// Break `z` into 24-bit if necessary...\n\t\tz = ldexp( z, -q0 );\n\t\tif ( z >= TWO24 ) {\n\t\t\tfw = (TWON24*z)|0;\n\t\t\tIQ[ jz ] = ( z - (TWO24*fw) )|0;\n\t\t\tjz += 1;\n\t\t\tq0 += 24;\n\t\t\tIQ[ jz ] = fw;\n\t\t} else {\n\t\t\tIQ[ jz ] = z|0;\n\t\t}\n\t}\n\t// Convert integer \"bit\" chunk to floating-point value...\n\tfw = ldexp( 1.0, q0 );\n\tfor ( i = jz; i >= 0; i-- ) {\n\t\tq[ i ] = fw * IQ[i];\n\t\tfw *= TWON24;\n\t}\n\t// Compute `PIO2[0,...,jp]*q[jz,...,0]`...\n\tfor ( i = jz; i >= 0; i-- ) {\n\t\tfw = 0.0;\n\t\tfor ( k = 0; k <= jp && k <= jz-i; k++ ) {\n\t\t\tfw += PIO2[ k ] * q[ i+k ];\n\t\t}\n\t\tFQ[ jz-i ] = fw;\n\t}\n\t// Compress `FQ[]` into `y[]`...\n\tfw = 0.0;\n\tfor ( i = jz; i >= 0; i-- ) {\n\t\tfw += FQ[ i ];\n\t}\n\tif ( ih === 0 ) {\n\t\ty[ 0 ] = fw;\n\t} else {\n\t\ty[ 0 ] = -fw;\n\t}\n\tfw = FQ[ 0 ] - fw;\n\tfor ( i = 1; i <= jz; i++ ) {\n\t\tfw += FQ[i];\n\t}\n\tif ( ih === 0 ) {\n\t\ty[ 1 ] = fw;\n\t} else {\n\t\ty[ 1 ] = -fw;\n\t}\n\treturn ( n & 7 );\n}\n\n\n// MAIN //\n\n/**\n* Returns the last three binary digits of `N` with `y = x - Nπ/2` so that `|y| < π/2`.\n*\n* ## Method\n*\n* - The method is to compute the integer (mod 8) and fraction parts of (2/π) * x without doing the full multiplication. In general, we skip the part of the product that are known to be a huge integer (more accurately, = 0 mod 8 ). Thus the number of operations are independent of the exponent of the input.\n*\n* - (2/π) is represented by an array of 24-bit integers in `ipio2[]`.\n*\n* - Input parameters:\n*\n* - `x[]` The input value (must be positive) is broken into `nx` pieces of 24-bit integers in double precision format. `x[i]` will be the i-th 24 bit of x. The scaled exponent of `x[0]` is given in input parameter `e0` (i.e., `x[0]*2^e0` match x's up to 24 bits).\n*\n* Example of breaking a double positive `z` into `x[0]+x[1]+x[2]`:\n*\n* ```tex\n* e0 = \\mathrm{ilogb}(z) - 23\n* z = \\mathrm{scalbn}(z, -e0)\n* ```\n*\n* for `i = 0,1,2`\n*\n* ```tex\n* x[i] = \\lfloor z \\rfloor\n* z = (z - x[i]) \\times 2^{24}\n* ```\n*\n* - `y[]` output result in an array of double precision numbers.\n*\n* The dimension of `y[]` is:\n* 24-bit precision 1\n* 53-bit precision 2\n* 64-bit precision 2\n* 113-bit precision 3\n*\n* The actual value is the sum of them. Thus, for 113-bit precision, one may have to do something like:\n*\n* ```tex\n* \\mathrm{long\\ double} \\: t, w, r_{\\text{head}}, r_{\\text{tail}}; \\\\\n* t &= (\\mathrm{long\\ double}) y[2] + (\\mathrm{long\\ double}) y[1]; \\\\\n* w &= (\\mathrm{long\\ double}) y[0]; \\\\\n* r_{\\text{head}} &= t + w; \\\\\n* r_{\\text{tail}} &= w - (r_{\\text{head}} - t);\n* ```\n*\n* - `e0` The exponent of `x[0]`. Must be <= 16360 or you need to expand the `ipio2` table.\n*\n* - `nx` dimension of `x[]`\n*\n* - `prec` an integer indicating the precision:\n* 0 24 bits (single)\n* 1 53 bits (double)\n* 2 64 bits (extended)\n* 3 113 bits (quad)\n*\n* - External function:\n*\n* - double `scalbn()`, `floor()`;\n*\n* - Here is the description of some local variables:\n*\n* - `jk` `jk+1` is the initial number of terms of `ipio2[]` needed in the computation. The minimum and recommended value for `jk` is 3,4,4,6 for single, double, extended, and quad. `jk+1` must be 2 larger than you might expect so that our recomputation test works. (Up to 24 bits in the integer part (the 24 bits of it that we compute) and 23 bits in the fraction part may be lost to cancellation before we recompute.)\n*\n* - `jz` local integer variable indicating the number of terms of `ipio2[]` used.\n*\n* - `jx` `nx - 1`\n*\n* - `jv` index for pointing to the suitable `ipio2[]` for the computation. In general, we want\n*\n* ```tex\n* \\frac{{2^{e0} \\cdot x[0] \\cdot \\mathrm{ipio2}[jv-1] \\cdot 2^{-24jv}}}{{8}}\n* ```\n*\n* to be an integer. Thus\n*\n* ```tex\n* e0 - 3 - 24 \\cdot jv \\geq 0 \\quad \\text{or} \\quad \\frac{{e0 - 3}}{{24}} \\geq jv\n* ```\n*\n* Hence\n*\n* ```tex\n* jv = \\max(0, \\frac{{e0 - 3}}{{24}})\n* ```\n*\n* - `jp` `jp+1` is the number of terms in `PIo2[]` needed, `jp = jk`.\n*\n* - `q[]` double array with integral value, representing the 24-bits chunk of the product of `x` and `2/π`.\n*\n* - `q0` the corresponding exponent of `q[0]`. Note that the exponent for `q[i]` would be `q0-24*i`.\n*\n* - `PIo2[]` double precision array, obtained by cutting `π/2` into 24 bits chunks.\n*\n* - `f[]` `ipso2[]` in floating point\n*\n* - `iq[]` integer array by breaking up `q[]` in 24-bits chunk.\n*\n* - `fq[]` final product of `x*(2/π)` in `fq[0],..,fq[jk]`\n*\n* - `ih` integer. If >0 it indicates `q[]` is >= 0.5, hence it also indicates the _sign_ of the result.\n*\n* - Constants:\n*\n* - The hexadecimal values are the intended ones for the following constants. The decimal values may be used, provided that the compiler will convert from decimal to binary accurately enough to produce the hexadecimal values shown.\n*\n* @private\n* @param {PositiveNumber} x - input value\n* @param {(Array|TypedArray|Object)} y - remainder elements\n* @param {PositiveInteger} e0 - the exponent of `x[0]` (must be <= 16360)\n* @param {PositiveInteger} nx - dimension of `x[]`\n* @returns {number} last three binary digits of `N`\n*/\nfunction kernelRempio2( x, y, e0, nx ) {\n\tvar fw;\n\tvar jk;\n\tvar jv;\n\tvar jx;\n\tvar jz;\n\tvar q0;\n\tvar i;\n\tvar j;\n\tvar m;\n\n\t// Initialize `jk` for double-precision floating-point numbers:\n\tjk = 4;\n\n\t// Determine `jx`, `jv`, `q0` (note that `q0 < 3`):\n\tjx = nx - 1;\n\tjv = ( (e0 - 3) / 24 )|0;\n\tif ( jv < 0 ) {\n\t\tjv = 0;\n\t}\n\tq0 = e0 - (24 * (jv + 1));\n\n\t// Set up `F[0]` to `F[jx+jk]` where `F[jx+jk] = IPIO2[jv+jk]`:\n\tj = jv - jx;\n\tm = jx + jk;\n\tfor ( i = 0; i <= m; i++ ) {\n\t\tif ( j < 0 ) {\n\t\t\tF[ i ] = 0.0;\n\t\t} else {\n\t\t\tF[ i ] = IPIO2[ j ];\n\t\t}\n\t\tj += 1;\n\t}\n\t// Compute `Q[0],Q[1],...,Q[jk]`:\n\tfor ( i = 0; i <= jk; i++ ) {\n\t\tfw = 0.0;\n\t\tfor ( j = 0; j <= jx; j++ ) {\n\t\t\tfw += x[ j ] * F[ jx + (i-j) ];\n\t\t}\n\t\tQ[ i ] = fw;\n\t}\n\tjz = jk;\n\treturn compute( x, y, jz, Q, q0, jk, jv, jx, F );\n}\n\n\n// EXPORTS //\n\nmodule.exports = kernelRempio2;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Rounds a numeric value to the nearest integer.\n*\n* @param {number} x - input value\n* @returns {number} function value\n*\n* @example\n* var v = round( -4.2 );\n* // returns -4.0\n*\n* @example\n* var v = round( -4.5 );\n* // returns -4.0\n*\n* @example\n* var v = round( -4.6 );\n* // returns -5.0\n*\n* @example\n* var v = round( 9.99999 );\n* // returns 10.0\n*\n* @example\n* var v = round( 9.5 );\n* // returns 10.0\n*\n* @example\n* var v = round( 9.2 );\n* // returns 9.0\n*\n* @example\n* var v = round( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = round( -0.0 );\n* // returns -0.0\n*\n* @example\n* var v = round( Infinity );\n* // returns Infinity\n*\n* @example\n* var v = round( -Infinity );\n* // returns -Infinity\n*\n* @example\n* var v = round( NaN );\n* // returns NaN\n*/\nvar round = Math.round; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nmodule.exports = round;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: implementation\n\n/**\n* Round a numeric value to the nearest integer.\n*\n* @module @stdlib/math/base/special/round\n*\n* @example\n* var round = require( '@stdlib/math/base/special/round' );\n*\n* var v = round( -4.2 );\n* // returns -4.0\n*\n* v = round( -4.5 );\n* // returns -4.0\n*\n* v = round( -4.6 );\n* // returns -5.0\n*\n* v = round( 9.99999 );\n* // returns 10.0\n*\n* v = round( 9.5 );\n* // returns 10.0\n*\n* v = round( 9.2 );\n* // returns 9.0\n*\n* v = round( 0.0 );\n* // returns 0.0\n*\n* v = round( -0.0 );\n* // returns -0.0\n*\n* v = round( Infinity );\n* // returns Infinity\n*\n* v = round( -Infinity );\n* // returns -Infinity\n*\n* v = round( NaN );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/k_rem_pio2.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nvar round = require( './../../../../base/special/round' );\nvar getHighWord = require( '@stdlib/number/float64/base/get-high-word' );\n\n\n// VARIABLES //\n\n// 53 bits of 2/π:\nvar INVPIO2 = 6.36619772367581382433e-01; // 0x3FE45F30, 0x6DC9C883\n\n// First 33 bits of π/2:\nvar PIO2_1 = 1.57079632673412561417e+00; // 0x3FF921FB, 0x54400000\n\n// PIO2_1T = π/2 - PIO2_1:\nvar PIO2_1T = 6.07710050650619224932e-11; // 0x3DD0B461, 0x1A626331\n\n// Another 33 bits of π/2:\nvar PIO2_2 = 6.07710050630396597660e-11; // 0x3DD0B461, 0x1A600000\n\n// PIO2_2T = π/2 - ( PIO2_1 + PIO2_2 ):\nvar PIO2_2T = 2.02226624879595063154e-21; // 0x3BA3198A, 0x2E037073\n\n// Another 33 bits of π/2:\nvar PIO2_3 = 2.02226624871116645580e-21; // 0x3BA3198A, 0x2E000000\n\n// PIO2_3T = π/2 - ( PIO2_1 + PIO2_2 + PIO2_3 ):\nvar PIO2_3T = 8.47842766036889956997e-32; // 0x397B839A, 0x252049C1\n\n// Exponent mask (2047 => 0x7ff):\nvar EXPONENT_MASK = 0x7ff|0; // asm type annotation\n\n\n// MAIN //\n\n/**\n* Computes `x - nπ/2 = r` for medium-sized inputs.\n*\n* @private\n* @param {number} x - input value\n* @param {uint32} ix - high word of `x`\n* @param {(Array|TypedArray|Object)} y - remainder elements\n* @returns {integer} factor of `π/2`\n*/\nfunction rempio2Medium( x, ix, y ) {\n\tvar high;\n\tvar n;\n\tvar t;\n\tvar r;\n\tvar w;\n\tvar i;\n\tvar j;\n\n\tn = round( x * INVPIO2 );\n\tr = x - ( n * PIO2_1 );\n\tw = n * PIO2_1T;\n\n\t// First rounding (good to 85 bits)...\n\tj = (ix >> 20)|0; // asm type annotation\n\ty[ 0 ] = r - w;\n\thigh = getHighWord( y[0] );\n\ti = j - ( (high >> 20) & EXPONENT_MASK );\n\n\t// Check if a second iteration is needed (good to 118 bits)...\n\tif ( i > 16 ) {\n\t\tt = r;\n\t\tw = n * PIO2_2;\n\t\tr = t - w;\n\t\tw = (n * PIO2_2T) - ((t-r) - w);\n\t\ty[ 0 ] = r - w;\n\t\thigh = getHighWord( y[0] );\n\t\ti = j - ( (high >> 20) & EXPONENT_MASK );\n\n\t\t// Check if a third iteration is needed (151 bits accumulated)...\n\t\tif ( i > 49 ) {\n\t\t\tt = r;\n\t\t\tw = n * PIO2_3;\n\t\t\tr = t - w;\n\t\t\tw = (n * PIO2_3T) - ((t-r) - w);\n\t\t\ty[ 0 ] = r - w;\n\t\t}\n\t}\n\ty[ 1 ] = (r - y[0]) - w;\n\treturn n;\n}\n\n\n// EXPORTS //\n\nmodule.exports = rempio2Medium;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/e_rem_pio2.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n*\n* Optimized by Bruce D. Evans.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ABS_MASK = require( '@stdlib/constants/float64/high-word-abs-mask' );\nvar EXPONENT_MASK = require( '@stdlib/constants/float64/high-word-exponent-mask' );\nvar SIGNIFICAND_MASK = require( '@stdlib/constants/float64/high-word-significand-mask' );\nvar getHighWord = require( '@stdlib/number/float64/base/get-high-word' );\nvar getLowWord = require( '@stdlib/number/float64/base/get-low-word' );\nvar fromWords = require( '@stdlib/number/float64/base/from-words' );\nvar rempio2Kernel = require( './kernel_rempio2.js' );\nvar rempio2Medium = require( './rempio2_medium.js' );\n\n\n// VARIABLES //\n\nvar ZERO = 0.00000000000000000000e+00; // 0x00000000, 0x00000000\nvar TWO24 = 1.67772160000000000000e+07; // 0x41700000, 0x00000000\n\n// 33 bits of π/2:\nvar PIO2_1 = 1.57079632673412561417e+00; // 0x3FF921FB, 0x54400000\n\n// PIO2_1T = π/2 - PIO2_1:\nvar PIO2_1T = 6.07710050650619224932e-11; // 0x3DD0B461, 0x1A626331\nvar TWO_PIO2_1T = 2.0 * PIO2_1T;\nvar THREE_PIO2_1T = 3.0 * PIO2_1T;\nvar FOUR_PIO2_1T = 4.0 * PIO2_1T;\n\n// High word significand for π and π/2: 0x921fb = 598523 => 00000000000010010010000111111011\nvar PI_HIGH_WORD_SIGNIFICAND = 0x921fb|0; // asm type annotation\n\n// High word for π/4: 0x3fe921fb = 1072243195 => 00111111111010010010000111111011\nvar PIO4_HIGH_WORD = 0x3fe921fb|0; // asm type annotation\n\n// High word for 3π/4: 0x4002d97c = 1073928572 => 01000000000000101101100101111100\nvar THREE_PIO4_HIGH_WORD = 0x4002d97c|0; // asm type annotation\n\n// High word for 5π/4: 0x400f6a7a = 1074752122 => 01000000000011110110101001111010\nvar FIVE_PIO4_HIGH_WORD = 0x400f6a7a|0; // asm type annotation\n\n// High word for 6π/4: 0x4012d97c = 1074977148 => 01000000000100101101100101111100\nvar THREE_PIO2_HIGH_WORD = 0x4012d97c|0; // asm type annotation\n\n// High word for 7π/4: 0x4015fdbc = 1075183036 => 01000000000101011111110110111100\nvar SEVEN_PIO4_HIGH_WORD = 0x4015fdbc|0; // asm type annotation\n\n// High word for 8π/4: 0x401921fb = 1075388923 => 01000000000110010010000111111011\nvar TWO_PI_HIGH_WORD = 0x401921fb|0; // asm type annotation\n\n// High word for 9π/4: 0x401c463b = 1075594811 => 01000000000111000100011000111011\nvar NINE_PIO4_HIGH_WORD = 0x401c463b|0; // asm type annotation\n\n// 2^20*π/2 = 1647099.3291652855 => 0100000100111001001000011111101101010100010001000010110100011000 => high word => 0x413921fb = 1094263291 => 01000001001110010010000111111011\nvar MEDIUM = 0x413921fb|0; // asm type annotation\n\n// Arrays for storing temporary values:\nvar TX = [ 0.0, 0.0, 0.0 ];\nvar TY = [ 0.0, 0.0 ];\n\n\n// MAIN //\n\n/**\n* Computes `x - nπ/2 = r`.\n*\n* ## Notes\n*\n* - Returns `n` and stores the remainder `r` as two numbers `y[0]` and `y[1]`, such that `y[0]+y[1] = r`.\n*\n* @param {number} x - input value\n* @param {(Array|TypedArray|Object)} y - remainder elements\n* @returns {integer} factor of `π/2`\n*\n* @example\n* var y = [ 0.0, 0.0 ];\n* var n = rempio2( 128.0, y );\n* // returns 81\n*\n* var y1 = y[ 0 ];\n* // returns ~0.765\n*\n* var y2 = y[ 1 ];\n* // returns ~3.618e-17\n*\n* @example\n* var y = [ 0.0, 0.0 ];\n* var n = rempio2( NaN, y );\n* // returns 0\n*\n* var y1 = y[ 0 ];\n* // returns NaN\n*\n* var y2 = y[ 1 ];\n* // returns NaN\n*/\nfunction rempio2( x, y ) {\n\tvar low;\n\tvar e0;\n\tvar hx;\n\tvar ix;\n\tvar nx;\n\tvar i;\n\tvar n;\n\tvar z;\n\n\thx = getHighWord( x )|0; // asm type annotation\n\tix = (hx & ABS_MASK)|0; // asm type annotation\n\n\t// Case: |x| ~<= π/4 (no need for reduction)\n\tif ( ix <= PIO4_HIGH_WORD ) {\n\t\ty[ 0 ] = x;\n\t\ty[ 1 ] = 0.0;\n\t\treturn 0;\n\t}\n\t// Case: |x| ~<= 5π/4\n\tif ( ix <= FIVE_PIO4_HIGH_WORD ) {\n\t\t// Case: |x| ~= π/2 or π\n\t\tif ( (ix & SIGNIFICAND_MASK) === PI_HIGH_WORD_SIGNIFICAND ) {\n\t\t\t// Cancellation => use medium case\n\t\t\treturn rempio2Medium( x, ix, y );\n\t\t}\n\t\t// Case: |x| ~<= 3π/4\n\t\tif ( ix <= THREE_PIO4_HIGH_WORD ) {\n\t\t\tif ( hx > 0 ) {\n\t\t\t\tz = x - PIO2_1;\n\t\t\t\ty[ 0 ] = z - PIO2_1T;\n\t\t\t\ty[ 1 ] = (z - y[0]) - PIO2_1T;\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tz = x + PIO2_1;\n\t\t\ty[ 0 ] = z + PIO2_1T;\n\t\t\ty[ 1 ] = (z - y[0]) + PIO2_1T;\n\t\t\treturn -1;\n\t\t}\n\t\tif ( hx > 0 ) {\n\t\t\tz = x - ( 2.0*PIO2_1 );\n\t\t\ty[ 0 ] = z - TWO_PIO2_1T;\n\t\t\ty[ 1 ] = (z - y[0]) - TWO_PIO2_1T;\n\t\t\treturn 2;\n\t\t}\n\t\tz = x + ( 2.0*PIO2_1 );\n\t\ty[ 0 ] = z + TWO_PIO2_1T;\n\t\ty[ 1 ] = (z - y[0]) + TWO_PIO2_1T;\n\t\treturn -2;\n\t}\n\t// Case: |x| ~<= 9π/4\n\tif ( ix <= NINE_PIO4_HIGH_WORD ) {\n\t\t// Case: |x| ~<= 7π/4\n\t\tif ( ix <= SEVEN_PIO4_HIGH_WORD ) {\n\t\t\t// Case: |x| ~= 3π/2\n\t\t\tif ( ix === THREE_PIO2_HIGH_WORD ) {\n\t\t\t\treturn rempio2Medium( x, ix, y );\n\t\t\t}\n\t\t\tif ( hx > 0 ) {\n\t\t\t\tz = x - ( 3.0*PIO2_1 );\n\t\t\t\ty[ 0 ] = z - THREE_PIO2_1T;\n\t\t\t\ty[ 1 ] = (z - y[0]) - THREE_PIO2_1T;\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t\tz = x + ( 3.0*PIO2_1 );\n\t\t\ty[ 0 ] = z + THREE_PIO2_1T;\n\t\t\ty[ 1 ] = (z - y[0]) + THREE_PIO2_1T;\n\t\t\treturn -3;\n\t\t}\n\t\t// Case: |x| ~= 4π/2\n\t\tif ( ix === TWO_PI_HIGH_WORD ) {\n\t\t\treturn rempio2Medium( x, ix, y );\n\t\t}\n\t\tif ( hx > 0 ) {\n\t\t\tz = x - ( 4.0*PIO2_1 );\n\t\t\ty[ 0 ] = z - FOUR_PIO2_1T;\n\t\t\ty[ 1 ] = (z - y[0]) - FOUR_PIO2_1T;\n\t\t\treturn 4;\n\t\t}\n\t\tz = x + ( 4.0*PIO2_1 );\n\t\ty[ 0 ] = z + FOUR_PIO2_1T;\n\t\ty[ 1 ] = (z - y[0]) + FOUR_PIO2_1T;\n\t\treturn -4;\n\t}\n\t// Case: |x| ~< 2^20*π/2 (medium size)\n\tif ( ix < MEDIUM ) {\n\t\treturn rempio2Medium( x, ix, y );\n\t}\n\t// Case: x is NaN or infinity\n\tif ( ix >= EXPONENT_MASK ) {\n\t\ty[ 0 ] = NaN;\n\t\ty[ 1 ] = NaN;\n\t\treturn 0.0;\n\t}\n\t// Set z = scalbn(|x|, ilogb(x)-23)...\n\tlow = getLowWord( x );\n\te0 = (ix >> 20) - 1046; // `e0 = ilogb(z) - 23` => unbiased exponent minus 23\n\tz = fromWords( ix - ((e0 << 20)|0), low );\n\tfor ( i = 0; i < 2; i++ ) {\n\t\tTX[ i ] = z|0;\n\t\tz = (z - TX[i]) * TWO24;\n\t}\n\tTX[ 2 ] = z;\n\tnx = 3;\n\twhile ( TX[ nx-1 ] === ZERO ) {\n\t\t// Skip zero term...\n\t\tnx -= 1;\n\t}\n\tn = rempio2Kernel( TX, TY, e0, nx, 1 );\n\tif ( hx < 0 ) {\n\t\ty[ 0 ] = -TY[ 0 ];\n\t\ty[ 1 ] = -TY[ 1 ];\n\t\treturn -n;\n\t}\n\ty[ 0 ] = TY[ 0 ];\n\ty[ 1 ] = TY[ 1 ];\n\treturn n;\n}\n\n\n// EXPORTS //\n\nmodule.exports = rempio2;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute `x - nπ/2 = r`.\n*\n* @module @stdlib/math/base/special/rempio2\n*\n* @example\n* var rempio2 = require( '@stdlib/math/base/special/rempio2' );\n*\n* var y = [ 0.0, 0.0 ];\n* var n = rempio2( 128.0, y );\n* // returns 81\n*\n* var y1 = y[ 0 ];\n* // returns ~0.765\n*\n* var y2 = y[ 1 ];\n* // returns ~3.618e-17\n*/\n\n// MODULES //\n\nvar rempio2 = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = rempio2;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright, license, and long comment were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_cos.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nvar getHighWord = require( '@stdlib/number/float64/base/get-high-word' );\nvar kernelCos = require( './../../../../base/special/kernel-cos' );\nvar kernelSin = require( './../../../../base/special/kernel-sin' );\nvar rempio2 = require( './../../../../base/special/rempio2' );\nvar ABS_MASK = require( '@stdlib/constants/float64/high-word-abs-mask' );\nvar EXPONENT_MASK = require( '@stdlib/constants/float64/high-word-exponent-mask' );\n\n\n// VARIABLES //\n\n// Scratch array for storing temporary values:\nvar buffer = [ 0.0, 0.0 ]; // WARNING: not thread safe\n\n// High word of π/4: 0x3fe921fb => 00111111111010010010000111111011\nvar HIGH_WORD_PIO4 = 0x3fe921fb|0; // asm type annotation\n\n// High word of 2^-27: 0x3e400000 => 00111110010000000000000000000000\nvar HIGH_WORD_TWO_NEG_27 = 0x3e400000|0; // asm type annotation\n\n\n// MAIN //\n\n/**\n* Computes the cosine of a number.\n*\n* ## Method\n*\n* - Let \\\\(S\\\\), \\\\(C\\\\), and \\\\(T\\\\) denote the \\\\(\\sin\\\\), \\\\(\\cos\\\\), and \\\\(\\tan\\\\), respectively, on \\\\(\\[-\\pi/4, +\\pi/4\\]\\\\).\n*\n* - Reduce the argument \\\\(x\\\\) to \\\\(y1+y2 = x-k\\pi/2\\\\) in \\\\(\\[-\\pi/4, +\\pi/4\\]\\\\), and let \\\\(n = k \\mod 4\\\\).\n*\n* - We have\n*\n* | n | sin(x) | cos(x) | tan(x) |\n* | - | ------ | ------ | ------ |\n* | 0 | S | C | T |\n* | 1 | C | -S | -1/T |\n* | 2 | -S | -C | T |\n* | 3 | -C | S | -1/T |\n*\n* @param {number} x - input value (in radians)\n* @returns {number} cosine\n*\n* @example\n* var v = cos( 0.0 );\n* // returns 1.0\n*\n* @example\n* var v = cos( 3.141592653589793/4.0 );\n* // returns ~0.707\n*\n* @example\n* var v = cos( -3.141592653589793/6.0 );\n* // returns ~0.866\n*\n* @example\n* var v = cos( NaN );\n* // returns NaN\n*/\nfunction cos( x ) {\n\tvar ix;\n\tvar n;\n\n\tix = getHighWord( x );\n\tix &= ABS_MASK;\n\n\t// Case: |x| ~< pi/4\n\tif ( ix <= HIGH_WORD_PIO4 ) {\n\t\t// Case: x < 2**-27\n\t\tif ( ix < HIGH_WORD_TWO_NEG_27 ) {\n\t\t\treturn 1.0;\n\t\t}\n\t\treturn kernelCos( x, 0.0 );\n\t}\n\t// Case: cos(Inf or NaN) is NaN */\n\tif ( ix >= EXPONENT_MASK ) {\n\t\treturn NaN;\n\t}\n\t// Case: Argument reduction needed...\n\tn = rempio2( x, buffer );\n\tswitch ( n & 3 ) {\n\tcase 0:\n\t\treturn kernelCos( buffer[ 0 ], buffer[ 1 ] );\n\tcase 1:\n\t\treturn -kernelSin( buffer[ 0 ], buffer[ 1 ] );\n\tcase 2:\n\t\treturn -kernelCos( buffer[ 0 ], buffer[ 1 ] );\n\tdefault:\n\t\treturn kernelSin( buffer[ 0 ], buffer[ 1 ] );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = cos;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cosine of a number.\n*\n* @module @stdlib/math/base/special/cos\n*\n* @example\n* var cos = require( '@stdlib/math/base/special/cos' );\n*\n* var v = cos( 0.0 );\n* // returns 1.0\n*\n* v = cos( 3.141592653589793/4.0 );\n* // returns ~0.707\n*\n* v = cos( -3.141592653589793/6.0 );\n* // returns ~0.866\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright, license, and long comment were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_sin.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nvar HIGH_WORD_ABS_MASK = require( '@stdlib/constants/float64/high-word-abs-mask' );\nvar HIGH_WORD_EXPONENT_MASK = require( '@stdlib/constants/float64/high-word-exponent-mask' );\nvar getHighWord = require( '@stdlib/number/float64/base/get-high-word' );\nvar kernelCos = require( './../../../../base/special/kernel-cos' );\nvar kernelSin = require( './../../../../base/special/kernel-sin' );\nvar rempio2 = require( './../../../../base/special/rempio2' );\n\n\n// VARIABLES //\n\n// High word for PI/4: 0x3fe921fb = 1072243195 => 00111111111010010010000111111011\nvar PIO4_HIGH_WORD = 0x3fe921fb|0; // asm type annotation\n\n// 2^-26 = 1.4901161193847656e-8 => 0011111001010000000000000000000000000000000000000000000000000000 => high word => 00111110010100000000000000000000 => 0x3e500000 = 1045430272\nvar SMALL_HIGH_WORD = 0x3e500000|0; // asm type annotation\n\n// Array for storing remainder elements:\nvar Y = [ 0.0, 0.0 ];\n\n\n// MAIN //\n\n/**\n* Computes the sine of a number.\n*\n* ## Method\n*\n* - Let \\\\(S\\\\), \\\\(C\\\\), and \\\\(T\\\\) denote the \\\\(\\sin\\\\), \\\\(\\cos\\\\), and \\\\(\\tan\\\\), respectively, on \\\\(\\[-\\pi/4, +\\pi/4\\]\\\\).\n*\n* - Reduce the argument \\\\(x\\\\) to \\\\(y1+y2 = x-k\\pi/2\\\\) in \\\\(\\[-\\pi/4, +\\pi/4\\]\\\\), and let \\\\(n = k \\mod 4\\\\).\n*\n* - We have\n*\n* | n | sin(x) | cos(x) | tan(x) |\n* | - | ------ | ------ | ------ |\n* | 0 | S | C | T |\n* | 1 | C | -S | -1/T |\n* | 2 | -S | -C | T |\n* | 3 | -C | S | -1/T |\n*\n* @param {number} x - input value (in radians)\n* @returns {number} sine\n*\n* @example\n* var v = sin( 0.0 );\n* // returns ~0.0\n*\n* @example\n* var v = sin( 3.141592653589793/2.0 );\n* // returns ~1.0\n*\n* @example\n* var v = sin( -3.141592653589793/6.0 );\n* // returns ~-0.5\n*\n* @example\n* var v = sin( NaN );\n* // returns NaN\n*/\nfunction sin( x ) {\n\tvar ix;\n\tvar n;\n\n\tix = getHighWord( x );\n\tix &= HIGH_WORD_ABS_MASK;\n\n\t// Case: |x| ~< π/4\n\tif ( ix <= PIO4_HIGH_WORD ) {\n\t\t// Case: |x| ~< 2^-26\n\t\tif ( ix < SMALL_HIGH_WORD ) {\n\t\t\treturn x;\n\t\t}\n\t\treturn kernelSin( x, 0.0 );\n\t}\n\t// Case: x is NaN or infinity\n\tif ( ix >= HIGH_WORD_EXPONENT_MASK ) {\n\t\treturn NaN;\n\t}\n\t// Argument reduction...\n\tn = rempio2( x, Y );\n\tswitch ( n & 3 ) {\n\tcase 0:\n\t\treturn kernelSin( Y[ 0 ], Y[ 1 ] );\n\tcase 1:\n\t\treturn kernelCos( Y[ 0 ], Y[ 1 ] );\n\tcase 2:\n\t\treturn -kernelSin( Y[ 0 ], Y[ 1 ] );\n\tdefault:\n\t\treturn -kernelCos( Y[ 0 ], Y[ 1 ] );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = sin;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sine of a number.\n*\n* @module @stdlib/math/base/special/sin\n*\n* @example\n* var sin = require( '@stdlib/math/base/special/sin' );\n*\n* var v = sin( 0.0 );\n* // returns ~0.0\n*\n* v = sin( 3.141592653589793/2.0 );\n* // returns ~1.0\n*\n* v = sin( -3.141592653589793/6.0 );\n* // returns ~-0.5\n*\n* v = sin( NaN );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* The mathematical constant `π`.\n*\n* @module @stdlib/constants/float64/pi\n* @type {number}\n*\n* @example\n* var PI = require( '@stdlib/constants/float64/pi' );\n* // returns 3.141592653589793\n*/\n\n\n// MAIN //\n\n/**\n* The mathematical constant `π`.\n*\n* @constant\n* @type {number}\n* @default 3.141592653589793\n* @see [Wikipedia]{@link https://en.wikipedia.org/wiki/Pi}\n*/\nvar PI = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679; // eslint-disable-line max-len\n\n\n// EXPORTS //\n\nmodule.exports = PI;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( './../../../../base/assert/is-nan' );\nvar isInfinite = require( './../../../../base/assert/is-infinite' );\nvar cos = require( './../../../../base/special/cos' );\nvar sin = require( './../../../../base/special/sin' );\nvar abs = require( './../../../../base/special/abs' );\nvar copysign = require( './../../../../base/special/copysign' );\nvar PI = require( '@stdlib/constants/float64/pi' );\n\n\n// MAIN //\n\n/**\n* Computes the value of `sin(πx)`.\n*\n* ## Notes\n*\n* - The function computes `sin(πx)` more accurately than the obvious approach, especially for large `x`.\n*\n* @param {number} x - input value\n* @returns {number} function value\n*\n* @example\n* var y = sinpi( 0.0 );\n* // returns 0.0\n*\n* @example\n* var y = sinpi( 0.5 );\n* // returns 1.0\n*\n* @example\n* var y = sinpi( 0.9 );\n* // returns ~0.309\n*\n* @example\n* var y = sinpi( NaN );\n* // returns NaN\n*/\nfunction sinpi( x ) {\n\tvar ar;\n\tvar r;\n\tif ( isnan( x ) ) {\n\t\treturn NaN;\n\t}\n\tif ( isInfinite( x ) ) {\n\t\treturn NaN;\n\t}\n\t// Argument reduction (reduce to [0,2))...\n\tr = x % 2.0; // sign preserving\n\tar = abs( r );\n\n\t// If `x` is an integer, the mod is an integer...\n\tif ( ar === 0.0 || ar === 1.0 ) {\n\t\treturn copysign( 0.0, r );\n\t}\n\tif ( ar < 0.25 ) {\n\t\treturn sin( PI*r );\n\t}\n\t// In each of the following, we further reduce to [-π/4,π/4)...\n\tif ( ar < 0.75 ) {\n\t\tar = 0.5 - ar;\n\t\treturn copysign( cos( PI*ar ), r );\n\t}\n\tif ( ar < 1.25 ) {\n\t\tr = copysign( 1.0, r ) - r;\n\t\treturn sin( PI*r );\n\t}\n\tif ( ar < 1.75 ) {\n\t\tar -= 1.5;\n\t\treturn -copysign( cos( PI*ar ), r );\n\t}\n\tr -= copysign( 2.0, r );\n\treturn sin( PI*r );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sinpi;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the value of `sin(πx)`.\n*\n* @module @stdlib/math/base/special/sinpi\n*\n* @example\n* var sinpi = require( '@stdlib/math/base/special/sinpi' );\n*\n* var y = sinpi( 0.0 );\n* // returns 0.0\n*\n* y = sinpi( 0.5 );\n* // returns 1.0\n*\n* y = sinpi( 0.9 );\n* // returns ~0.309\n*\n* y = sinpi( NaN );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.06735230105312927;\n\t}\n\treturn 0.06735230105312927 + (x * (0.007385550860814029 + (x * (0.0011927076318336207 + (x * (0.00022086279071390839 + (x * 0.000025214456545125733))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.020580808432516733;\n\t}\n\treturn 0.020580808432516733 + (x * (0.0028905138367341563 + (x * (0.0005100697921535113 + (x * (0.00010801156724758394 + (x * 0.000044864094961891516))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 1.3920053346762105;\n\t}\n\treturn 1.3920053346762105 + (x * (0.7219355475671381 + (x * (0.17193386563280308 + (x * (0.01864591917156529 + (x * (0.0007779424963818936 + (x * 0.000007326684307446256))))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.21498241596060885;\n\t}\n\treturn 0.21498241596060885 + (x * (0.325778796408931 + (x * (0.14635047265246445 + (x * (0.02664227030336386 + (x * (0.0018402845140733772 + (x * 0.00003194753265841009))))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn -0.032788541075985965;\n\t}\n\treturn -0.032788541075985965 + (x * (0.006100538702462913 + (x * (-0.0014034646998923284 + (x * 0.00031563207090362595))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.01797067508118204;\n\t}\n\treturn 0.01797067508118204 + (x * (-0.0036845201678113826 + (x * (0.000881081882437654 + (x * -0.00031275416837512086))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn -0.010314224129834144;\n\t}\n\treturn -0.010314224129834144 + (x * (0.0022596478090061247 + (x * (-0.0005385953053567405 + (x * 0.0003355291926355191))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.6328270640250934;\n\t}\n\treturn 0.6328270640250934 + (x * (1.4549225013723477 + (x * (0.9777175279633727 + (x * (0.22896372806469245 + (x * 0.013381091853678766))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 2.4559779371304113;\n\t}\n\treturn 2.4559779371304113 + (x * (2.128489763798934 + (x * (0.7692851504566728 + (x * (0.10422264559336913 + (x * 0.003217092422824239))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.08333333333333297;\n\t}\n\treturn 0.08333333333333297 + (x * (-0.0027777777772877554 + (x * (0.0007936505586430196 + (x * (-0.00059518755745034 + (x * (0.0008363399189962821 + (x * -0.0016309293409657527))))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright, license, and long comment were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/12.2.0/lib/msun/src/e_lgamma_r.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( './../../../../base/assert/is-nan' );\nvar isInfinite = require( './../../../../base/assert/is-infinite' );\nvar abs = require( './../../../../base/special/abs' );\nvar ln = require( './../../../../base/special/ln' );\nvar trunc = require( './../../../../base/special/trunc' );\nvar sinpi = require( './../../../../base/special/sinpi' );\nvar PI = require( '@stdlib/constants/float64/pi' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar polyvalA1 = require( './polyval_a1.js' );\nvar polyvalA2 = require( './polyval_a2.js' );\nvar polyvalR = require( './polyval_r.js' );\nvar polyvalS = require( './polyval_s.js' );\nvar polyvalT1 = require( './polyval_t1.js' );\nvar polyvalT2 = require( './polyval_t2.js' );\nvar polyvalT3 = require( './polyval_t3.js' );\nvar polyvalU = require( './polyval_u.js' );\nvar polyvalV = require( './polyval_v.js' );\nvar polyvalW = require( './polyval_w.js' );\n\n\n// VARIABLES //\n\nvar A1C = 7.72156649015328655494e-02; // 0x3FB3C467E37DB0C8\nvar A2C = 3.22467033424113591611e-01; // 0x3FD4A34CC4A60FAD\nvar RC = 1.0;\nvar SC = -7.72156649015328655494e-02; // 0xBFB3C467E37DB0C8\nvar T1C = 4.83836122723810047042e-01; // 0x3FDEF72BC8EE38A2\nvar T2C = -1.47587722994593911752e-01; // 0xBFC2E4278DC6C509\nvar T3C = 6.46249402391333854778e-02; // 0x3FB08B4294D5419B\nvar UC = -7.72156649015328655494e-02; // 0xBFB3C467E37DB0C8\nvar VC = 1.0;\nvar WC = 4.18938533204672725052e-01; // 0x3FDACFE390C97D69\nvar YMIN = 1.461632144968362245;\nvar TWO52 = 4503599627370496; // 2**52\nvar TWO56 = 72057594037927936; // 2**56\nvar TINY = 1.3877787807814457e-17;\nvar TC = 1.46163214496836224576e+00; // 0x3FF762D86356BE3F\nvar TF = -1.21486290535849611461e-01; // 0xBFBF19B9BCC38A42\nvar TT = -3.63867699703950536541e-18; // 0xBC50C7CAA48A971F => TT = -(tail of TF)\n\n\n// MAIN //\n\n/**\n* Evaluates the natural logarithm of the gamma function.\n*\n* ## Method\n*\n* 1. Argument reduction for \\\\(0 < x \\leq 8\\\\). Since \\\\(\\Gamma(1+s) = s \\Gamma(s)\\\\), for \\\\(x \\in \\[0,8]\\\\), we may reduce \\\\(x\\\\) to a number in \\\\(\\[1.5,2.5]\\\\) by\n*\n* ```tex\n* \\operatorname{lgamma}(1+s) = \\ln(s) + \\operatorname{lgamma}(s)\n* ```\n*\n* For example,\n*\n* ```tex\n* \\begin{align*}\n* \\operatorname{lgamma}(7.3) &= \\ln(6.3) + \\operatorname{lgamma}(6.3) \\\\\n* &= \\ln(6.3 \\cdot 5.3) + \\operatorname{lgamma}(5.3) \\\\\n* &= \\ln(6.3 \\cdot 5.3 \\cdot 4.3 \\cdot 3.3 \\cdot2.3) + \\operatorname{lgamma}(2.3)\n* \\end{align*}\n* ```\n*\n* 2. Compute a polynomial approximation of \\\\(\\mathrm{lgamma}\\\\) around its minimum (\\\\(\\mathrm{ymin} = 1.461632144968362245\\\\)) to maintain monotonicity. On the interval \\\\(\\[\\mathrm{ymin} - 0.23, \\mathrm{ymin} + 0.27]\\\\) (i.e., \\\\(\\[1.23164,1.73163]\\\\)), we let \\\\(z = x - \\mathrm{ymin}\\\\) and use\n*\n* ```tex\n* \\operatorname{lgamma}(x) = -1.214862905358496078218 + z^2 \\cdot \\operatorname{poly}(z)\n* ```\n*\n* where \\\\(\\operatorname{poly}(z)\\\\) is a \\\\(14\\\\) degree polynomial.\n*\n* 3. Compute a rational approximation in the primary interval \\\\(\\[2,3]\\\\). Let \\\\( s = x - 2.0 \\\\). We can thus use the approximation\n*\n* ```tex\n* \\operatorname{lgamma}(x) = \\frac{s}{2} + s\\frac{\\operatorname{P}(s)}{\\operatorname{Q}(s)}\n* ```\n*\n* with accuracy\n*\n* ```tex\n* \\biggl|\\frac{\\mathrm{P}}{\\mathrm{Q}} - \\biggr(\\operatorname{lgamma}(x)-\\frac{s}{2}\\biggl)\\biggl| < 2^{-61.71}\n* ```\n*\n* The algorithms are based on the observation\n*\n* ```tex\n* \\operatorname{lgamma}(2+s) = s(1 - \\gamma) + \\frac{\\zeta(2) - 1}{2} s^2 - \\frac{\\zeta(3) - 1}{3} s^3 + \\ldots\n* ```\n*\n* where \\\\(\\zeta\\\\) is the zeta function and \\\\(\\gamma = 0.5772156649...\\\\) is the Euler-Mascheroni constant, which is very close to \\\\(0.5\\\\).\n*\n* 4. For \\\\(x \\geq 8\\\\),\n*\n* ```tex\n* \\operatorname{lgamma}(x) \\approx \\biggl(x-\\frac{1}{2}\\biggr) \\ln(x) - x + \\frac{\\ln(2\\pi)}{2} + \\frac{1}{12x} - \\frac{1}{360x^3} + \\ldots\n* ```\n*\n* which can be expressed\n*\n* ```tex\n* \\operatorname{lgamma}(x) \\approx \\biggl(x-\\frac{1}{2}\\biggr)(\\ln(x)-1)-\\frac{\\ln(2\\pi)-1}{2} + \\ldots\n* ```\n*\n* Let \\\\(z = \\frac{1}{x}\\\\). We can then use the approximation\n*\n* ```tex\n* f(z) = \\operatorname{lgamma}(x) - \\biggl(x-\\frac{1}{2}\\biggr)(\\ln(x)-1)\n* ```\n*\n* by\n*\n* ```tex\n* w = w_0 + w_1 z + w_2 z^3 + w_3 z^5 + \\ldots + w_6 z^{11}\n* ```\n*\n* where\n*\n* ```tex\n* |w - f(z)| < 2^{-58.74}\n* ```\n*\n* 5. For negative \\\\(x\\\\), since\n*\n* ```tex\n* -x \\Gamma(-x) \\Gamma(x) = \\frac{\\pi}{\\sin(\\pi x)}\n* ```\n*\n* where \\\\(\\Gamma\\\\) is the gamma function, we have\n*\n* ```tex\n* \\Gamma(x) = \\frac{\\pi}{\\sin(\\pi x)(-x)\\Gamma(-x)}\n* ```\n*\n* Since \\\\(\\Gamma(-x)\\\\) is positive,\n*\n* ```tex\n* \\operatorname{sign}(\\Gamma(x)) = \\operatorname{sign}(\\sin(\\pi x))\n* ```\n*\n* for \\\\(x < 0\\\\). Hence, for \\\\(x < 0\\\\),\n*\n* ```tex\n* \\mathrm{signgam} = \\operatorname{sign}(\\sin(\\pi x))\n* ```\n*\n* and\n*\n* ```tex\n* \\begin{align*}\n* \\operatorname{lgamma}(x) &= \\ln(|\\Gamma(x)|) \\\\\n* &= \\ln\\biggl(\\frac{\\pi}{|x \\sin(\\pi x)|}\\biggr) - \\operatorname{lgamma}(-x)\n* \\end{align*}\n* ```\n*\n* <!-- <note> -->\n*\n* Note that one should avoid computing \\\\(\\pi (-x)\\\\) directly in the computation of \\\\(\\sin(\\pi (-x))\\\\).\n*\n* <!-- </note> -->\n*\n* ## Special Cases\n*\n* ```tex\n* \\begin{align*}\n* \\operatorname{lgamma}(2+s) &\\approx s (1-\\gamma) & \\mathrm{for\\ tiny\\ s} \\\\\n* \\operatorname{lgamma}(x) &\\approx -\\ln(x) & \\mathrm{for\\ tiny\\ x} \\\\\n* \\operatorname{lgamma}(1) &= 0 & \\\\\n* \\operatorname{lgamma}(2) &= 0 & \\\\\n* \\operatorname{lgamma}(0) &= \\infty & \\\\\n* \\operatorname{lgamma}(\\infty) &= \\infty & \\\\\n* \\operatorname{lgamma}(-\\mathrm{integer}) &= \\pm \\infty\n* \\end{align*}\n* ```\n*\n* @param {number} x - input value\n* @returns {number} function value\n*\n* @example\n* var v = gammaln( 1.0 );\n* // returns 0.0\n*\n* @example\n* var v = gammaln( 2.0 );\n* // returns 0.0\n*\n* @example\n* var v = gammaln( 4.0 );\n* // returns ~1.792\n*\n* @example\n* var v = gammaln( -0.5 );\n* // returns ~1.266\n*\n* @example\n* var v = gammaln( 0.5 );\n* // returns ~0.572\n*\n* @example\n* var v = gammaln( 0.0 );\n* // returns Infinity\n*\n* @example\n* var v = gammaln( NaN );\n* // returns NaN\n*/\nfunction gammaln( x ) {\n\tvar isNegative;\n\tvar nadj;\n\tvar flg;\n\tvar p3;\n\tvar p2;\n\tvar p1;\n\tvar p;\n\tvar q;\n\tvar t;\n\tvar w;\n\tvar y;\n\tvar z;\n\tvar r;\n\n\t// Special cases: NaN, +-infinity\n\tif ( isnan( x ) || isInfinite( x ) ) {\n\t\treturn x;\n\t}\n\t// Special case: 0\n\tif ( x === 0.0 ) {\n\t\treturn PINF;\n\t}\n\tif ( x < 0.0 ) {\n\t\tisNegative = true;\n\t\tx = -x;\n\t} else {\n\t\tisNegative = false;\n\t}\n\t// If |x| < 2**-56, return -ln(|x|)\n\tif ( x < TINY ) {\n\t\treturn -ln( x );\n\t}\n\tif ( isNegative ) {\n\t\t// If |x| >= 2**52, must be -integer\n\t\tif ( x >= TWO52 ) {\n\t\t\treturn PINF;\n\t\t}\n\t\tt = sinpi( x );\n\t\tif ( t === 0.0 ) {\n\t\t\treturn PINF;\n\t\t}\n\t\tnadj = ln( PI / abs( t*x ) );\n\t}\n\t// If x equals 1 or 2, return 0\n\tif ( x === 1.0 || x === 2.0 ) {\n\t\treturn 0.0;\n\t}\n\t// If x < 2, use lgamma(x) = lgamma(x+1) - log(x)\n\tif ( x < 2.0 ) {\n\t\tif ( x <= 0.9 ) {\n\t\t\tr = -ln( x );\n\n\t\t\t// 0.7316 <= x <= 0.9\n\t\t\tif ( x >= ( YMIN - 1.0 + 0.27 ) ) {\n\t\t\t\ty = 1.0 - x;\n\t\t\t\tflg = 0;\n\t\t\t}\n\t\t\t// 0.2316 <= x < 0.7316\n\t\t\telse if ( x >= (YMIN - 1.0 - 0.27) ) {\n\t\t\t\ty = x - (TC - 1.0);\n\t\t\t\tflg = 1;\n\t\t\t}\n\t\t\t// 0 < x < 0.2316\n\t\t\telse {\n\t\t\t\ty = x;\n\t\t\t\tflg = 2;\n\t\t\t}\n\t\t} else {\n\t\t\tr = 0.0;\n\n\t\t\t// 1.7316 <= x < 2\n\t\t\tif ( x >= (YMIN + 0.27) ) {\n\t\t\t\ty = 2.0 - x;\n\t\t\t\tflg = 0;\n\t\t\t}\n\t\t\t// 1.2316 <= x < 1.7316\n\t\t\telse if ( x >= (YMIN - 0.27) ) {\n\t\t\t\ty = x - TC;\n\t\t\t\tflg = 1;\n\t\t\t}\n\t\t\t// 0.9 < x < 1.2316\n\t\t\telse {\n\t\t\t\ty = x - 1.0;\n\t\t\t\tflg = 2;\n\t\t\t}\n\t\t}\n\t\tswitch ( flg ) { // eslint-disable-line default-case\n\t\tcase 0:\n\t\t\tz = y * y;\n\t\t\tp1 = A1C + (z*polyvalA1( z ));\n\t\t\tp2 = z * (A2C + (z*polyvalA2( z )));\n\t\t\tp = (y*p1) + p2;\n\t\t\tr += ( p - (0.5*y) );\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tz = y * y;\n\t\t\tw = z * y;\n\t\t\tp1 = T1C + (w*polyvalT1( w ));\n\t\t\tp2 = T2C + (w*polyvalT2( w ));\n\t\t\tp3 = T3C + (w*polyvalT3( w ));\n\t\t\tp = (z*p1) - (TT - (w*(p2+(y*p3))));\n\t\t\tr += ( TF + p );\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tp1 = y * (UC + (y*polyvalU( y )));\n\t\t\tp2 = VC + (y*polyvalV( y ));\n\t\t\tr += (-0.5*y) + (p1/p2);\n\t\t\tbreak;\n\t\t}\n\t}\n\t// 2 <= x < 8\n\telse if ( x < 8.0 ) {\n\t\tflg = trunc( x );\n\t\ty = x - flg;\n\t\tp = y * (SC + (y*polyvalS( y )));\n\t\tq = RC + (y*polyvalR( y ));\n\t\tr = (0.5*y) + (p/q);\n\t\tz = 1.0; // gammaln(1+s) = ln(s) + gammaln(s)\n\t\tswitch ( flg ) { // eslint-disable-line default-case\n\t\tcase 7:\n\t\t\tz *= y + 6.0;\n\n\t\t\t/* Falls through */\n\t\tcase 6:\n\t\t\tz *= y + 5.0;\n\n\t\t\t/* Falls through */\n\t\tcase 5:\n\t\t\tz *= y + 4.0;\n\n\t\t\t/* Falls through */\n\t\tcase 4:\n\t\t\tz *= y + 3.0;\n\n\t\t\t/* Falls through */\n\t\tcase 3:\n\t\t\tz *= y + 2.0;\n\t\t\tr += ln( z );\n\t\t}\n\t}\n\t// 8 <= x < 2**56\n\telse if ( x < TWO56 ) {\n\t\tt = ln( x );\n\t\tz = 1.0 / x;\n\t\ty = z * z;\n\t\tw = WC + (z*polyvalW( y ));\n\t\tr = ((x-0.5)*(t-1.0)) + w;\n\t}\n\t// 2**56 <= x <= Inf\n\telse {\n\t\tr = x * ( ln(x)-1.0 );\n\t}\n\tif ( isNegative ) {\n\t\tr = nadj - r;\n\t}\n\treturn r;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gammaln;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Evaluate the natural logarithm of the gamma function.\n*\n* @module @stdlib/math/base/special/gammaln\n*\n* @example\n* var gammaln = require( '@stdlib/math/base/special/gammaln' );\n*\n* var v = gammaln( 1.0 );\n* // returns 0.0\n*\n* v = gammaln( 2.0 );\n* // returns 0.0\n*\n* v = gammaln( 4.0 );\n* // returns ~1.792\n*\n* v = gammaln( -0.5 );\n* // returns ~1.266\n*\n* v = gammaln( 0.5 );\n* // returns ~0.572\n*\n* v = gammaln( 0.0 );\n* // returns Infinity\n*\n* v = gammaln( NaN );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeInteger = require( './../../../../base/assert/is-negative-integer' );\nvar gammaln = require( './../../../../base/special/gammaln' );\n\n\n// MAIN //\n\n/**\n* Evaluates the natural logarithm of the factorial of `x`.\n*\n* @param {number} x - input value\n* @returns {number} natural logarithm of factorial of `x`\n*\n* @example\n* var v = factorialln( 3.0 );\n* // returns ~1.792\n*\n* @example\n* var v = factorialln( 2.4 );\n* // returns ~1.092\n*\n* @example\n* var v = factorialln( -1.0 );\n* // returns NaN\n*\n* @example\n* var v = factorialln( -1.5 );\n* // returns ~1.266\n*\n* @example\n* var v = factorialln( NaN );\n* // returns NaN\n*/\nfunction factorialln( x ) {\n\tif ( isNegativeInteger( x ) ) {\n\t\treturn NaN;\n\t}\n\treturn gammaln( x + 1.0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = factorialln;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Evaluate the natural logarithm of the factorial function.\n*\n* @module @stdlib/math/base/special/factorialln\n*\n* @example\n* var factorialln = require( '@stdlib/math/base/special/factorialln' );\n*\n* var v = factorialln( 3.0 );\n* // returns ~1.792\n*\n* v = factorialln( 2.4 );\n* // returns ~1.092\n*\n* v = factorialln( -1.0 );\n* // returns NaN\n*\n* v = factorialln( -1.5 );\n* // returns ~1.266\n*\n* v = factorialln( NaN );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar exp = require( '@stdlib/math/base/special/exp' );\nvar fln = require( '@stdlib/math/base/special/factorialln' );\nvar max = require( '@stdlib/math/base/special/max' );\nvar min = require( '@stdlib/math/base/special/min' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\n\n\n// MAIN //\n\n/**\n* Evaluates the probability mass function (PMF) for a hypergeometric distribution with population size `N`, subpopulation size `K`, and number of draws `n`.\n*\n* @param {number} x - input value\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {Probability} evaluated PMF\n*\n* @example\n* var y = pmf( 1.0, 8, 4, 2 );\n* // returns ~0.571\n*\n* @example\n* var y = pmf( 2.0, 8, 4, 2 );\n* // returns ~0.214\n*\n* @example\n* var y = pmf( 0.0, 8, 4, 2 );\n* // returns ~0.214\n*\n* @example\n* var y = pmf( 1.5, 8, 4, 2 );\n* // returns 0.0\n*\n* @example\n* var y = pmf( NaN, 10, 5, 2 );\n* // returns NaN\n*\n* @example\n* var y = pmf( 0.0, NaN, 5, 2 );\n* // returns NaN\n*\n* @example\n* var y = pmf( 0.0, 10, NaN, 2 );\n* // returns NaN\n*\n* @example\n* var y = pmf( 0.0, 10, 5, NaN );\n* // returns NaN\n*\n* @example\n* var y = pmf( 2.0, 10.5, 5, 2 );\n* // returns NaN\n*\n* @example\n* var y = pmf( 2.0, 5, 1.5, 2 );\n* // returns NaN\n*\n* @example\n* var y = pmf( 2.0, 10, 5, -2.0 );\n* // returns NaN\n*\n* @example\n* var y = pmf( 2.0, 10, 5, 12 );\n* // returns NaN\n*\n* @example\n* var y = pmf( 2.0, 8, 3, 9 );\n* // returns NaN\n*/\nfunction pmf( x, N, K, n ) {\n\tvar ldenom;\n\tvar lnum;\n\tvar lpmf;\n\tvar maxs;\n\tvar mins;\n\n\tif (\n\t\tisnan( x ) ||\n\t\tisnan( N ) ||\n\t\tisnan( K ) ||\n\t\tisnan( n ) ||\n\t\t!isNonNegativeInteger( N ) ||\n\t\t!isNonNegativeInteger( K ) ||\n\t\t!isNonNegativeInteger( n ) ||\n\t\tN === PINF ||\n\t\tK === PINF ||\n\t\tK > N ||\n\t\tn > N\n\t) {\n\t\treturn NaN;\n\t}\n\tmins = max( 0, n + K - N );\n\tmaxs = min( K, n );\n\tif (\n\t\tisNonNegativeInteger( x ) &&\n\t\tmins <= x &&\n\t\tx <= maxs\n\t) {\n\t\tlnum = fln( n ) + fln( K ) + fln( N - n ) + fln( N - K );\n\t\tldenom = fln( N ) + fln( x ) + fln( n - x );\n\t\tldenom += fln( K - x ) + fln( N - K + x - n );\n\t\tlpmf = lnum - ldenom;\n\t\treturn exp( lpmf );\n\t}\n\treturn 0.0;\n}\n\n\n// EXPORTS //\n\nmodule.exports = pmf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Creates a function which always returns the same value.\n*\n* @param {*} [value] - value to always return\n* @returns {Function} constant function\n*\n* @example\n* var fcn = wrap( 3.14 );\n*\n* var v = fcn();\n* // returns 3.14\n*\n* v = fcn();\n* // returns 3.14\n*\n* v = fcn();\n* // returns 3.14\n*/\nfunction wrap( value ) {\n\treturn constantFunction;\n\n\t/**\n\t* Constant function.\n\t*\n\t* @private\n\t* @returns {*} constant value\n\t*/\n\tfunction constantFunction() {\n\t\treturn value;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a constant function.\n*\n* @module @stdlib/utils/constant-function\n*\n* @example\n* var constantFunction = require( '@stdlib/utils/constant-function' );\n*\n* var fcn = constantFunction( 3.14 );\n*\n* var v = fcn();\n* // returns 3.14\n*\n* v = fcn();\n* // returns 3.14\n*\n* v = fcn();\n* // returns 3.14\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar exp = require( '@stdlib/math/base/special/exp' );\nvar fln = require( '@stdlib/math/base/special/factorialln' );\nvar max = require( '@stdlib/math/base/special/max' );\nvar min = require( '@stdlib/math/base/special/min' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\n\n\n// MAIN //\n\n/**\n* Returns a function for evaluating the probability mass function (PMF) for a hypergeometric distribution with population size `N`, subpopulation size `K`, and number of draws `n`.\n*\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {Function} PMF\n*\n* @example\n* var mypmf = factory( 30, 20, 5 );\n* var y = mypmf( 4.0 );\n* // returns ~0.34\n*\n* y = mypmf( 1.0 );\n* // returns ~0.029\n*/\nfunction factory( N, K, n ) {\n\tvar maxs;\n\tvar mins;\n\tif (\n\t\tisnan( N ) ||\n\t\tisnan( K ) ||\n\t\tisnan( n ) ||\n\t\t!isNonNegativeInteger( N ) ||\n\t\t!isNonNegativeInteger( K ) ||\n\t\t!isNonNegativeInteger( n ) ||\n\t\tN === PINF ||\n\t\tK === PINF ||\n\t\tK > N ||\n\t\tn > N\n\t) {\n\t\treturn constantFunction( NaN );\n\t}\n\n\tmins = max( 0, n + K - N );\n\tmaxs = min( K, n );\n\treturn pmf;\n\n\t/**\n\t* Evaluates the probability mass function (PMF) for a hypergeometric distribution.\n\t*\n\t* @private\n\t* @param {number} x - input value\n\t* @returns {Probability} evaluated PMF\n\t*/\n\tfunction pmf( x ) {\n\t\tvar ldenom;\n\t\tvar lnum;\n\t\tvar lpmf;\n\t\tif ( isnan( x ) ) {\n\t\t\treturn NaN;\n\t\t}\n\t\tif (\n\t\t\tisNonNegativeInteger( x ) &&\n\t\t\tmins <= x &&\n\t\t\tx <= maxs\n\t\t) {\n\t\t\tlnum = fln( n ) + fln( K ) + fln( N - n ) + fln( N - K );\n\t\t\tldenom = fln( N ) + fln( x ) + fln( n - x );\n\t\t\tldenom += fln( K - x ) + fln( N - K + x - n );\n\t\t\tlpmf = lnum - ldenom;\n\t\t\treturn exp( lpmf );\n\t\t}\n\t\treturn 0.0;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Hypergeometric distribution probability mass function (PMF).\n*\n* @module @stdlib/stats/base/dists/hypergeometric/pmf\n*\n* @example\n* var pmf = require( '@stdlib/stats/base/dists/hypergeometric/pmf' );\n*\n* var y = pmf( 1.0, 8, 4, 2 );\n* // returns ~0.571\n*\n* y = pmf( 2.0, 8, 4, 2 );\n* // returns ~0.214\n*\n* y = pmf( 0.0, 8, 4, 2 );\n* // returns ~0.214\n*\n* y = pmf( 1.5, 8, 4, 2 );\n* // returns 0.0\n*\n* var mypmf = pmf.factory( 30, 20, 5 );\n* y = mypmf( 4.0 );\n* // returns ~0.34\n*\n* y = mypmf( 1.0 );\n* // returns ~0.029\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Computes the sum of elements in an array.\n*\n* @private\n* @param {Array} arr - input array\n* @returns {number} sum\n*/\nfunction sum( arr ) {\n\tvar len;\n\tvar s;\n\tvar i;\n\tlen = arr.length;\n\ts = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\ts += arr[ i ];\n\t}\n\treturn s;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sum;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar trunc = require( '@stdlib/math/base/special/trunc' );\nvar max = require( '@stdlib/math/base/special/max' );\nvar min = require( '@stdlib/math/base/special/min' );\nvar pmf = require( './../../../../../base/dists/hypergeometric/pmf' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar Float64Array = require( '@stdlib/array/float64' );\nvar sum = require( './sum.js' );\n\n\n// MAIN //\n\n/**\n* Evaluates the cumulative distribution function (CDF) for a hypergeometric distribution with population size `N`, subpopulation size `K`, and number of draws `n` at a value `x`.\n*\n* @param {number} x - input value\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {Probability} evaluated CDF\n*\n* @example\n* var y = cdf( 1.0, 8, 4, 2 );\n* // returns ~0.786\n*\n* @example\n* var y = cdf( 1.5, 8, 4, 2 );\n* // returns ~0.786\n*\n* @example\n* var y = cdf( 2.0, 8, 4, 2 );\n* // returns 1.0\n*\n* @example\n* var y = cdf( 0, 8, 4, 2 );\n* // returns ~0.214\n*\n* @example\n* var y = cdf( NaN, 10, 5, 2 );\n* // returns NaN\n*\n* @example\n* var y = cdf( 0.0, NaN, 5, 2 );\n* // returns NaN\n*\n* @example\n* var y = cdf( 0.0, 10, NaN, 2 );\n* // returns NaN\n*\n* @example\n* var y = cdf( 0.0, 10, 5, NaN );\n* // returns NaN\n*\n* @example\n* var y = cdf( 2.0, 10.5, 5, 2 );\n* // returns NaN\n*\n* @example\n* var y = cdf( 2.0, 10, 1.5, 2 );\n* // returns NaN\n*\n* @example\n* var y = cdf( 2.0, 10, 5, -2.0 );\n* // returns NaN\n*\n* @example\n* var y = cdf( 2.0, 10, 5, 12 );\n* // returns NaN\n*\n* @example\n* var y = cdf( 2.0, 8, 3, 9 );\n* // returns NaN\n*/\nfunction cdf( x, N, K, n ) {\n\tvar denom;\n\tvar probs;\n\tvar num;\n\tvar ret;\n\tvar i;\n\n\tif (\n\t\tisnan( x ) ||\n\t\tisnan( N ) ||\n\t\tisnan( K ) ||\n\t\tisnan( n ) ||\n\t\t!isNonNegativeInteger( N ) ||\n\t\t!isNonNegativeInteger( K ) ||\n\t\t!isNonNegativeInteger( n ) ||\n\t\tN === PINF ||\n\t\tK === PINF ||\n\t\tK > N ||\n\t\tn > N\n\t) {\n\t\treturn NaN;\n\t}\n\tx = trunc( x );\n\tif ( x < max( 0, n+K-N ) ) {\n\t\treturn 0.0;\n\t}\n\tif ( x >= min( n, K ) ) {\n\t\treturn 1.0;\n\t}\n\n\tprobs = new Float64Array( x+1 );\n\tprobs[ x ] = pmf( x, N, K, n );\n\n\t/*\n\t* Use recurrence relation:\n\t*\n\t* (x+1)( N - K - (n-x-1))P(X=x+1)=(K-x)(n-x)P(X=x)\n\t*/\n\tfor ( i = x-1; i >= 0; i-- ) {\n\t\tnum = ( i+1 ) * ( N-K-(n-i-1) );\n\t\tdenom = ( K-i ) * ( n-i );\n\t\tprobs[ i ] = ( num/denom ) * probs[ i+1 ];\n\t}\n\tret = sum( probs );\n\treturn min( ret, 1.0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = cdf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar trunc = require( '@stdlib/math/base/special/trunc' );\nvar max = require( '@stdlib/math/base/special/max' );\nvar min = require( '@stdlib/math/base/special/min' );\nvar pmf = require( './../../../../../base/dists/hypergeometric/pmf' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar Float64Array = require( '@stdlib/array/float64' );\nvar sum = require( './sum.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for evaluating the cumulative distribution function (CDF) for a hypergeometric distribution with population size `N`, subpopulation size `K`, and number of draws `n`.\n*\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {Function} CDF\n*\n* @example\n* var mycdf = factory( 30, 20, 5 );\n* var y = mycdf( 4.0 );\n* // returns ~0.891\n*\n* y = mycdf( 1.0 );\n* // returns ~0.031\n*/\nfunction factory( N, K, n ) {\n\tif (\n\t\tisnan( N ) ||\n\t\tisnan( K ) ||\n\t\tisnan( n ) ||\n\t\t!isNonNegativeInteger( N ) ||\n\t\t!isNonNegativeInteger( K ) ||\n\t\t!isNonNegativeInteger( n ) ||\n\t\tN === PINF ||\n\t\tK === PINF ||\n\t\tK > N ||\n\t\tn > N\n\t) {\n\t\treturn constantFunction( NaN );\n\t}\n\treturn cdf;\n\n\t/**\n\t* Evaluates the cumulative distribution function (CDF) for a hypergeometric distribution.\n\t*\n\t* @private\n\t* @param {number} x - input value\n\t* @returns {Probability} evaluated CDF\n\t*\n\t* @example\n\t* var y = cdf( 2.0 );\n\t* // returns <number>\n\t*/\n\tfunction cdf( x ) {\n\t\tvar denom;\n\t\tvar probs;\n\t\tvar num;\n\t\tvar ret;\n\t\tvar i;\n\n\t\tif ( isnan( x ) ) {\n\t\t\treturn NaN;\n\t\t}\n\t\tx = trunc( x );\n\t\tif ( x < max( 0, n + K - N ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\tif ( x >= min( n, K ) ) {\n\t\t\treturn 1.0;\n\t\t}\n\n\t\tprobs = new Float64Array( x+1 );\n\t\tprobs[ x ] = pmf( x, N, K, n );\n\n\t\t/*\n\t\t* Use recurrence relation:\n\t\t*\n\t\t* (x+1)( N - K - (n-x-1) )P(X=x+1)=(K-x)(n-x)P(X=x)\n\t\t*/\n\t\tfor ( i = x-1; i >= 0; i-- ) {\n\t\t\tnum = ( i+1 ) * ( N-K-(n-i-1) );\n\t\t\tdenom = ( K-i ) * ( n-i );\n\t\t\tprobs[ i ] = ( num/denom ) * probs[ i+1 ];\n\t\t}\n\t\tret = sum( probs );\n\t\treturn min( ret, 1.0 );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Hypergeometric distribution cumulative distribution function (CDF).\n*\n* @module @stdlib/stats/base/dists/hypergeometric/cdf\n*\n* @example\n* var cdf = require( '@stdlib/stats/base/dists/hypergeometric/cdf' );\n*\n* var y = cdf( 1.0, 8, 4, 2 );\n* // returns ~0.786\n*\n* y = cdf( 1.5, 8, 4, 2 );\n* // returns ~0.786\n*\n* y = cdf( 2.0, 8, 4, 2 );\n* // returns 1.0\n*\n* y = cdf( 0.0, 8, 4, 2 );\n* // returns ~0.214\n*\n* var mycdf = cdf.factory( 30, 20, 5 );\n* y = mycdf( 4.0 );\n* // returns ~0.891\n*\n* y = mycdf( 1.0 );\n* // returns ~0.031\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\n\n\n// MAIN //\n\n/**\n* Returns the expected value of a hypergeometric distribution.\n*\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {NonNegativeNumber} expected value\n*\n* @example\n* var v = mean( 16, 11, 4 );\n* // returns 2.75\n*\n* @example\n* var v = mean( 2, 1, 1 );\n* // returns 0.5\n*\n* @example\n* var v = mean( 10, 5, 12 );\n* // returns NaN\n*\n* @example\n* var v = mean( 10.3, 10, 4 );\n* // returns NaN\n*\n* @example\n* var v = mean( 10, 5.5, 4 );\n* // returns NaN\n*\n* @example\n* var v = mean( 10, 5, 4.5 );\n* // returns NaN\n*\n* @example\n* var v = mean( NaN, 10, 4 );\n* // returns NaN\n*\n* @example\n* var v = mean( 20, NaN, 4 );\n* // returns NaN\n*\n* @example\n* var v = mean( 20, 10, NaN );\n* // returns NaN\n*/\nfunction mean( N, K, n ) {\n\tif (\n\t\t!isNonNegativeInteger( N ) ||\n\t\t!isNonNegativeInteger( K ) ||\n\t\t!isNonNegativeInteger( n ) ||\n\t\tN === PINF ||\n\t\tK === PINF ||\n\t\tK > N ||\n\t\tn > N\n\t) {\n\t\treturn NaN;\n\t}\n\treturn n * ( K / N );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Hypergeometric distribution expected value.\n*\n* @module @stdlib/stats/base/dists/hypergeometric/mean\n*\n* @example\n* var mean = require( '@stdlib/stats/base/dists/hypergeometric/mean' );\n*\n* var v = mean( 16, 11, 4 );\n* // returns 2.75\n*\n* v = mean( 2, 1, 1 );\n* // returns 0.5\n*/\n\n// MODULES //\n\nvar mean = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = mean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isLittleEndian = require( '@stdlib/assert/is-little-endian' );\n\n\n// MAIN //\n\nvar LOW;\nif ( isLittleEndian === true ) {\n\tLOW = 0; // first index\n} else {\n\tLOW = 1; // second index\n}\n\n\n// EXPORTS //\n\nmodule.exports = LOW;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar Float64Array = require( '@stdlib/array/float64' );\nvar LOW = require( './low.js' );\n\n\n// VARIABLES //\n\nvar FLOAT64_VIEW = new Float64Array( 1 );\nvar UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );\n\n\n// MAIN //\n\n/**\n* Sets the less significant 32 bits of a double-precision floating-point number.\n*\n* ## Notes\n*\n* ```text\n* float64 (64 bits)\n* f := fraction (significand/mantissa) (52 bits)\n* e := exponent (11 bits)\n* s := sign bit (1 bit)\n*\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Float64 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* | Uint32 | Uint32 |\n* |-------- -------- -------- -------- -------- -------- -------- --------|\n* ```\n*\n* If little endian (more significant bits last):\n*\n* ```text\n* <-- lower higher -->\n* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |\n* ```\n*\n* If big endian (more significant bits first):\n*\n* ```text\n* <-- higher lower -->\n* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |\n* ```\n*\n* In which Uint32 can we find the lower order bits? If little endian, the first; if big endian, the second.\n*\n* ## References\n*\n* - [Open Group][1]\n*\n* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm\n*\n* @param {number} x - double\n* @param {uinteger32} low - unsigned 32-bit integer to replace the lower order word of `x`\n* @returns {number} double having the same higher order word as `x`\n*\n* @example\n* var low = 5 >>> 0; // => 00000000000000000000000000000101\n*\n* var x = 3.14e201; // => 0 11010011100 01001000001011000011 10010011110010110101100010000010\n*\n* var y = setLowWord( x, low ); // => 0 11010011100 01001000001011000011 00000000000000000000000000000101\n* // returns 3.139998651394392e+201\n*\n* @example\n* var PINF = require( '@stdlib/constants/float64/pinf' );\n* var NINF = require( '@stdlib/constants/float64/ninf' );\n*\n* var low = 12345678;\n*\n* var y = setLowWord( PINF, low );\n* // returns NaN\n*\n* y = setLowWord( NINF, low );\n* // returns NaN\n*\n* y = setLowWord( NaN, low );\n* // returns NaN\n*/\nfunction setLowWord( x, low ) {\n\tFLOAT64_VIEW[ 0 ] = x;\n\tUINT32_VIEW[ LOW ] = ( low >>> 0 ); // identity bit shift to ensure integer\n\treturn FLOAT64_VIEW[ 0 ];\n}\n\n\n// EXPORTS //\n\nmodule.exports = setLowWord;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Set the less significant 32 bits of a double-precision floating-point number.\n*\n* @module @stdlib/number/float64/base/set-low-word\n*\n* @example\n* var setLowWord = require( '@stdlib/number/float64/base/set-low-word' );\n*\n* var low = 5 >>> 0; // => 00000000000000000000000000000101\n*\n* var x = 3.14e201; // => 0 11010011100 01001000001011000011 10010011110010110101100010000010\n*\n* var y = setLowWord( x, low ); // => 0 11010011100 01001000001011000011 00000000000000000000000000000101\n* // returns 3.139998651394392e+201\n*\n* @example\n* var PINF = require( '@stdlib/constants/float64/pinf' );\n* var NINF = require( '@stdlib/constants/float64/ninf' );\n* var setLowWord = require( '@stdlib/number/float64/base/set-low-word' );\n*\n* var low = 12345678;\n*\n* var y = setLowWord( PINF, low );\n* // returns NaN\n*\n* y = setLowWord( NINF, low );\n* // returns NaN\n*\n* y = setLowWord( NaN, low );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn -0.3250421072470015;\n\t}\n\treturn -0.3250421072470015 + (x * (-0.02848174957559851 + (x * (-0.005770270296489442 + (x * -0.000023763016656650163))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.39791722395915535;\n\t}\n\treturn 0.39791722395915535 + (x * (0.0650222499887673 + (x * (0.005081306281875766 + (x * (0.00013249473800432164 + (x * -0.000003960228278775368))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.41485611868374833;\n\t}\n\treturn 0.41485611868374833 + (x * (-0.3722078760357013 + (x * (0.31834661990116175 + (x * (-0.11089469428239668 + (x * (0.035478304325618236 + (x * -0.002166375594868791))))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 0.10642088040084423;\n\t}\n\treturn 0.10642088040084423 + (x * (0.540397917702171 + (x * (0.07182865441419627 + (x * (0.12617121980876164 + (x * (0.01363708391202905 + (x * 0.011984499846799107))))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn -0.6938585727071818;\n\t}\n\treturn -0.6938585727071818 + (x * (-10.558626225323291 + (x * (-62.375332450326006 + (x * (-162.39666946257347 + (x * (-184.60509290671104 + (x * (-81.2874355063066 + (x * -9.814329344169145))))))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 19.651271667439257;\n\t}\n\treturn 19.651271667439257 + (x * (137.65775414351904 + (x * (434.56587747522923 + (x * (645.3872717332679 + (x * (429.00814002756783 + (x * (108.63500554177944 + (x * (6.570249770319282 + (x * -0.0604244152148581))))))))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn -0.799283237680523;\n\t}\n\treturn -0.799283237680523 + (x * (-17.757954917754752 + (x * (-160.63638485582192 + (x * (-637.5664433683896 + (x * (-1025.0951316110772 + (x * -483.5191916086514))))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* This is a generated file. Do not edit directly. */\n'use strict';\n\n// MAIN //\n\n/**\n* Evaluates a polynomial.\n*\n* ## Notes\n*\n* - The implementation uses [Horner's rule][horners-method] for efficient computation.\n*\n* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method\n*\n* @private\n* @param {number} x - value at which to evaluate the polynomial\n* @returns {number} evaluated polynomial\n*/\nfunction evalpoly( x ) {\n\tif ( x === 0.0 ) {\n\t\treturn 30.33806074348246;\n\t}\n\treturn 30.33806074348246 + (x * (325.7925129965739 + (x * (1536.729586084437 + (x * (3199.8582195085955 + (x * (2553.0504064331644 + (x * (474.52854120695537 + (x * -22.44095244658582))))))))))); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = evalpoly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The following copyright, license, and long comment were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_erf.c}. The implementation follows the original, but has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n*\n* Developed at SunPro, a Sun Microsystems, Inc. business.\n* Permission to use, copy, modify, and distribute this\n* software is freely granted, provided that this notice\n* is preserved.\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( './../../../../base/assert/is-nan' );\nvar exp = require( './../../../../base/special/exp' );\nvar setLowWord = require( '@stdlib/number/float64/base/set-low-word' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar NINF = require( '@stdlib/constants/float64/ninf' );\nvar polyvalPP = require( './polyval_pp.js' );\nvar polyvalQQ = require( './polyval_qq.js' );\nvar polyvalPA = require( './polyval_pa.js' );\nvar polyvalQA = require( './polyval_qa.js' );\nvar polyvalRA = require( './polyval_ra.js' );\nvar polyvalSA = require( './polyval_sa.js' );\nvar polyvalRB = require( './polyval_rb.js' );\nvar polyvalSB = require( './polyval_sb.js' );\n\n\n// VARIABLES //\n\nvar TINY = 1.0e-300;\n\n// 2**-56 = 1/(2**56) = 1/72057594037927940\nvar SMALL = 1.3877787807814457e-17;\n\nvar ERX = 8.45062911510467529297e-1; // 0x3FEB0AC1, 0x60000000\n\nvar PPC = 1.28379167095512558561e-1; // 0x3FC06EBA, 0x8214DB68\nvar QQC = 1.0;\n\nvar PAC = -2.36211856075265944077e-3; // 0xBF6359B8, 0xBEF77538\nvar QAC = 1.0;\n\nvar RAC = -9.86494403484714822705e-3; // 0xBF843412, 0x600D6435\nvar SAC = 1.0;\n\nvar RBC = -9.86494292470009928597e-3; // 0xBF843412, 0x39E86F4A\nvar SBC = 1.0;\n\n\n// MAIN //\n\n/**\n* Evaluates the complementary error function.\n*\n* ```tex\n* \\operatorname{erf}(x) = \\frac{2}{\\sqrt{\\pi}} \\int^{x}_{0} e^{-t^2}\\ \\mathrm{dt}\n* ```\n*\n* Note that\n*\n* ```tex\n* \\begin{align*}\n* \\operatorname{erfc}(x) &= 1 - \\operatorname{erf}(x) \\\\\n* \\operatorname{erf}(-x) &= -\\operatorname{erf}(x) \\\\\n* \\operatorname{erfc}(-x) &= 2 - \\operatorname{erfc}(x)\n* \\end{align*}\n* ```\n*\n* ## Method\n*\n* 1. For \\\\(|x| \\in [0, 0.84375)\\\\),\n*\n* ```tex\n* \\operatorname{erf}(x) = x + x \\cdot \\operatorname{R}(x^2)\n* ```\n*\n* and\n*\n* ```tex\n* \\operatorname{erfc}(x) = \\begin{cases}\n* 1 - \\operatorname{erf}(x) & \\textrm{if}\\ x \\in (-.84375,0.25) \\\\\n* 0.5 + ((0.5-x)-x \\mathrm{R}) & \\textrm{if}\\ x \\in [0.25,0.84375)\n* \\end{cases}\n* ```\n*\n* where \\\\(R = P/Q\\\\) and where \\\\(P\\\\) is an odd polynomial of degree \\\\(8\\\\) and \\\\(Q\\\\) is an odd polynomial of degree \\\\(10\\\\).\n*\n* ```tex\n* \\biggl| \\mathrm{R} - \\frac{\\operatorname{erf}(x)-x}{x} \\biggr| \\leq 2^{-57.90}\n* ```\n*\n* <!-- <note> -->\n*\n* The formula is derived by noting\n*\n* ```tex\n* \\operatorname{erf}(x) = \\frac{2}{\\sqrt{\\pi}}\\biggl(x - \\frac{x^3}{3} + \\frac{x^5}{10} - \\frac{x^7}{42} + \\ldots \\biggr)\n* ```\n*\n* and that\n*\n* ```tex\n* \\frac{2}{\\sqrt{\\pi}} = 1.128379167095512573896158903121545171688\n* ```\n*\n* is close to unity. The interval is chosen because the fix point of \\\\(\\operatorname{erf}(x)\\\\) is near \\\\(0.6174\\\\) (i.e., \\\\(\\operatorname{erf(x)} = x\\\\) when \\\\(x\\\\) is near \\\\(0.6174\\\\)), and, by some experiment, \\\\(0.84375\\\\) is chosen to guarantee the error is less than one ulp for \\\\(\\operatorname{erf}(x)\\\\).\n*\n* <!-- </note> -->\n*\n* 2. For \\\\(|x| \\in [0.84375,1.25)\\\\), let \\\\(s = |x|-1\\\\), and \\\\(c = 0.84506291151\\\\) rounded to single (\\\\(24\\\\) bits)\n*\n* ```tex\n* \\operatorname{erf}(x) = \\operatorname{sign}(x) \\cdot \\biggl(c + \\frac{\\operatorname{P1}(s)}{\\operatorname{Q1}(s)}\\biggr)\n* ```\n*\n* and\n*\n* ```tex\n* \\operatorname{erfc}(x) = \\begin{cases}\n* (1-c) - \\frac{\\operatorname{P1}(s)}{\\operatorname{Q1}(s)} & \\textrm{if}\\ x > 0 \\\\\n* 1 + \\biggl(c + \\frac{\\operatorname{P1}(s)}{\\operatorname{Q1}(s)}\\biggr) & \\textrm{if}\\ x < 0\n* \\end{cases}\n* ```\n*\n* where\n*\n* ```tex\n* \\biggl|\\frac{\\mathrm{P1}}{\\mathrm{Q1}} - (\\operatorname{erf}(|x|)-c)\\biggr| \\leq 2^{-59.06}\n* ```\n*\n* <!-- <note> -->\n*\n* Here, we use the Taylor series expansion at \\\\(x = 1\\\\)\n*\n* ```tex\n* \\begin{align*}\n* \\operatorname{erf}(1+s) &= \\operatorname{erf}(1) + s\\cdot \\operatorname{poly}(s) \\\\\n* &= 0.845.. + \\frac{\\operatorname{P1}(s)}{\\operatorname{Q1}(s)}\n* \\end{align*}\n* ```\n*\n* using a rational approximation to approximate\n*\n* ```tex\n* \\operatorname{erf}(1+s) - (c = (\\mathrm{single})0.84506291151)\n* ```\n*\n* <!-- </note> -->\n*\n* Note that, for \\\\(x \\in [0.84375,1.25)\\\\), \\\\(|\\mathrm{P1}/\\mathrm{Q1}| < 0.078\\\\), where\n*\n* - \\\\(\\operatorname{P1}(s)\\\\) is a degree \\\\(6\\\\) polynomial in \\\\(s\\\\)\n* - \\\\(\\operatorname{Q1}(s)\\\\) is a degree \\\\(6\\\\) polynomial in \\\\(s\\\\)\n*\n* 3. For \\\\(x \\in [1.25,1/0.35)\\\\),\n*\n* ```tex\n* \\begin{align*}\n* \\operatorname{erfc}(x) &= \\frac{1}{x}e^{-x^2-0.5625+(\\mathrm{R1}/\\mathrm{S1})} \\\\\n* \\operatorname{erf}(x) &= 1 - \\operatorname{erfc}(x)\n* \\end{align*}\n* ```\n*\n* where\n*\n* - \\\\(\\operatorname{R1}(z)\\\\) is a degree \\\\(7\\\\) polynomial in \\\\(z\\\\), where \\\\(z = 1/x^2\\\\)\n* - \\\\(\\operatorname{S1}(z)\\\\) is a degree \\\\(8\\\\) polynomial in \\\\(z\\\\)\n*\n* 4. For \\\\(x \\in [1/0.35,28)\\\\),\n*\n* ```tex\n* \\operatorname{erfc}(x) = \\begin{cases}\n* \\frac{1}{x} e^{-x^2-0.5625+(\\mathrm{R2}/\\mathrm{S2})} & \\textrm{if}\\ x > 0 \\\\\n* 2.0 - \\frac{1}{x} e^{-x^2-0.5625+(\\mathrm{R2}/\\mathrm{S2})} & \\textrm{if}\\ -6 < x < 0 \\\\\n* 2.0 - \\mathrm{tiny} & \\textrm{if}\\ x \\leq -6\n* \\end{cases}\n* ```\n*\n* and\n*\n* ```tex\n* \\operatorname{erf}(x) = \\begin{cases}\n* \\operatorname{sign}(x) \\cdot (1.0 - \\operatorname{erfc}(x)) & \\textrm{if}\\ x < 6 \\\\\n* \\operatorname{sign}(x) \\cdot (1.0 - \\mathrm{tiny}) & \\textrm{otherwise}\n* \\end{cases}\n* ```\n*\n* where\n*\n* - \\\\(\\operatorname{R2}(z)\\\\) is a degree \\\\(6\\\\) polynomial in \\\\(z\\\\), where \\\\(z = 1/x^2\\\\)\n* - \\\\(\\operatorname{S2}(z)\\\\) is a degree \\\\(7\\\\) polynomial in \\\\(z\\\\)\n*\n* 5. For \\\\(x \\in [28, \\infty)\\\\),\n*\n* ```tex\n* \\begin{align*}\n* \\operatorname{erf}(x) &= \\operatorname{sign}(x) \\cdot (1 - \\mathrm{tiny}) & \\textrm{(raise inexact)}\n* \\end{align*}\n* ```\n*\n* and\n*\n* ```tex\n* \\operatorname{erfc}(x) = \\begin{cases}\n* \\mathrm{tiny} \\cdot \\mathrm{tiny} & \\textrm{if}\\ x > 0\\ \\textrm{(raise underflow)} \\\\\n* 2 - \\mathrm{tiny} & \\textrm{if}\\ x < 0\n* \\end{cases}\n* ```\n*\n* ## Special Cases\n*\n* ```tex\n* \\begin{align*}\n* \\operatorname{erf}(0) &= 0 \\\\\n* \\operatorname{erf}(-0) &= -0 \\\\\n* \\operatorname{erf}(\\infty) &= 1 \\\\\n* \\operatorname{erf}(-\\infty) &= -1 \\\\\n* \\operatorname{erfc}(0) &= 1 \\\\\n* \\operatorname{erfc}(\\infty) &= 0 \\\\\n* \\operatorname{erfc}(-\\infty) &= 2 \\\\\n* \\operatorname{erf}(\\mathrm{NaN}) &= \\mathrm{NaN} \\\\\n* \\operatorname{erfc}(\\mathrm{NaN}) &= \\mathrm{NaN}\n* \\end{align*}\n* ```\n*\n* ## Notes\n*\n* - To compute \\\\(\\exp(-x^2-0.5625+(\\mathrm{R}/\\mathrm{S}))\\\\), let \\\\(s\\\\) be a single precision number and \\\\(s := x\\\\); then\n*\n* ```tex\n* -x^2 = -s^2 + (s-x)(s+x)\n* ```\n*\n* and\n*\n* ```tex\n* e^{-x^2-0.5626+(\\mathrm{R}/\\mathrm{S})} = e^{-s^2-0.5625} e^{(s-x)(s+x)+(\\mathrm{R}/\\mathrm{S})}\n* ```\n*\n* - `#4` and `#5` make use of the asymptotic series\n*\n* ```tex\n* \\operatorname{erfc}(x) \\approx \\frac{e^{-x^2}}{x\\sqrt{\\pi}} (1 + \\operatorname{poly}(1/x^2))\n* ```\n*\n* We use a rational approximation to approximate\n*\n* ```tex\n* g(s) = f(1/x^2) = \\ln(\\operatorname{erfc}(x) \\cdot x) - x^2 + 0.5625\n* ```\n*\n* - The error bound for \\\\(\\mathrm{R1}/\\mathrm{S1}\\\\) is\n*\n* ```tex\n* |\\mathrm{R1}/\\mathrm{S1} - f(x)| < 2^{-62.57}\n* ```\n*\n* and for \\\\(\\mathrm{R2}/\\mathrm{S2}\\\\) is\n*\n* ```tex\n* |\\mathrm{R2}/\\mathrm{S2} - f(x)| < 2^{-61.52}\n* ```\n*\n* @param {number} x - input value\n* @returns {number} function value\n*\n* @example\n* var y = erfc( 2.0 );\n* // returns ~0.0047\n*\n* @example\n* var y = erfc( -1.0 );\n* // returns ~1.8427\n*\n* @example\n* var y = erfc( 0.0 );\n* // returns 1.0\n*\n* @example\n* var y = erfc( Infinity );\n* // returns 0.0\n*\n* @example\n* var y = erfc( -Infinity );\n* // returns 2.0\n*\n* @example\n* var y = erfc( NaN );\n* // returns NaN\n*/\nfunction erfc( x ) {\n\tvar sign;\n\tvar ax;\n\tvar z;\n\tvar r;\n\tvar s;\n\tvar y;\n\tvar p;\n\tvar q;\n\n\t// Special case: NaN\n\tif ( isnan( x ) ) {\n\t\treturn NaN;\n\t}\n\t// Special case: +infinity\n\tif ( x === PINF ) {\n\t\treturn 0.0;\n\t}\n\t// Special case: -infinity\n\tif ( x === NINF ) {\n\t\treturn 2.0;\n\t}\n\t// Special case: +-0\n\tif ( x === 0.0 ) {\n\t\treturn 1.0;\n\t}\n\tif ( x < 0.0 ) {\n\t\tsign = true;\n\t\tax = -x;\n\t} else {\n\t\tsign = false;\n\t\tax = x;\n\t}\n\t// |x| < 0.84375\n\tif ( ax < 0.84375 ) {\n\t\tif ( ax < SMALL ) {\n\t\t\treturn 1.0 - x; // raise inexact\n\t\t}\n\t\tz = x * x;\n\t\tr = PPC + ( z*polyvalPP( z ) );\n\t\ts = QQC + ( z*polyvalQQ( z ) );\n\t\ty = r / s;\n\n\t\t// x < 1/4\n\t\tif ( x < 0.25 ) {\n\t\t\treturn 1.0 - ( x + (x*y) );\n\t\t}\n\t\tr = x * y;\n\t\tr += x - 0.5;\n\t\treturn 0.5 - r;\n\t}\n\t// 0.84375 <= |x| < 1.25\n\tif ( ax < 1.25 ) {\n\t\ts = ax - 1.0;\n\t\tp = PAC + ( s*polyvalPA( s ) );\n\t\tq = QAC + ( s*polyvalQA( s ) );\n\t\tif ( sign ) {\n\t\t\treturn 1.0 + ERX + (p/q);\n\t\t}\n\t\treturn 1.0 - ERX - (p/q);\n\t}\n\t// |x| < 28\n\tif ( ax < 28.0 ) {\n\t\ts = 1.0 / (ax*ax);\n\n\t\t// |x| < 1/0.35 ~ 2.857143\n\t\tif ( ax < 2.857142857142857 ) {\n\t\t\tr = RAC + ( s*polyvalRA( s ) );\n\t\t\ts = SAC + ( s*polyvalSA( s ) );\n\t\t}\n\t\t// |x| >= 1/0.35 ~ 2.857143\n\t\telse {\n\t\t\t// x < -6\n\t\t\tif ( x < -6.0 ) {\n\t\t\t\treturn 2.0 - TINY; // raise inexact\n\t\t\t}\n\t\t\tr = RBC + ( s*polyvalRB( s ) );\n\t\t\ts = SBC + ( s*polyvalSB( s ) );\n\t\t}\n\t\tz = setLowWord( ax, 0 ); // pseudo-single (20-bit) precision x\n\t\tr = exp( -(z*z) - 0.5625 ) * exp( ((z-ax)*(z+ax)) + (r/s) );\n\t\tif ( sign ) {\n\t\t\treturn 2.0 - (r/ax);\n\t\t}\n\t\treturn r/ax;\n\t}\n\tif ( sign ) {\n\t\treturn 2.0 - TINY; // raise inexact; ~2\n\t}\n\treturn TINY * TINY; // raise inexact; ~0\n}\n\n\n// EXPORTS //\n\nmodule.exports = erfc;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Evaluate the complementary error function.\n*\n* @module @stdlib/math/base/special/erfc\n*\n* @example\n* var erfc = require( '@stdlib/math/base/special/erfc' );\n*\n* var y = erfc( 2.0 );\n* // returns ~0.0047\n*\n* y = erfc( -1.0 );\n* // returns ~1.8427\n*\n* y = erfc( 0.0 );\n* // returns 1.0\n*\n* y = erfc( Infinity );\n* // returns 0.0\n*\n* y = erfc( -Infinity );\n* // returns 2.0\n*\n* y = erfc( NaN );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Compute the principal square root of a double-precision floating-point number.\n*\n* @type {Function}\n* @param {number} x - input value\n* @returns {number} principal square root\n*\n* @example\n* var v = sqrt( 4.0 );\n* // returns 2.0\n*\n* v = sqrt( 9.0 );\n* // returns 3.0\n*\n* v = sqrt( 0.0 );\n* // returns 0.0\n*\n* v = sqrt( -4.0 );\n* // returns NaN\n*\n* v = sqrt( NaN );\n* // returns NaN\n*/\nvar sqrt = Math.sqrt; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nmodule.exports = sqrt;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the principal square root of a double-precision floating-point number.\n*\n* @module @stdlib/math/base/special/sqrt\n*\n* @example\n* var sqrt = require( '@stdlib/math/base/special/sqrt' );\n*\n* var v = sqrt( 4.0 );\n* // returns 2.0\n*\n* v = sqrt( 9.0 );\n* // returns 3.0\n*\n* v = sqrt( 0.0 );\n* // returns 0.0\n*\n* v = sqrt( -4.0 );\n* // returns NaN\n*\n* v = sqrt( NaN );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar erfc = require( '@stdlib/math/base/special/erfc' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Evaluates the cumulative distribution function (CDF) for a Normal distribution with mean `mu` and standard deviation `sigma` at a value `x`.\n*\n* @param {number} x - input value\n* @param {number} mu - mean\n* @param {NonNegativeNumber} sigma - standard deviation\n* @returns {Probability} evaluated cumulative distribution function\n*\n* @example\n* var y = cdf( 2.0, 0.0, 1.0 );\n* // returns ~0.977\n*\n* @example\n* var y = cdf( -1.0, -1.0, 2.0 );\n* // returns 0.5\n*\n* @example\n* var y = cdf( -1.0, 4.0, 2.0 );\n* // returns ~0.006\n*\n* @example\n* var y = cdf( NaN, 0.0, 1.0 );\n* // returns NaN\n*\n* @example\n* var y = cdf( 0.0, NaN, 1.0 );\n* // returns NaN\n*\n* @example\n* var y = cdf( 0.0, 0.0, NaN );\n* // returns NaN\n*\n* @example\n* // Negative standard deviation:\n* var y = cdf( 2.0, 0.0, -1.0 );\n* // returns NaN\n*/\nfunction cdf( x, mu, sigma ) {\n\tvar denom;\n\tvar xc;\n\tif (\n\t\tisnan( x ) ||\n\t\tisnan( mu ) ||\n\t\tisnan( sigma ) ||\n\t\tsigma < 0.0\n\t) {\n\t\treturn NaN;\n\t}\n\tif ( sigma === 0.0 ) {\n\t\treturn (x < mu) ? 0.0 : 1.0;\n\t}\n\tdenom = sigma * sqrt( 2.0 );\n\txc = x - mu;\n\treturn 0.5 * erfc( -xc/denom );\n}\n\n\n// EXPORTS //\n\nmodule.exports = cdf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Evaluates the cumulative distribution function (CDF) for a degenerate distribution with mean value `mu`.\n*\n* @param {number} x - input value\n* @param {number} mu - constant value of distribution\n* @returns {Probability} evaluated cumulative distribution function\n*\n* @example\n* var y = cdf( 2.0, 3.0 );\n* // returns 0.0\n*\n* @example\n* var y = cdf( 4.0, 3.0 );\n* // returns 1.0\n*\n* @example\n* var y = cdf( 3.0, 3.0 );\n* // returns 1.0\n*\n* @example\n* var y = cdf( NaN, 0.0 );\n* // returns NaN\n*\n* @example\n* var y = cdf( 0.0, NaN );\n* // returns NaN\n*/\nfunction cdf( x, mu ) {\n\tif ( isnan( x ) || isnan( mu ) ) {\n\t\treturn NaN;\n\t}\n\treturn (x < mu) ? 0.0 : 1.0;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cdf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Returns a function for evaluating the cumulative distribution function (CDF) of a degenerate distribution centered at a provided mean value.\n*\n* @param {number} mu - constant value of distribution\n* @returns {Function} function to evaluate the cumulative distribution function\n*\n* @example\n* var cdf = factory( 5.0 );\n*\n* var y = cdf( 3.0 );\n* // returns 0.0\n*\n* y = cdf( 6.0 );\n* // returns 1.0\n*\n* y = cdf( NaN );\n* // returns NaN\n*/\nfunction factory( mu ) {\n\tif ( isnan( mu ) ) {\n\t\treturn constantFunction( NaN );\n\t}\n\treturn cdf;\n\n\t/**\n\t* Evaluates the cumulative distribution function (CDF) of a degenerate distribution.\n\t*\n\t* @private\n\t* @param {number} x - input value\n\t* @returns {Probability} evaluated cumulative distribution function\n\t*\n\t* @example\n\t* var y = cdf( 10.0 );\n\t* // returns <number>\n\t*/\n\tfunction cdf( x ) {\n\t\tif ( isnan( x ) ) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn (x < mu) ? 0.0 : 1.0;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Degenerate distribution cumulative distribution function (CDF).\n*\n* @module @stdlib/stats/base/dists/degenerate/cdf\n*\n* @example\n* var cdf = require( '@stdlib/stats/base/dists/degenerate/cdf' );\n*\n* var y = cdf( 2.0, 5.0 );\n* // returns 0.0\n*\n* @example\n* var factory = require( '@stdlib/stats/base/dists/degenerate/cdf' ).factory;\n*\n* var cdf = factory( 5.0 );\n*\n* var y = cdf( 3.0 );\n* // returns 0.0\n*\n* y = cdf( 6.0 );\n* // returns 1.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar degenerate = require( './../../../../../base/dists/degenerate/cdf' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar erfc = require( '@stdlib/math/base/special/erfc' );\n\n\n// MAIN //\n\n/**\n* Returns a function for evaluating the cumulative distribution function (CDF) for a Normal distribution.\n*\n* @param {number} mu - mean\n* @param {NonNegativeNumber} sigma - standard deviation\n* @returns {Function} function to evaluate the cumulative distribution function\n*\n* @example\n* var cdf = factory( 10.0, 2.0 );\n* var y = cdf( 10.0 );\n* // returns 0.5\n*\n* y = cdf( 12.0 );\n* // returns ~0.841\n*/\nfunction factory( mu, sigma ) {\n\tvar denom;\n\tif (\n\t\tisnan( mu ) ||\n\t\tisnan( sigma ) ||\n\t\tsigma < 0.0\n\t) {\n\t\treturn constantFunction( NaN );\n\t}\n\tif ( sigma === 0.0 ) {\n\t\treturn degenerate( mu );\n\t}\n\tdenom = sigma * sqrt( 2.0 );\n\treturn cdf;\n\n\t/**\n\t* Evaluates the cumulative distribution function (CDF) for a Normal distribution.\n\t*\n\t* @private\n\t* @param {number} x - input value\n\t* @returns {Probability} evaluated CDF\n\t*\n\t* @example\n\t* var y = cdf( 2.0 );\n\t* // returns <number>\n\t*/\n\tfunction cdf( x ) {\n\t\tvar xc;\n\t\tif ( isnan( x ) ) {\n\t\t\treturn NaN;\n\t\t}\n\t\txc = x - mu;\n\t\treturn 0.5 * erfc( -xc / denom );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Normal distribution cumulative distribution function (CDF).\n*\n* @module @stdlib/stats/base/dists/normal/cdf\n*\n* @example\n* var cdf = require( '@stdlib/stats/base/dists/normal/cdf' );\n*\n* var y = cdf( 2.0, 0.0, 1.0 );\n* // returns ~0.977\n*\n* var myCDF = cdf.factory( 10.0, 2.0 );\n* y = myCDF( 10.0 );\n* // returns 0.5\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n","// Statistical helpers matching the scipy / statsmodels functions used by SpatialQuery,\n// built on @stdlib/stats where it provides the functionality.\nimport padjust from '@stdlib/stats/padjust/lib/index.js';\nimport ranks from '@stdlib/stats/ranks/lib/index.js';\nimport stridedMean from '@stdlib/stats/strided/mean/lib/index.js';\nimport mediansorted from '@stdlib/stats/strided/mediansorted/lib/index.js';\nimport hypergeometricCdf from '@stdlib/stats/base/dists/hypergeometric/cdf/lib/index.js';\nimport hypergeometricMean from '@stdlib/stats/base/dists/hypergeometric/mean/lib/index.js';\nimport normalCdf from '@stdlib/stats/base/dists/normal/cdf/lib/index.js';\n\n// Python's built-in round() uses round-half-to-even (\"banker's rounding\"),\n// whereas Math.round rounds half up.\nexport function roundHalfEven(x: number): number {\n const r = Math.round(x);\n return (Math.abs(x % 1) === 0.5 && r % 2 !== 0) ? r - 1 : r;\n}\n\n// Hypergeometric distribution, using the same parameterization as scipy.stats.hypergeom:\n// M = total number of objects,\n// n = total number of \"success\" objects,\n// N = number of objects drawn without replacement.\n// (In @stdlib, these are N, K, and n, respectively.)\n// Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.hypergeom.html\nexport function hypergeom(M: number, n: number, N: number) {\n return {\n mean(): number {\n return hypergeometricMean(M, n, N);\n },\n // Survival function: P(X > k).\n // Computed as the CDF of the number of failures drawn, N - X ~ Hypergeometric(M, M - n, N):\n // P(X > k) = P(N - X <= N - k - 1). Unlike 1 - CDF, this retains precision for very small p-values.\n sf(k: number): number {\n return hypergeometricCdf(N - Math.floor(k) - 1, M, M - n, N);\n },\n };\n}\n\n// Survival function of the standard normal distribution, P(Z > z).\nexport function normSf(z: number): number {\n return normalCdf(-z, 0, 1);\n}\n\nexport function mean(values: number[]): number {\n return stridedMean(values.length, values, 1);\n}\n\nexport function median(values: number[]): number {\n const sorted = values.toSorted((a, b) => a - b);\n return mediansorted(sorted.length, sorted, 1);\n}\n\n// Ranks of the values (1-based), with ties assigned their average rank\n// (equivalent to scipy.stats.rankdata(method='average') and pandas rank()).\nexport function rankAverage(values: number[]): number[] {\n return ranks(values, { method: 'average' });\n}\n\n// Number of arrangements yielding each value of the Mann-Whitney U statistic (0..n1*n2),\n// for sample sizes n1 and n2. These are the coefficients of the Gaussian binomial\n// coefficient [n1+n2 choose n1]_q = prod_{i=1..n1} (1 - q^(n2+i)) / (1 - q^i).\nfunction mwuFrequencies(n1: number, n2: number): Float64Array {\n const maxU = n1 * n2;\n const freqs = new Float64Array(maxU + 1);\n freqs[0] = 1;\n for (let i = 1; i <= n1; i++) {\n // Multiply by 1 / (1 - q^i) = 1 + q^i + q^2i + ...\n for (let u = i; u <= maxU; u++) freqs[u] += freqs[u - i];\n // Multiply by (1 - q^(n2+i)).\n for (let u = maxU; u >= n2 + i; u--) freqs[u] -= freqs[u - n2 - i];\n }\n return freqs;\n}\n\n// Two-sided Mann-Whitney U test (not available in @stdlib/stats).\n// Equivalent to scipy.stats.mannwhitneyu(x, y, alternative='two-sided', method='auto'):\n// the exact null distribution is used when either sample has at most 8 values and there are no ties,\n// otherwise the normal approximation with tie and continuity corrections.\n// Reference: https://github.com/scipy/scipy/blob/main/scipy/stats/_mannwhitneyu.py\nexport function mannWhitneyU(x: number[], y: number[]): { statistic: number, pValue: number } {\n const n1 = x.length;\n const n2 = y.length;\n const xy = [...x, ...y];\n const r = rankAverage(xy);\n let r1 = 0;\n for (let i = 0; i < n1; i++) r1 += r[i];\n const u1 = r1 - n1 * (n1 + 1) / 2;\n const u2 = n1 * n2 - u1;\n\n // Number of values in each group of tied values.\n const valueCounts = new Map<number, number>();\n for (const v of xy) valueCounts.set(v, (valueCounts.get(v) ?? 0) + 1);\n const tieCounts = Array.from(valueCounts.values());\n const hasTies = tieCounts.some(t => t > 1);\n\n let pValue: number;\n if ((n1 <= 8 || n2 <= 8) && !hasTies) {\n // Exact: p = 2 * P(U >= max(U1, U2)) = 2 * P(U <= min(U1, U2)) by symmetry.\n const uMin = Math.round(Math.min(u1, u2));\n const freqs = mwuFrequencies(Math.min(n1, n2), Math.max(n1, n2));\n let count = 0;\n let total = 0;\n freqs.forEach((f, u) => {\n total += f;\n if (u <= uMin) count += f;\n });\n pValue = 2 * count / total;\n } else {\n const n = n1 + n2;\n const mu = n1 * n2 / 2;\n const tieTerm = tieCounts.reduce((acc, t) => acc + t ** 3 - t, 0);\n const s = Math.sqrt(n1 * n2 / 12 * ((n + 1) - tieTerm / (n * (n - 1))));\n // Continuity correction, in the direction that increases the p-value.\n const numerator = u1 - mu - 0.5 * Math.sign(u1 - mu);\n const z = numerator / s;\n pValue = 2 * normSf(Math.abs(z));\n }\n // NaN (e.g., when all values are tied) is propagated, as in scipy.\n return { statistic: u1, pValue: Math.min(Math.max(pValue, 0), 1) };\n}\n\n// Benjamini-Hochberg FDR correction.\n// Equivalent to statsmodels.stats.multitest.fdrcorrection(pvals, alpha, method='poscorr').\n// Returns the rejection decisions and adjusted p-values, in the original order.\nexport function fdrCorrection(pvals: number[], alpha = 0.05) {\n const adjusted = padjust(pvals, 'bh');\n const rejected = adjusted.map(p => p <= alpha);\n return { rejected, adjusted };\n}\n\ntype FdrCorrectable = { pValue: number, adjPValue?: number, ifSignificant?: boolean };\n\n// Determine significance across all tested motifs, applying FDR correction\n// when more than one motif was tested.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/0570c54bd6e046466e05c6b800d6701a7ab15c4a/SpatialQuery/spatial_utils.py#L134\nexport function applyFdrCorrection<T extends FdrCorrectable>(results: T[], alpha = 0.05): T[] {\n if (results.length === 0) {\n return [];\n }\n if (results.length === 1) {\n // Single-motif case: significance comes straight from the raw p-value, with no adjusted p-value.\n const { adjPValue: _, ...result } = results[0];\n return [{ ...result, ifSignificant: result.pValue < alpha } as T];\n }\n const { rejected, adjusted } = fdrCorrection(results.map(r => r.pValue), alpha);\n return results\n .map((r, i) => ({ ...r, adjPValue: adjusted[i], ifSignificant: rejected[i] }))\n .toSorted((a, b) => a.adjPValue - b.adjPValue);\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar FPNode = /** @class */ (function () {\n /**\n * FPNode composes an FPTree and represents a given item a item-prefix subtree.\n * It keeps track of its parent if it has any, and lists his children FPNodes.\n *\n * @param {T} item The item it represents.\n * @param {FPNode<T>} parent His parent, if it has any.\n */\n function FPNode(item, parent) {\n if (item === void 0) { item = null; }\n if (parent === void 0) { parent = null; }\n this.item = item;\n this.parent = parent;\n /**\n * Support of the FPNode. (a.k.a. \"count\" as defined by Han).\n */\n this.support = 1;\n /**\n * nextSameItemNode (a.k.a. \"Node-link\" as defined by Han):\n * Links to the next node in the FP-tree carrying the same\n * item, or null if there is none.\n */\n this.nextSameItemNode = null;\n /**\n * PUBLIC READONLY. Children of the FPNode in an array. Empty array if there is none.\n */\n this._children = [];\n }\n Object.defineProperty(FPNode.prototype, \"children\", {\n get: function () {\n return this._children;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Adds a given item to its current children FPNodes.\n * If no child yet represents the given item, it creates a new node.\n *\n * @param {T} item The item to add as a children.\n * @param {FPNode<T>} onNewChild Callback function to call if a child is actually created for the first time. It helps keeping track of Node-Links\n * @return {[type]} The FPNode representing the given item.\n */\n FPNode.prototype.upsertChild = function (item, onNewChild, support) {\n if (support === void 0) { support = 1; }\n var child = this.getChild(item);\n // If no child exists, creating a new node.\n if (!child) {\n child = new FPNode(item, this);\n child.support = support;\n this._children.push(child);\n // Calls callback function if any.\n if (onNewChild)\n onNewChild(child);\n }\n // Else, increment the support of the child.\n else\n child.support += support;\n return child;\n };\n /**\n * Returns the child FPNode representing a given item, if any. Returns undefined if it does not exist.\n *\n * @param {T} item The item.\n * @return {FPNode<T>} The FPNode you expect, or undefined.\n */\n FPNode.prototype.getChild = function (item) {\n return this._children.find(function (child) { return child.item == item; });\n };\n return FPNode;\n}());\nexports.FPNode = FPNode;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar fpnode_1 = require(\"./fpnode\");\nvar FPTree = /** @class */ (function () {\n /**\n * FPTree is a frequent-pattern tree implementation. It consists in a compact\n * data structure that stores quantitative information about frequent patterns in\n * a set of transactions.\n *\n * @param {ItemsCount} supports The support count of each unique items to be inserted the FPTree.\n * @param {number} support The minimum support of each frequent itemset we want to mine.\n */\n function FPTree(supports, _support) {\n this.supports = supports;\n this._support = _support;\n /**\n * Whether or not the tree has been built\n */\n this._isInit = false;\n /**\n * Root node of the FPTree\n */\n this.root = new fpnode_1.FPNode();\n /**\n * All first nodes (of different items) inserted in the FPTree (Heads of node-links).\n */\n this._firstInserted = {};\n /**\n * All last nodes (of different items) inserted in the FPTree (Foots of node-links).\n */\n this._lastInserted = {};\n }\n Object.defineProperty(FPTree.prototype, \"headers\", {\n get: function () {\n return this._headers;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Builds the tree from a set of transactions.\n *\n * @param {T[][]} transactions The unsorted transactions.\n * @return {FPTree<T>} Method chaining.\n */\n FPTree.prototype.fromTransactions = function (transactions) {\n var _this = this;\n if (this._isInit)\n throw new Error('Error building the FPTree');\n // Sorting the items of each transaction by their support, descendingly.\n // Items not meeting the minimum support are pruned.\n transactions.forEach(function (transaction) {\n var items = transaction\n // Pruning.\n .filter(function (item) { return _this.supports[JSON.stringify(item)] >= _this._support; })\n // Sorting.\n .sort(function (a, b) {\n var res = _this.supports[JSON.stringify(b)] - _this.supports[JSON.stringify(a)];\n if (res == 0)\n return JSON.stringify(b).localeCompare(JSON.stringify(a));\n return res;\n });\n // Pushing formatted transaction to the tree.\n _this._addItems(items);\n });\n // Generating headers.\n this._headers = this._getHeaderList();\n this._isInit = true;\n return this;\n };\n /**\n * Builds the tree from a set of prefix paths.\n *\n * @param {IPrefixPath<T>[]} prefixPaths The prefix paths.\n * @return {FPTree<T>} Method chaining.\n */\n FPTree.prototype.fromPrefixPaths = function (prefixPaths) {\n var _this = this;\n if (this._isInit)\n throw new Error('Error building the FPTree');\n // Sorting the items of each transaction by their support, descendingly.\n // Items not meeting the minimum support are pruned.\n prefixPaths.forEach(function (prefixPath) {\n var items = prefixPath.path\n // Pruning.\n .filter(function (item) { return _this.supports[JSON.stringify(item)] >= _this._support; })\n // Sorting.\n .sort(function (a, b) {\n var res = _this.supports[JSON.stringify(b)] - _this.supports[JSON.stringify(a)];\n if (res == 0)\n return JSON.stringify(b).localeCompare(JSON.stringify(a));\n return res;\n });\n // Pushing each prefix path to the tree.\n _this._addItems(items, prefixPath.support);\n });\n // Generating headers.\n this._headers = this._getHeaderList();\n this._isInit = true;\n return this;\n };\n /**\n * Returns a new conditional FPTree from a given item.\n * If item is not included in the current tree, or if the resulting tree is empty, returns null.\n *\n * @param {T} item The conditional item.\n * @return {FPTree<T>} The result you expect.\n */\n FPTree.prototype.getConditionalFPTree = function (item) {\n var start = this._firstInserted[JSON.stringify(item)];\n // Trivial pre-condition.\n if (!start)\n return null;\n var s = this.supports[JSON.stringify(item)];\n // In order to make the conditional FPTree of the given item, we need both the prefix\n // paths of the item, as well as the support of each item which composes this sub-tree.\n var conditionalTreeSupports = {};\n // Getting all prefixPaths of the given item. On pushing a new item to a prefix path, a callback\n // function is called, allowing us to update the item support.\n var prefixPaths = this._getPrefixPaths(start, s, function (i, count) {\n conditionalTreeSupports[JSON.stringify(i)] = (conditionalTreeSupports[JSON.stringify(i)] || 0) + count;\n });\n // FP-Tree is built from the conditional tree supports and the processed prefix paths.\n var ret = new FPTree(conditionalTreeSupports, this._support).fromPrefixPaths(prefixPaths);\n // If tree is not empty, return the tree.\n if (ret.root.children.length)\n return ret;\n // Else return null.\n return null;\n };\n /**\n * Returns all the prefix paths of a given item in the tree.\n * Returns an empty array if item cannot be found in the current tree.\n *\n * @param {T} item The item you want the prefix paths.\n * @return {IPrefixPath<T>} The result you expect.\n */\n FPTree.prototype.getPrefixPaths = function (item) {\n if (!this._isInit)\n throw new Error('Error building the FPTree');\n var start = this._firstInserted[JSON.stringify(item)];\n if (!start)\n return [];\n return this._getPrefixPaths(start, start.support);\n };\n /**\n * Return the prefix path of a given node.\n * Callback functions allows to keep track of items added to the prefix path.\n *\n * @param {FPNode<T>} node The node you want the prefix path.\n * @param {Function} onPushingNewItem Callback function to keep track of items added to the prefix path.\n * @return {[type]} The result you expect.\n */\n FPTree.prototype.getPrefixPath = function (node, onPushingNewItem) {\n if (!this._isInit)\n throw new Error('Error building the FPTree');\n var path = this._getPrefixPath(node, node.support, onPushingNewItem);\n if (path.length === 0)\n return;\n return {\n support: node.support,\n path: path\n };\n };\n /**\n * Returns whether or not this FPTree is single pathed.\n *\n * @return {boolean} The result you expect.\n */\n FPTree.prototype.isSinglePath = function () {\n if (!this._isInit)\n throw new Error('Error building the FPTree');\n if (!this.getSinglePath())\n return false;\n return true;\n };\n /**\n * Returns the single path of the tree, if it is one. Else, it returns null.\n *\n * @return {FPNode<T>[]} The result you expect.\n */\n FPTree.prototype.getSinglePath = function () {\n if (!this._isInit)\n throw new Error('Error building the FPTree');\n return this._getSinglePath(this.root);\n };\n /**\n * Inserts a sorted transaction to the FPTree.\n *\n * @param {T[]} items The set of sorted items you want to add (Either a transaction of a prefix part).\n * @param {number} prefixSupport Optional: The base support to associate with the set of items.\n */\n FPTree.prototype._addItems = function (items, prefixSupport) {\n var _this = this;\n if (prefixSupport === void 0) { prefixSupport = 1; }\n // For each transaction, we start up from the root element.\n var current = this.root;\n // Keep in mind items are sorted by their support descendingly.\n items.forEach(function (item) {\n // If current item is a child of current node, updating its support and returning the child.\n // Else creating a new item element and returing this new element.\n current = current.upsertChild(item, function (child) {\n var itemKey = JSON.stringify(item);\n // Keeping track of first and last inserted elements of this type on Node creation.\n _this._updateLastInserted(itemKey, child);\n _this._updateFirstInserted(itemKey, child);\n }, prefixSupport);\n });\n };\n /**\n * RECURSIVE CALL - Returns the prefix path of each node of the same type until there is no node-link anymore.\n *\n * @param {FPNode<T>} node The node of which you want the prefix path.\n * @param {number} count The support of the stating node (which is node).\n * @param {Function} onPushingNewItem Callback function to keep track of items added to the prefix path.\n * @return {IPrefixPath<T>[]} The result you expect.\n */\n FPTree.prototype._getPrefixPaths = function (node, count, onPushingNewItem, prefixPaths) {\n if (prefixPaths === void 0) { prefixPaths = []; }\n var prefixPath = this.getPrefixPath(node, onPushingNewItem);\n if (prefixPath)\n prefixPaths.push(prefixPath);\n if (!node.nextSameItemNode)\n return prefixPaths;\n return this._getPrefixPaths(node.nextSameItemNode, count, onPushingNewItem, prefixPaths);\n };\n /**\n * RECURSIVE CALL - Returns the prefix path (as a set of items) of the tree from a given node.\n *\n * @param {FPNode<T>} node The node to start the prefix.\n * @param {number} count The support of the stating node (which is node).\n * @param {Function} onPushingNewItem Callback function to keep track of items added to the prefix path.\n * @return {T[]} The result you expect.\n */\n FPTree.prototype._getPrefixPath = function (node, count, onPushingNewItem) {\n if (node.parent && node.parent.parent) {\n if (onPushingNewItem)\n onPushingNewItem(node.parent.item, count);\n return [node.parent.item].concat(this._getPrefixPath(node.parent, count, onPushingNewItem));\n }\n return [];\n };\n /**\n * RECURSIVE CALL - Returns the single path of the tree, if it is one. Else, it returns null.\n *\n * @param {FPNode<T>} node The node to test for single path.\n * @param {FPNode<T>[]} currentPath The current saved path.\n * @return {FPNode<T>[]} The path to return.\n */\n FPTree.prototype._getSinglePath = function (node, currentPath) {\n if (currentPath === void 0) { currentPath = []; }\n // If current node is a tree leaf, that's a win.\n if (node.children.length == 0)\n return currentPath;\n // If it has more than child, tree has more than one single path.\n if (node.children.length > 1)\n return null;\n // Else test next child for single path.\n currentPath.push(node.children[0]);\n return this._getSinglePath(node.children[0], currentPath);\n };\n /**\n * Keep track of the each last inserted item of different types.\n *\n * @param {string} key The key as stringified item.\n * @param {FPNode<T>} child The child FPNode it represtents.\n */\n FPTree.prototype._updateLastInserted = function (key, child) {\n var last = this._lastInserted[key];\n if (last)\n last.nextSameItemNode = child;\n this._lastInserted[key] = child;\n };\n /**\n * Keep track of the first item of different type we inserted in the FPTree.\n *\n * @param {string} key The key as stringified item.\n * @param {FPNode<T>} child The child FPNode it represtents.\n */\n FPTree.prototype._updateFirstInserted = function (key, child) {\n var first = this._firstInserted[key];\n if (!first)\n this._firstInserted[key] = child;\n };\n /**\n * Returns the tree's headers as a list, sorted ASCENDINGLY by their support.\n *\n * @param {ItemsCount} supports The support count of each items.\n * @return {T[]} [description]\n */\n FPTree.prototype._getHeaderList = function () {\n var _this = this;\n return Object.keys(this._firstInserted)\n .sort(function (a, b) { return _this.supports[a] - _this.supports[b]; })\n .map(function (key) { return JSON.parse(key); });\n };\n return FPTree;\n}());\nexports.FPTree = FPTree;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar events_1 = require(\"events\");\nvar fptree_1 = require(\"./fptree\");\nvar FPGrowth = /** @class */ (function (_super) {\n __extends(FPGrowth, _super);\n /**\n * FPGrowth is an algorithm for frequent item set mining and association rule\n * earning over transactional databases.\n * It was proposed by Han et al. (2000). FPGrowth is a very fast and memory efficient algorithm. It uses a special internal structure called an FP-Tree.\n *\n * @param {number} _support 0 < _support < 1. Minimum support of itemsets to mine.\n */\n function FPGrowth(_support /*, private _confidence: number*/) {\n var _this = _super.call(this) || this;\n _this._support = _support;\n /**\n * Output of the algorithm: The mined frequent itemsets.\n */\n _this._itemsets = [];\n return _this;\n }\n /**\n * Executes the FPGrowth Algorithm.\n * You can keep track of frequent itemsets as they are mined by listening to the 'data' event on the FPGrowth object.\n * All mined itemsets, as well as basic execution stats, are returned at the end of the execution through a callback function or a Promise.\n *\n * @param {T[][]} transactions The transactions from which you want to mine itemsets.\n * @param {IAprioriResults<T>} cb Callback function returning the results.\n * @return {Promise<IAprioriResults<T>>} Promise returning the results.\n */\n FPGrowth.prototype.exec = function (transactions, cb) {\n var _this = this;\n this._transactions = transactions;\n // Relative support.\n this._support = Math.ceil(this._support * transactions.length);\n // First scan to determine the occurence of each unique item.\n var supports = this._getDistinctItemsCount(this._transactions);\n return new Promise(function (resolve, reject) {\n // Building the FP-Tree...\n var tree = new fptree_1.FPTree(supports, _this._support).fromTransactions(_this._transactions);\n // Running the algorithm on the main tree.\n // All the frequent itemsets are returned at the end of the execution.\n var result = _this._fpGrowth(tree, _this._transactions.length);\n if (cb)\n cb(result);\n resolve(result);\n });\n };\n /**\n * RECURSIVE CALL - Returns mined itemset from each conditional sub-FPTree of the given FPtree.\n *\n * @param {FPTree<T>} tree The FPTree you want to mine.\n * @param {number} prefixSupport The support of the FPTree's current prefix.\n * @param {T[]} prefix The current prefix associated with the FPTree.\n * @return {Itemset<T>} The mined itemsets.\n */\n FPGrowth.prototype._fpGrowth = function (tree, prefixSupport, prefix) {\n // Test whether or not the FP-Tree is single path.\n // If it is, we can short-cut the mining process pretty efficiently.\n // TODO: let singlePath: FPNode<T>[] = tree.getSinglePath();\n // TODO: if(singlePath) return this._handleSinglePath(singlePath, prefix);\n var _this = this;\n if (prefix === void 0) { prefix = []; }\n // For each header, ordered ascendingly by their support, determining the prefix paths.\n // These prefix paths represent new transactions to mine in a new FPTree.\n // If no prefix path can be mined, the algorithm stops.\n return tree.headers.reduce(function (itemsets, item) {\n var support = Math.min(tree.supports[JSON.stringify(item)], prefixSupport);\n // Array copy.\n var currentPrefix = prefix.slice(0);\n currentPrefix.push(item);\n // Prefix is a mined itemset.\n itemsets.push(_this._getFrequentItemset(currentPrefix, support));\n // Method below generates the prefix paths of the current item, as well as the support of\n // each item composing the prefix paths, and returns a new conditional FPTree if one can be created.\n var childTree = tree.getConditionalFPTree(item);\n // If a conditional tree can be mined... mine it recursively.\n if (childTree)\n return itemsets.concat(_this._fpGrowth(childTree, support, currentPrefix));\n return itemsets;\n }, []);\n };\n /**\n * Handles the mining of frequent itemsets over a single path tree.\n *\n * @param {FPNode<T>[]} singlePath The given single path.\n * @param {T[]} prefix The prefix associated with the path.\n * @return {Itemset<T>} The mined itemsets.\n */\n FPGrowth.prototype._handleSinglePath = function (singlePath, prefix) {\n // TODO\n return [];\n };\n /**\n * Returns and emit through an event a formatted mined frequent itemset.\n *\n * @param {T[]} itemset The items of the frequent itemset.\n * @param {number} support The support of the itemset.\n * @return {Itemset<T>} The formatted itemset.\n */\n FPGrowth.prototype._getFrequentItemset = function (itemset, support) {\n var ret = {\n items: itemset,\n support: support\n };\n this.emit('data', ret);\n return ret;\n };\n /**\n * Returns the occurence of single items in a given set of transactions.\n *\n * @param {T[][]} transactions The set of transaction.\n * @return {ItemsCount} Count of items (stringified items as keys).\n */\n FPGrowth.prototype._getDistinctItemsCount = function (transactions) {\n return transactions.reduce(function (count, arr) {\n return arr.reduce(function (count, item) {\n count[JSON.stringify(item)] = (count[JSON.stringify(item)] || 0) + 1;\n return count;\n }, count);\n }, {});\n };\n return FPGrowth;\n}(events_1.EventEmitter));\nexports.FPGrowth = FPGrowth;\n","import { FPGrowth } from 'node-fpgrowth';\n\nexport type FrequentPattern = {\n // Sorted list of cell types in the frequent pattern.\n itemsets: string[],\n // Fraction of transactions containing the pattern.\n support: number,\n // Obs IDs of the cells belonging to the pattern (only if returnCellIds is true).\n neighborIds?: string[],\n};\n\n// Keep only the maximal patterns: those that are not a proper subset of another pattern.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_utils.py#L68\nexport function findMaximalPatterns<T extends { itemsets: string[] }>(patterns: T[]): T[] {\n const sets = patterns.map(p => new Set(p.itemsets));\n return patterns.filter((p, i) => !sets.some((other, j) => (\n j !== i\n && other.size > sets[i].size\n && p.itemsets.every(item => other.has(item))\n )));\n}\n\n// Mine frequent patterns from transactions of cell type labels.\n// Equivalent to the MultiLabelBinarizer + mlxtend fpgrowth + find_maximal_patterns\n// steps of build_fptree_dist / build_fptree_knn.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_utils.py#L454\nexport async function mineFrequentPatterns(\n transactions: string[][],\n minSupport: number,\n ifMax: boolean,\n): Promise<FrequentPattern[]> {\n if (transactions.length === 0) {\n return [];\n }\n // Transactions are binarized in Python, so duplicate cell types are collapsed.\n const uniqueTransactions = transactions.map(t => Array.from(new Set(t)));\n\n const fpgrowth = new FPGrowth<string>(minSupport);\n const itemsets = await fpgrowth.exec(uniqueTransactions);\n\n // node-fpgrowth reports support as a count; mlxtend reports a fraction.\n const byKey = new Map<string, FrequentPattern>();\n for (const { items, support } of itemsets) {\n const sorted = items.toSorted();\n byKey.set(JSON.stringify(sorted), { itemsets: sorted, support: support / transactions.length });\n }\n let patterns = Array.from(byKey.values());\n\n if (ifMax) {\n patterns = findMaximalPatterns(patterns);\n }\n // Sort by descending support, breaking ties by itemsets for a deterministic order.\n return patterns.toSorted((a, b) => (\n b.support - a.support || JSON.stringify(a.itemsets).localeCompare(JSON.stringify(b.itemsets))\n ));\n}\n","import { applyFdrCorrection } from './stats.js';\nimport { findMaximalPatterns, type FrequentPattern } from './fpgrowth.js';\n\n// Nested motif testing.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_utils.py#L97\n//\n// The maximal-pattern reduction happens BEFORE the hypergeometric test, so a sub-pattern\n// of a non-significant maximal pattern never enters the tested set at all. When a maximal\n// pattern is diluted by one abundant, unrelated cell type, the whole pattern fails the\n// test and the informative core inside it is never examined.\n//\n// Nested testing walks into those patterns:\n//\n// 1. Test every maximal pattern, exactly as the maximal mode does.\n// 2. A maximal pattern that IS significant is a finding in its own right -- stop, and do\n// not test its sub-patterns.\n// 3. A maximal pattern that is NOT significant is expanded into its immediate (k-1)\n// sub-patterns, which are then tested.\n// 4. Descent continues only along branches that stay non-significant. A branch ends when\n// it becomes significant or reaches length 1.\n// 5. A sub-pattern reachable from several parents is tested once.\n// 6. Multiple-testing correction is applied over every pattern actually tested.\n// 7. A child whose support equals its parent's marks the same neighborhoods as the\n// parent, so it carries no extra information and is not reported.\n\nconst NESTED_SUPPORT_TOL = 1e-9;\nconst NESTED_MAX_TESTED_PATTERNS = 5000;\nconst NESTED_MAX_EXPANSION_FACTOR = 50.0;\n\ntype TestedMotif = { motifs: string[], pValue: number, adjPValue?: number, ifSignificant?: boolean };\n\n// Canonical motif key: the sorted motif.\nconst canonicalKey = (motif: string[]) => JSON.stringify(motif.toSorted());\n\ntype NestedMotifDescentParams<T> = {\n // Runs the hypergeometric test plus FDR correction over exactly the given motifs.\n // The per-motif statistics must not depend on which other motifs were in the same call.\n testMotifs: (motifs: string[][]) => Promise<T[]>,\n // Every frequent pattern (ifMax=false), used to find the maximal patterns and,\n // via their supports, the redundant sub-patterns (rule 7).\n frequentPatterns: FrequentPattern[],\n // A child is dropped when |support(child) - support(parent)| <= supportTol.\n supportTol?: number,\n // Guard rails: descent stops early rather than letting the tested set explode.\n maxTestedPatterns?: number,\n maxExpansionFactor?: number,\n};\n\n// Run the nested descent and return the corrected results over everything tested.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_utils.py#L161\nexport async function nestedMotifDescent<T extends TestedMotif>(params: NestedMotifDescentParams<T>): Promise<T[]> {\n const {\n testMotifs,\n frequentPatterns,\n supportTol = NESTED_SUPPORT_TOL,\n maxTestedPatterns = NESTED_MAX_TESTED_PATTERNS,\n maxExpansionFactor = NESTED_MAX_EXPANSION_FACTOR,\n } = params;\n if (frequentPatterns.length === 0) {\n return [];\n }\n const supportOf = new Map(frequentPatterns.map(p => [canonicalKey(p.itemsets), p.support]));\n const maximal = findMaximalPatterns(frequentPatterns).map(p => p.itemsets.toSorted());\n\n // Level 0 is the maximal patterns; gating them decides where the descent starts.\n const gateRes = maximal.length > 0 ? await testMotifs(maximal) : [];\n if (gateRes.length === 0) {\n return [];\n }\n\n const significance = (results: T[]) => new Map(results.map(r => [canonicalKey(r.motifs), Boolean(r.ifSignificant)]));\n const gateSig = significance(gateRes);\n\n // `tested` records every pattern the descent touches, significant or not: correction\n // in rule 6 must cover them all. Insertion order keeps the final results reproducible.\n const tested = new Set(maximal.map(canonicalKey));\n const parentOf = new Map<string, string>();\n const levelTables: T[][] = [gateRes];\n let frontier = maximal.filter(m => !gateSig.get(canonicalKey(m)));\n\n while (frontier.length > 0) {\n const children: string[][] = [];\n for (const parent of frontier) {\n if (parent.length <= 1) continue;\n // Immediate sub-patterns, in the order of itertools.combinations(parent, len(parent) - 1).\n for (let drop = parent.length - 1; drop >= 0; drop--) {\n const child = parent.filter((_, n) => n !== drop);\n const childKey = canonicalKey(child);\n if (tested.has(childKey)) {\n // Reachable from an earlier parent already: test it once, and keep the\n // shallowest parent, which breadth-first order guarantees is this one.\n continue;\n }\n tested.add(childKey);\n parentOf.set(childKey, canonicalKey(parent));\n children.push(child);\n }\n }\n if (children.length === 0) break;\n\n if (tested.size > maxTestedPatterns || tested.size > maxExpansionFactor * Math.max(maximal.length, 1)) {\n console.warn(\n `Nested descent stopped early at ${tested.size} tested patterns `\n + `(limits: maxTestedPatterns=${maxTestedPatterns}, `\n + `maxExpansionFactor=${maxExpansionFactor} x ${maximal.length} maximal patterns). `\n + `Reported results cover the patterns reached so far.`,\n );\n break;\n }\n\n const levelRes = await testMotifs(children);\n levelTables.push(levelRes);\n const levelSig = significance(levelRes);\n frontier = children.filter(c => !levelSig.get(canonicalKey(c)));\n }\n\n // Every field except the FDR ones depends only on the motif and the data, so the\n // results computed level by level are reused; only the correction is redone over the union.\n const seen = new Set<string>();\n const combined = levelTables.flat().filter((r) => {\n const key = canonicalKey(r.motifs);\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n\n // Rule 7: a child marking the same neighborhoods as its parent adds nothing. It stays\n // in the correction -- it was tested -- but is not reported.\n const redundant = new Set<string>();\n for (const [child, parent] of parentOf) {\n const supportChild = supportOf.get(child);\n const supportParent = supportOf.get(parent);\n if (supportChild !== undefined && supportParent !== undefined && Math.abs(supportChild - supportParent) <= supportTol) {\n redundant.add(child);\n }\n }\n\n return applyFdrCorrection(combined).filter(r => !redundant.has(canonicalKey(r.motifs)));\n}\n","import Flatbush from 'flatbush';\nimport { extent } from 'd3-array';\nimport { assert } from './assert.js';\nimport { hypergeom, roundHalfEven, applyFdrCorrection } from './stats.js';\nimport { mineFrequentPatterns, type FrequentPattern } from './fpgrowth.js';\nimport { nestedMotifDescent } from './nested.js';\n\nexport function generateObsIdToObsSetName(obsSetsMembership: Map<string, string[][]>, currSelectedSetGroup: string) {\n // Function that accepts an obsId and returns a single string representing the cell type name.\n return (obsId: string) => {\n const obsIdCellType = obsSetsMembership.get(obsId)\n ?.find(setPath => setPath[0] === currSelectedSetGroup)\n ?.[1]; // Again, we take the second element of the setPath as the cell type name\n assert(typeof obsIdCellType === 'string', \"Result of obsIdToObsSetName was falsey\");\n return obsIdCellType;\n };\n}\n\ntype ToObsSetNameFunc = ReturnType<typeof generateObsIdToObsSetName>;\n\ntype Coords = Float32Array | Float64Array;\n\n// Reference: https://spatialquery.readthedocs.io/en/latest/generated/SpatialQuery.spatial_query.__init__.html\nexport type InitParams = {\n obsIndex: string[],\n xCoords: Coords,\n yCoords: Coords,\n obsIdToObsSetName: ToObsSetNameFunc,\n leafSize?: number, // Default: 10\n normalizeSpatialCoord?: boolean, // Default: true\n};\n\nexport type SqContext = {\n obsIndex: string[],\n // Cell type label of each cell, aligned with obsIndex.\n labels: string[],\n // Spatial coordinates, normalized if normalizeSpatialCoord was true.\n xCoords: Coords,\n yCoords: Coords,\n flatbushIndex: Flatbush,\n xExtent: [number, number],\n yExtent: [number, number],\n}\n\n// Scale spatial coordinates so that the mean nearest neighbor distance equals 1.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/0570c54bd6e046466e05c6b800d6701a7ab15c4a/SpatialQuery/spatial_utils.py#L804\nexport function normalizeSpatialCoords(xCoords: Coords, yCoords: Coords) {\n const numCells = xCoords.length;\n assert(numCells >= 2, \"At least two cells are required to normalize spatial coordinates.\");\n\n // Temporary spatial index over the original coordinates, used to find each cell's nearest neighbor.\n const index = new Flatbush(numCells);\n for (let i = 0; i < numCells; i++) {\n index.add(xCoords[i], yCoords[i]);\n }\n index.finish();\n\n let nnDistSum = 0;\n for (let i = 0; i < numCells; i++) {\n // Exclude the cell itself (equivalent to taking the second result of a k=2 KDTree query).\n const [j] = index.neighbors(xCoords[i], yCoords[i], 1, Infinity, (j) => j !== i);\n nnDistSum += Math.hypot(xCoords[i] - xCoords[j], yCoords[i] - yCoords[j]);\n }\n const nnDist = nnDistSum / numCells;\n assert(nnDist > 0, \"Mean nearest neighbor distance was zero; cannot normalize spatial coordinates.\");\n\n const scaleFactor = 1.0 / nnDist;\n return {\n xCoords: Float64Array.from(xCoords, x => x * scaleFactor),\n yCoords: Float64Array.from(yCoords, y => y * scaleFactor),\n scaleFactor,\n };\n}\n\n// Build the context object.\nexport function buildContext(params: InitParams): SqContext {\n const {\n obsIndex, // Array of each obs ID, as a string.\n xCoords: rawXCoords, // TypedArray containing X coordinate of each cell (centroid)\n yCoords: rawYCoords, // TypedArray containing Y coordinate of each cell (centroid)\n obsIdToObsSetName, // Function mapping an obs ID to its cell type label.\n\n leafSize = 10, // Leaf size parameter for KDTree construction. Larger values reduce tree depth but increase computation per query.\n normalizeSpatialCoord = true, // If True, normalizes spatial coordinates so mean nearest neighbor distance equals 1. This makes max_dist parameter interpretable as “number of cell diameters.” Set to False if original spatial units (e.g., micrometers) are required and should be preserved for downstream analysis.\n } = params;\n\n const { xCoords, yCoords } = normalizeSpatialCoord\n ? normalizeSpatialCoords(rawXCoords, rawYCoords)\n : { xCoords: rawXCoords, yCoords: rawYCoords };\n\n const xExtent = extent(xCoords);\n const yExtent = extent(yCoords);\n\n assert(typeof xExtent[0] === 'number' && typeof xExtent[1] === 'number', \"X extent min or max was undefined.\");\n assert(typeof yExtent[0] === 'number' && typeof yExtent[1] === 'number', \"Y extent min or max was undefined.\");\n\n // Initialize Flatbush for N items\n const flatbushIndex = new Flatbush(obsIndex.length, leafSize);\n\n for (let i = 0; i < obsIndex.length; i++) {\n flatbushIndex.add(xCoords[i], yCoords[i]);\n }\n\n // perform the indexing\n flatbushIndex.finish();\n\n return {\n obsIndex,\n labels: obsIndex.map(obsId => obsIdToObsSetName(obsId)),\n xCoords,\n yCoords,\n xExtent,\n yExtent,\n flatbushIndex,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Neighborhood queries\n// ---------------------------------------------------------------------------\n\n// Indices of cells within maxDist (inclusive) of a point, like KDTree.query_ball_point.\nfunction radiusNeighbors(context: SqContext, x: number, y: number, maxDist: number): number[] {\n return context.flatbushIndex.neighbors(x, y, Infinity, maxDist);\n}\n\n// The k nearest neighbors of cell i (excluding itself) and their distances,\n// like KDTree.query(k=k+1) with the first result (the cell itself) dropped.\nfunction knnNeighbors(context: SqContext, i: number, k: number) {\n const { xCoords, yCoords, flatbushIndex } = context;\n const x = xCoords[i];\n const y = yCoords[i];\n const indices = flatbushIndex.neighbors(x, y, k, Infinity, j => j !== i);\n const dists = indices.map(j => Math.hypot(xCoords[j] - x, yCoords[j] - y));\n return { indices, dists };\n}\n\n// Indices of the cells annotated with the cell type ct (possibly none).\nexport function findCellIndicesOfType(context: SqContext, ct: string): number[] {\n const cinds: number[] = [];\n context.labels.forEach((label, i) => {\n if (label === ct) cinds.push(i);\n });\n return cinds;\n}\n\n// Indices of the cells annotated with the cell type ct, throwing if there are none.\nfunction getCellIndicesOfType(context: SqContext, ct: string): number[] {\n const cinds = findCellIndicesOfType(context, ct);\n if (cinds.length === 0) {\n throw new Error(`Found no ${ct} in the cell type labels!`);\n }\n return cinds;\n}\n\nexport type QueryPoint = {\n x: number,\n y: number,\n // Index of a cell to exclude from the neighborhood (the center cell itself).\n exclude?: number,\n};\n\n// Neighborhood of each cell (excluding the cell itself) used by the k-NN motif enrichment and composition:\n// the k nearest neighbors within maxDist (inclusive).\nexport function knnNeighborhood(context: SqContext, k: number, maxDist: number) {\n return (i: number) => {\n const { indices, dists } = knnNeighbors(context, i, k);\n return indices.filter((_, n) => dists[n] <= maxDist);\n };\n}\n\n// Neighborhood of each cell (excluding the cell itself) used by the radius-based motif enrichment and composition.\nexport function radiusNeighborhood(context: SqContext, maxDist: number) {\n const { xCoords, yCoords } = context;\n return (i: number) => radiusNeighbors(context, xCoords[i], yCoords[i], maxDist).filter(j => j !== i);\n}\n\n// Cell type transactions for the radius-based neighborhood of each query point.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_utils.py#L393\nexport function radiusTransactions(context: SqContext, points: QueryPoint[], maxDist: number, minSize: number) {\n const transactions: string[][] = [];\n const neighborLists: number[][] = [];\n for (const { x, y, exclude } of points) {\n const idx = radiusNeighbors(context, x, y, maxDist);\n if (idx.length === 0) continue;\n const validIndices = idx.filter(j => j !== exclude);\n // Python compares the number of neighbor cells (not unique cell types) against min_size.\n if (validIndices.length > minSize) {\n transactions.push(validIndices.map(j => context.labels[j]));\n neighborLists.push(validIndices);\n }\n }\n return { transactions, neighborLists };\n}\n\n// Cell type transactions for the k-NN neighborhood of each center cell.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_utils.py#L475\nexport function knnTransactions(context: SqContext, cinds: number[], k: number, maxDist: number) {\n const transactions: string[][] = [];\n // In Python, the center cell itself (at distance 0) must pass the dist < max_dist filter,\n // otherwise the neighborhood is skipped entirely. Neighborhoods may otherwise be empty.\n if (!(maxDist > 0)) {\n return transactions;\n }\n for (const i of cinds) {\n const { indices, dists } = knnNeighbors(context, i, k);\n // Note: strict inequality here, unlike in motif_enrichment_knn.\n transactions.push(indices.filter((_, n) => dists[n] < maxDist).map(j => context.labels[j]));\n }\n return transactions;\n}\n\n// For each pattern, collect the cells (with cell types in the pattern) from the\n// neighborhoods that contain the full pattern.\nfunction attachNeighborIds(\n context: SqContext,\n patterns: FrequentPattern[],\n transactions: string[][],\n neighborLists: number[][],\n): FrequentPattern[] {\n const transactionSets = transactions.map(t => new Set(t));\n return patterns.map((pattern) => {\n const motif = new Set(pattern.itemsets);\n const ids = new Set<number>();\n transactionSets.forEach((transaction, t) => {\n if (pattern.itemsets.every(ct => transaction.has(ct))) {\n for (const j of neighborLists[t]) {\n if (motif.has(context.labels[j])) ids.add(j);\n }\n }\n });\n const neighborIds = Array.from(ids).sort((a, b) => a - b).map(j => context.obsIndex[j]);\n return { ...pattern, neighborIds };\n });\n}\n\n// ---------------------------------------------------------------------------\n// find_patterns_grid / find_patterns_rand\n// ---------------------------------------------------------------------------\n\ntype FindPatternsParams = {\n // Maximum distance to consider a cell as a neighbor.\n maxDist?: number, // Default: 20\n // Minimum neighborhood size for each point to consider.\n minSize?: number, // Default: 0\n // Threshold of frequency to consider a pattern as a frequent pattern.\n minSupport?: number, // Default: 0.5\n // Whether to return the obs IDs of the cells belonging to each pattern.\n returnCellIds?: boolean, // Default: false\n};\n\nasync function findPatternsAtPoints(\n context: SqContext,\n points: [number, number][],\n params: FindPatternsParams,\n): Promise<FrequentPattern[]> {\n const {\n maxDist = 20,\n minSize = 0,\n minSupport = 0.5,\n returnCellIds = false,\n } = params;\n\n // Note: Python (build_fptree_dist with cinds=None) also excludes the cell whose index\n // equals the index of the query point. We do not reproduce that quirk.\n const queryPoints = points.map(([x, y]) => ({ x, y }));\n const { transactions, neighborLists } = radiusTransactions(context, queryPoints, maxDist, minSize);\n const patterns = await mineFrequentPatterns(transactions, minSupport, true);\n\n if (returnCellIds) {\n return attachNeighborIds(context, patterns, transactions, neighborLists);\n }\n return patterns;\n}\n\n// Equivalent to np.arange(start, stop, step).\nfunction arange(start: number, stop: number, step: number): number[] {\n const n = Math.max(0, Math.ceil((stop - start) / step));\n return Array.from({ length: n }, (_, i) => start + i * step);\n}\n\n// Grid points used by findPatternsGrid, with spacing maxDist.\n// Equivalent to the grid returned by find_patterns_grid(return_grid=True).\nexport function buildGridPoints(context: SqContext, maxDist = 20): [number, number][] {\n const { xExtent, yExtent } = context;\n const xGrid = arange(xExtent[0] - maxDist, xExtent[1] + maxDist, maxDist);\n const yGrid = arange(yExtent[0] - maxDist, yExtent[1] + maxDist, maxDist);\n const gridPoints: [number, number][] = [];\n for (const x of xGrid) {\n for (const y of yGrid) {\n gridPoints.push([x, y]);\n }\n }\n return gridPoints;\n}\n\n// Create a grid and use it to find surrounding patterns in spatial data.\n// Reference: https://spatialquery.readthedocs.io/en/latest/generated/SpatialQuery.spatial_query.find_patterns_grid.html\nexport async function findPatternsGrid(context: SqContext, params: FindPatternsParams = {}) {\n const { maxDist = 20 } = params;\n return findPatternsAtPoints(context, buildGridPoints(context, maxDist), params);\n}\n\n// Randomly generate points and use them to find surrounding patterns in spatial data.\n// Uses Math.random, so results will not exactly match Python (which uses a seeded numpy RNG).\n// Reference: https://spatialquery.readthedocs.io/en/latest/generated/SpatialQuery.spatial_query.find_patterns_rand.html\nexport async function findPatternsRand(\n context: SqContext,\n params: FindPatternsParams & {\n // Number of random points to generate.\n nPoints?: number, // Default: 1000\n } = {},\n) {\n const { nPoints = 1000 } = params;\n const { xExtent: [xMin, xMax], yExtent: [yMin, yMax] } = context;\n // As in Python, all x coordinates are drawn before all y coordinates.\n const xs = Array.from({ length: nPoints }, () => Math.random() * (xMax - xMin) + xMin);\n const ys = Array.from({ length: nPoints }, () => Math.random() * (yMax - yMin) + yMin);\n const points = xs.map((x, i) => [x, ys[i]] as [number, number]);\n return findPatternsAtPoints(context, points, params);\n}\n\n// ---------------------------------------------------------------------------\n// find_fp_knn / find_fp_dist\n// ---------------------------------------------------------------------------\n\ntype FindFpKnnParams = {\n // Cell type of the center cells.\n ct: string,\n // Number of nearest neighbors.\n k?: number, // Default: 30\n // Threshold of frequency to consider a pattern as a frequent pattern.\n minSupport?: number, // Default: 0.5\n // Maximum distance for considering a cell as a neighbor.\n maxDist?: number, // Default: 20\n // Return only maximal patterns.\n ifMax?: boolean, // Default: true\n};\n\n// Find frequent patterns within the k-NN neighborhoods of a cell type.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query.py#L155\nexport async function findFpKnn(context: SqContext, params: FindFpKnnParams): Promise<FrequentPattern[]> {\n const { ct, k = 30, minSupport = 0.5, maxDist = 20, ifMax = true } = params;\n const cinds = getCellIndicesOfType(context, ct);\n const transactions = knnTransactions(context, cinds, k, maxDist);\n return mineFrequentPatterns(transactions, minSupport, ifMax);\n}\n\ntype FindFpDistParams = {\n // Cell type of the center cells.\n ct: string,\n // Maximum distance for considering a cell as a neighbor.\n maxDist?: number, // Default: 20\n // Minimum neighborhood size for each center cell to consider.\n minSize?: number, // Default: 0\n // Threshold of frequency to consider a pattern as a frequent pattern.\n minSupport?: number, // Default: 0.5\n // Return only maximal patterns.\n ifMax?: boolean, // Default: true\n};\n\n// Find frequent patterns within the radius-based neighborhoods of a cell type.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query.py#L202\nexport async function findFpDist(context: SqContext, params: FindFpDistParams): Promise<FrequentPattern[]> {\n const { ct, maxDist = 20, minSize = 0, minSupport = 0.5, ifMax = true } = params;\n const cinds = getCellIndicesOfType(context, ct);\n const { transactions } = radiusTransactions(context, centerQueryPoints(context, cinds), maxDist, minSize);\n return mineFrequentPatterns(transactions, minSupport, ifMax);\n}\n\n// Query points at the given cells, excluding each cell from its own neighborhood.\nexport function centerQueryPoints(context: SqContext, cinds: number[]): QueryPoint[] {\n return cinds.map(i => ({ x: context.xCoords[i], y: context.yCoords[i], exclude: i }));\n}\n\n// ---------------------------------------------------------------------------\n// Motif enrichment\n// ---------------------------------------------------------------------------\n\ntype MotifEnrichmentCountsParams = {\n // Cell type of interest (the center cell type).\n center: string,\n // List of cell types in the motif.\n motif: string[],\n // Total number of cells (all cell types).\n numCells: number,\n // Number of cells annotated as the center cell type.\n numCenter: number,\n // Number of cells (of any cell type) whose k-NN or radius neighborhood contains the motif.\n numMotif: number,\n // Number of center cells whose k-NN or radius neighborhood contains the motif.\n numCenterMotif: number,\n};\n\nexport type MotifEnrichmentResult = {\n center: string,\n motifs: string[],\n nCenterMotif: number,\n nCenter: number,\n nMotif: number,\n expectation: number,\n pValue: number,\n ifSignificant?: boolean,\n adjPValue?: number,\n // Obs IDs of neighbor cells with motif cell types (only if returnCellIds is true).\n neighborIds?: string[],\n // Obs IDs of center cells with the motif in their neighborhood (only if returnCellIds is true).\n centerIds?: string[],\n};\n\n// Compute the hypergeometric enrichment test for a single motif,\n// given the neighborhood counts from a k-NN or radius-based query.\n// Currently, SpatialQuery only provides p-values for cellTypeOfInterest queries.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/0570c54bd6e046466e05c6b800d6701a7ab15c4a/SpatialQuery/spatial_query.py#L490C13-L492C131\nexport function computeMotifEnrichment(params: MotifEnrichmentCountsParams): MotifEnrichmentResult {\n const {\n center,\n motif,\n numCells,\n numCenter,\n numMotif,\n numCenterMotif,\n } = params;\n\n // If the center cell type appears in the motif, divide by the number of times it appears.\n // Python's round() rounds half to even, so we match that here.\n let nCenter = numCenter;\n const centerCount = motif.filter(ct => ct === center).length;\n if (centerCount > 0) {\n nCenter = roundHalfEven(nCenter / centerCount);\n }\n\n // M = total number of cells, n = number of \"successes\" (center cells),\n // N = number drawn without replacement (cells with the motif in their neighborhood).\n const hyge = hypergeom(numCells, nCenter, numMotif);\n\n return {\n center,\n motifs: motif.toSorted(),\n nCenterMotif: numCenterMotif,\n nCenter,\n nMotif: numMotif,\n expectation: hyge.mean(),\n pValue: hyge.sf(numCenterMotif),\n };\n}\n\nexport type MotifsParam = string | string[] | string[][];\n\n// Turn a str / List[str] / List[List[str]] motifs argument into a list of motifs.\nfunction toMotifList(motifs: MotifsParam): string[][] {\n if (typeof motifs === 'string') {\n return [[motifs]];\n }\n if (motifs.every(m => typeof m === 'string')) {\n return [motifs as string[]];\n }\n return motifs as string[][];\n}\n\n// Normalize a motifs argument into a list of motifs, dropping cell types that are not\n// present in the data. Used by the motif enrichment functions (which keep the motif order and duplicates).\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query.py#L343\nexport function normalizeMotifs(motifs: MotifsParam, labelsUnique: Set<string>): string[][] {\n const filteredMotifs: string[][] = [];\n for (const motif of toMotifList(motifs)) {\n const motifExc = motif.filter(m => !labelsUnique.has(m));\n if (motifExc.length > 0) {\n console.warn(`Found no ${JSON.stringify(motifExc)} in the cell type labels. Ignoring them.`);\n }\n const validMotif = motif.filter(m => labelsUnique.has(m));\n if (validMotif.length > 0) {\n filteredMotifs.push(validMotif);\n }\n }\n return filteredMotifs;\n}\n\n// Normalize a motifs argument into sorted, de-duplicated motifs, dropping cell types that are\n// not present in the data. Used by the motif composition functions.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_utils.py#L300\nexport function normalizeMotifList(motifs: MotifsParam, labelsUnique: Set<string>): string[][] {\n return normalizeMotifs(motifs, labelsUnique).map(motif => Array.from(new Set(motif)).sort());\n}\n\n// Neighborhood counts for the motif enrichment test, within one FOV.\nexport type MotifCounts = {\n numCells: number,\n numCenter: number,\n numMotif: number,\n numCenterMotif: number,\n // Indices of the center cells with the motif in their neighborhood (only if returnCellIds is true).\n centerIndices?: number[],\n // Indices of the motif-type neighbors of those center cells (only if returnCellIds is true).\n neighborIndices?: number[],\n};\n\n// Count, for each motif, the cells (and center cells) whose neighborhood contains every\n// cell type of the motif, given a function returning the neighborhood of each cell.\n// The center cell type may be absent (relevant for multi-FOV).\nexport function countMotifs(\n context: SqContext,\n ct: string,\n motifs: string[][],\n neighborsOf: (i: number) => number[],\n returnCellIds: boolean,\n): MotifCounts[] {\n const { labels } = context;\n const numCells = labels.length;\n const cinds = findCellIndicesOfType(context, ct);\n\n // Encode cell type labels as integers.\n const labelsUnique = Array.from(new Set(labels)).sort();\n const labelToCode = new Map(labelsUnique.map((label, code) => [label, code]));\n const numTypes = labelsUnique.length;\n\n // A motif with a cell type missing from this FOV cannot be present in any neighborhood.\n const isActive = motifs.map(motif => motif.every(m => labelToCode.has(m)));\n const emptyCounts = (): MotifCounts => ({\n numCells,\n numCenter: cinds.length,\n numMotif: 0,\n numCenterMotif: 0,\n ...(returnCellIds ? { centerIndices: [], neighborIndices: [] } : {}),\n });\n if (!isActive.some(Boolean)) {\n return motifs.map(emptyCounts);\n }\n\n // Presence of each cell type in the neighborhood of each cell.\n const codes = Int32Array.from(labels, label => labelToCode.get(label)!);\n const presence = new Uint8Array(numCells * numTypes);\n const centerNeighbors = new Map<number, number[]>();\n const isCenter = new Uint8Array(numCells);\n for (const i of cinds) isCenter[i] = 1;\n for (let i = 0; i < numCells; i++) {\n const neighbors = neighborsOf(i);\n for (const j of neighbors) {\n presence[i * numTypes + codes[j]] = 1;\n }\n if (returnCellIds && isCenter[i]) {\n centerNeighbors.set(i, neighbors);\n }\n }\n\n const hasMotif = (i: number, motifCodes: number[]) => motifCodes.every(c => presence[i * numTypes + c] === 1);\n\n return motifs.map((motif, m) => {\n if (!isActive[m]) {\n return emptyCounts();\n }\n const motifCodes = Array.from(new Set(motif), t => labelToCode.get(t)!);\n\n let numMotif = 0;\n for (let i = 0; i < numCells; i++) {\n if (hasMotif(i, motifCodes)) numMotif++;\n }\n const centersWithMotif = cinds.filter(i => hasMotif(i, motifCodes));\n const counts: MotifCounts = {\n numCells,\n numCenter: cinds.length,\n numMotif,\n numCenterMotif: centersWithMotif.length,\n };\n\n if (returnCellIds) {\n const motifSet = new Set(motif);\n const neighborIndices = new Set<number>();\n for (const i of centersWithMotif) {\n for (const j of centerNeighbors.get(i)!) {\n if (motifSet.has(labels[j])) neighborIndices.add(j);\n }\n }\n counts.centerIndices = centersWithMotif;\n counts.neighborIndices = Array.from(neighborIndices).sort((a, b) => a - b);\n }\n return counts;\n });\n}\n\n// Run the enrichment test for each motif, given a function returning the\n// neighborhood (excluding the cell itself) of each cell.\nfunction motifEnrichment(\n context: SqContext,\n ct: string,\n motifs: string[][],\n neighborsOf: (i: number) => number[],\n returnCellIds: boolean,\n): MotifEnrichmentResult[] {\n const { obsIndex } = context;\n const counts = countMotifs(context, ct, motifs, neighborsOf, returnCellIds);\n const out = motifs.map((motif, m) => {\n const { numCells, numCenter, numMotif, numCenterMotif, centerIndices, neighborIndices } = counts[m];\n const result = computeMotifEnrichment({ center: ct, motif, numCells, numCenter, numMotif, numCenterMotif });\n if (returnCellIds) {\n // Note: when no center cell has the motif, Python skips the motif entirely\n // (it is dropped from the results). Here we keep it, with empty cell IDs.\n result.neighborIds = neighborIndices!.map(j => obsIndex[j]);\n result.centerIds = centerIndices!.map(i => obsIndex[i]);\n }\n return result;\n });\n return applyFdrCorrection(out);\n}\n\n// How the motifs to test are chosen when motifs are not provided.\n// 'maximal': test the maximal frequent patterns only.\n// 'nested': test the maximal patterns, then descend into the sub-patterns of any that are\n// not significant (see nestedMotifDescent).\nexport type EnrichmentMode = 'maximal' | 'nested';\n\nexport function assertEnrichmentMode(mode: string) {\n if (mode !== 'maximal' && mode !== 'nested') {\n throw new Error(`mode must be 'nested' or 'maximal', got '${mode}'`);\n }\n}\n\ntype MotifEnrichmentKnnParams = {\n // Cell type of the center cells.\n ct: string,\n // Motifs to test. If not provided, the frequent patterns within the\n // neighborhoods of the center cell type are used as motifs.\n motifs?: MotifsParam,\n // Number of nearest neighbors.\n k?: number, // Default: 30\n // Threshold of frequency to consider a pattern as a frequent pattern.\n minSupport?: number, // Default: 0.5\n // Maximum distance for neighbors.\n maxDist?: number, // Default: 20\n // Whether to return the obs IDs of center and neighbor cells for each motif.\n returnCellIds?: boolean, // Default: false\n // How the motifs to test are chosen when motifs is not provided.\n mode?: EnrichmentMode, // Default: 'maximal'\n};\n\n// Perform motif enrichment analysis using k-nearest neighbors.\n// Reference: https://spatialquery.readthedocs.io/en/latest/generated/SpatialQuery.spatial_query.motif_enrichment_knn.html\nexport async function motifEnrichmentKnn(context: SqContext, params: MotifEnrichmentKnnParams): Promise<MotifEnrichmentResult[]> {\n const { ct, k = 30, minSupport = 0.5, maxDist = 20, returnCellIds = false, mode = 'maximal' } = params;\n getCellIndicesOfType(context, ct);\n assertEnrichmentMode(mode);\n\n if (mode === 'nested' && params.motifs === undefined) {\n return nestedMotifDescent({\n testMotifs: motifs => motifEnrichmentKnn(context, { ...params, motifs, mode: 'maximal' }),\n frequentPatterns: await findFpKnn(context, { ct, k, minSupport, maxDist, ifMax: false }),\n });\n }\n\n const motifs = params.motifs === undefined\n ? (await findFpKnn(context, { ct, k, minSupport, maxDist })).map(p => p.itemsets)\n : normalizeMotifs(params.motifs, new Set(context.labels));\n if (motifs.length === 0) {\n return [];\n }\n return motifEnrichment(context, ct, motifs, knnNeighborhood(context, k, maxDist), returnCellIds);\n}\n\ntype MotifEnrichmentDistParams = {\n // Cell type of the center cells.\n ct: string,\n // Motifs to test. If not provided, the frequent patterns within the\n // neighborhoods of the center cell type are used as motifs.\n motifs?: MotifsParam,\n // Maximum distance for considering a cell as a neighbor.\n maxDist?: number, // Default: 20\n // Minimum neighborhood size for each point to consider (only used for finding frequent patterns).\n minSize?: number, // Default: 0\n // Threshold of frequency to consider a pattern as a frequent pattern.\n minSupport?: number, // Default: 0.5\n // Whether to return the obs IDs of center and neighbor cells for each motif.\n returnCellIds?: boolean, // Default: false\n // How the motifs to test are chosen when motifs is not provided.\n mode?: EnrichmentMode, // Default: 'maximal'\n};\n\n// Perform motif enrichment analysis within a radius-based neighborhood.\n// Reference: https://spatialquery.readthedocs.io/en/latest/generated/SpatialQuery.spatial_query.motif_enrichment_dist.html\nexport async function motifEnrichmentDist(context: SqContext, params: MotifEnrichmentDistParams): Promise<MotifEnrichmentResult[]> {\n const { ct, maxDist = 20, minSize = 0, minSupport = 0.5, returnCellIds = false, mode = 'maximal' } = params;\n getCellIndicesOfType(context, ct);\n assertEnrichmentMode(mode);\n\n if (mode === 'nested' && params.motifs === undefined) {\n return nestedMotifDescent({\n testMotifs: motifs => motifEnrichmentDist(context, { ...params, motifs, mode: 'maximal' }),\n frequentPatterns: await findFpDist(context, { ct, maxDist, minSize, minSupport, ifMax: false }),\n });\n }\n\n const motifs = params.motifs === undefined\n ? (await findFpDist(context, { ct, maxDist, minSize, minSupport })).map(p => p.itemsets)\n : normalizeMotifs(params.motifs, new Set(context.labels));\n if (motifs.length === 0) {\n return [];\n }\n return motifEnrichment(context, ct, motifs, radiusNeighborhood(context, maxDist), returnCellIds);\n}\n\n// ---------------------------------------------------------------------------\n// Motif composition\n// ---------------------------------------------------------------------------\n\nexport type MotifCompositionRow = {\n // Center cell type.\n center: string,\n // Sorted list of cell types in the motif.\n motifs: string[],\n // Motif cell type this row describes.\n cellType: string,\n // Number of cells of cellType in the neighborhood.\n nCells: number,\n // Number of motif-type cells in the neighborhood.\n nMotifCells: number,\n // nCells / nMotifCells\n proportion: number,\n};\n\n// Long-format composition of the motif-type cells in the neighborhoods of the center cells\n// (cinds) whose neighborhood contains every motif cell type: one row per (center cell, motif cell type).\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_utils.py#L362\nexport function motifCompositionRows(\n context: SqContext,\n ct: string,\n motifs: string[][],\n cinds: number[],\n neighborsOf: (i: number) => number[],\n): MotifCompositionRow[] {\n const { labels } = context;\n // Per-cell-type neighbor counts of each center cell.\n const centerCounts = cinds.map((i) => {\n const counts = new Map<string, number>();\n for (const j of neighborsOf(i)) {\n counts.set(labels[j], (counts.get(labels[j]) ?? 0) + 1);\n }\n return counts;\n });\n\n const rows: MotifCompositionRow[] = [];\n for (const motif of motifs) {\n for (const counts of centerCounts) {\n const motifCounts = motif.map(t => counts.get(t) ?? 0);\n if (!motifCounts.every(c => c > 0)) continue;\n const total = motifCounts.reduce((a, b) => a + b, 0);\n motif.forEach((cellType, n) => {\n rows.push({\n center: ct,\n motifs: motif,\n cellType,\n nCells: motifCounts[n],\n nMotifCells: total,\n proportion: motifCounts[n] / total,\n });\n });\n }\n }\n return rows;\n}\n\ntype MotifCompositionKnnParams = {\n // Cell type of the center cells.\n ct: string,\n // Motifs to analyze, e.g. the motifs of the motifEnrichmentKnn output.\n motifs: MotifsParam,\n // Number of nearest neighbors.\n k?: number, // Default: 30\n // Maximum distance for neighbors.\n maxDist?: number, // Default: 20\n};\n\n// Compute the composition of motif cell types in the k-NN neighborhoods of center cells.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query.py#L681\nexport function motifCompositionKnn(context: SqContext, params: MotifCompositionKnnParams): MotifCompositionRow[] {\n const { ct, k = 30, maxDist = 20 } = params;\n const cinds = getCellIndicesOfType(context, ct);\n const motifs = normalizeMotifList(params.motifs, new Set(context.labels));\n return motifCompositionRows(context, ct, motifs, cinds, knnNeighborhood(context, k, maxDist));\n}\n\ntype MotifCompositionDistParams = {\n // Cell type of the center cells.\n ct: string,\n // Motifs to analyze, e.g. the motifs of the motifEnrichmentDist output.\n motifs: MotifsParam,\n // Maximum distance for considering a cell as a neighbor.\n maxDist?: number, // Default: 20\n};\n\n// Compute the composition of motif cell types in the radius-based neighborhoods of center cells.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query.py#L631\nexport function motifCompositionDist(context: SqContext, params: MotifCompositionDistParams): MotifCompositionRow[] {\n const { ct, maxDist = 20 } = params;\n const cinds = getCellIndicesOfType(context, ct);\n const motifs = normalizeMotifList(params.motifs, new Set(context.labels));\n return motifCompositionRows(context, ct, motifs, cinds, radiusNeighborhood(context, maxDist));\n}\n\n","// Port of the multi-FOV class spatial_query_multi.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query_multiple_fov.py\nimport {\n buildContext,\n findCellIndicesOfType,\n knnTransactions,\n radiusTransactions,\n centerQueryPoints,\n knnNeighborhood,\n radiusNeighborhood,\n countMotifs,\n computeMotifEnrichment,\n normalizeMotifs,\n normalizeMotifList,\n motifCompositionRows,\n assertEnrichmentMode,\n findFpKnn as findFpKnnSingle,\n findFpDist as findFpDistSingle,\n type InitParams,\n type SqContext,\n type MotifsParam,\n type MotifEnrichmentResult,\n type MotifCompositionRow,\n type EnrichmentMode,\n type MotifCounts,\n} from './single-fov.js';\nimport { mineFrequentPatterns, type FrequentPattern } from './fpgrowth.js';\nimport { nestedMotifDescent } from './nested.js';\nimport { applyFdrCorrection, fdrCorrection, mannWhitneyU, rankAverage, median, mean } from './stats.js';\n\nexport type FovInitParams = InitParams & {\n // Unique ID of the dataset (FOV).\n datasetId: string,\n // Class (e.g., condition) that the dataset belongs to. Multiple datasets can share a class.\n datasetClass: string,\n};\n\nexport type SqMultiContext = {\n // Unique ID of each dataset (FOV).\n datasetIds: string[],\n // Class of each dataset (FOV).\n datasetClasses: string[],\n // Single-FOV context of each dataset (each FOV's coordinates are normalized separately).\n contexts: SqContext[],\n};\n\n// Build the multi-FOV context object.\n// Unlike Python, which derives unique FOV names from the (possibly repeated) dataset names\n// ('name' -> 'name_0', 'name_1', ...), each FOV has an explicit ID and class.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query_multiple_fov.py#L43\nexport function buildMultiContext(fovs: FovInitParams[]): SqMultiContext {\n const datasetIds = fovs.map(fov => fov.datasetId);\n const duplicates = datasetIds.filter((id, i) => datasetIds.indexOf(id) !== i);\n if (duplicates.length > 0) {\n throw new Error(`Dataset IDs must be unique. Found duplicates: ${Array.from(new Set(duplicates)).join(', ')}`);\n }\n return {\n datasetIds,\n datasetClasses: fovs.map(fov => fov.datasetClass),\n contexts: fovs.map(fov => buildContext(fov)),\n };\n}\n\ntype Fov = { datasetId: string, context: SqContext };\n\n// The datasets (FOVs) belonging to the selected classes (all classes if not provided).\nfunction selectFovs(multi: SqMultiContext, datasetClass?: string | string[]): Fov[] {\n const validClasses = new Set(multi.datasetClasses);\n const selected = datasetClass === undefined\n ? validClasses\n : new Set(typeof datasetClass === 'string' ? [datasetClass] : datasetClass);\n for (const c of selected) {\n if (!validClasses.has(c)) {\n throw new Error(`Invalid dataset class: ${c}. Valid dataset classes are: ${Array.from(validClasses).join(', ')}`);\n }\n }\n return multi.contexts\n .map((context, i) => ({ datasetId: multi.datasetIds[i], datasetClass: multi.datasetClasses[i], context }))\n .filter(fov => selected.has(fov.datasetClass));\n}\n\n// Throws if the cell type is absent from every FOV (selected or not, as in Python).\nfunction assertCellTypeInAnyFov(multi: SqMultiContext, ct: string) {\n if (!multi.contexts.some(context => context.labels.includes(ct))) {\n throw new Error(`Found no ${ct} in any datasets!`);\n }\n}\n\n// Unique cell type labels across all FOVs.\nfunction allLabels(multi: SqMultiContext): Set<string> {\n return new Set(multi.contexts.flatMap(context => context.labels));\n}\n\n// ---------------------------------------------------------------------------\n// find_fp_knn / find_fp_dist (pooled across FOVs)\n// ---------------------------------------------------------------------------\n\ntype DatasetClassParam = {\n // Classes of the datasets (FOVs) to include. Use all datasets if not provided.\n datasetClass?: string | string[],\n};\n\ntype MultiFindFpKnnParams = DatasetClassParam & {\n ct: string,\n k?: number, // Default: 30\n minSupport?: number, // Default: 0.5\n maxDist?: number, // Default: 20\n ifMax?: boolean, // Default: true\n};\n\n// Find frequent patterns within the k-NN neighborhoods of a cell type, pooling the\n// neighborhoods of all selected FOVs.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query_multiple_fov.py#L116\nexport async function multiFindFpKnn(multi: SqMultiContext, params: MultiFindFpKnnParams): Promise<FrequentPattern[]> {\n const { ct, datasetClass, k = 30, minSupport = 0.5, maxDist = 20, ifMax = true } = params;\n assertCellTypeInAnyFov(multi, ct);\n const transactions = selectFovs(multi, datasetClass).flatMap(({ context }) => (\n knnTransactions(context, findCellIndicesOfType(context, ct), k, maxDist)\n ));\n return mineFrequentPatterns(transactions, minSupport, ifMax);\n}\n\ntype MultiFindFpDistParams = DatasetClassParam & {\n ct: string,\n maxDist?: number, // Default: 20\n minSize?: number, // Default: 0\n minSupport?: number, // Default: 0.5\n ifMax?: boolean, // Default: true\n};\n\n// Find frequent patterns within the radius-based neighborhoods of a cell type, pooling the\n// neighborhoods of all selected FOVs.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query_multiple_fov.py#L219\nexport async function multiFindFpDist(multi: SqMultiContext, params: MultiFindFpDistParams): Promise<FrequentPattern[]> {\n const { ct, datasetClass, maxDist = 20, minSize = 0, minSupport = 0.5, ifMax = true } = params;\n assertCellTypeInAnyFov(multi, ct);\n const transactions = selectFovs(multi, datasetClass).flatMap(({ context }) => {\n const points = centerQueryPoints(context, findCellIndicesOfType(context, ct));\n return radiusTransactions(context, points, maxDist, minSize).transactions;\n });\n return mineFrequentPatterns(transactions, minSupport, ifMax);\n}\n\ntype FindFpFovParams = {\n ct: string,\n // ID of the dataset (FOV).\n datasetId: string,\n};\n\nfunction getFov(multi: SqMultiContext, datasetId: string): SqContext {\n const index = multi.datasetIds.indexOf(datasetId);\n if (index === -1) {\n throw new Error(`Found no dataset with ID ${datasetId}.`);\n }\n return multi.contexts[index];\n}\n\n// Find frequent (maximal) patterns within the k-NN neighborhoods of a cell type in a single FOV.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query_multiple_fov.py#L993\nexport async function findFpKnnFov(\n multi: SqMultiContext,\n params: FindFpFovParams & { k?: number, minSupport?: number, maxDist?: number },\n): Promise<FrequentPattern[]> {\n const { ct, datasetId, k = 30, minSupport = 0.5, maxDist = 20 } = params;\n const context = getFov(multi, datasetId);\n if (!context.labels.includes(ct)) return [];\n return findFpKnnSingle(context, { ct, k, minSupport, maxDist });\n}\n\n// Find frequent (maximal) patterns within the radius-based neighborhoods of a cell type in a single FOV.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query_multiple_fov.py#L1049\nexport async function findFpDistFov(\n multi: SqMultiContext,\n params: FindFpFovParams & { maxDist?: number, minSize?: number, minSupport?: number },\n): Promise<FrequentPattern[]> {\n const { ct, datasetId, maxDist = 20, minSize = 0, minSupport = 0.5 } = params;\n const context = getFov(multi, datasetId);\n if (!context.labels.includes(ct)) return [];\n return findFpDistSingle(context, { ct, maxDist, minSize, minSupport });\n}\n\n// ---------------------------------------------------------------------------\n// Motif enrichment (counts pooled across FOVs)\n// ---------------------------------------------------------------------------\n\nexport type MultiFovMotifEnrichmentResult = Omit<MotifEnrichmentResult, 'neighborIds' | 'centerIds'> & {\n // Obs IDs of neighbor cells with motif cell types, per dataset ID (only if returnCellIds is true).\n // Only datasets with at least one center cell with the motif are included.\n neighborIds?: Record<string, string[]>,\n // Obs IDs of center cells with the motif in their neighborhood, per dataset ID (only if returnCellIds is true).\n centerIds?: Record<string, string[]>,\n};\n\n// Normalize user-specified motifs against the labels of all FOVs, throwing if none remain.\nfunction normalizeMultiMotifs(multi: SqMultiContext, motifs: MotifsParam): string[][] {\n const filtered = normalizeMotifs(motifs, allLabels(multi));\n if (filtered.length === 0) {\n throw new Error(\"All cell types in motifs are missing in the cell type labels.\");\n }\n return filtered;\n}\n\nfunction multiMotifEnrichment(\n fovs: Fov[],\n ct: string,\n motifs: string[][],\n neighborhood: (context: SqContext) => (i: number) => number[],\n returnCellIds: boolean,\n): MultiFovMotifEnrichmentResult[] {\n const totals = motifs.map(() => ({ numCells: 0, numCenter: 0, numMotif: 0, numCenterMotif: 0 }));\n const neighborIds = motifs.map(() => ({} as Record<string, string[]>));\n const centerIds = motifs.map(() => ({} as Record<string, string[]>));\n\n for (const { datasetId, context } of fovs) {\n const counts: MotifCounts[] = countMotifs(context, ct, motifs, neighborhood(context), returnCellIds);\n counts.forEach((c, m) => {\n totals[m].numCells += c.numCells;\n totals[m].numCenter += c.numCenter;\n totals[m].numMotif += c.numMotif;\n totals[m].numCenterMotif += c.numCenterMotif;\n if (returnCellIds && c.centerIndices!.length > 0) {\n neighborIds[m][datasetId] = c.neighborIndices!.map(j => context.obsIndex[j]);\n centerIds[m][datasetId] = c.centerIndices!.map(i => context.obsIndex[i]);\n }\n });\n }\n\n const out = motifs.map((motif, m): MultiFovMotifEnrichmentResult => {\n const { neighborIds: _n, centerIds: _c, ...result } = computeMotifEnrichment({ center: ct, motif, ...totals[m] });\n return returnCellIds\n ? { ...result, neighborIds: neighborIds[m], centerIds: centerIds[m] }\n : result;\n });\n return applyFdrCorrection(out);\n}\n\ntype MultiMotifEnrichmentKnnParams = DatasetClassParam & {\n ct: string,\n motifs?: MotifsParam,\n k?: number, // Default: 30\n minSupport?: number, // Default: 0.5\n maxDist?: number, // Default: 20\n returnCellIds?: boolean, // Default: false\n mode?: EnrichmentMode, // Default: 'maximal'\n};\n\n// Perform motif enrichment analysis using k-nearest neighbors in multiple FOVs.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query_multiple_fov.py#L319\nexport async function multiMotifEnrichmentKnn(\n multi: SqMultiContext,\n params: MultiMotifEnrichmentKnnParams,\n): Promise<MultiFovMotifEnrichmentResult[]> {\n const { ct, datasetClass, k = 30, minSupport = 0.5, maxDist = 20, returnCellIds = false, mode = 'maximal' } = params;\n const fovs = selectFovs(multi, datasetClass);\n assertCellTypeInAnyFov(multi, ct);\n assertEnrichmentMode(mode);\n\n if (mode === 'nested' && params.motifs === undefined) {\n return nestedMotifDescent({\n testMotifs: motifs => multiMotifEnrichmentKnn(multi, { ...params, motifs, mode: 'maximal' }),\n frequentPatterns: await multiFindFpKnn(multi, { ct, datasetClass, k, minSupport, maxDist, ifMax: false }),\n });\n }\n\n const motifs = params.motifs === undefined\n ? (await multiFindFpKnn(multi, { ct, datasetClass, k, minSupport, maxDist })).map(p => p.itemsets)\n : normalizeMultiMotifs(multi, params.motifs);\n return multiMotifEnrichment(fovs, ct, motifs, context => knnNeighborhood(context, k, maxDist), returnCellIds);\n}\n\ntype MultiMotifEnrichmentDistParams = DatasetClassParam & {\n ct: string,\n motifs?: MotifsParam,\n maxDist?: number, // Default: 20\n minSize?: number, // Default: 0\n minSupport?: number, // Default: 0.5\n returnCellIds?: boolean, // Default: false\n mode?: EnrichmentMode, // Default: 'maximal'\n};\n\n// Perform motif enrichment analysis within a radius-based neighborhood in multiple FOVs.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query_multiple_fov.py#L581\nexport async function multiMotifEnrichmentDist(\n multi: SqMultiContext,\n params: MultiMotifEnrichmentDistParams,\n): Promise<MultiFovMotifEnrichmentResult[]> {\n const { ct, datasetClass, maxDist = 20, minSize = 0, minSupport = 0.5, returnCellIds = false, mode = 'maximal' } = params;\n const fovs = selectFovs(multi, datasetClass);\n assertCellTypeInAnyFov(multi, ct);\n assertEnrichmentMode(mode);\n\n if (mode === 'nested' && params.motifs === undefined) {\n return nestedMotifDescent({\n testMotifs: motifs => multiMotifEnrichmentDist(multi, { ...params, motifs, mode: 'maximal' }),\n frequentPatterns: await multiFindFpDist(multi, { ct, datasetClass, maxDist, minSize, minSupport, ifMax: false }),\n });\n }\n\n const motifs = params.motifs === undefined\n ? (await multiFindFpDist(multi, { ct, datasetClass, maxDist, minSize, minSupport })).map(p => p.itemsets)\n : normalizeMultiMotifs(multi, params.motifs);\n return multiMotifEnrichment(fovs, ct, motifs, context => radiusNeighborhood(context, maxDist), returnCellIds);\n}\n\n// ---------------------------------------------------------------------------\n// Motif composition\n// ---------------------------------------------------------------------------\n\nexport type MultiFovMotifCompositionRow = MotifCompositionRow & {\n // ID of the dataset (FOV) that the center cell belongs to.\n datasetId: string,\n};\n\n// Pool the motif composition over the selected FOVs.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query_multiple_fov.py#L851\nfunction multiMotifComposition(\n multi: SqMultiContext,\n ct: string,\n motifsParam: MotifsParam,\n datasetClass: string | string[] | undefined,\n neighborhood: (context: SqContext) => (i: number) => number[],\n): MultiFovMotifCompositionRow[] {\n const fovs = selectFovs(multi, datasetClass);\n assertCellTypeInAnyFov(multi, ct);\n const motifs = normalizeMotifList(motifsParam, allLabels(multi));\n\n return fovs.flatMap(({ datasetId, context }) => {\n const cinds = findCellIndicesOfType(context, ct);\n const labelsUnique = new Set(context.labels);\n // A motif with a cell type missing from this FOV has no motif-positive center here.\n const active = motifs.filter(m => m.every(t => labelsUnique.has(t)));\n if (cinds.length === 0 || active.length === 0) return [];\n return motifCompositionRows(context, ct, active, cinds, neighborhood(context))\n .map(row => ({ datasetId, ...row }));\n });\n}\n\n// Compute the composition of motif cell types in the k-NN neighborhoods of center cells across multiple FOVs.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query_multiple_fov.py#L931\nexport function multiMotifCompositionKnn(\n multi: SqMultiContext,\n params: DatasetClassParam & { ct: string, motifs: MotifsParam, k?: number, maxDist?: number },\n): MultiFovMotifCompositionRow[] {\n const { ct, motifs, datasetClass, k = 30, maxDist = 20 } = params;\n return multiMotifComposition(multi, ct, motifs, datasetClass, context => knnNeighborhood(context, k, maxDist));\n}\n\n// Compute the composition of motif cell types in the radius-based neighborhoods of center cells across multiple FOVs.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query_multiple_fov.py#L888\nexport function multiMotifCompositionDist(\n multi: SqMultiContext,\n params: DatasetClassParam & { ct: string, motifs: MotifsParam, maxDist?: number },\n): MultiFovMotifCompositionRow[] {\n const { ct, motifs, datasetClass, maxDist = 20 } = params;\n return multiMotifComposition(multi, ct, motifs, datasetClass, context => radiusNeighborhood(context, maxDist));\n}\n\n// ---------------------------------------------------------------------------\n// Differential analysis of motif patterns between two dataset classes\n// ---------------------------------------------------------------------------\n\nexport type DifferentialTestResult = {\n // Sorted motif cell types.\n itemsets: string[],\n // Support of the motif in each dataset (FOV) of each of the two classes.\n supports: Record<string, number[]>,\n // Mean support across the datasets of each of the two classes.\n supportMean: Record<string, number>,\n // Two-sided Mann-Whitney U test p-value.\n pValue: number,\n // FDR-corrected p-value (equal to pValue when a single motif is tested).\n adjPValue: number,\n ifSignificant: boolean,\n // Class with the higher median rank of support ('neither' if a class has no datasets).\n datasetClassHigherFrequency: string,\n};\n\nexport type DifferentialResult = Pick<DifferentialTestResult, 'itemsets' | 'supportMean' | 'adjPValue'>;\n\n// Normalize motifs as differential_analysis_motif_* does (no filtering of unknown cell types).\nfunction toDifferentialMotifs(motifs: MotifsParam): string[][] {\n if (typeof motifs === 'string') return [[motifs]];\n if (motifs.length > 0 && typeof motifs[0] === 'string') return [motifs as string[]];\n return motifs as string[][];\n}\n\n// Test every motif for a difference in support between the datasets of two classes.\n// Returns all tested motifs, unlike differentialAnalysisKnn/Dist which return only the significant ones.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_differential_pattern.py\nfunction differentialTests(\n multi: SqMultiContext,\n datasetClasses: string[],\n ct: string,\n motifsParam: MotifsParam,\n // Support of each motif among the given center cells of a dataset.\n supportsInFov: (context: SqContext, cinds: number[], motifs: string[][]) => number[],\n): DifferentialTestResult[] {\n const motifs: string[][] = [];\n const motifKeys = new Set<string>();\n for (const motif of toDifferentialMotifs(motifsParam)) {\n const sorted = motif.toSorted();\n const key = JSON.stringify(sorted);\n if (!motifKeys.has(key)) {\n motifKeys.add(key);\n motifs.push(sorted);\n }\n }\n\n const supports = motifs.map(() => Object.fromEntries(datasetClasses.map(c => [c, [] as number[]])));\n for (const datasetClass of datasetClasses) {\n for (const { context } of selectFovs(multi, datasetClass)) {\n const cinds = findCellIndicesOfType(context, ct);\n const fovSupports = cinds.length === 0 ? motifs.map(() => 0) : supportsInFov(context, cinds, motifs);\n fovSupports.forEach((s, m) => supports[m][datasetClass].push(s));\n }\n }\n\n const [c0, c1] = datasetClasses;\n const results = motifs.map((itemsets, m) => {\n const group1 = supports[m][c0];\n const group2 = supports[m][c1];\n let pValue = 1.0;\n let datasetClassHigherFrequency = 'neither';\n if (group1.length > 0 && group2.length > 0) {\n pValue = mannWhitneyU(group1, group2).pValue;\n // Determine which class has higher frequency using the median rank.\n const ranks = rankAverage([...group1, ...group2]);\n const medianRank1 = median(ranks.slice(0, group1.length));\n const medianRank2 = median(ranks.slice(group1.length));\n datasetClassHigherFrequency = medianRank1 > medianRank2 ? c0 : c1;\n }\n return {\n itemsets,\n supports: supports[m],\n supportMean: { [c0]: mean(group1), [c1]: mean(group2) },\n pValue,\n datasetClassHigherFrequency,\n };\n });\n\n if (results.length > 1) {\n const { rejected, adjusted } = fdrCorrection(results.map(r => r.pValue), 0.05);\n return results.map((r, i) => ({ ...r, adjPValue: adjusted[i], ifSignificant: rejected[i] }));\n }\n return results.map(r => ({ ...r, adjPValue: r.pValue, ifSignificant: r.pValue < 0.05 }));\n}\n\n// Split the significant results by the class with the higher frequency, sorted by adjusted p-value.\nfunction splitSignificant(results: DifferentialTestResult[], datasetClasses: string[]): Record<string, DifferentialResult[]> {\n return Object.fromEntries(datasetClasses.map(c => [\n c,\n results\n .filter(r => r.datasetClassHigherFrequency === c && r.ifSignificant)\n .map(({ itemsets, supportMean, adjPValue }) => ({ itemsets, supportMean, adjPValue }))\n .toSorted((a, b) => a.adjPValue - b.adjPValue),\n ]));\n}\n\n// Union of the frequent patterns discovered in each dataset of the two classes.\nasync function discoverMotifs(\n multi: SqMultiContext,\n datasetClasses: string[],\n findFpFov: (datasetId: string) => Promise<FrequentPattern[]>,\n): Promise<string[][]> {\n const motifs = new Map<string, string[]>();\n for (const datasetClass of datasetClasses) {\n for (const { datasetId } of selectFovs(multi, datasetClass)) {\n for (const { itemsets } of await findFpFov(datasetId)) {\n motifs.set(JSON.stringify(itemsets.toSorted()), itemsets.toSorted());\n }\n }\n }\n return Array.from(motifs.values());\n}\n\nfunction validateDifferentialClasses(multi: SqMultiContext, datasetClasses: string[]) {\n if (datasetClasses.length !== 2) {\n throw new Error(\"Require 2 dataset classes for differential analysis.\");\n }\n selectFovs(multi, datasetClasses);\n}\n\n// Fraction of the center cells whose neighborhood contains every motif cell type\n// (0 for motifs with a cell type missing from the dataset).\nfunction motifSupports(\n context: SqContext,\n cinds: number[],\n motifs: string[][],\n neighborsOf: (i: number) => number[],\n isValidCenter: (neighbors: number[]) => boolean = () => true,\n): number[] {\n const labelsUnique = new Set(context.labels);\n const neighborTypes = cinds.map((i) => {\n const neighbors = neighborsOf(i);\n return isValidCenter(neighbors) ? new Set(neighbors.map(j => context.labels[j])) : null;\n });\n return motifs.map((motif) => {\n if (!motif.every(t => labelsUnique.has(t))) return 0;\n const count = neighborTypes.filter(types => types !== null && motif.every(t => types.has(t))).length;\n return count / cinds.length;\n });\n}\n\ntype DifferentialAnalysisKnnParams = {\n ct: string,\n // Exactly 2 dataset classes to compare.\n datasetClasses: string[],\n // Motifs to test. If not provided, the frequent patterns found in each dataset of both classes are tested.\n motifs?: MotifsParam,\n k?: number, // Default: 30\n minSupport?: number, // Default: 0.5 (only used when motifs is not provided)\n maxDist?: number, // Default: 20\n};\n\n// Test all motifs for differential support between two dataset classes using k-NN neighborhoods.\n// Returns every tested motif (including non-significant ones).\nexport async function differentialTestsKnn(multi: SqMultiContext, params: DifferentialAnalysisKnnParams): Promise<DifferentialTestResult[]> {\n const { ct, datasetClasses, k = 30, minSupport = 0.5, maxDist = 20 } = params;\n validateDifferentialClasses(multi, datasetClasses);\n const motifs = params.motifs ?? await discoverMotifs(multi, datasetClasses, datasetId => (\n findFpKnnFov(multi, { ct, datasetId, k, minSupport, maxDist })\n ));\n return differentialTests(multi, datasetClasses, ct, motifs, (context, cinds, ms) => (\n motifSupports(context, cinds, ms, knnNeighborhood(context, k, maxDist))\n ));\n}\n\n// Perform differential analysis of motif patterns between two dataset classes using k-NN neighborhoods.\n// Returns, for each class, the motifs significantly more frequent in that class.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query_multiple_fov.py#L1105\nexport async function differentialAnalysisKnn(\n multi: SqMultiContext,\n params: DifferentialAnalysisKnnParams,\n): Promise<Record<string, DifferentialResult[]>> {\n return splitSignificant(await differentialTestsKnn(multi, params), params.datasetClasses);\n}\n\ntype DifferentialAnalysisDistParams = {\n ct: string,\n // Exactly 2 dataset classes to compare.\n datasetClasses: string[],\n // Motifs to test. If not provided, the frequent patterns found in each dataset of both classes are tested.\n motifs?: MotifsParam,\n maxDist?: number, // Default: 20\n minSupport?: number, // Default: 0.5 (only used when motifs is not provided)\n // Minimum neighborhood size for each center cell to be considered.\n minSize?: number, // Default: 0\n};\n\n// Test all motifs for differential support between two dataset classes using radius-based neighborhoods.\n// Returns every tested motif (including non-significant ones).\nexport async function differentialTestsDist(multi: SqMultiContext, params: DifferentialAnalysisDistParams): Promise<DifferentialTestResult[]> {\n const { ct, datasetClasses, maxDist = 20, minSupport = 0.5, minSize = 0 } = params;\n validateDifferentialClasses(multi, datasetClasses);\n const motifs = params.motifs ?? await discoverMotifs(multi, datasetClasses, datasetId => (\n findFpDistFov(multi, { ct, datasetId, maxDist, minSize, minSupport })\n ));\n // Center cells with neighborhoods not larger than minSize never count as having the motif,\n // but still count in the denominator of the support.\n return differentialTests(multi, datasetClasses, ct, motifs, (context, cinds, ms) => (\n motifSupports(context, cinds, ms, radiusNeighborhood(context, maxDist), neighbors => neighbors.length > minSize)\n ));\n}\n\n// Perform differential analysis of motif patterns between two dataset classes using radius-based neighborhoods.\n// Returns, for each class, the motifs significantly more frequent in that class.\n// Reference: https://github.com/ShaokunAn/Spatial-Query/blob/9250b61/SpatialQuery/spatial_query_multiple_fov.py#L1206\nexport async function differentialAnalysisDist(\n multi: SqMultiContext,\n params: DifferentialAnalysisDistParams,\n): Promise<Record<string, DifferentialResult[]>> {\n return splitSignificant(await differentialTestsDist(multi, params), params.datasetClasses);\n}\n\n"],"names":["data","valueof","main","require$$0","require$$1","is_string","require$$2","require$$3","require$$4","require$$5","lib","polyfill","builtin","primitive","tostring","Symbol","Number","try2serialize","object","polyfill_1","Int32Array","order_1","Float64Array","Boolean","codegen","tojson","Float32Array","require$$6","from_iterator","from_iterator_map","from_array","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18","require$$19","require$$20","require$$21","require$$22","require$$23","require$$24","require$$25","require$$26","require$$27","require$$28","require$$29","require$$30","self","re","sort","Uint8Array","Uint32Array","Uint16Array","Int16Array","Uint8ClampedArray","Int8Array","ctor2dtype","accessors","ndarray","padjust","sum_1","factory_1","ranks","mean","mediansorted","ctors","indices_1","assign","high","low","polyval_p","FPNode","FPTree","this","FPGrowth","count","fpgrowth","j","motifs","findFpKnnSingle","findFpDistSingle"],"mappings":"AAEe,MAAM,UAAU;AAAA,EAE3B,cAAc;AAEV,SAAK,MAAM,CAAA;AAGX,SAAK,SAAS,CAAA;AAGd,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA,EAGA,QAAQ;AACJ,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,KAAK,MAAM,UAAU;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77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,482,483,484,485]}