4 if (newConst ==
nullptr)
5 throw VertexException(
"MultipleKinematicConstraint::zero constraint pointer passed");
6 cts.push_back(newConst);
12 throw VertexException(
"MultipleKinematicConstraint::value requested for empty constraint");
13 if (exPoint.num_row() == 0)
14 throw VertexException(
"MultipleKinematicConstraint::value requested for zero Linearization point");
20 int inSize = exPoint.num_row();
21 if ((inSize % 7) != 0)
22 throw VertexException(
"MultipleKinematicConstraint::linearization point has a wrong dimension");
25 for (std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++) {
26 total += (*i)->numberOfEquations();
31 for (std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++) {
33 int sz = vlc.num_row();
34 for (
int j = 1;
j < sz + 1;
j++) {
35 vl(cr_size +
j) = vlc(
j);
39 return std::pair<AlgebraicVector, AlgebraicVector>(vl, expansion);
45 throw VertexException(
"MultipleKinematicConstraint::derivative requested for empty constraint");
46 if (exPoint.num_row() == 0)
47 throw VertexException(
"MultipleKinematicConstraint::value requested for zero Linearization point");
50 int inSize = exPoint.num_row();
51 if ((inSize % 7) != 0)
52 throw VertexException(
"MultipleKinematicConstraint::linearization point has a wrong dimension");
56 for (std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++) {
57 total += (*i)->numberOfEquations();
64 for (std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++) {
67 dr.sub(cr_size + 1, 1, lConst);
68 cr_size += (*i)->numberOfEquations();
70 return std::pair<AlgebraicMatrix, AlgebraicVector>(
dr, par);
76 throw VertexException(
"MultipleKinematicConstraint::number of equations requested for empty constraint");
77 for (std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++) {
78 ne += (*i)->numberOfEquations();
84 const std::vector<RefCountedKinematicParticle> &par)
const {
86 throw VertexException(
"MultipleKinematicConstraint::derivative requested for empty constraint");
87 int nStates = par.size();
90 for (std::vector<RefCountedKinematicParticle>::const_iterator
i = par.begin();
i != par.end();
i++) {
91 for (
int j = 1;
j < 8;
j++) {
92 param((
count - 1) * 7 +
j) = (*i)->currentState().kinematicParameters().vector()(
j - 1);
99 for (std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++) {
100 total += (*i)->numberOfEquations();
105 for (std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++) {
107 int sz = vlc.num_row();
108 for (
int j = 1;
j <= sz;
j++) {
109 vl(cr_size +
j) = vlc(
j);
113 return std::pair<AlgebraicVector, AlgebraicVector>(vl, param);
117 const std::vector<RefCountedKinematicParticle> &par)
const {
119 throw VertexException(
"MultipleKinematicConstraint::derivative requested for empty constraint");
120 int nStates = par.size();
124 for (std::vector<RefCountedKinematicParticle>::const_iterator
i = par.begin();
i != par.end();
i++) {
125 for (
int j = 1;
j < 8;
j++) {
126 param((
count - 1) * 7 +
j) = (*i)->currentState().kinematicParameters().vector()(
j - 1);
131 for (std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++) {
132 total += (*i)->numberOfEquations();
137 for (std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++) {
143 dr.sub(cr_size + 1, 1, lConst);
144 cr_size += (*i)->numberOfEquations();
146 return std::pair<AlgebraicMatrix, AlgebraicVector>(
dr, param);
152 throw VertexException(
"MultipleKinematicConstraint::deviations requested for empty constraint");
153 for (std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++) {
155 for (
int j = 1;
j < nStates * 7 + 1;
j++) {
156 dev(
j) = dev(
j) + dev_loc(
j);