Copies a specified number of rows containing a specified number of elements, from the given row/column offset in source matrix to the given row/column offset in target matrix. The source matrix, or the relevant part of it, are internally transposed before copying.
Mat XCpy a([i, j])=b([k, l])[,h, w]
i, j, k, l, w, h:integer expression
a(),b():one- or two-dimensional floating point array
Mat XCpy a([i, j])=b([k, l])[,h, w] copies h rows with w elements, from row/column offset defined with l and k in matrix b(), to row/column offset defined with i and j in matrix a(). The maximum number of elements copied is equivalent to the minimum number allowed when dimensioning the matrices, the number of rows (h) and the number of elements per row (w). The matrix b(), or the relevant part of it, are internally transposed before copying, that is to say the rows and column are swapped. This change affects only the copy and not the matrix b() itself.
If Mat XCpy is used on vectors j and l are ignored. Following a Dim a(n),b(m) the a() and b() are interpreted as row vectors, that is to say as matrices of type (1,n) and (1,m).
To handle a() and b() as column vectors, they must be dimension as matrices of type (n,1) and (m,1), that is to say as Dim a(n,1),b(m,1).
If both vectors are of the same type, that is to say they are both rows or columns, Mat Cpy must be used.
If the h and w parameters in Mat XCpy are given explicitly, the following rules apply when copying vectors:
When w => 1, the h parameter is taken into account only when b() is a column vector and a() is a row vector. When w=0 no copying takes place.
When h => 1 the w parameter is taken into account only when b() is a row vector and a() is a column vector. When h=0 no copying takes place.
OpenW # 1
Global Double a(1 To 3, 1 To 5), x%
Global Double b(1 To 7, 1 To 2)
Mat Set a() = -1
Mat Set b() = 5
Mat Print a(), 2, 0
Mat Print b(), 2, 0
Mat XCpy a(1, 2) = b(3, 2)
Mat Print a(), 2, 0
If some indices are dropped - due to the given width (w) or height (h) - the following special cases can result just like with Mat Cpy:
Mat XCpy a()=b()
Mat XCpy a([i,j])=b()
Mat XCpy a()=b([k, l])
Mat XCpy a()=b(),w, h
These act the same as the corresponding Mat Cpy commands, except for the transposition of relevant areas of matrix b() before copying to matrix a(). The b() matrix remains unchanged!
{Created by Sjouke Hamstra; Last updated: 15/10/2014 by James Gaite}