mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
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
Block a user