Scythe-1.0.3
|
template<typename T_type = double, matrix_order ORDER = Col, matrix_style STYLE = Concrete>
template<matrix_order O, matrix_style S>
Make this Matrix a copy of another. Converts this Matrix into a deep copy of another Matrix. This Matrix retains its own matrix_order and matrix_style but contains copies of M's elements and becomes the same size and shape as M. Calling this method automatically detaches this Matrix from its previous DataBlock before copying.
Example: #include <iostream> #include <scythestat/matrix.h> using namespace scythe; int main () { // Construct two 10x10 matrices of 1s, one a view of the other. Matrix<> A(10, 10, true, 1); Matrix<double,Col,View> B(A); A[3] = 22; // Prints true (1) std::cout << A.equals(B) << "\n"; B.copy(A); A[4] = 12.4; // Prints false (0) std::cout << A.equals(B) << "\n"; return 0; } |