2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-09 11:32:19 +00:00

add new constructor from vector to permutation matrix

svn path=/trunk/boost/numeric/ublas/; revision=51741
This commit is contained in:
Gunter Winkler
2009-03-12 21:35:10 +00:00
parent f158c4e006
commit b3767e6039

View File

@@ -32,12 +32,18 @@ namespace boost { namespace numeric { namespace ublas {
// Construction and destruction
BOOST_UBLAS_INLINE
explicit
permutation_matrix (size_type size):
vector<T, A> (size) {
for (size_type i = 0; i < size; ++ i)
(*this) (i) = i;
}
BOOST_UBLAS_INLINE
explicit
permutation_matrix (const vector_type & init)
: vector_type(init)
{ }
BOOST_UBLAS_INLINE
~permutation_matrix () {}
// Assignment