2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-22 03:42:19 +00:00

Move to Boost standard test directory

This commit is contained in:
Michael Stevens
2005-03-15 09:03:25 +00:00
parent 1a0e91ab37
commit 7459653cb8
43 changed files with 26 additions and 0 deletions

26
test/common/init.hpp Normal file
View File

@@ -0,0 +1,26 @@
/*
* Copyright (c) 2004 Michael Stevens
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
/*
* Initialise test values in vector/matrix
*/
template<class V>
void initialize_vector (V &v) {
typename V::size_type size = v.size ();
for (typename V::size_type i = 0; i < size; ++ i)
v [i] = i + 1.f;
}
template<class M>
void initialize_matrix (M &m) {
typename M::size_type size1 = m.size1 ();
typename M::size_type size2 = m.size2 ();
for (typename M::size_type i = 0; i < size1; ++ i)
for (typename M::size_type j = 0; j < size2; ++ j)
m (i, j) = i * size1 + j + 1.f;
}