Click or drag to resize

Copying And Conversion

Hereinafter the following convention is used:

  • VSmall Greek – small Greek letters are used to denote scalars;

  • VSmall Latin – small Latin letters are used to denote vectors;

  • VCapital Latin – capital Latin letters are used to denote matrices.

This topic contains the following sections:

Copying

This section describes methods applied to receive a copy of a vector and to get a sub-vector of the given vector.

Operation

Description

Performance

copy

Creates a copy of the original vector.

methodClone

methodCopyTo(Vector)

copy part of this vector to another vector

Suppose the given vector is VCopy Offset 1

and the vector to copy to is VCopy Offset 2

We want to copy l elements from offset k of the source vector to offset t of the destination vector. The resulting vector will then contain the set of l elements from vector u, which will replace l elements in vector v, starting from t-th element.

Consider our vector is VCopy ExU,

the destination vector is VCopy ExV.

User specifies offsets as follows:

C#
1u.CopyTo(v, 2, 4, 3);

after that vector v will be VCopy Ex Res.

methodCopyTo(Vector, Int32, Int32, Int32)

set subvector

Copies the values from another vector and places them into this vector starting from a specified offset. Suppose our vector is:

VOffset Sub

and another vector is:

VAnotherV

then the values of the vector v will be placed into the vector u starting from the element with k-th index.

methodSetSubVector(Int32, Vector)

get subvector

Gets values of the subvector of this vector. Copies a specified number of values l from this vector starting from a specified offset k. Suppose our vector is:

VCopy Offset 1

then the subvector of the vector u will be:

VSub Vector

methodGetSubVector(Int32, Int32)

It is also available to get subvector of vector starting from a specified index, number of elements to copy is equal to the length of the destination vector.

methodGetSubVector(Int32, Vector)

Conversion
See Also