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

Fixed tab and no-newline-at-end-of-file issues from inspection report

This commit is contained in:
Jeremiah Willcock
2010-04-20 17:54:16 +00:00
parent 73f083c1ec
commit 4478fe76a4
5 changed files with 180 additions and 180 deletions

View File

@@ -499,7 +499,7 @@ namespace boost { namespace numeric { namespace ublas {
void constraints () {
function_requires< VectorConcept<vector_type> >();
function_requires< DefaultConstructible<vector_type> >();
function_requires< DefaultConstructible<vector_type> >();
function_requires< Mutable_VectorExpressionConcept<vector_type> >();
size_type n (0);
value_type t = value_type ();
@@ -580,7 +580,7 @@ namespace boost { namespace numeric { namespace ublas {
void constraints () {
function_requires< MatrixConcept<matrix_type> >();
function_requires< DefaultConstructible<matrix_type> >();
function_requires< DefaultConstructible<matrix_type> >();
function_requires< Mutable_MatrixExpressionConcept<matrix_type> >();
size_type n (0);
value_type t = value_type ();
@@ -905,8 +905,8 @@ namespace boost { namespace numeric { namespace ublas {
#define INTERNAL_EXPRESSION
#endif
// TODO enable this for development
// #define VIEW_CONCEPTS
// TODO enable this for development
// #define VIEW_CONCEPTS
// Element value type for tests
typedef float T;
@@ -980,7 +980,7 @@ namespace boost { namespace numeric { namespace ublas {
#endif
#ifdef VIEW_CONCEPTS
// read only vectors
// read only vectors
{
typedef vector_view<T> container_model;
function_requires< RandomAccessContainerConcept<container_model> >();

View File

@@ -26,42 +26,42 @@ namespace boost { namespace numeric { namespace ublas {
template < class T >
class c_array_view
: public storage_array< c_array_view<T> > {
: public storage_array< c_array_view<T> > {
private:
typedef c_array_view<T> self_type;
typedef T * pointer;
typedef c_array_view<T> self_type;
typedef T * pointer;
public:
// TODO: think about a const pointer
typedef const pointer array_type;
// TODO: think about a const pointer
typedef const pointer array_type;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef T value_type;
typedef const T &const_reference;
typedef const T *const_pointer;
typedef T value_type;
typedef const T &const_reference;
typedef const T *const_pointer;
typedef const_pointer const_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
//
// typedefs required by vector concept
//
//
// typedefs required by vector concept
//
typedef dense_tag storage_category;
typedef dense_tag storage_category;
typedef const vector_reference<const self_type> const_closure_type;
c_array_view(size_type size, array_type data) :
size_(size), data_(data)
{}
c_array_view(size_type size, array_type data) :
size_(size), data_(data)
{}
~c_array_view()
{}
~c_array_view()
{}
//
// immutable methods of container concept
//
//
// immutable methods of container concept
//
BOOST_UBLAS_INLINE
size_type size () const {
@@ -93,8 +93,8 @@ namespace boost { namespace numeric { namespace ublas {
}
private:
size_type size_;
array_type data_;
size_type size_;
array_type data_;
};
@@ -133,14 +133,14 @@ namespace boost { namespace numeric { namespace ublas {
// ISSUE require type consistency check
// is_convertable (IA::size_type, TA::size_type)
typedef typename boost::remove_cv<typename vector_view_traits<JA>::value_type>::type index_type;
// for compatibility, should be removed some day ...
// for compatibility, should be removed some day ...
typedef index_type size_type;
// size_type for the data arrays.
typedef typename vector_view_traits<JA>::size_type array_size_type;
typedef typename vector_view_traits<JA>::difference_type difference_type;
typedef const value_type & const_reference;
// do NOT define reference type, because class is read only
// do NOT define reference type, because class is read only
// typedef value_type & reference;
typedef IA rowptr_array_type;
@@ -149,93 +149,93 @@ namespace boost { namespace numeric { namespace ublas {
typedef const matrix_reference<const self_type> const_closure_type;
typedef matrix_reference<self_type> closure_type;
// FIXME: define a corresponding temporary type
// FIXME: define a corresponding temporary type
// typedef compressed_vector<T, IB, IA, TA> vector_temporary_type;
// FIXME: define a corresponding temporary type
// FIXME: define a corresponding temporary type
// typedef self_type matrix_temporary_type;
typedef sparse_tag storage_category;
typedef typename L::orientation_category orientation_category;
//
// private types for internal use
//
//
// private types for internal use
//
private:
typedef typename vector_view_traits<index_array_type>::const_iterator const_subiterator_type;
typedef typename vector_view_traits<index_array_type>::const_iterator const_subiterator_type;
//
//
// Construction and destruction
//
//
private:
/// private default constructor because data must be filled by caller
/// private default constructor because data must be filled by caller
BOOST_UBLAS_INLINE
compressed_matrix_view () { }
public:
BOOST_UBLAS_INLINE
BOOST_UBLAS_INLINE
compressed_matrix_view (index_type n_rows, index_type n_cols, array_size_type nnz
, const rowptr_array_type & iptr
, const index_array_type & jptr
, const value_array_type & values):
, const rowptr_array_type & iptr
, const index_array_type & jptr
, const value_array_type & values):
matrix_expression<self_type> (),
size1_ (n_rows), size2_ (n_cols),
nnz_ (nnz),
index1_data_ (iptr),
index2_data_ (jptr),
value_data_ (values) {
index2_data_ (jptr),
value_data_ (values) {
storage_invariants ();
}
BOOST_UBLAS_INLINE
compressed_matrix_view(const compressed_matrix_view& o) :
size1_(size1_), size2_(size2_),
nnz_(nnz_),
index1_data_(index1_data_),
index2_data_(index2_data_),
value_data_(value_data_)
{}
BOOST_UBLAS_INLINE
compressed_matrix_view(const compressed_matrix_view& o) :
size1_(size1_), size2_(size2_),
nnz_(nnz_),
index1_data_(index1_data_),
index2_data_(index2_data_),
value_data_(value_data_)
{}
//
// implement immutable iterator types
//
//
// implement immutable iterator types
//
class const_iterator1 {};
class const_iterator2 {};
class const_iterator1 {};
class const_iterator2 {};
typedef reverse_iterator_base1<const_iterator1> const_reverse_iterator1;
typedef reverse_iterator_base1<const_iterator1> const_reverse_iterator1;
typedef reverse_iterator_base2<const_iterator2> const_reverse_iterator2;
//
// implement all read only methods for the matrix expression concept
//
//
// implement all read only methods for the matrix expression concept
//
//! return the number of rows
index_type size1() const {
return size1_;
}
//! return the number of rows
index_type size1() const {
return size1_;
}
//! return the number of columns
index_type size2() const {
return size2_;
}
//! return the number of columns
index_type size2() const {
return size2_;
}
//! return value at position (i,j)
value_type operator()(index_type i, index_type j) const {
const_pointer p = find_element(i,j);
if (!p) {
return zero_;
} else {
return *p;
}
}
//! return value at position (i,j)
value_type operator()(index_type i, index_type j) const {
const_pointer p = find_element(i,j);
if (!p) {
return zero_;
} else {
return *p;
}
}
private:
//
// private helper functions
//
//
// private helper functions
//
const_pointer find_element (index_type i, index_type j) const {
index_type element1 (layout_type::index_M (i, j));
@@ -244,22 +244,22 @@ namespace boost { namespace numeric { namespace ublas {
const array_size_type itv = zero_based( index1_data_[element1] );
const array_size_type itv_next = zero_based( index1_data_[element1+1] );
const_subiterator_type it_start = boost::next(vector_view_traits<index_array_type>::begin(index2_data_),itv);
const_subiterator_type it_end = boost::next(vector_view_traits<index_array_type>::begin(index2_data_),itv_next);
const_subiterator_type it_start = boost::next(vector_view_traits<index_array_type>::begin(index2_data_),itv);
const_subiterator_type it_end = boost::next(vector_view_traits<index_array_type>::begin(index2_data_),itv_next);
const_subiterator_type it = find_index_in_row(it_start, it_end, element2) ;
if (it == it_end || *it != k_based (element2))
return 0;
return &value_data_ [it - vector_view_traits<index_array_type>::begin(index2_data_)];
}
const_subiterator_type find_index_in_row(const_subiterator_type it_start
, const_subiterator_type it_end
, index_type index) const {
return std::lower_bound( it_start
, it_end
, k_based (index) );
}
const_subiterator_type find_index_in_row(const_subiterator_type it_start
, const_subiterator_type it_end
, index_type index) const {
return std::lower_bound( it_start
, it_end
, k_based (index) );
}
private:
@@ -301,13 +301,13 @@ namespace boost { namespace numeric { namespace ublas {
template<class L, std::size_t IB, class IA, class JA, class TA >
compressed_matrix_view<L,IB,IA,JA,TA>
make_compressed_matrix_view(typename vector_view_traits<JA>::value_type n_rows
, typename vector_view_traits<JA>::value_type n_cols
, typename vector_view_traits<JA>::size_type nnz
, const IA & ia
, const JA & ja
, const TA & ta) {
, typename vector_view_traits<JA>::value_type n_cols
, typename vector_view_traits<JA>::size_type nnz
, const IA & ia
, const JA & ja
, const TA & ta) {
return compressed_matrix_view<L,IB,IA,JA,TA>(n_rows, n_cols, nnz, ia, ja, ta);
return compressed_matrix_view<L,IB,IA,JA,TA>(n_rows, n_cols, nnz, ia, ja, ta);
}

View File

@@ -67,82 +67,82 @@ namespace boost { namespace numeric { namespace ublas {
template<typename R, typename I>
typename boost::enable_if<
mpl::and_<
boost::is_float<R>,
boost::is_integral<I>
>,
std::complex<R> >::type inline operator+ (I in1, std::complex<R> const& in2 ) {
return R (in1) + in2;
mpl::and_<
boost::is_float<R>,
boost::is_integral<I>
>,
std::complex<R> >::type inline operator+ (I in1, std::complex<R> const& in2 ) {
return R (in1) + in2;
}
template<typename R, typename I>
typename boost::enable_if<
mpl::and_<
boost::is_float<R>,
boost::is_integral<I>
>,
std::complex<R> >::type inline operator+ (std::complex<R> const& in1, I in2) {
return in1 + R (in2);
mpl::and_<
boost::is_float<R>,
boost::is_integral<I>
>,
std::complex<R> >::type inline operator+ (std::complex<R> const& in1, I in2) {
return in1 + R (in2);
}
template<typename R, typename I>
typename boost::enable_if<
mpl::and_<
boost::is_float<R>,
boost::is_integral<I>
>,
std::complex<R> >::type inline operator- (I in1, std::complex<R> const& in2) {
return R (in1) - in2;
mpl::and_<
boost::is_float<R>,
boost::is_integral<I>
>,
std::complex<R> >::type inline operator- (I in1, std::complex<R> const& in2) {
return R (in1) - in2;
}
template<typename R, typename I>
typename boost::enable_if<
mpl::and_<
boost::is_float<R>,
boost::is_integral<I>
>,
std::complex<R> >::type inline operator- (std::complex<R> const& in1, I in2) {
return in1 - R (in2);
mpl::and_<
boost::is_float<R>,
boost::is_integral<I>
>,
std::complex<R> >::type inline operator- (std::complex<R> const& in1, I in2) {
return in1 - R (in2);
}
template<typename R, typename I>
typename boost::enable_if<
mpl::and_<
boost::is_float<R>,
boost::is_integral<I>
>,
std::complex<R> >::type inline operator* (I in1, std::complex<R> const& in2) {
return R (in1) * in2;
mpl::and_<
boost::is_float<R>,
boost::is_integral<I>
>,
std::complex<R> >::type inline operator* (I in1, std::complex<R> const& in2) {
return R (in1) * in2;
}
template<typename R, typename I>
typename boost::enable_if<
mpl::and_<
boost::is_float<R>,
boost::is_integral<I>
>,
std::complex<R> >::type inline operator* (std::complex<R> const& in1, I in2) {
return in1 * R(in2);
mpl::and_<
boost::is_float<R>,
boost::is_integral<I>
>,
std::complex<R> >::type inline operator* (std::complex<R> const& in1, I in2) {
return in1 * R(in2);
}
template<typename R, typename I>
typename boost::enable_if<
mpl::and_<
boost::is_float<R>,
boost::is_integral<I>
>,
std::complex<R> >::type inline operator/ (I in1, std::complex<R> const& in2) {
return R(in1) / in2;
mpl::and_<
boost::is_float<R>,
boost::is_integral<I>
>,
std::complex<R> >::type inline operator/ (I in1, std::complex<R> const& in2) {
return R(in1) / in2;
}
template<typename R, typename I>
typename boost::enable_if<
mpl::and_<
boost::is_float<R>,
boost::is_integral<I>
>,
std::complex<R> >::type inline operator/ (std::complex<R> const& in1, I in2) {
return in1 / R (in2);
mpl::and_<
boost::is_float<R>,
boost::is_integral<I>
>,
std::complex<R> >::type inline operator/ (std::complex<R> const& in1, I in2) {
return in1 / R (in2);
}
@@ -641,7 +641,7 @@ namespace boost { namespace numeric { namespace ublas {
*/
template < class E >
struct container_traits
: container_view_traits<E>, mutable_container_traits<E> {
: container_view_traits<E>, mutable_container_traits<E> {
};
@@ -667,7 +667,7 @@ namespace boost { namespace numeric { namespace ublas {
*/
template < class MATRIX >
struct mutable_matrix_traits
: mutable_container_traits <MATRIX> {
: mutable_container_traits <MATRIX> {
/// row iterator for the matrix
typedef typename MATRIX::iterator1 iterator1;
@@ -682,7 +682,7 @@ namespace boost { namespace numeric { namespace ublas {
*/
template < class MATRIX >
struct matrix_traits
: matrix_view_traits <MATRIX>, mutable_matrix_traits <MATRIX> {
: matrix_view_traits <MATRIX>, mutable_matrix_traits <MATRIX> {
};
/** \brief Traits class to extract type information from a VECTOR.
@@ -694,16 +694,16 @@ namespace boost { namespace numeric { namespace ublas {
/// iterator for the VECTOR
typedef typename VECTOR::const_iterator const_iterator;
/// iterator pointing to the first element
static
const_iterator begin(const VECTOR & v) {
return v.begin();
}
/// iterator pointing behind the last element
static
const_iterator end(const VECTOR & v) {
return v.end();
}
/// iterator pointing to the first element
static
const_iterator begin(const VECTOR & v) {
return v.begin();
}
/// iterator pointing behind the last element
static
const_iterator end(const VECTOR & v) {
return v.end();
}
};
@@ -715,17 +715,17 @@ namespace boost { namespace numeric { namespace ublas {
/// iterator for the VECTOR
typedef typename VECTOR::iterator iterator;
/// iterator pointing to the first element
static
iterator begin(VECTOR & v) {
return v.begin();
}
/// iterator pointing to the first element
static
iterator begin(VECTOR & v) {
return v.begin();
}
/// iterator pointing behind the last element
static
iterator end(VECTOR & v) {
return v.end();
}
/// iterator pointing behind the last element
static
iterator end(VECTOR & v) {
return v.end();
}
};
/** \brief Traits class to extract type information from a VECTOR.
@@ -733,7 +733,7 @@ namespace boost { namespace numeric { namespace ublas {
*/
template < class VECTOR >
struct vector_traits
: vector_view_traits <VECTOR>, mutable_vector_traits <VECTOR> {
: vector_view_traits <VECTOR>, mutable_vector_traits <VECTOR> {
};

View File

@@ -75,9 +75,9 @@ BOOST_AUTO_TEST_CASE( test_construction_from_pointers )
{
std::cout << ( ublas::make_compressed_matrix_view<ublas::column_major,IB>(4,3,NNZ
, ublas::c_array_view<const unsigned int>(4,&(IA[0]))
, ublas::c_array_view<const unsigned int>(6,&(JA[0]))
, ublas::c_array_view<const double>(6,&(VA[0]))) ) << std::endl;
, ublas::c_array_view<const unsigned int>(4,&(IA[0]))
, ublas::c_array_view<const unsigned int>(6,&(JA[0]))
, ublas::c_array_view<const double>(6,&(VA[0]))) ) << std::endl;
unsigned int * ia = new unsigned int[4]();
unsigned int * ja = new unsigned int[6]();
@@ -94,9 +94,9 @@ BOOST_AUTO_TEST_CASE( test_construction_from_pointers )
, ublas::c_array_view<double> > COMPMATVIEW;
COMPMATVIEW viewA(4,3,NNZ
, ublas::c_array_view<unsigned int>(4,ia)
, ublas::c_array_view<unsigned int>(6,ja)
, ublas::c_array_view<double>(6,va));
, ublas::c_array_view<unsigned int>(4,ia)
, ublas::c_array_view<unsigned int>(6,ja)
, ublas::c_array_view<double>(6,va));
std::cout << viewA << std::endl;

View File

@@ -14,9 +14,9 @@
#define JOIN_(x,y) x ## y
#ifndef NDEBUG
# define BOOST_UBLAS_DEBUG_TRACE(x) std::cerr << "[Debug>> " << EXPAND_(x) << std::endl
# define BOOST_UBLAS_DEBUG_TRACE(x) std::cerr << "[Debug>> " << EXPAND_(x) << std::endl
#else
# define BOOST_UBLAS_DEBUG_TRACE(x) /**/
# define BOOST_UBLAS_DEBUG_TRACE(x) /**/
#endif // NDEBUG
#define BOOST_UBLAS_TEST_BEGIN() unsigned int test_fails_(0)