Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
csm
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
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Show more breadcrumbs
labrobotica
algorithms
csm
Commits
031a9965
Commit
031a9965
authored
15 years ago
by
Paloma de la Puente
Browse files
Options
Downloads
Patches
Plain Diff
alphas instead of indices
parent
1acdb927
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
sm/csm/structprior/Constraint.cpp
+17
-3
17 additions, 3 deletions
sm/csm/structprior/Constraint.cpp
sm/csm/structprior/Constraint.h
+1
-1
1 addition, 1 deletion
sm/csm/structprior/Constraint.h
with
18 additions
and
4 deletions
sm/csm/structprior/Constraint.cpp
+
17
−
3
View file @
031a9965
...
@@ -20,13 +20,26 @@ Values Constraint::ApplyConstraint(double alphas[], double params[])
...
@@ -20,13 +20,26 @@ Values Constraint::ApplyConstraint(double alphas[], double params[])
{
{
Values
v
;
Values
v
;
double
err
=
0
;
double
err
=
0
;
double
grd
=
0
;
double
grd
[
3
]
=
{
0
,
0
,
0
}
;
switch
(
type
)
switch
(
type
)
{
{
case
EQUAL_TO_EITHER
:
case
EQUAL_TO_EITHER
:
{
{
double
e1
=
0.5
*
(
alphas
[
1
]
-
alphas
[
0
]);
double
e2
=
0.5
*
(
alphas
[
2
]
-
alphas
[
1
]);
if
(
e1
<
e2
)
{
err
=
e1
;
}
else
{
err
=
e2
;
}
break
;
break
;
}
}
...
@@ -40,7 +53,8 @@ Values Constraint::ApplyConstraint(double alphas[], double params[])
...
@@ -40,7 +53,8 @@ Values Constraint::ApplyConstraint(double alphas[], double params[])
}
}
v
.
error
=
err
;
v
.
error
=
err
;
v
.
grad
=
grd
;
for
(
int
i
=
0
;
i
<
3
;
i
++
)
v
.
grad
[
i
]
=
grd
[
i
];
return
v
;
return
v
;
}
}
This diff is collapsed.
Click to expand it.
sm/csm/structprior/Constraint.h
+
1
−
1
View file @
031a9965
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
struct
Values
{
struct
Values
{
double
error
;
double
error
;
double
grad
;
double
grad
[]
;
};
};
...
...
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