
{{alias}}.main( N, correction, x, strideX )
    Computes the variance of a double-precision floating-point strided array
    ignoring `NaN` values and using Welford's algorithm.

    The `N` and stride parameters determine which elements in the strided array
    are accessed at runtime.

    Indexing is relative to the first index. To introduce an offset, use a typed
    array view.

    If `N <= 0`, the function returns `0.0`.

    Parameters
    ----------
    N: integer
        Number of indexed elements.

    correction: number
        Degrees of freedom adjustment. Setting this parameter to a value other
        than `0` has the effect of adjusting the divisor during the calculation
        of the variance according to `n - c` where `c` corresponds to the
        provided degrees of freedom adjustment and `n` corresponds to the number
        of non-`NaN` indexed elements. When computing the variance of a
        population, setting this parameter to `0` is the standard choice (i.e.,
        the provided array contains data constituting an entire population).
        When computing the unbiased sample variance, setting this parameter to
        `1` is the standard choice (i.e., the provided array contains data
        sampled from a larger population; this is commonly referred to as
        Bessel's correction).

    x: Float64Array
        Input array.

    strideX: integer
        Stride length.

    Returns
    -------
    out: number
        The variance.

    Examples
    --------
    // Standard Usage:
    > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, NaN, 2.0 ] );
    > {{alias}}.main( x.length, 1, x, 1 )
    ~4.3333

    // Using `N` and stride parameters:
    > x = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0, NaN, NaN ] );
    > {{alias}}.main( 4, 1, x, 2 )
    ~4.3333

    // Using view offsets:
    > var x0 = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0, NaN, NaN ] );
    > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
    > {{alias}}.main( 4, 1, x1, 2)
    ~4.3333


{{alias}}.ndarray( N, correction, x, strideX, offsetX )
    Computes the variance of a double-precision floating-point strided array
    ignoring `NaN` values and using Welford's algorithm and alternative
    indexing semantics.

    While typed array views mandate a view offset based on the underlying
    buffer, the offset parameter supports indexing semantics based on a starting
    index.

    Parameters
    ----------
    N: integer
        Number of indexed elements.

    correction: number
        Degrees of freedom adjustment. Setting this parameter to a value other
        than `0` has the effect of adjusting the divisor during the calculation
        of the variance according to `n - c` where `c` corresponds to the
        provided degrees of freedom adjustment and `n` corresponds to the number
        of non-`NaN` indexed elements. When computing the variance of a
        population, setting this parameter to `0` is the standard choice (i.e.,
        the provided array contains data constituting an entire population).
        When computing the unbiased sample variance, setting this parameter to
        `1` is the standard choice (i.e., the provided array contains data
        sampled from a larger population; this is commonly referred to as
        Bessel's correction).

    x: Float64Array
        Input array.

    strideX: integer
        Stride length.

    offsetX: integer
        Starting index.

    Returns
    -------
    out: number
        The variance.

    Examples
    --------
    // Standard Usage:
    > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, NaN, 2.0 ] );
    > {{alias}}.ndarray( x.length, 1, x, 1, 0 )
    ~4.3333

    // Using offset parameter:
    > x = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0, NaN, NaN ] );
    > {{alias}}.ndarray( 4, 1, x, 2, 1 )
    ~4.3333


{{alias}}.Module( memory )
    Returns a new WebAssembly module wrapper which uses the provided WebAssembly
    memory instance as its underlying memory.

    Parameters
    ----------
    memory: Memory
        WebAssembly memory instance.

    Returns
    -------
    mod: Module
        WebAssembly module wrapper.

    Examples
    --------
    // Create a new memory instance:
    > var mem = new {{alias:@stdlib/wasm/memory}}( { 'initial': 0 } );

    // Create a new routine:
    > var mod = new {{alias}}.Module( mem );

    // Initialize the routine:
    > mod.initializeSync();


