Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "array/full-like/docs/types/index.d"

Index

Functions

Functions

Export assignment fullLike

  • Creates a filled array having the same length as a provided input array.

    Parameters

    • x: AnyArray

      input array from which to derive the output array length

    • value: number

      fill value

    • dtype: "float64"

      data type

    Returns Float64Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'float32' );
    // returns <Float32Array>[ 0.0, 0.0 ]
    
    var y = fullLike( x, 1.0, 'float64' );
    // returns <Float64Array>[ 1.0, 1.0 ]
  • Creates a filled array having the same length as a provided input array.

    Parameters

    • x: AnyArray

      input array from which to derive the output array length

    • value: number

      fill value

    • dtype: "float32"

      data type

    Returns Float32Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'float64' );
    // returns <Float64Array>[ 0.0, 0.0 ]
    
    var y = fullLike( x, 1.0, 'float32' );
    // returns <Float32Array>[ 1.0, 1.0 ]
  • Creates a filled array having the same length as a provided input array.

    Parameters

    • x: AnyArray

      input array from which to derive the output array length

    • value: boolean

      fill value

    • dtype: "bool"

      data type

    Returns BooleanArray

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'uint8' );
    // returns <Uint8Array>[ 0, 0 ]
    
    var y = fullLike( x, true, 'bool' );
    // returns <BooleanArray>[ true, true ]
  • Creates a filled array having the same length as a provided input array.

    Notes

    • If provided a number, the function returns a complex number array where each element has a real component whose value equals the provided fill value and where each element has an imaginary component equal to 0.

    Parameters

    • x: AnyArray

      input array from which to derive the output array length

    • value: number | ComplexLike

      fill value

    • dtype: "complex128"

      data type

    Returns Complex128Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'float64' );
    // returns <Float64Array>[ 0.0, 0.0 ]
    
    var y = fullLike( x, 1.0, 'complex128' );
    // returns <Complex128Array>
  • Creates a filled array having the same length as a provided input array.

    Notes

    • If provided a number, the function returns a complex number array where each element has a real component whose value equals the provided fill value and where each element has an imaginary component equal to 0.

    Parameters

    • x: AnyArray

      input array from which to derive the output array length

    • value: number | ComplexLike

      fill value

    • dtype: "complex64"

      data type

    Returns Complex64Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'float64' );
    // returns <Float64Array>[ 0.0, 0.0 ]
    
    var y = fullLike( x, 1.0, 'complex64' );
    // returns <Complex64Array>
  • Creates a filled array having the same length as a provided input array.

    Parameters

    • x: AnyArray

      input array from which to derive the output array length

    • value: number

      fill value

    • dtype: "int32"

      data type

    Returns Int32Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'float64' );
    // returns <Float64Array>[ 0.0, 0.0 ]
    
    var y = fullLike( x, 1, 'int32' );
    // returns <Int32Array>[ 1, 1 ]
  • Creates a filled array having the same length as a provided input array.

    Parameters

    • x: AnyArray

      input array from which to derive the output array length

    • value: number

      fill value

    • dtype: "int16"

      data type

    Returns Int16Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'float64' );
    // returns <Float64Array>[ 0.0, 0.0 ]
    
    var y = fullLike( x, 1, 'int16' );
    // returns <Int16Array>[ 1, 1 ]
  • Creates a filled array having the same length as a provided input array.

    Parameters

    • x: AnyArray

      input array from which to derive the output array length

    • value: number

      fill value

    • dtype: "int8"

      data type

    Returns Int8Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'float64' );
    // returns <Float64Array>[ 0.0, 0.0 ]
    
    var y = fullLike( x, 1, 'int8' );
    // returns <Int8Array>[ 1, 1 ]
  • Creates a filled array having the same length as a provided input array.

    Parameters

    • x: AnyArray

      input array from which to derive the output array length

    • value: number

      fill value

    • dtype: "uint32"

      data type

    Returns Uint32Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'float64' );
    // returns <Float64Array>[ 0, 0 ]
    
    var y = fullLike( x, 1, 'uint32' );
    // returns <Uint32Array>[ 1, 1 ]
  • Creates a filled array having the same length as a provided input array.

    Parameters

    • x: AnyArray

      input array from which to derive the output array length

    • value: number

      fill value

    • dtype: "uint16"

      data type

    Returns Uint16Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'float64' );
    // returns <Float64Array>[ 0.0, 0.0 ]
    
    var y = fullLike( x, 1, 'uint16' );
    // returns <Uint16Array>[ 1, 1 ]
  • Creates a filled array having the same length as a provided input array.

    Parameters

    • x: AnyArray

      input array from which to derive the output array length

    • value: number

      fill value

    • dtype: "uint8"

      data type

    Returns Uint8Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'float64' );
    // returns <Float64Array>[ 0.0, 0.0 ]
    
    var y = fullLike( x, 1, 'uint8' );
    // returns <Uint8Array>[ 1, 1 ]
  • Creates a filled array having the same length as a provided input array.

    Parameters

    • x: AnyArray

      input array from which to derive the output array length

    • value: number

      fill value

    • dtype: "uint8c"

      data type

    Returns Uint8ClampedArray

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'float64' );
    // returns <Float64Array>[ 0.0, 0.0 ]
    
    var y = fullLike( x, 1, 'uint8c' );
    // returns <Uint8ClampedArray>[ 1, 1 ]
  • Creates a filled array having the same length as a provided input array.

    Parameters

    • x: AnyArray

      input array from which to derive the output array length

    • value: any

      fill value

    • dtype: "generic"

      data type

    Returns Array < any >

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'float64' );
    // returns <Float64Array>[ 0.0, 0.0 ]
    
    var y = fullLike( x, 1.0, 'generic' );
    // returns [ 1.0, 1.0 ]
  • Creates a filled array having the same length and data type as a provided input array.

    Parameters

    • x: Float64Array

      input array from which to derive the output array length

    • value: number

      fill value

    • Optional dtype: DataType

      data type

    Returns Float64Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'float64' );
    // returns <Float64Array>[ 0.0, 0.0 ]
    
    var y = fullLike( x, 1.0 );
    // returns <Float64Array>[ 1.0, 1.0 ]
  • Creates a filled array having the same length and data type as a provided input array.

    Parameters

    • x: Float32Array

      input array from which to derive the output array length

    • value: number

      fill value

    • Optional dtype: DataType

      data type

    Returns Float32Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'float32' );
    // returns <Float32Array>[ 0.0, 0.0 ]
    
    var y = fullLike( x, 1.0 );
    // returns <Float32Array>[ 1.0, 1.0 ]
  • Creates a filled array having the same length and data type as a provided input array.

    Parameters

    • x: BooleanArray

      input array from which to derive the output array length

    • value: boolean

      fill value

    • Optional dtype: DataType

      data type

    Returns BooleanArray

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'bool' );
    // returns <BooleanArray>[ false, false ]
    
    var y = fullLike( x, true );
    // returns <BooleanArray>[ true, true ]
  • Creates a filled array having the same length and data type as a provided input array.

    Notes

    • If provided a number, the function returns a complex number array where each element has a real component whose value equals the provided fill value and where each element has an imaginary component equal to 0.

    Parameters

    Returns Complex128Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'complex128' );
    // returns <Complex128Array>
    
    var y = fullLike( x, 1.0 );
    // returns <Complex128Array>
  • Creates a filled array having the same length and data type as a provided input array.

    Notes

    • If provided a number, the function returns a complex number array where each element has a real component whose value equals the provided fill value and where each element has an imaginary component equal to 0.

    Parameters

    Returns Complex64Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'complex64' );
    // returns <Complex64Array>
    
    var y = fullLike( x, 1.0 );
    // returns <Complex64Array>
  • Creates a filled array having the same length and data type as a provided input array.

    Parameters

    • x: Int32Array

      input array from which to derive the output array length

    • value: number

      fill value

    • Optional dtype: DataType

      data type

    Returns Int32Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'int32' );
    // returns <Int32Array>[ 0, 0 ]
    
    var y = fullLike( x, 1 );
    // returns <Int32Array>[ 1, 1 ]
  • Creates a filled array having the same length and data type as a provided input array.

    Parameters

    • x: Int16Array

      input array from which to derive the output array length

    • value: number

      fill value

    • Optional dtype: DataType

      data type

    Returns Int16Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'int16' );
    // returns <Int16Array>[ 0, 0 ]
    
    var y = fullLike( x, 1 );
    // returns <Int16Array>[ 1, 1 ]
  • Creates a filled array having the same length and data type as a provided input array.

    Parameters

    • x: Int8Array

      input array from which to derive the output array length

    • value: number

      fill value

    • Optional dtype: DataType

      data type

    Returns Int8Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'int8' );
    // returns <Int8Array>[ 0, 0 ]
    
    var y = fullLike( x, 1 );
    // returns <Int8Array>[ 1, 1 ]
  • Creates a filled array having the same length and data type as a provided input array.

    Parameters

    • x: Uint32Array

      input array from which to derive the output array length

    • value: number

      fill value

    • Optional dtype: DataType

      data type

    Returns Uint32Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'uint32' );
    // returns <Uint32Array>[ 0, 0 ]
    
    var y = fullLike( x, 1 );
    // returns <Uint32Array>[ 1, 1 ]
  • Creates a filled array having the same length and data type as a provided input array.

    Parameters

    • x: Uint16Array

      input array from which to derive the output array length

    • value: number

      fill value

    • Optional dtype: DataType

      data type

    Returns Uint16Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'uint16' );
    // returns <Uint16Array>[ 0, 0 ]
    
    var y = fullLike( x, 1 );
    // returns <Uint16Array>[ 1, 1 ]
  • Creates a filled array having the same length and data type as a provided input array.

    Parameters

    • x: Uint8Array

      input array from which to derive the output array length

    • value: number

      fill value

    • Optional dtype: DataType

      data type

    Returns Uint8Array

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'uint8' );
    // returns <Uint8Array>[ 0, 0 ]
    
    var y = fullLike( x, 1 );
    // returns <Uint8Array>[ 1, 1 ]
  • Creates a filled array having the same length and data type as a provided input array.

    Parameters

    • x: Uint8ClampedArray

      input array from which to derive the output array length

    • value: number

      fill value

    • Optional dtype: DataType

      data type

    Returns Uint8ClampedArray

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'uint8c' );
    // returns <Uint8ClampedArray>[ 0, 0 ]
    
    var y = fullLike( x, 1 );
    // returns <Uint8ClampedArray>[ 1, 1 ]
  • Creates a filled array having the same length and data type as a provided input array.

    Parameters

    • x: Array<any>

      input array from which to derive the output array length

    • value: any

      fill value

    • Optional dtype: DataType

      data type

    Returns Array < any >

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'generic' );
    // returns [ 0, 0 ]
    
    var y = fullLike( x, 1.0 );
    // returns [ 1.0, 1.0 ]
  • Creates a filled array having the same length and data type as a provided input array.

    Parameters

    • x: AnyArray

      input array from which to derive the output array length

    • value: any

      fill value

    • Optional dtype: DataType

      data type

    Returns AnyArray

    filled array

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'float64' );
    // returns <Float64Array>[ 0.0, 0.0 ]
    
    var y = fullLike( x, 1.0 );
    // returns <Float64Array>[ 1.0, 1.0 ]

    Example

    var zeros = require( '@stdlib/array/zeros' );
    
    var x = zeros( 2, 'float64' );
    // returns <Float64Array>[ 0.0, 0.0 ]
    
    var y = fullLike( x, 1.0, 'float32' );
    // returns <Float32Array>[ 1.0, 1.0 ]