mirror of https://github.com/davisking/dlib.git
Added overloads of mat() that convert a single scalar into a matrix.
This commit is contained in:
parent
eb08ae92a8
commit
8c797ae9b3
|
@ -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.
|
||||
!*/
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue