Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
9f5aed3b
Commit
9f5aed3b
authored
10 years ago
by
Thomas Toulorge
Browse files
Options
Downloads
Patches
Plain Diff
Fixed compliance to C++98 standard in MeshOptObjContribFunc
parent
b87f2376
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contrib/MeshOptimizer/MeshOptObjContribFunc.cpp
+3
-4
3 additions, 4 deletions
contrib/MeshOptimizer/MeshOptObjContribFunc.cpp
contrib/MeshOptimizer/MeshOptObjContribFunc.h
+10
-12
10 additions, 12 deletions
contrib/MeshOptimizer/MeshOptObjContribFunc.h
with
13 additions
and
16 deletions
contrib/MeshOptimizer/MeshOptObjContribFunc.cpp
+
3
−
4
View file @
9f5aed3b
...
...
@@ -4,10 +4,9 @@
#include
"MeshOptObjContribFunc.h"
namespace
{
}
const
double
ObjContribFuncBarrier
::
LOWMARGINMULT
=
0.9
;
const
double
ObjContribFuncBarrier
::
UPMARGINMULT
=
1.1
;
const
double
ObjContribFuncBarrier
::
STAGTHRESHOLD
=
0.01
;
ObjContribFuncBarrier
::
ObjContribFuncBarrier
()
:
...
...
This diff is collapsed.
Click to expand it.
contrib/MeshOptimizer/MeshOptObjContribFunc.h
+
10
−
12
View file @
9f5aed3b
...
...
@@ -26,9 +26,8 @@ public:
void
setTarget
(
double
target
,
double
opt
=
1.
);
protected:
static
const
double
BLOWUPVAL
=
1.e300
,
DIFFBLOWUPVAL
=
1.e300
;
// Big values to set when function should be infinite
static
const
double
LOWMARGINMULT
=
0.9
,
UPMARGINMULT
=
1.1
;
// Upper and lower margins w.r.t. min. & max. to set barrier
static
const
double
STAGTHRESHOLD
=
0.01
;
// Threshold to consider that measures stagnates
static
const
double
LOWMARGINMULT
,
UPMARGINMULT
;
// Upper and lower margins w.r.t. min. & max. to set barrier
static
const
double
STAGTHRESHOLD
;
// Threshold to consider that measures stagnates
double
_opt
;
// Optimal value of measure in barrier function
double
_barrier
,
_target
,
_init
;
// Current barrier, target and initial values of min./max. of measure
static
double
logBarrier
(
double
v
,
double
barrier
,
double
opt
);
...
...
@@ -92,28 +91,28 @@ inline double ObjContribFuncBarrier::diffLogBarrier(double v, double barrier, do
inline
double
ObjContribFuncBarrierMin
::
compute
(
double
v
)
{
if
(
v
>
_barrier
)
return
logBarrier
(
v
,
_barrier
,
_opt
);
else
return
BLOWUPVAL
;
else
return
1e300
;
}
inline
double
ObjContribFuncBarrierMin
::
computeDiff
(
double
v
)
{
if
(
v
>
_barrier
)
return
diffLogBarrier
(
v
,
_barrier
,
_opt
);
else
return
-
DIFFBLOWUPVAL
;
else
return
-
1e300
;
}
inline
double
ObjContribFuncBarrierMax
::
compute
(
double
v
)
{
if
(
v
<
_barrier
)
return
logBarrier
(
v
,
_barrier
,
_opt
);
else
return
BLOWUPVAL
;
else
return
1e300
;
}
inline
double
ObjContribFuncBarrierMax
::
computeDiff
(
double
v
)
{
if
(
v
<
_barrier
)
return
diffLogBarrier
(
v
,
_barrier
,
_opt
);
else
return
DIFFBLOWUPVAL
;
else
return
1e300
;
}
...
...
@@ -121,12 +120,12 @@ inline double ObjContribFuncBarrierMinMax::compute(double v)
{
double
obj
;
if
(
v
<
_barrier
)
obj
=
logBarrier
(
v
,
_barrier
,
_opt
);
else
return
BLOWUPVAL
;
else
return
1e300
;
if
(
v
>
_fixedMinBarrier
)
{
obj
+=
logBarrier
(
v
,
_fixedMinBarrier
,
_opt
);
return
obj
;
}
else
return
BLOWUPVAL
;
else
return
1e300
;
}
...
...
@@ -134,14 +133,13 @@ inline double ObjContribFuncBarrierMinMax::computeDiff(double v)
{
double
dobj
;
if
(
v
<
_barrier
)
dobj
=
diffLogBarrier
(
v
,
_barrier
,
_opt
);
else
return
DIFFBLOWUPVAL
;
else
return
1e300
;
if
(
v
>
_fixedMinBarrier
)
{
dobj
+=
diffLogBarrier
(
v
,
_fixedMinBarrier
,
_opt
);
return
dobj
;
}
else
return
-
DIFFBLOWUPVAL
;
else
return
-
1e300
;
}
#endif
/* _MESHOPTOBJCONTRIBFUNC_H_ */
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