{{alias}}.Module.prototype.binary
    Read-only property which returns WebAssembly binary code.

    Returns
    -------
    out: Uint8Array
        WebAssembly binary code.

    Examples
    --------
    > var mem = new {{alias:@stdlib/wasm/memory}}( { 'initial': 0 } );
    > var mod = new {{alias}}.Module( mem );
    > mod.initializeSync();
    > mod.binary
    <Uint8Array>


{{alias}}.Module.prototype.memory
    Read-only property which returns WebAssembly memory.

    Returns
    -------
    mem: Memory|null
        WebAssembly memory.

    Examples
    --------
    > var mem = new {{alias:@stdlib/wasm/memory}}( { 'initial': 0 } );
    > var mod = new {{alias}}.Module( mem );
    > mod.initializeSync();
    > mod.memory
    <Memory>


{{alias}}.Module.prototype.buffer
    Read-only property which returns a WebAssembly memory buffer as a
    Uint8Array.

    Returns
    -------
    buf: Uint8Array|null
        WebAssembly memory buffer.

    Examples
    --------
    > var mem = new {{alias:@stdlib/wasm/memory}}( { 'initial': 0 } );
    > var mod = new {{alias}}.Module( mem );
    > mod.initializeSync();
    > mod.buffer
    <Uint8Array>


{{alias}}.Module.prototype.view
    Read-only property which returns a WebAsssembly memory buffer as a DataView.

    Returns
    -------
    view: DataView|null
        WebAssembly memory view.

    Examples
    --------
    > var mem = new {{alias:@stdlib/wasm/memory}}( { 'initial': 0 } );
    > var mod = new {{alias}}.Module( mem );
    > mod.initializeSync();
    > mod.view
    <DataView>


{{alias}}.Module.prototype.exports
    Read-only property which returns "raw" WebAssembly module exports.

    Returns
    -------
    out: Object|null
        WebAssembly module exports.

    Examples
    --------
    > var mem = new {{alias:@stdlib/wasm/memory}}( { 'initial': 0 } );
    > var mod = new {{alias}}.Module( mem );
    > mod.initializeSync();
    > mod.exports
    {...}


{{alias}}.Module.prototype.initialize()
    Asynchronously initializes a WebAssembly module instance.

    Returns
    -------
    p: Promise
        Promise which resolves upon initializing a WebAssembly module instance.

    Examples
    --------
    > var mem = new {{alias:@stdlib/wasm/memory}}( { 'initial': 0 } );
    > var mod = new {{alias}}.Module( mem );
    > mod.initialize();


{{alias}}.Module.prototype.initializeAsync( clbk )
    Asynchronously initializes a WebAssembly module instance.

    Parameters
    ----------
    clbk: Function
        Callback to invoke upon initializing a WebAssembly module instance.

    Examples
    --------
    > var mem = new {{alias:@stdlib/wasm/memory}}( { 'initial': 0 } );
    > var mod = new {{alias}}.Module( mem );
    > function clbk() { console.log( 'done' ) };
    > mod.initializeAsync( clbk );


{{alias}}.Module.prototype.initializeSync()
    Synchronously initializes a WebAssembly module instance.

    In web browsers, JavaScript engines may raise an exception when attempting
    to synchronously compile large WebAssembly binaries due to concerns about
    blocking the main thread. Hence, to initialize WebAssembly modules having
    large binaries (e.g., >4KiB), consider using asynchronous initialization
    methods in browser contexts.

    Returns
    -------
    mod: Module
        Module wrapper instance.

    Examples
    --------
    > var mem = new {{alias:@stdlib/wasm/memory}}( { 'initial': 0 } );
    > var mod = new {{alias}}.Module( mem );
    > mod.initializeSync();


