Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "array/filled/docs/types/index.d"

Index

Functions

Functions

Export assignment filledarray

  • filledarray<T, U>(dtype?: U): DataTypeMap<any>[U]
  • filledarray<T, U>(value: T, length: number, dtype?: U): DataTypeMap<T>[U]
  • filledarray<T, U>(value: T, array: Collection, dtype?: U): DataTypeMap<T>[U]
  • filledarray<T, U>(value: T, iterable: IterableIterator, dtype?: U): DataTypeMap<T>[U]
  • filledarray<T, U>(value: T, buffer: ArrayBuffer, byteOffset: number, length: number, dtype?: U): DataTypeMap<T>[U]
  • filledarray<T, U>(value: T, buffer: ArrayBuffer, byteOffset: number, dtype?: U): DataTypeMap<T>[U]
  • filledarray<T, U>(value: T, buffer: ArrayBuffer, dtype?: U): DataTypeMap<T>[U]
  • Creates a filled array.

    Type parameters

    Parameters

    • Optional dtype: U

      data type (default: 'float64')

    Returns DataTypeMap < any > [ U ]

    filled array

    Example

    var arr = filledarray();
    // returns <Float64Array>

    Example

    var arr = filledarray( 'float32' );
    // returns <Float32Array>
  • Creates a filled array having a specified length.

    Type parameters

    Parameters

    • value: T

      fill value

    • length: number

      array length

    • Optional dtype: U

      data type (default: 'float64')

    Returns DataTypeMap < T > [ U ]

    filled array

    Example

    var arr = filledarray( 1.0, 5 );
    // returns <Float64Array>[ 1.0, 1.0, 1.0, 1.0, 1.0 ]

    Example

    var arr = filledarray( 1.0, 5, 'float32' );
    // returns <Float32Array>[ 1.0, 1.0, 1.0, 1.0, 1.0 ]
  • Creates a filled array from another array.

    Type parameters

    Parameters

    • value: T

      fill value

    • array: Collection

      typed array or array-like object

    • Optional dtype: U

      data type (default: 'float64')

    Returns DataTypeMap < T > [ U ]

    filled array

    Example

    var arr = filledarray( 1.0, [ 5.0, -3.0, 2.0 ] );
    // returns <Float64Array>[ 1.0, 1.0, 1.0 ]

    Example

    var arr = filledarray( 1.0, [ 5.0, -3.0, 2.0 ], 'float32' );
    // returns <Float32Array>[ 1.0, 1.0, 1.0 ]
  • Creates a filled array from an iterable.

    Type parameters

    Parameters

    • value: T

      fill value

    • iterable: IterableIterator

      iterable

    • Optional dtype: U

      data type (default: 'float64')

    Returns DataTypeMap < T > [ U ]

    filled array

    Example

    var iterConstant = require( '@stdlib/iter/constant' );
    
    var it = iterConstant( 3.0, {
        'iter': 3
    });
    var arr = filledarray( 1.0, it );
    // returns <Float64Array>[ 1.0, 1.0, 1.0 ]

    Example

    var iterConstant = require( '@stdlib/iter/constant' );
    
    var it = iterConstant( 3.0, {
        'iter': 3
    });
    var arr = filledarray( 1.0, it, 'float32' );
    // returns <Float32Array>[ 1.0, 1.0, 1.0 ]
  • Returns a filled typed array view of an ArrayBuffer.

    Notes

    • Creating a generic array from an ArrayBuffer is not supported.

    Type parameters

    Parameters

    • value: T

      fill value

    • buffer: ArrayBuffer

      ArrayBuffer

    • byteOffset: number

      byte offset

    • length: number

      view length

    • Optional dtype: U

      data type (default: 'float64')

    Returns DataTypeMap < T > [ U ]

    filled array

    Example

    var ArrayBuffer = require( '@stdlib/array/buffer' );
    
    var buf = new ArrayBuffer( 32 );
    var arr = filledarray( 1.0, buf, 8, 2 );
    // returns <Float64Array>[ 1.0, 1.0 ]

    Example

    var ArrayBuffer = require( '@stdlib/array/buffer' );
    
    var buf = new ArrayBuffer( 32 );
    var arr = filledarray( 1.0, buf, 8, 2, 'float32' );
    // returns <Float32Array>[ 1.0, 1.0 ]
  • Returns a filled typed array view of an ArrayBuffer.

    Notes

    • Creating a generic array from an ArrayBuffer is not supported.

    Type parameters

    Parameters

    • value: T

      fill value

    • buffer: ArrayBuffer

      ArrayBuffer

    • byteOffset: number

      byte offset

    • Optional dtype: U

      data type (default: 'float64')

    Returns DataTypeMap < T > [ U ]

    filled array

    Example

    var ArrayBuffer = require( '@stdlib/array/buffer' );
    
    var buf = new ArrayBuffer( 32 );
    var arr = filledarray( 1.0, buf, 8 );
    // returns <Float64Array>[ 1.0, 1.0, 1.0 ]

    Example

    var ArrayBuffer = require( '@stdlib/array/buffer' );
    
    var buf = new ArrayBuffer( 32 );
    var arr = filledarray( 1.0, buf, 8, 'float32' );
    // returns <Float32Array>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
  • Returns a filled typed array view of an ArrayBuffer.

    Notes

    • Creating a generic array from an ArrayBuffer is not supported.

    Type parameters

    Parameters

    • value: T

      fill value

    • buffer: ArrayBuffer

      ArrayBuffer

    • Optional dtype: U

      data type (default: 'float64')

    Returns DataTypeMap < T > [ U ]

    filled array

    Example

    var ArrayBuffer = require( '@stdlib/array/buffer' );
    
    var buf = new ArrayBuffer( 32 );
    var arr = filledarray( 1.0, buf );
    // returns <Float64Array>[ 1.0, 1.0, 1.0, 1.0 ]

    Example

    var ArrayBuffer = require( '@stdlib/array/buffer' );
    
    var buf = new ArrayBuffer( 32 );
    var arr = filledarray( 1.0, buf, 'float32' );
    // returns <Float32Array>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]