| ||||||
| ||||||
![]() | ||||||
Prototype | ||||||
template <class Matrix, class VecX, class VecY> void rank_one_update(Matrix A, const VecX& x, const VecY& y) ; | ||||||
![]() | ||||||
Description | ||||||
Also known as the outer product of two vectors.
y = [ 1 2 3 ] [ 1 ] [ 1 2 3 ] x = [ 2 ] [ 2 4 6 ] => A [ 3 ] [ 3 6 9 ] [ 4 ] [ 4 8 12 ] When using this algorithm with a symmetric matrix, x and y must be the same vector, or at least have the same values. Otherwise the resulting matrix is not symmetric. | ||||||
![]() | ||||||
Definition | ||||||
mtl.h | ||||||
![]() | ||||||
Requirements on types | ||||||
![]() | ||||||
Preconditions | ||||||
![]() | ||||||
Complexity | ||||||
![]() | ||||||
Example | ||||||
In rank_one.cc:
typedef matrix< double, rectangle<>, dense<>, column_major >::type Matrix; typedef Matrix::size_type sizeT; const sizeT M = 4, N = 3; Matrix A(M, N); dense1D<double> x(M), y(N); double alpha = 1.0; // fill A, x, and y ... rank_one_update(A, scaled(x, alpha), y); | ||||||
![]() | ||||||
Notes | ||||||
![]() | ||||||
See also | ||||||
Copyright ©
1998,1999 University of Notre Dame. All Rights Reserved.