| ||||||
| ||||||
![]() | ||||||
Prototype | ||||||
template <class LinalgA, class LinalgB> void swap(LinalgA A, LinalgB B) ; | ||||||
![]() | ||||||
Description | ||||||
Exchanges the elements of the containers. Not compatible with sparse matrices. For banded matrices and other shaped matrices, A and B must be the same shape. Also, the two matrices must be the same orientation. | ||||||
![]() | ||||||
Definition | ||||||
mtl.h | ||||||
![]() | ||||||
Preconditions | ||||||
| ||||||
![]() | ||||||
Complexity | ||||||
O(n^2) | ||||||
![]() | ||||||
Example | ||||||
In vecvec_swap.cc:
dense1D<double> x(20,1), y(10,2); swap(strided(x,2), y); | ||||||
![]() | ||||||
Notes | ||||||
![]() | ||||||
See also | ||||||
Copyright ©
1998,1999 University of Notre Dame. All Rights Reserved.