Commit 8c797ae9 authored by Davis King's avatar Davis King

Added overloads of mat() that convert a single scalar into a matrix.

parent eb08ae92
......@@ -469,6 +469,35 @@ namespace dlib
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
inline matrix<double,1,1> mat (
double value
)
{
matrix<double,1,1> temp;
temp(0) = value;
return temp;
}
inline matrix<float,1,1> mat (
float value
)
{
matrix<float,1,1> temp;
temp(0) = value;
return temp;
}
inline matrix<long double,1,1> mat (
long double value
)
{
matrix<long double,1,1> temp;
temp(0) = value;
return temp;
}
// ----------------------------------------------------------------------------------------
}
......
......@@ -188,6 +188,17 @@ namespace dlib
R(r,c) == m(r,c)
!*/
// ----------------------------------------------------------------------------------------
matrix<double,1,1> mat (double value);
matrix<float,1,1> mat (float value);
matrix<long double,1,1> mat (long double value);
/*!
ensures
- Converts a scalar into a matrix containing just that scalar and returns the
results.
!*/
// ----------------------------------------------------------------------------------------
}
......
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