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

VC6 requires old static init syntax

[SVN r24798]
This commit is contained in:
Michael Stevens
2004-08-28 17:15:35 +00:00
parent 15defb08d3
commit bb1daccb95
9 changed files with 113 additions and 39 deletions

View File

@@ -1005,7 +1005,11 @@ namespace boost { namespace numeric { namespace ublas {
};
template<class T, class F, class A>
typename banded_matrix<T, F, A>::const_value_type banded_matrix<T, F, A>::zero_ (0);
typename banded_matrix<T, F, A>::const_value_type banded_matrix<T, F, A>::zero_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME banded_matrix<T>::const_value_type
#endif
(0);
// Diagonal matrix class
template<class T, class F, class A>
@@ -2035,7 +2039,11 @@ namespace boost { namespace numeric { namespace ublas {
template<class M>
typename banded_adaptor<M>::const_matrix_type banded_adaptor<M>::nil_;
template<class M>
typename banded_adaptor<M>::const_value_type banded_adaptor<M>::zero_ (0);
typename banded_adaptor<M>::const_value_type banded_adaptor<M>::zero_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME banded_adaptor<M>::const_value_type
#endif
(0);
// Diagonal matrix adaptor class
template<class M>

View File

@@ -38,6 +38,8 @@
#if BOOST_MSVC < 1300
// Cannot access private members from member class
#define BOOST_UBLAS_NESTED_CLASS_DR45
// static member data initialisers require = syntax
#define BOOST_UBLAS_STATIC_OLD_INIT
#endif
// Version 6.0 & 7.0

View File

@@ -2410,14 +2410,22 @@ namespace boost { namespace numeric { namespace ublas {
private:
size_type size1_;
size_type size2_;
static value_type zero_;
static value_type one_;
static const value_type zero_;
static const value_type one_;
};
template<class T>
typename identity_matrix<T>::value_type identity_matrix<T>::zero_ (0);
const typename identity_matrix<T>::value_type identity_matrix<T>::zero_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME identity_matrix<T>::value_type
#endif
(0);
template<class T>
typename identity_matrix<T>::value_type identity_matrix<T>::one_ (1);
const typename identity_matrix<T>::value_type identity_matrix<T>::one_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME identity_matrix<T>::value_type
#endif
(1);
// Zero matrix class
template<class T>
@@ -2865,11 +2873,15 @@ namespace boost { namespace numeric { namespace ublas {
private:
size_type size1_;
size_type size2_;
static value_type zero_;
static const value_type zero_;
};
template<class T>
typename zero_matrix<T>::value_type zero_matrix<T>::zero_ (0);
const typename zero_matrix<T>::value_type zero_matrix<T>::zero_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME zero_matrix<T>::value_type
#endif
(0);
// Scalar matrix class
template<class T>

View File

@@ -1309,11 +1309,15 @@ namespace boost { namespace numeric { namespace ublas {
size_type size2_;
size_type non_zeros_;
array_type data_;
static value_type zero_;
static const value_type zero_;
};
template<class T, class F, class A>
typename sparse_matrix<T, F, A>::value_type sparse_matrix<T, F, A>::zero_ (0);
const typename sparse_matrix<T, F, A>::value_type sparse_matrix<T, F, A>::zero_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME sparse_matrix<T, F, A>::value_type
#endif
(0);
// Array based sparse matrix class
template<class T, class F, class A>
@@ -2497,11 +2501,15 @@ namespace boost { namespace numeric { namespace ublas {
size_type size2_;
size_type non_zeros_;
array_type data_;
static value_type zero_;
static const value_type zero_;
};
template<class T, class F, class A>
typename sparse_vector_of_sparse_vector<T, F, A>::value_type sparse_vector_of_sparse_vector<T, F, A>::zero_ (0);
const typename sparse_vector_of_sparse_vector<T, F, A>::value_type sparse_vector_of_sparse_vector<T, F, A>::zero_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME sparse_vector_of_sparse_vector<T, F, A>::value_type
#endif
(0);
// Array based sparse matrix class
// Thanks to Kresimir Fresl for extending this to cover different index bases.
@@ -3819,7 +3827,7 @@ namespace boost { namespace numeric { namespace ublas {
index_array_type index1_data_;
index_array_type index2_data_;
value_array_type value_data_;
static value_type zero_;
static const value_type zero_;
BOOST_UBLAS_INLINE
static size_type zero_based (size_type k_based_index) {
@@ -3837,7 +3845,11 @@ namespace boost { namespace numeric { namespace ublas {
};
template<class T, class F, std::size_t IB, class IA, class TA>
typename compressed_matrix<T, F, IB, IA, TA>::value_type compressed_matrix<T, F, IB, IA, TA>::zero_ (0);
const typename compressed_matrix<T, F, IB, IA, TA>::value_type compressed_matrix<T, F, IB, IA, TA>::zero_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME compressed_matrix<T, F, IB, IA, TA>::value_type
#endif
(0);
// Array based sparse matrix class
// Thanks to Kresimir Fresl for extending this to cover different index bases.
@@ -5130,7 +5142,7 @@ namespace boost { namespace numeric { namespace ublas {
mutable index_array_type index1_data_;
mutable index_array_type index2_data_;
mutable value_array_type value_data_;
static value_type zero_;
static const value_type zero_;
BOOST_UBLAS_INLINE
static size_type zero_based (size_type k_based_index) {
@@ -5148,7 +5160,11 @@ namespace boost { namespace numeric { namespace ublas {
};
template<class T, class F, std::size_t IB, class IA, class TA>
typename coordinate_matrix<T, F, IB, IA, TA>::value_type coordinate_matrix<T, F, IB, IA, TA>::zero_ (0);
const typename coordinate_matrix<T, F, IB, IA, TA>::value_type coordinate_matrix<T, F, IB, IA, TA>::zero_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME coordinate_matrix<T, F, IB, IA, TA>::value_type
#endif
(0);
}}}

View File

@@ -934,9 +934,17 @@ namespace boost { namespace numeric { namespace ublas {
};
template<class T, class F1, class F2, class A>
const typename triangular_matrix<T, F1, F2, A>::value_type triangular_matrix<T, F1, F2, A>::zero_ (0);
const typename triangular_matrix<T, F1, F2, A>::value_type triangular_matrix<T, F1, F2, A>::zero_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME triangular_matrix<T, F1, F2, A>::value_type
#endif
(0);
template<class T, class F1, class F2, class A>
const typename triangular_matrix<T, F1, F2, A>::value_type triangular_matrix<T, F1, F2, A>::one_ (1);
const typename triangular_matrix<T, F1, F2, A>::value_type triangular_matrix<T, F1, F2, A>::one_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME triangular_matrix<T, F1, F2, A>::value_type
#endif
(1);
// Triangular matrix adaptor class
template<class M, class F>
@@ -1844,9 +1852,17 @@ namespace boost { namespace numeric { namespace ublas {
template<class M, class F>
typename triangular_adaptor<M, F>::const_matrix_type triangular_adaptor<M, F>::nil_;
template<class M, class F>
const typename triangular_adaptor<M, F>::value_type triangular_adaptor<M, F>::zero_ (0);
const typename triangular_adaptor<M, F>::value_type triangular_adaptor<M, F>::zero_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME triangular_adaptor<M, F>::value_type
#endif
(0);
template<class M, class F>
const typename triangular_adaptor<M, F>::value_type triangular_adaptor<M, F>::one_ (1);
const typename triangular_adaptor<M, F>::value_type triangular_adaptor<M, F>::one_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME triangular_adaptor<M, F>::value_type
#endif
(1);
template<class E1, class E2>
struct matrix_vector_solve_traits {

View File

@@ -850,9 +850,17 @@ namespace boost { namespace numeric { namespace ublas {
};
template<class T>
typename unit_vector<T>::const_value_type unit_vector<T>::zero_ (0);
typename unit_vector<T>::const_value_type unit_vector<T>::zero_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME unit_vector<T>::const_value_type
#endif
(0);
template<class T>
typename unit_vector<T>::const_value_type unit_vector<T>::one_ (1);
typename unit_vector<T>::const_value_type unit_vector<T>::one_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME unit_vector<T>::const_value_type
#endif
(1);
// Zero vector class
template<class T>
@@ -1061,7 +1069,11 @@ namespace boost { namespace numeric { namespace ublas {
};
template<class T>
typename zero_vector<T>::const_value_type zero_vector<T>::zero_ (0);
typename zero_vector<T>::const_value_type zero_vector<T>::zero_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME zero_vector<T>::const_value_type
#endif
(0);
// Scalar vector class
template<class T>

View File

@@ -33,16 +33,8 @@ namespace boost { namespace numeric { namespace ublas {
private nonassignable {
typedef const T const_value_type;
public:
// Linear algebra identities
static const_value_type zero;
static const_value_type one;
};
template<class V>
typename expression_base<V>::const_value_type expression_base<V>::zero (0);
template<class V>
typename expression_base<V>::const_value_type expression_base<V>::one (1);
template<class T>
struct scalar_expression:

View File

@@ -1217,11 +1217,15 @@ namespace boost { namespace numeric { namespace ublas {
size_type size2_;
size_type non_zeros_;
array_type data_;
static value_type zero_;
static const value_type zero_;
};
template<class T, class F, class A>
typename generalized_vector_of_vector<T, F, A>::value_type generalized_vector_of_vector<T, F, A>::zero_ (0);
const typename generalized_vector_of_vector<T, F, A>::value_type generalized_vector_of_vector<T, F, A>::zero_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME generalized_vector_of_vector<T, F, A>::value_type
#endif
(0);
}}}

View File

@@ -717,11 +717,15 @@ namespace boost { namespace numeric { namespace ublas {
size_type size_;
size_type non_zeros_;
array_type data_;
static value_type zero_;
static const value_type zero_;
};
template<class T, class A>
typename sparse_vector<T, A>::value_type sparse_vector<T, A>::zero_ (0);
const typename sparse_vector<T, A>::value_type sparse_vector<T, A>::zero_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME sparse_vector<T, A>::value_type
#endif
(0);
// Array based sparse vector class
// Thanks to Kresimir Fresl for extending this to cover different index bases.
@@ -1268,7 +1272,7 @@ namespace boost { namespace numeric { namespace ublas {
size_type filled_;
index_array_type index_data_;
value_array_type value_data_;
static value_type zero_;
static const value_type zero_;
BOOST_UBLAS_INLINE
static size_type zero_based (size_type k_based_index) {
@@ -1284,7 +1288,11 @@ namespace boost { namespace numeric { namespace ublas {
};
template<class T, std::size_t IB, class IA, class TA>
typename compressed_vector<T, IB, IA, TA>::value_type compressed_vector<T, IB, IA, TA>::zero_ (0);
const typename compressed_vector<T, IB, IA, TA>::value_type compressed_vector<T, IB, IA, TA>::zero_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME compressed_vector<T, IB, IA, TA>::value_type
#endif
(0);
// Array based sparse vector class
// Thanks to Kresimir Fresl for extending this to cover different index bases.
@@ -1862,7 +1870,7 @@ namespace boost { namespace numeric { namespace ublas {
mutable bool sorted_;
mutable index_array_type index_data_;
mutable value_array_type value_data_;
static value_type zero_;
static const value_type zero_;
BOOST_UBLAS_INLINE
static size_type zero_based (size_type k_based_index) {
@@ -1878,7 +1886,11 @@ namespace boost { namespace numeric { namespace ublas {
};
template<class T, std::size_t IB, class IA, class TA>
typename coordinate_vector<T, IB, IA, TA>::value_type coordinate_vector<T, IB, IA, TA>::zero_ (0);
const typename coordinate_vector<T, IB, IA, TA>::value_type coordinate_vector<T, IB, IA, TA>::zero_
#ifdef BOOST_UBLAS_STATIC_OLD_INIT
= BOOST_UBLAS_TYPENAME coordinate_vector<T, IB, IA, TA>::value_type
#endif
(0);
}}}