import { assert } from "../../assert.js";

/**
 *
 * @param {number[]|Float32Array|Float64Array} out
 * @param {number} out_offset
 * @param {number[]|Float32Array|Float64Array} input
 * @param {number} input_offset
 * @param {number} dimensions
 * @param {number} scale
 */
export function vector_scale_array(
    out, out_offset,
    input, input_offset,
    dimensions,
    scale) {

    assert.isArrayLike(out, 'out');
    assert.isNonNegativeInteger(out_offset, 'out_offset');

    assert.isArrayLike(input, 'input');
    assert.isNonNegativeInteger(input_offset, 'input_offset');

    assert.isNonNegativeInteger(dimensions, 'dimensions');
    assert.isNumber(scale, 'scale');

    for (let i = 0; i < dimensions; i++) {
        out[out_offset + i] = input[input_offset + i] * scale;
    }

}