Commit 031e5af3 authored by Davis King's avatar Davis King

Fixed compiler warnings in visual studio

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403433
parent 8557e674
......@@ -95,7 +95,7 @@ namespace dlib
typedef matrix<type,NR,NC,mem_manager_type,layout_type> matrix_type;
typedef EXP exp_type;
inline const const_ret_type operator() (
inline const_ret_type operator() (
long r,
long c
) const
......@@ -112,7 +112,7 @@ namespace dlib
return ref()(r,c);
}
const const_ret_type operator() (
const_ret_type operator() (
long i
) const
{
......@@ -1768,12 +1768,12 @@ namespace dlib
ref_(item)
{}
const const_ret_type operator() (
const_ret_type operator() (
long r,
long c
) const { return ref_(r,c); }
const const_ret_type operator() ( long i ) const
const_ret_type operator() ( long i ) const
{ return ref_(i); }
template <typename U>
......
......@@ -54,7 +54,9 @@ namespace dlib
const_ret_type typedef (defined below)
The purpose of the const_ret_type typedef is to allow matrix expressions
to return their elements by reference when appropriate. So const_ret_type
should either be of the same type as "type" or be of type "const type&".
should be one of the following types:
- const type
- const type&
!*/
public:
......@@ -68,7 +70,7 @@ namespace dlib
typedef matrix<type,NR,NC, mem_manager_type,layout_type> matrix_type;
typedef EXP exp_type;
const const_ret_type operator() (
const_ret_type operator() (
long r,
long c
) const;
......@@ -82,7 +84,7 @@ namespace dlib
the matrix represented by this matrix expression)
!*/
const const_ret_type operator() (
const_ret_type operator() (
long i
) const;
/*!
......
......@@ -255,12 +255,12 @@ namespace dlib
m(m_)
{}
const const_ret_type operator() (
const_ret_type operator() (
long r,
long c
) const { return OP::apply(m,r,c); }
const const_ret_type operator() ( long i ) const
const_ret_type operator() ( long i ) const
{ return matrix_exp<matrix_unary_exp>::operator()(i); }
template <typename U>
......@@ -339,12 +339,12 @@ namespace dlib
COMPILE_TIME_ASSERT(is_matrix<S>::value == false);
}
const const_ret_type operator() (
const_ret_type operator() (
long r,
long c
) const { return OP::apply(m,s,r,c); }
const const_ret_type operator() ( long i ) const
const_ret_type operator() ( long i ) const
{ return matrix_exp<matrix_scalar_binary_exp>::operator()(i); }
template <typename U>
......@@ -426,12 +426,12 @@ namespace dlib
COMPILE_TIME_ASSERT(is_matrix<S>::value == false);
}
const const_ret_type operator() (
const_ret_type operator() (
long r,
long c
) const { return OP::apply(m,s1,s2,r,c); }
const const_ret_type operator() ( long i ) const
const_ret_type operator() ( long i ) const
{ return matrix_exp<matrix_scalar_ternary_exp>::operator()(i); }
template <typename U>
......@@ -510,12 +510,12 @@ namespace dlib
m2(m2_)
{}
const const_ret_type operator() (
const_ret_type operator() (
long r,
long c
) const { return OP::apply(m1,m2,r,c); }
const const_ret_type operator() ( long i ) const
const_ret_type operator() ( long i ) const
{ return matrix_exp<matrix_binary_exp>::operator()(i); }
template <typename U>
......@@ -597,12 +597,12 @@ namespace dlib
m3(m3_)
{}
const const_ret_type operator() (
const_ret_type operator() (
long r,
long c
) const { return OP::apply(m1,m2,m3,r,c); }
const const_ret_type operator() ( long i ) const
const_ret_type operator() ( long i ) const
{ return matrix_exp<matrix_ternary_exp>::operator()(i); }
template <typename U>
......@@ -688,12 +688,12 @@ namespace dlib
m4(m4_)
{}
const const_ret_type operator() (
const_ret_type operator() (
long r,
long c
) const { return OP::apply(m1,m2,m3,m4,r,c); }
const const_ret_type operator() ( long i ) const
const_ret_type operator() ( long i ) const
{ return matrix_exp<matrix_fourary_exp>::operator()(i); }
template <typename U>
......@@ -769,12 +769,12 @@ namespace dlib
COMPILE_TIME_ASSERT(is_matrix<S>::value == false);
}
const const_ret_type operator() (
const_ret_type operator() (
long r,
long c
) const { return OP::apply(s,r,c); }
const const_ret_type operator() ( long i ) const
const_ret_type operator() ( long i ) const
{ return matrix_exp<dynamic_matrix_scalar_unary_exp>::operator()(i); }
template <typename U>
......@@ -845,12 +845,12 @@ namespace dlib
COMPILE_TIME_ASSERT(is_matrix<S>::value == false);
}
const const_ret_type operator() (
const_ret_type operator() (
long r,
long c
) const { return OP::apply(s,r,c); }
const const_ret_type operator() ( long i ) const
const_ret_type operator() ( long i ) const
{ return matrix_exp<matrix_scalar_unary_exp>::operator()(i); }
template <typename U>
......@@ -909,12 +909,12 @@ namespace dlib
matrix_zeroary_exp (
) {}
const const_ret_type operator() (
const_ret_type operator() (
long r,
long c
) const { return OP::apply(r,c); }
const const_ret_type operator() ( long i ) const
const_ret_type operator() ( long i ) const
{ return matrix_exp<matrix_zeroary_exp>::operator()(i); }
template <typename U>
......@@ -993,12 +993,12 @@ namespace dlib
{
}
const const_ret_type operator() (
const_ret_type operator() (
long r,
long c
) const { return m(rows(r),cols(c)); }
const const_ret_type operator() ( long i ) const
const_ret_type operator() ( long i ) const
{ return matrix_exp<matrix_sub_range_exp>::operator()(i); }
template <typename U>
......@@ -1073,12 +1073,12 @@ namespace dlib
{
}
const const_ret_type operator() (
const_ret_type operator() (
long r,
long
) const { return m[r]; }
const const_ret_type operator() ( long i ) const
const_ret_type operator() ( long i ) const
{ return m[i]; }
template <typename U>
......@@ -1150,12 +1150,12 @@ namespace dlib
{
}
const const_ret_type operator() (
const_ret_type operator() (
long r,
long
) const { return m[r]; }
const const_ret_type operator() ( long i ) const
const_ret_type operator() ( long i ) const
{ return m[i]; }
template <typename U>
......@@ -1227,12 +1227,12 @@ namespace dlib
{
}
const const_ret_type operator() (
const_ret_type operator() (
long r,
long c
) const { return m[r][c]; }
const const_ret_type operator() ( long i ) const
const_ret_type operator() ( long i ) const
{ return matrix_exp<matrix_array2d_exp>::operator()(i); }
template <typename U>
......@@ -1311,12 +1311,12 @@ namespace dlib
{
}
const const_ret_type operator() (
const_ret_type operator() (
long r,
long c
) const { return m(r+r_,c+c_); }
const const_ret_type operator() ( long i ) const
const_ret_type operator() ( long i ) const
{ return matrix_exp<matrix_sub_exp>::operator()(i); }
template <typename U>
......@@ -1349,7 +1349,7 @@ namespace dlib
struct matrix_traits<matrix_range_exp<T> >
{
typedef T type;
typedef T const_ret_type;
typedef const T const_ret_type;
typedef memory_manager<char>::kernel_1a mem_manager_type;
typedef row_major_layout layout_type;
const static long NR = 1;
......@@ -1417,12 +1417,12 @@ namespace dlib
}
const const_ret_type operator() (
const_ret_type operator() (
long,
long c
) const { return start + c*inc; }
const const_ret_type operator() (
const_ret_type operator() (
long c
) const { return start + c*inc; }
......@@ -1456,7 +1456,7 @@ namespace dlib
struct matrix_traits<matrix_log_range_exp<T> >
{
typedef T type;
typedef T const_ret_type;
typedef const T const_ret_type;
typedef memory_manager<char>::kernel_1a mem_manager_type;
typedef row_major_layout layout_type;
const static long NR = 1;
......@@ -1497,12 +1497,12 @@ namespace dlib
}
const const_ret_type operator() (
const_ret_type operator() (
long,
long c
) const { return std::pow((T)10,start + c*inc); }
const const_ret_type operator() (
const_ret_type operator() (
long c
) const { return std::pow(10,start + c*inc); }
......@@ -1536,7 +1536,7 @@ namespace dlib
struct matrix_traits<matrix_range_static_exp<start,inc_,end> >
{
typedef long type;
typedef long const_ret_type;
typedef const long const_ret_type;
typedef memory_manager<char>::kernel_1a mem_manager_type;
const static long NR = 1;
const static long NC = tabs<(end - start)>::value/inc_ + 1;
......@@ -1562,12 +1562,12 @@ namespace dlib
matrix_range_static_exp (
) {}
const const_ret_type operator() (
const_ret_type operator() (
long ,
long c
) const { return start + c*inc; }
const const_ret_type operator() (
const_ret_type operator() (
long c
) const { return start + c*inc; }
......
This diff is collapsed.
......@@ -161,7 +161,7 @@ namespace dlib
typedef typename EXP::const_ret_type const_ret_type;
typedef typename EXP::mem_manager_type mem_manager_type;
template <typename M>
static const const_ret_type apply ( const M& m, long row, long, long c)
static const_ret_type apply ( const M& m, long row, long, long c)
{ return m(row,c); }
template <typename M>
......@@ -205,7 +205,7 @@ namespace dlib
typedef typename EXP::const_ret_type const_ret_type;
typedef typename EXP::mem_manager_type mem_manager_type;
template <typename M>
static const const_ret_type apply ( const M& m, long row, long , long , long c)
static const_ret_type apply ( const M& m, long row, long , long , long c)
{ return m(row,c); }
template <typename M>
......@@ -253,7 +253,7 @@ namespace dlib
const static long NC = EXP1::NC;
template <typename M1, typename M2>
static const const_ret_type apply ( const M1& m1, const M2& rows , long r, long c)
static const_ret_type apply ( const M1& m1, const M2& rows , long r, long c)
{ return m1(rows(r),c); }
template <typename M1, typename M2>
......@@ -304,7 +304,7 @@ namespace dlib
typedef typename EXP::const_ret_type const_ret_type;
typedef typename EXP::mem_manager_type mem_manager_type;
template <typename M>
static const const_ret_type apply ( const M& m, long col, long r, long)
static const_ret_type apply ( const M& m, long col, long r, long)
{ return m(r,col); }
template <typename M>
......@@ -348,7 +348,7 @@ namespace dlib
typedef typename EXP::const_ret_type const_ret_type;
typedef typename EXP::mem_manager_type mem_manager_type;
template <typename M>
static const const_ret_type apply ( const M& m, long col, long , long r, long )
static const_ret_type apply ( const M& m, long col, long , long r, long )
{ return m(r,col); }
template <typename M>
......@@ -396,7 +396,7 @@ namespace dlib
const static long cost = EXP1::cost+EXP2::cost;
template <typename M1, typename M2>
static const const_ret_type apply ( const M1& m1, const M2& cols , long r, long c)
static const_ret_type apply ( const M1& m1, const M2& cols , long r, long c)
{ return m1(r,cols(c)); }
template <typename M1, typename M2>
......
This diff is collapsed.
......@@ -22,7 +22,7 @@ namespace dlib
struct matrix_traits<kernel_matrix_exp<kernel_type,alloc> >
{
typedef typename kernel_type::scalar_type type;
typedef typename kernel_type::scalar_type const_ret_type;
typedef const type const_ret_type;
typedef typename kernel_type::mem_manager_type mem_manager_type;
typedef row_major_layout layout_type;
const static long NR = 0;
......@@ -116,7 +116,7 @@ namespace dlib
const static long cost = EXP::cost+100;
typedef typename kernel_type::scalar_type type;
typedef typename kernel_type::scalar_type const_ret_type;
typedef const type const_ret_type;
template <typename M>
static const const_ret_type apply ( const M& m, const kernel_type& kern, const long r, long c)
{
......@@ -164,7 +164,7 @@ namespace dlib
struct matrix_traits<kernel_matrix_exp1<kernel_type,lhs_type> >
{
typedef typename kernel_type::scalar_type type;
typedef typename kernel_type::scalar_type const_ret_type;
typedef const type const_ret_type;
typedef typename kernel_type::mem_manager_type mem_manager_type;
typedef row_major_layout layout_type;
const static long NR = 0;
......@@ -281,7 +281,7 @@ namespace dlib
struct matrix_traits<kernel_matrix_exp2<kernel_type,lhs_type> >
{
typedef typename kernel_type::scalar_type type;
typedef typename kernel_type::scalar_type const_ret_type;
typedef const type const_ret_type;
typedef typename kernel_type::mem_manager_type mem_manager_type;
typedef row_major_layout layout_type;
const static long NR = 1;
......@@ -398,7 +398,7 @@ namespace dlib
struct matrix_traits<kernel_matrix_exp3<kernel_type,lhs_type,rhs_type> >
{
typedef typename kernel_type::scalar_type type;
typedef typename kernel_type::scalar_type const_ret_type;
typedef const type const_ret_type;
typedef typename kernel_type::mem_manager_type mem_manager_type;
typedef row_major_layout layout_type;
const static long NR = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment