copy_matrix.h
-
enum slap_ErrorCode slap_Copy(Matrix dest, Matrix src)
Copy a matrix to another matrix.
- Parameters:
dest – a matrix of size (m,n)
src – a matrix of size (n,m)
- Returns:
slap error code
-
enum slap_ErrorCode slap_CopyTranspose(Matrix dest, Matrix src)
Copy a matrix to another matrix, transposed.
- Parameters:
dest – a matrix of size (m,n)
src – a matrix of size (n,m)
- Returns:
slap error code
-
enum slap_ErrorCode slap_CopyFromArray(Matrix mat, const sfloat *data)
Copy the data from an array into the matrix.
The data is always copied into the same order as the underlying memory layout, so this method ignores whether the matrix is transposed or not.
The source array must be at least as long as the destination Matrix, otherwise this function will result in undefined behavior.
- Parameters:
mat – A valid matrix
data – Data to be copied into the array. Must have length of at least mat.rows * * mat.cols.
- Returns:
slap error code