function complex( x, index, value, out, stride, offset ) {
	var so;
	var io;
	var i;
	var j;

	so = stride * 2; // multiply by 2, as real-valued array consists of interleaved real and imaginary components
	io = offset * 2;
	for ( i = 0; i < x.length/2; i++ ) {
		j = i * 2;
		out[ io ] = x[ j ];
		out[ io+1 ] = x[ j+1 ];
		io += so;
	}
	io = ( offset+(index*stride) ) * 2;
	out[ io ] = real( value );
	out[ io+1 ] = imag( value );
	return out;
}
Copies elements from one complex array to another complex array and sets the element at the specified index to a provided value.

@private
@param {Collection} x - real-valued floating-point input array view
@param {integer} index - element index
@param {ComplexLike} value - replacement value
@param {Collection} out - real-valued floating-point output array view
@param {integer} stride - output array stride
@param {NonNegativeInteger} offset - output array offset
@returns {Collection} output array view

@example
var Complex128 = require( '@stdlib/complex/float64/ctor' );
var Float64Array = require( '@stdlib/array/float64' );

var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );

var out = new Float64Array( 4 );
var arr = complex( x, 0, new Complex128( 5.0, 6.0 ), out, 1, 0 );
// returns <Float64Array>[ 5.0, 6.0, 3.0, 4.0 ]