toMatrix method

Matrix toMatrix([
  1. bool deepCopy = true
])

Returns the Matrix representation of this Vector

Note that by default this function returns a Matrix that does not shares its storage with the Vector, but allocates it's own memory. This means you can freely change the Vector after creating the Matrix and the Matrix will be unaffected.

If you wish to create a Matrix that shares its memory with the vector set deepCopy to false.

Implementation

Matrix toMatrix([bool deepCopy = true]) {
  if (deepCopy) {
    return _matrix.copy();
  } else {
    return _matrix;
  }
}