Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jrl-walkgen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Guilhem Saurel
jrl-walkgen
Commits
136dc7de
Commit
136dc7de
authored
13 years ago
by
Andrei Herdt
Browse files
Options
Downloads
Patches
Plain Diff
Change enum type names and clean up
parent
7fe6c1be
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ZMPRefTrajectoryGeneration/qp-problem.cpp
+11
-14
11 additions, 14 deletions
src/ZMPRefTrajectoryGeneration/qp-problem.cpp
src/ZMPRefTrajectoryGeneration/qp-problem.hh
+18
-18
18 additions, 18 deletions
src/ZMPRefTrajectoryGeneration/qp-problem.hh
with
29 additions
and
32 deletions
src/ZMPRefTrajectoryGeneration/qp-problem.cpp
+
11
−
14
View file @
136dc7de
...
...
@@ -56,7 +56,6 @@ QPProblem_s::QPProblem_s():
iout_
(
0
),
ifail_
(
0
),
iprint_
(
0
),
lwar_
(
0
),
liwar_
(
0
),
eps_
(
0
),
NbVariables_
(
0
),
NbConstraints_
(
0
),
NbEqConstraints_
(
0
)
{
NbVariables_
=
0
;
NbConstraints_
=
0
;
...
...
@@ -74,8 +73,8 @@ QPProblem_s::QPProblem_s():
liwar_
=
n_
;
eps_
=
1e-8
;
last
_s
olution_
.
resize
(
1
,
1
);
last
_s
olution_
.
empty
();
last
S
olution_
.
resize
(
1
,
1
);
last
S
olution_
.
empty
();
istate_
=
0x0
;
kx_
=
0x0
;
...
...
@@ -138,14 +137,14 @@ QPProblem_s::resize_all()
istate_
=
new
int
[(
NbVariables_
+
NbConstraints_
+
2
)
*
10
];
kx_
=
new
int
[(
NbVariables_
+
1
)
*
10
];
b_
=
new
double
[(
NbVariables_
+
1
)
*
10
];
b_
=
new
double
[(
NbVariables_
+
1
)
*
10
];
clamda_
=
new
double
[(
NbVariables_
+
NbConstraints_
+
2
)
*
10
];
}
void
QPProblem_s
::
clear
(
QPE
lement
Type
)
QPProblem_s
::
clear
(
qp_e
lement
_e
Type
)
{
switch
(
Type
)
...
...
@@ -189,10 +188,8 @@ void QPProblem_s::reset()
}
void
QPProblem_s
::
solve
(
S
olver
Solver
,
solution_t
&
Result
,
const
T
ests
&
tests
)
QPProblem_s
::
solve
(
s
olver
_e
Solver
,
solution_t
&
Result
,
const
t
ests
_e
&
tests
)
{
m_
=
NbConstraints_
+
1
;
...
...
@@ -324,11 +321,11 @@ QPProblem_s::solve( Solver Solver, solution_t & Result, const Tests & tests )
last
_s
olution_
.
resize
(
n_
);
last
S
olution_
.
resize
(
n_
);
for
(
int
i
=
0
;
i
<
n_
;
i
++
)
{
Result
.
Solution_vec
(
i
)
=
X_
.
Array_
[
i
];
last
_s
olution_
(
i
)
=
Result
.
Solution_vec
(
i
);
last
S
olution_
(
i
)
=
Result
.
Solution_vec
(
i
);
Result
.
LBoundsLagr_vec
(
i
)
=
0
;
Result
.
UBoundsLagr_vec
(
i
)
=
0
;
}
...
...
@@ -357,7 +354,7 @@ QPProblem_s::solve( Solver Solver, solution_t & Result, const Tests & tests )
void
QPProblem_s
::
add_term_to
(
QPE
lement
Type
,
const
MAL_MATRIX
(
&
Mat
,
double
),
QPProblem_s
::
add_term_to
(
qp_e
lement
_e
Type
,
const
MAL_MATRIX
(
&
Mat
,
double
),
unsigned
int
Row
,
unsigned
int
Col
)
{
...
...
@@ -431,7 +428,7 @@ QPProblem_s::add_term_to( QPElement Type, const MAL_MATRIX (&Mat, double),
void
QPProblem_s
::
add_term_to
(
QPE
lement
Type
,
const
MAL_VECTOR
(
&
Vec
,
double
),
QPProblem_s
::
add_term_to
(
qp_e
lement
_e
Type
,
const
MAL_VECTOR
(
&
Vec
,
double
),
unsigned
int
Row
)
{
...
...
@@ -499,7 +496,7 @@ QPProblem_s::dump_solver_parameters(std::ostream & aos)
void
QPProblem_s
::
dump
(
QPE
lement
Type
,
std
::
ostream
&
aos
)
QPProblem_s
::
dump
(
qp_e
lement
_e
Type
,
std
::
ostream
&
aos
)
{
unsigned
int
NbRows
=
0
,
NbCols
=
0
;
...
...
@@ -562,7 +559,7 @@ QPProblem_s::dump( QPElement Type, std::ostream & aos)
void
QPProblem_s
::
dump
(
QPE
lement
Type
,
const
char
*
FileName
)
QPProblem_s
::
dump
(
qp_e
lement
_e
Type
,
const
char
*
FileName
)
{
std
::
ofstream
aof
;
aof
.
open
(
FileName
,
std
::
ofstream
::
out
);
...
...
This diff is collapsed.
Click to expand it.
src/ZMPRefTrajectoryGeneration/qp-problem.hh
+
18
−
18
View file @
136dc7de
...
...
@@ -50,7 +50,7 @@ namespace PatternGeneratorJRL
//
public:
enum
QPE
lement
enum
qp_e
lement
_e
{
MATRIX_Q
,
MATRIX_DU
,
...
...
@@ -60,13 +60,13 @@ namespace PatternGeneratorJRL
VECTOR_XU
};
enum
S
olver
enum
s
olver
_e
{
QLD
,
LSSOL
};
enum
T
ests
enum
t
ests
_e
{
NONE
,
ALL
,
...
...
@@ -95,19 +95,19 @@ namespace PatternGeneratorJRL
/// \brief Add a matrix to the final optimization problem in array form
///
/// \param[in] Mat Added matrix
/// \param[in] Type Target matrix type
/// \param[in] Mat Added matrix
/// \param[in] Row First row inside the target
/// \param[in] Col First column inside the target
void
add_term_to
(
QPE
lement
Type
,
const
boost_ublas
::
matrix
<
double
>
&
Mat
,
void
add_term_to
(
qp_e
lement
_e
Type
,
const
boost_ublas
::
matrix
<
double
>
&
Mat
,
unsigned
int
Row
,
unsigned
int
Col
);
/// \brief Add a vector to the final optimization problem in array form
///
/// \param
Mat Added
vector
/// \param
ype Target
vector
type
/// \param
r
ow First row inside the target
void
add_term_to
(
QPE
lement
Type
,
const
boost_ublas
::
vector
<
double
>
&
Vec
,
/// \param
[in] Type Target
vector
type
/// \param
[in] Mat Added
vector
/// \param
[in] R
ow First row inside the target
void
add_term_to
(
qp_e
lement
_e
Type
,
const
boost_ublas
::
vector
<
double
>
&
Vec
,
unsigned
int
Row
);
/// \brief Dump current problem on disk.
...
...
@@ -118,13 +118,13 @@ namespace PatternGeneratorJRL
///
/// \param Type
/// \param Filename
void
dump
(
QPE
lement
Type
,
const
char
*
Filename
);
void
dump
(
qp_e
lement
_e
Type
,
const
char
*
Filename
);
/// \}
/// \brief Initialize array
///
/// \param[in] type
void
clear
(
QPE
lement
Type
);
void
clear
(
qp_e
lement
_e
Type
);
/// \brief Set matrices to zero
void
reset
();
...
...
@@ -134,7 +134,7 @@ namespace PatternGeneratorJRL
/// \param[in] Solver
/// \param[out] Result
/// \param[in] Tests
void
solve
(
S
olver
Solver
,
solution_t
&
Result
,
const
T
ests
&
Tests
=
NONE
);
void
solve
(
s
olver
_e
Solver
,
solution_t
&
Result
,
const
t
ests
_e
&
Tests
=
NONE
);
/// \name Accessors and mutators
/// \{
...
...
@@ -172,7 +172,7 @@ namespace PatternGeneratorJRL
/// \brief Print_ on disk the parameters that are passed to the solver
void
dump_solver_parameters
(
std
::
ostream
&
aos
);
/// \brief Print_ array
void
dump
(
QPE
lement
Type
,
std
::
ostream
&
aos
);
void
dump
(
qp_e
lement
_e
Type
,
std
::
ostream
&
aos
);
/// \brief Print_ problem
void
dump_problem
(
std
::
ostream
&
);
/// \}
...
...
@@ -298,14 +298,13 @@ namespace PatternGeneratorJRL
/// \{
int
*
istate_
;
int
*
kx_
;
double
*
b_
;
int
inform_
;
int
iter_
;
double
obj_
;
double
*
clamda_
;
/// \}
/// \name ql-parameters
/// \{
int
m_
,
me_
,
mmax_
,
n_
,
nmax_
,
mnn_
;
...
...
@@ -313,12 +312,13 @@ namespace PatternGeneratorJRL
array_s
<
int
>
iwar_
;
int
iout_
,
ifail_
,
iprint_
,
lwar_
,
liwar_
;
double
eps_
;
/// \}
/// \brief Robot
RigidBodySystem
*
Robot_
;
boost_ublas
::
vector
<
double
>
last_solution_
;
/// \}
/// \brief Last solution
boost_ublas
::
vector
<
double
>
lastSolution_
;
/// \brief Number of optimization parameters
unsigned
int
NbVariables_
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment