16 #ifndef SURGSIM_MATH_MLCPPROBLEM_H
17 #define SURGSIM_MATH_MLCPPROBLEM_H
62 typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic>
Matrix;
63 typedef Eigen::Matrix<double, Eigen::Dynamic, 1>
Vector;
89 return (b.rows() >= 0) ? static_cast<size_t>(b.rows()) : 0;
96 size_t numConstraintTypes = constraintTypes.size();
97 return ((b.rows() >= 0) && (b.cols() == 1) && (A.rows() == b.rows()) && (A.cols() == A.rows())
98 && (numConstraintTypes <= static_cast<size_t>(b.rows())) && (mu.size() >= 0)
99 && (static_cast<size_t>(mu.size()) == numConstraintTypes));
106 virtual void setZero(
size_t numDof,
size_t numConstraintDof,
size_t numConstraints);
113 static MlcpProblem Zero(
size_t numDof,
size_t numConstraintDof,
size_t numConstraints);
119 #endif // SURGSIM_MATH_MLCPPROBLEM_H
Definition: DriveElementFromInputBehavior.cpp:27
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
Definition: MlcpProblem.h:63
Matrix A
Matrix used to describe the mixed LCP problem.
Definition: MlcpProblem.h:66
virtual void setZero(size_t numDof, size_t numConstraintDof, size_t numConstraints)
Resize an MlcpProblem and set to zero.
Definition: MlcpProblem.cpp:27
bool isConsistent() const
Checks if the sizes of various elements of the system are consistent with each other.
Definition: MlcpProblem.h:94
size_t getSize() const
Gets the size of the system.
Definition: MlcpProblem.h:87
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition: MlcpProblem.h:62
static MlcpProblem Zero(size_t numDof, size_t numConstraintDof, size_t numConstraints)
Initialize an MlcpProblem with zero values.
Definition: MlcpProblem.cpp:39
std::vector< MlcpConstraintType > constraintTypes
A vector of constraint types used to describe the mixed LCP problem.
Definition: MlcpProblem.h:74
Vector b
Vector used to describe the mixed LCP problem.
Definition: MlcpProblem.h:68
A description of an MLCP (mixed linear complementarity problem, or mixed LCP) system to be solved...
Definition: MlcpProblem.h:57
Vector mu
A vector of friction coefficients used to describe the mixed LCP problem.
Definition: MlcpProblem.h:71
virtual ~MlcpProblem()
Destructor.
Definition: MlcpProblem.cpp:23