@@ -14,6 +14,9 @@
|
||||
template<typename Scalar>
|
||||
void assert_is_VectorX(const std::string name, const Eigen::PlainObjectBase<Scalar>& v)
|
||||
{
|
||||
if (v.size() == 0)
|
||||
return;
|
||||
|
||||
if (v.cols() != 1)
|
||||
throw std::runtime_error(name + " must be a column vector.");
|
||||
}
|
||||
@@ -21,6 +24,9 @@ void assert_is_VectorX(const std::string name, const Eigen::PlainObjectBase<Scal
|
||||
template<typename Scalar>
|
||||
void assert_is_RowVectorX(const std::string name, const Eigen::PlainObjectBase<Scalar>& v)
|
||||
{
|
||||
if (v.size() == 0)
|
||||
return;
|
||||
|
||||
if (v.rows() != 1)
|
||||
throw std::runtime_error(name + " must be a row vector.");
|
||||
}
|
||||
@@ -28,6 +34,9 @@ void assert_is_RowVectorX(const std::string name, const Eigen::PlainObjectBase<S
|
||||
template<typename Scalar>
|
||||
void assert_is_Vector3(const std::string name, const Eigen::PlainObjectBase<Scalar>& v)
|
||||
{
|
||||
if (v.size() == 0)
|
||||
return;
|
||||
|
||||
if ((v.cols() != 1) || (v.rows() != 3))
|
||||
throw std::runtime_error(name + " must be a column vector with 3 entries.");
|
||||
}
|
||||
@@ -35,6 +44,9 @@ void assert_is_Vector3(const std::string name, const Eigen::PlainObjectBase<Scal
|
||||
template<typename Scalar>
|
||||
void assert_is_RowVector3(const std::string name, const Eigen::PlainObjectBase<Scalar>& v)
|
||||
{
|
||||
if (v.size() == 0)
|
||||
return;
|
||||
|
||||
if ((v.cols() != 3) || (v.rows() != 1))
|
||||
throw std::runtime_error(name + " must be a row vector with 3 entries.");
|
||||
}
|
||||
@@ -42,6 +54,9 @@ void assert_is_RowVector3(const std::string name, const Eigen::PlainObjectBase<S
|
||||
template<typename Scalar>
|
||||
void assert_is_Vector4(const std::string name, const Eigen::PlainObjectBase<Scalar>& v)
|
||||
{
|
||||
if (v.size() == 0)
|
||||
return;
|
||||
|
||||
if ((v.cols() != 1) || (v.rows() != 4))
|
||||
throw std::runtime_error(name + " must be a column vector with 4 entries.");
|
||||
}
|
||||
@@ -49,6 +64,9 @@ void assert_is_Vector4(const std::string name, const Eigen::PlainObjectBase<Scal
|
||||
template<typename Scalar>
|
||||
void assert_is_RowVector4(const std::string name, const Eigen::PlainObjectBase<Scalar>& v)
|
||||
{
|
||||
if (v.size() == 0)
|
||||
return;
|
||||
|
||||
if ((v.cols() != 4) || (v.rows() != 1))
|
||||
throw std::runtime_error(name + " must be a row vector with 4 entries.");
|
||||
}
|
||||
@@ -56,6 +74,9 @@ void assert_is_RowVector4(const std::string name, const Eigen::PlainObjectBase<S
|
||||
template<typename Scalar>
|
||||
void assert_is_Matrix4(const std::string name, const Eigen::PlainObjectBase<Scalar>& v)
|
||||
{
|
||||
if (v.size() == 0)
|
||||
return;
|
||||
|
||||
if ((v.cols() != 4) || (v.rows() != 4))
|
||||
throw std::runtime_error(name + " must be a 4x4 matrix.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user