Commit 47538992 authored by Davis King's avatar Davis King

Minor code cleanup. I removed a bunch of superfluous copy constructors. There

was a time when they played an important role but now they are just cruft.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403269
parent 07946078
...@@ -312,10 +312,6 @@ namespace dlib ...@@ -312,10 +312,6 @@ namespace dlib
typedef typename conditional_matrix_temp<const LHS,lhs_is_costly == false>::type LHS_ref_type; typedef typename conditional_matrix_temp<const LHS,lhs_is_costly == false>::type LHS_ref_type;
typedef typename conditional_matrix_temp<const RHS,rhs_is_costly == false>::type RHS_ref_type; typedef typename conditional_matrix_temp<const RHS,rhs_is_costly == false>::type RHS_ref_type;
matrix_multiply_exp (
const matrix_multiply_exp& item
) : matrix_exp<matrix_multiply_exp>(*this), lhs(item.lhs), rhs(item.rhs) {}
// This constructor exists simply for the purpose of causing a compile time error if // This constructor exists simply for the purpose of causing a compile time error if
// someone tries to create an instance of this object with the wrong kind of objects. // someone tries to create an instance of this object with the wrong kind of objects.
template <typename T1, typename T2> template <typename T1, typename T2>
...@@ -473,10 +469,6 @@ namespace dlib ...@@ -473,10 +469,6 @@ namespace dlib
const static long cost = matrix_traits<matrix_add_exp>::cost; const static long cost = matrix_traits<matrix_add_exp>::cost;
typedef typename matrix_traits<matrix_add_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_add_exp>::layout_type layout_type;
matrix_add_exp (
const matrix_add_exp& item
) : matrix_exp<matrix_add_exp>(*this), lhs(item.lhs), rhs(item.rhs) {}
// This constructor exists simply for the purpose of causing a compile time error if // This constructor exists simply for the purpose of causing a compile time error if
// someone tries to create an instance of this object with the wrong kind of objects. // someone tries to create an instance of this object with the wrong kind of objects.
template <typename T1, typename T2> template <typename T1, typename T2>
...@@ -582,9 +574,6 @@ namespace dlib ...@@ -582,9 +574,6 @@ namespace dlib
const static long cost = matrix_traits<matrix_subtract_exp>::cost; const static long cost = matrix_traits<matrix_subtract_exp>::cost;
typedef typename matrix_traits<matrix_subtract_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_subtract_exp>::layout_type layout_type;
matrix_subtract_exp (
const matrix_subtract_exp& item
) : matrix_exp<matrix_subtract_exp>(*this), lhs(item.lhs), rhs(item.rhs) {}
// This constructor exists simply for the purpose of causing a compile time error if // This constructor exists simply for the purpose of causing a compile time error if
// someone tries to create an instance of this object with the wrong kind of objects. // someone tries to create an instance of this object with the wrong kind of objects.
...@@ -690,9 +679,6 @@ namespace dlib ...@@ -690,9 +679,6 @@ namespace dlib
const static long cost = matrix_traits<matrix_div_scal_exp>::cost; const static long cost = matrix_traits<matrix_div_scal_exp>::cost;
typedef typename matrix_traits<matrix_div_scal_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_div_scal_exp>::layout_type layout_type;
matrix_div_scal_exp (
const matrix_div_scal_exp& item
) : matrix_exp<matrix_div_scal_exp>(*this), m(item.m), s(item.s) {}
// This constructor exists simply for the purpose of causing a compile time error if // This constructor exists simply for the purpose of causing a compile time error if
// someone tries to create an instance of this object with the wrong kind of objects. // someone tries to create an instance of this object with the wrong kind of objects.
...@@ -783,9 +769,6 @@ namespace dlib ...@@ -783,9 +769,6 @@ namespace dlib
const static long cost = matrix_traits<matrix_mul_scal_exp>::cost; const static long cost = matrix_traits<matrix_mul_scal_exp>::cost;
typedef typename matrix_traits<matrix_mul_scal_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_mul_scal_exp>::layout_type layout_type;
matrix_mul_scal_exp (
const matrix_mul_scal_exp& item
) : matrix_exp<matrix_mul_scal_exp>(*this), m(item.m), s(item.s) {}
// This constructor exists simply for the purpose of causing a compile time error if // This constructor exists simply for the purpose of causing a compile time error if
// someone tries to create an instance of this object with the wrong kind of objects. // someone tries to create an instance of this object with the wrong kind of objects.
...@@ -1106,7 +1089,7 @@ namespace dlib ...@@ -1106,7 +1089,7 @@ namespace dlib
matrix ( matrix (
const matrix& m const matrix& m
): matrix_exp<matrix>(*this) )
{ {
data.set_size(m.nr(),m.nc()); data.set_size(m.nr(),m.nc());
matrix_assign(*this, m); matrix_assign(*this, m);
......
...@@ -242,13 +242,6 @@ namespace dlib ...@@ -242,13 +242,6 @@ namespace dlib
const static long NC = matrix_traits<matrix_unary_exp>::NC; const static long NC = matrix_traits<matrix_unary_exp>::NC;
const static long cost = matrix_traits<matrix_unary_exp>::cost; const static long cost = matrix_traits<matrix_unary_exp>::cost;
matrix_unary_exp (
const matrix_unary_exp& item
) :
matrix_exp<matrix_unary_exp>(*this),
m(item.m)
{}
// This constructor exists simply for the purpose of causing a compile time error if // This constructor exists simply for the purpose of causing a compile time error if
// someone tries to create an instance of this object with the wrong kind of objects. // someone tries to create an instance of this object with the wrong kind of objects.
template <typename T1> template <typename T1>
...@@ -326,14 +319,7 @@ namespace dlib ...@@ -326,14 +319,7 @@ namespace dlib
const static long cost = matrix_traits<matrix_scalar_binary_exp>::cost; const static long cost = matrix_traits<matrix_scalar_binary_exp>::cost;
typedef typename matrix_traits<matrix_scalar_binary_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_scalar_binary_exp>::layout_type layout_type;
matrix_scalar_binary_exp (
const matrix_scalar_binary_exp& item
) :
matrix_exp<matrix_scalar_binary_exp>(*this),
m(item.m),
s(item.s)
{}
// This constructor exists simply for the purpose of causing a compile time error if // This constructor exists simply for the purpose of causing a compile time error if
// someone tries to create an instance of this object with the wrong kind of objects. // someone tries to create an instance of this object with the wrong kind of objects.
template <typename T1> template <typename T1>
...@@ -416,16 +402,7 @@ namespace dlib ...@@ -416,16 +402,7 @@ namespace dlib
const static long cost = matrix_traits<matrix_scalar_ternary_exp>::cost; const static long cost = matrix_traits<matrix_scalar_ternary_exp>::cost;
typedef typename matrix_traits<matrix_scalar_ternary_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_scalar_ternary_exp>::layout_type layout_type;
matrix_scalar_ternary_exp (
const matrix_scalar_ternary_exp& item
) :
matrix_exp<matrix_scalar_ternary_exp>(*this),
m(item.m),
s1(item.s1),
s2(item.s2)
{
}
// This constructor exists simply for the purpose of causing a compile time error if // This constructor exists simply for the purpose of causing a compile time error if
// someone tries to create an instance of this object with the wrong kind of objects. // someone tries to create an instance of this object with the wrong kind of objects.
template <typename T1> template <typename T1>
...@@ -511,13 +488,6 @@ namespace dlib ...@@ -511,13 +488,6 @@ namespace dlib
const static long cost = matrix_traits<matrix_binary_exp>::cost; const static long cost = matrix_traits<matrix_binary_exp>::cost;
typedef typename matrix_traits<matrix_binary_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_binary_exp>::layout_type layout_type;
matrix_binary_exp (
const matrix_binary_exp& item
) :
matrix_exp<matrix_binary_exp>(*this),
m1(item.m1),
m2(item.m2)
{}
// This constructor exists simply for the purpose of causing a compile time error if // This constructor exists simply for the purpose of causing a compile time error if
// someone tries to create an instance of this object with the wrong kind of objects. // someone tries to create an instance of this object with the wrong kind of objects.
...@@ -601,14 +571,6 @@ namespace dlib ...@@ -601,14 +571,6 @@ namespace dlib
const static long cost = matrix_traits<matrix_ternary_exp>::cost; const static long cost = matrix_traits<matrix_ternary_exp>::cost;
typedef typename matrix_traits<matrix_ternary_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_ternary_exp>::layout_type layout_type;
matrix_ternary_exp (
const matrix_ternary_exp& item
) :
matrix_exp<matrix_ternary_exp>(*this),
m1(item.m1),
m2(item.m2),
m3(item.m3)
{}
// This constructor exists simply for the purpose of causing a compile time error if // This constructor exists simply for the purpose of causing a compile time error if
// someone tries to create an instance of this object with the wrong kind of objects. // someone tries to create an instance of this object with the wrong kind of objects.
...@@ -696,15 +658,6 @@ namespace dlib ...@@ -696,15 +658,6 @@ namespace dlib
const static long cost = matrix_traits<matrix_fourary_exp>::cost; const static long cost = matrix_traits<matrix_fourary_exp>::cost;
typedef typename matrix_traits<matrix_fourary_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_fourary_exp>::layout_type layout_type;
matrix_fourary_exp (
const matrix_fourary_exp& item
) :
matrix_exp<matrix_fourary_exp>(*this),
m1(item.m1),
m2(item.m2),
m3(item.m3),
m4(item.m4)
{}
// This constructor exists simply for the purpose of causing a compile time error if // This constructor exists simply for the purpose of causing a compile time error if
// someone tries to create an instance of this object with the wrong kind of objects. // someone tries to create an instance of this object with the wrong kind of objects.
...@@ -789,14 +742,6 @@ namespace dlib ...@@ -789,14 +742,6 @@ namespace dlib
const static long cost = matrix_traits<dynamic_matrix_scalar_unary_exp>::cost; const static long cost = matrix_traits<dynamic_matrix_scalar_unary_exp>::cost;
typedef typename matrix_traits<dynamic_matrix_scalar_unary_exp>::layout_type layout_type; typedef typename matrix_traits<dynamic_matrix_scalar_unary_exp>::layout_type layout_type;
dynamic_matrix_scalar_unary_exp (
const dynamic_matrix_scalar_unary_exp& item
) :
matrix_exp<dynamic_matrix_scalar_unary_exp>(*this),
nr_(item.nr_),
nc_(item.nc_),
s(item.s)
{}
dynamic_matrix_scalar_unary_exp ( dynamic_matrix_scalar_unary_exp (
long nr__, long nr__,
...@@ -875,12 +820,6 @@ namespace dlib ...@@ -875,12 +820,6 @@ namespace dlib
const static long cost = matrix_traits<matrix_scalar_unary_exp>::cost; const static long cost = matrix_traits<matrix_scalar_unary_exp>::cost;
typedef typename matrix_traits<matrix_scalar_unary_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_scalar_unary_exp>::layout_type layout_type;
matrix_scalar_unary_exp (
const matrix_scalar_unary_exp& item
) :
matrix_exp<matrix_scalar_unary_exp>(*this),
s(item.s)
{}
matrix_scalar_unary_exp ( matrix_scalar_unary_exp (
const S& s_ const S& s_
...@@ -948,11 +887,6 @@ namespace dlib ...@@ -948,11 +887,6 @@ namespace dlib
const static long cost = matrix_traits<matrix_zeroary_exp>::cost; const static long cost = matrix_traits<matrix_zeroary_exp>::cost;
typedef typename matrix_traits<matrix_zeroary_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_zeroary_exp>::layout_type layout_type;
matrix_zeroary_exp (
const matrix_zeroary_exp&
) :
matrix_exp<matrix_zeroary_exp>(*this)
{}
matrix_zeroary_exp ( matrix_zeroary_exp (
) {} ) {}
...@@ -1022,15 +956,6 @@ namespace dlib ...@@ -1022,15 +956,6 @@ namespace dlib
const static long cost = matrix_traits<matrix_sub_range_exp>::cost; const static long cost = matrix_traits<matrix_sub_range_exp>::cost;
typedef typename matrix_traits<matrix_sub_range_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_sub_range_exp>::layout_type layout_type;
matrix_sub_range_exp (
const matrix_sub_range_exp& item
) :
matrix_exp<matrix_sub_range_exp>(*this),
m(item.m),
rows(item.rows),
cols(item.cols)
{
}
// This constructor exists simply for the purpose of causing a compile time error if // This constructor exists simply for the purpose of causing a compile time error if
// someone tries to create an instance of this object with the wrong kind of objects. // someone tries to create an instance of this object with the wrong kind of objects.
...@@ -1113,13 +1038,6 @@ namespace dlib ...@@ -1113,13 +1038,6 @@ namespace dlib
const static long cost = matrix_traits<matrix_std_vector_exp>::cost; const static long cost = matrix_traits<matrix_std_vector_exp>::cost;
typedef typename matrix_traits<matrix_std_vector_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_std_vector_exp>::layout_type layout_type;
matrix_std_vector_exp (
const matrix_std_vector_exp& item
) :
matrix_exp<matrix_std_vector_exp>(*this),
m(item.m)
{
}
// This constructor exists simply for the purpose of causing a compile time error if // This constructor exists simply for the purpose of causing a compile time error if
// someone tries to create an instance of this object with the wrong kind of objects. // someone tries to create an instance of this object with the wrong kind of objects.
...@@ -1195,14 +1113,7 @@ namespace dlib ...@@ -1195,14 +1113,7 @@ namespace dlib
const static long cost = matrix_traits<matrix_array_exp>::cost; const static long cost = matrix_traits<matrix_array_exp>::cost;
typedef typename matrix_traits<matrix_array_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_array_exp>::layout_type layout_type;
matrix_array_exp (
const matrix_array_exp& item
) :
matrix_exp<matrix_array_exp>(*this),
m(item.m)
{
}
// This constructor exists simply for the purpose of causing a compile time error if // This constructor exists simply for the purpose of causing a compile time error if
// someone tries to create an instance of this object with the wrong kind of objects. // someone tries to create an instance of this object with the wrong kind of objects.
template <typename T1> template <typename T1>
...@@ -1277,13 +1188,6 @@ namespace dlib ...@@ -1277,13 +1188,6 @@ namespace dlib
const static long cost = matrix_traits<matrix_array2d_exp>::cost; const static long cost = matrix_traits<matrix_array2d_exp>::cost;
typedef typename matrix_traits<matrix_array2d_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_array2d_exp>::layout_type layout_type;
matrix_array2d_exp (
const matrix_array2d_exp& item
) :
matrix_exp<matrix_array2d_exp>(*this),
m(item.m)
{
}
// This constructor exists simply for the purpose of causing a compile time error if // This constructor exists simply for the purpose of causing a compile time error if
// someone tries to create an instance of this object with the wrong kind of objects. // someone tries to create an instance of this object with the wrong kind of objects.
...@@ -1358,17 +1262,6 @@ namespace dlib ...@@ -1358,17 +1262,6 @@ namespace dlib
const static long cost = matrix_traits<matrix_sub_exp>::cost; const static long cost = matrix_traits<matrix_sub_exp>::cost;
typedef typename matrix_traits<matrix_sub_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_sub_exp>::layout_type layout_type;
matrix_sub_exp (
const matrix_sub_exp& item
) :
matrix_exp<matrix_sub_exp>(*this),
m(item.m),
r_(item.r_),
c_(item.c_),
nr_(item.nr_),
nc_(item.nc_)
{
}
// This constructor exists simply for the purpose of causing a compile time error if // This constructor exists simply for the purpose of causing a compile time error if
// someone tries to create an instance of this object with the wrong kind of objects. // someone tries to create an instance of this object with the wrong kind of objects.
...@@ -1446,14 +1339,6 @@ namespace dlib ...@@ -1446,14 +1339,6 @@ namespace dlib
const static long cost = matrix_traits<matrix_range_exp>::cost; const static long cost = matrix_traits<matrix_range_exp>::cost;
typedef typename matrix_traits<matrix_range_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_range_exp>::layout_type layout_type;
matrix_range_exp (
const matrix_range_exp& item
) :
matrix_exp<matrix_range_exp>(*this),
nc_(item.nc_),
start(item.start),
inc(item.inc)
{}
matrix_range_exp ( matrix_range_exp (
T start_, T start_,
...@@ -1559,14 +1444,6 @@ namespace dlib ...@@ -1559,14 +1444,6 @@ namespace dlib
const static long cost = matrix_traits<matrix_log_range_exp>::cost; const static long cost = matrix_traits<matrix_log_range_exp>::cost;
typedef typename matrix_traits<matrix_log_range_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_log_range_exp>::layout_type layout_type;
matrix_log_range_exp (
const matrix_log_range_exp& item
) :
matrix_exp<matrix_log_range_exp>(*this),
nc_(item.nc_),
start(item.start),
inc(item.inc)
{}
matrix_log_range_exp ( matrix_log_range_exp (
T start_, T start_,
...@@ -1647,11 +1524,6 @@ namespace dlib ...@@ -1647,11 +1524,6 @@ namespace dlib
const static long inc = (start <= end)?inc_:-inc_; const static long inc = (start <= end)?inc_:-inc_;
matrix_range_static_exp (
const matrix_range_static_exp&
) :
matrix_exp<matrix_range_static_exp>(*this)
{}
matrix_range_static_exp ( matrix_range_static_exp (
) {} ) {}
......
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