00001
00002
00003 #ifndef _JBLAS_BOUNDED_SYMMETRIC_MATRIX_HPP_
00004 #define _JBLAS_BOUNDED_SYMMETRIC_MATRIX_HPP_
00005
00006 namespace ublas = boost::numeric::ublas;
00007
00008 namespace jblas {
00010 template<class T, std::size_t M, class TRI = boost::numeric::ublas::lower, class L = boost::numeric::ublas::row_major>
00011 class bounded_symmetric_matrix:
00012 public boost::numeric::ublas::symmetric_matrix<T, TRI, L, boost::numeric::ublas::bounded_array<T, M * M> > {
00013 public:
00014 typedef boost::numeric::ublas::symmetric_matrix<T, TRI, L, boost::numeric::ublas::bounded_array<T, M * M> > symmetric_matrix_type;
00015 public:
00016 typedef typename symmetric_matrix_type::size_type size_type;
00017 static const size_type max_size1 = M;
00018 static const size_type max_size2 = M;
00019
00020
00021 BOOST_UBLAS_INLINE
00022 bounded_symmetric_matrix ():
00023 symmetric_matrix_type (M, M) {}
00024 BOOST_UBLAS_INLINE
00025 bounded_symmetric_matrix (size_type size1, size_type size2):
00026 symmetric_matrix_type (size1, size2) {}
00027 BOOST_UBLAS_INLINE
00028 bounded_symmetric_matrix (const bounded_symmetric_matrix &m):
00029 symmetric_matrix_type (m) {}
00030 template<class A2>
00031 BOOST_UBLAS_INLINE
00032 bounded_symmetric_matrix (const ublas::matrix<T, L, A2> &m):
00033 symmetric_matrix_type (m) {}
00034 template<class AE>
00035 BOOST_UBLAS_INLINE
00036 bounded_symmetric_matrix (const ublas::matrix_expression<AE> &ae):
00037 symmetric_matrix_type (ae) {}
00038 BOOST_UBLAS_INLINE
00039 ~bounded_symmetric_matrix () {}
00040
00041
00042 BOOST_UBLAS_INLINE
00043 bounded_symmetric_matrix &operator = (const bounded_symmetric_matrix &m) {
00044 symmetric_matrix_type::operator = (m);
00045 return *this;
00046 }
00047 template<class L2, class A2>
00048 BOOST_UBLAS_INLINE
00049 bounded_symmetric_matrix &operator = (const ublas::symmetric_matrix<T, L2, A2> &m) {
00050 symmetric_matrix_type::operator = (m);
00051 return *this;
00052 }
00053 template<class L2, class A2>
00054 BOOST_UBLAS_INLINE
00055 bounded_symmetric_matrix &operator = (const ublas::matrix<T, L2, A2> &m) {
00056 symmetric_matrix_type::operator = (m);
00057 return *this;
00058 }
00059 template<class C>
00060 BOOST_UBLAS_INLINE
00061 bounded_symmetric_matrix &operator = (const ublas::matrix_container<C> &m) {
00062 symmetric_matrix_type::operator = (m);
00063 return *this;
00064 }
00065 template<class AE>
00066 BOOST_UBLAS_INLINE
00067 bounded_symmetric_matrix &operator = (const ublas::matrix_expression<AE> &ae) {
00068 symmetric_matrix_type::operator = (ae);
00069 return *this;
00070 }
00071 };
00072 }
00073
00074 #endif