{{alias}}.Module.prototype.realloc( nbytes )
    Reallocates the underlying WebAssembly memory instance to a specified number
    of bytes.

    WebAssembly memory can only *grow*, not shrink. Hence, if provided a number
    of bytes which is less than or equal to the size of the current memory, the
    function does nothing.

    When non-shared memory is resized, the underlying the `ArrayBuffer` is
    detached, consequently invalidating any associated typed array views. Before
    resizing non-shared memory, ensure that associated typed array views no
    longer need byte access and can be garbage collected.

    Parameters
    ----------
    nbytes: integer
        Memory size (in bytes).

    Returns
    -------
    bool: boolean
        Boolean indicating whether the resize operation was successful.

    Examples
    --------
    > var mem = new {{alias:@stdlib/wasm/memory}}( { 'initial': 0 } );
    > var mod = new {{alias}}.Module( mem );
    > mod.initializeSync();
    > mod.realloc( 100 )
    <boolean>


{{alias}}.Module.prototype.hasCapacity( byteOffset, values )
    Returns a boolean indicating whether the underlying WebAssembly memory
    instance has the capacity to store a provided list of values starting from a
    specified byte offset.

    Parameters
    ----------
    byteOffset: integer
        Byte offset at which to start writing values.

    values: ArrayLikeObject
        Input array containing values to write.

    Returns
    -------
    bool: boolean
        Boolean indicating whether the underlying WebAssembly memory instance
        has enough capacity.

    Examples
    --------
    > var mem = new {{alias:@stdlib/wasm/memory}}( { 'initial': 0 } );
    > var mod = new {{alias}}.Module( mem );
    > mod.initializeSync();
    > mod.realloc( 100 );
    > mod.hasCapacity( 0, [ 1, 2, 3, 4 ] )
    true


{{alias}}.Module.prototype.isView( values )
    Returns a boolean indicating whether a provided list of values is a view of
    the underlying memory of the WebAssembly module.

    Parameters
    ----------
    values: ArrayLikeObject
        Input array.

    Returns
    -------
    bool: boolean
        Boolean indicating whether the list is a memory view.

    Examples
    --------
    > var mem = new {{alias:@stdlib/wasm/memory}}( { 'initial': 0 } );
    > var mod = new {{alias}}.Module( mem );
    > mod.initializeSync();
    > mod.realloc( 100 );
    > mod.isView( [ 1, 2, 3, 4 ] )
    false


{{alias}}.Module.prototype.write( byteOffset, values )
    Writes values to the underlying WebAssembly memory instance.

    The function infers element size (i.e., number of bytes per element) from
    the data type of the input array. For example, if provided a Float32Array,
    the function writes each element as a single-precision floating-point number
    to the underlying WebAssembly memory instance.

    In order to write elements as a different data type, you need to perform an
    explicit cast *before* calling this method. For example, in order to write
    single-precision floating-point numbers contained in a Float32Array as
    signed 32-bit integers, you must first convert the Float32Array to an
    Int32Array before passing the values to this method.

    If provided an array having an unknown or "generic" data type, elements are
    written as double-precision floating-point numbers.

    Parameters
    ----------
    byteOffset: integer
        Byte offset at which to start writing values.

    values: ArrayLikeObject
        Input array containing values to write.

    Returns
    -------
    mod: Module
        Module wrapper instance.

    Examples
    --------
    > var mem = new {{alias:@stdlib/wasm/memory}}( { 'initial': 0 } );
    > var mod = new {{alias}}.Module( mem );
    > mod.initializeSync();
    > mod.realloc( 100 );
    > mod.write( 0, [ 1, 2, 3, 4 ] );


