Scythe-1.0.3
|
template<typename T_type = double, matrix_order ORDER = Col, matrix_style STYLE = Concrete>
Create a copy of this matrix. Creates a deep copy of this Matrix. The returned concrete matrix references a newly created DataBlock that contains values that are identical to, but distinct from, the values contained in the original Matrix.
Example: #include <iostream> #include <scythestat/matrix.h> using namespace scythe; int main () { // Construct two distinct 10x10 matrices of 1s, one a view. Matrix<> A(10, 10, true, 1); Matrix<double,Col,View> B = A.copy(); // Prints true (1) std::cout << A.equals(B) << "\n"; A[3] = 22; // Prints false (0) std::cout << A.equals(B) << "\n"; return 0; } Referenced by scythe::Matrix< T_type, M_ORDER, M_STYLE >::copy(), and scythe::Matrix< T_type, M_ORDER, M_STYLE >::Matrix(). |