* \brief Performs a deep clone of the matrix. * Usually, when you assign matrix instances, the underlying data is shared. This method explicitly copies the internal data * of the matrix into a new matrix. The two matrices are then completely independent, i.e. if you perform an * inplace modification on this or the returned matrix, the changes are not reflected in the other. *
| 286 | * \return the new matrix with a deep clone of the data |
| 287 | */ |
| 288 | Type deepClone(bool cloneSparsity = false) const |
| 289 | { |
| 290 | Type mat(cloneSparsity ? getSparsityPattern().deepClone() : getSparsityPattern(), batches()); |
| 291 | mat.A_ = A_.deepClone(); |
| 292 | return mat; |
| 293 | } |
| 294 | |
| 295 | private: |
| 296 | void checkInitialized() const |