{{alias}}.Module.prototype.read( byteOffset, out )
    Reads values from the underlying WebAssembly memory instance.

    The function infers element size (i.e., number of bytes per element) from
    the data type of the output array. For example, if provided a Float32Array,
    the function reads each element as a single-precision floating-point number
    from the underlying WebAssembly memory instance.

    In order to read elements as a different data type, you need to perform an
    explicit cast *after* calling this method. For example, in order to read
    single-precision floating-point numbers contained in a Float32Array as
    signed 32-bit integers, you must convert the Float32Array to an Int32Array
    after reading memory values using this method.

    If provided an output array having an unknown or "generic" data type,
    elements are read as double-precision floating-point numbers.

    Parameters
    ----------
    byteOffset: integer
        Byte offset at which to start reading values.

    out: ArrayLikeObject
        Output array for storing read values.

    Returns
    -------
    mod: Module
        Module wrapper instance.

    Examples
    --------
    > var mem = new {{alias:@stdlib/wasm/memory}}( { 'initial': 0 } );
    > var mod = new {{alias}}.Module( mem );
    > mod.initializeSync();
    > mod.realloc( 100 );
    > mod.write( 0, [ 1, 2, 3, 4 ] );
    > var out = [ 0, 0, 0, 0 ];
    > mod.read( 0, out );
    > out
    [ 1, 2, 3, 4 ]


{{alias}}.Module.prototype.main( N, correction, xp, sx )
    Computes the variance of a double-precision floating-point strided array
    ignoring `NaN` values and using Welford's algorithm.

    Parameters
    ----------
    N: integer
        Number of indexed elements.

    correction: number
        Degrees of freedom adjustment. Setting this parameter to a value other
        than `0` has the effect of adjusting the divisor during the calculation
        of the variance according to `n - c` where `c` corresponds to the
        provided degrees of freedom adjustment and `n` corresponds to the number
        of non-`NaN` indexed elements. When computing the variance of a
        population, setting this parameter to `0` is the standard choice (i.e.,
        the provided array contains data constituting an entire population).
        When computing the unbiased sample variance, setting this parameter to
        `1` is the standard choice (i.e., the provided array contains data
        sampled from a larger population; this is commonly referred to as
        Bessel's correction).

    xp: integer
        Input array pointer (i.e., byte offset).

    sx: integer
        Stride length.

    Returns
    -------
    out: number
        The variance.

    Examples
    --------
    > var mem = new {{alias:@stdlib/wasm/memory}}( { 'initial': 1 } );
    > var mod = new {{alias}}.Module( mem );
    > mod.initializeSync();

    // Define a "pointer" (i.e., byte offset) into module memory:
    > var xptr = 0;

    // Write data to module memory:
    > mod.write( xptr, {{alias:@stdlib/array/one-to}}( 3, 'float64' ) );

    // Perform computation:
    > var s = mod.main( 3, 1, xptr, 1 )
    1.0


{{alias}}.Module.prototype.ndarray( N, correction, xp, sx, ox )
    Computes the variance of a double-precision floating-point strided array
    ignoring `NaN` values and using Welford's algorithm and alternative
    indexing semantics.

    Parameters
    ----------
    N: integer
        Number of indexed elements.

    correction: number
        Degrees of freedom adjustment. Setting this parameter to a value other
        than `0` has the effect of adjusting the divisor during the calculation
        of the variance according to `n - c` where `c` corresponds to the
        provided degrees of freedom adjustment and `n` corresponds to the number
        of non-`NaN` indexed elements. When computing the variance of a
        population, setting this parameter to `0` is the standard choice (i.e.,
        the provided array contains data constituting an entire population).
        When computing the unbiased sample variance, setting this parameter to
        `1` is the standard choice (i.e., the provided array contains data
        sampled from a larger population; this is commonly referred to as
        Bessel's correction).

    xp: integer
        Input array pointer (i.e., byte offset).

    sx: integer
        Stride length.

    ox: integer
        Starting index.

    Returns
    -------
    out: number
        The variance.

    Examples
    --------
    > var mem = new {{alias:@stdlib/wasm/memory}}( { 'initial': 1 } );
    > var mod = new {{alias}}.Module( mem );
    > mod.initializeSync();

    // Define a "pointer" (i.e., byte offset) into module memory:
    > var xptr = 0;

    // Write data to module memory:
    > mod.write( xptr, {{alias:@stdlib/array/one-to}}( 3, 'float64' ) );

    // Perform computation:
    > var s = mod.ndarray( 3, 1, xptr, 1, 0 )
    1.0

    See Also
    --------

