Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
a9bd42a2
Commit
a9bd42a2
authored
Aug 28, 2020
by
Valentin Platzgummer
Browse files
appimage mod
parent
9a7d98f8
Changes
729
Hide whitespace changes
Inline
Side-by-side
QGCExternalLibs.pri
View file @
a9bd42a2
...
...
@@ -198,7 +198,7 @@ contains (DEFINES, DISABLE_AIRMAP) {
# GeograpicLib (TODO: add Windows support!)
LinuxBuild {
LIBS += -L
/usr/local
/lib -lGeographic # libGeograpic.so
LIBS += -L
$$BASEDIR/libs/libGeographic
/lib -lGeographic # libGeograpic.so
.17
}
# google or-tools (TODO: add Windows support!)
...
...
deploy/QGroundControl.AppImage
View file @
a9bd42a2
No preview for this file type
deploy/create_linux_appimage.sh
View file @
a9bd42a2
...
...
@@ -69,7 +69,7 @@ cp -L libts/usr/lib/x86_64-linux-gnu/libts-0.0.so.0 ${APPDIR}/usr/lib/x86_64-lin
cp
-L
${
QGC_SRC
}
/libs/or-tools-src-ubuntu/lib/
*
${
APPDIR
}
/usr/lib/x86_64-linux-gnu/
||
{
echo
"libortools.so not found"
;
exit
1
;
}
# copy libGeographic.so.17
cp
-L
/usr/lib/x86_64-linux-gnu
/libGeographic.so.17
${
APPDIR
}
/usr/lib/x86_64-linux-gnu/
||
{
echo
"libGeographic.so.17 not found"
;
exit
1
;
}
cp
-L
${
QGC_SRC
}
/libs/libGeographic
/libGeographic.so.17
${
APPDIR
}
/usr/lib/x86_64-linux-gnu/
||
{
echo
"libGeographic.so.17 not found"
;
exit
1
;
}
# copy boost
cp
-L
/usr/lib/x86_64-linux-gnu/libboost_system.so.1.65.1
${
APPDIR
}
/usr/lib/x86_64-linux-gnu/
||
{
echo
"libboost_system.so.1.65.1 not found"
;
exit
1
;
}
...
...
libs/or-tools-src-ubuntu/Makefile
View file @
a9bd42a2
...
...
@@ -269,6 +269,8 @@ test_cc: detect_cc
$(MAKE)
run
SOURCE
=
examples/cpp/vrp.cc
$(MAKE)
run
SOURCE
=
examples/cpp/nurses_cp.cc
$(MAKE)
run
SOURCE
=
examples/cpp/minimal_jobshop_cp.cc
$(MAKE)
run
SOURCE
=
examples/cpp/linear_programming.cc
$(MAKE)
run
SOURCE
=
examples/cpp/integer_programming.cc
##################
## C++ SOURCE ##
...
...
libs/or-tools-src-ubuntu/bin/clp
View file @
a9bd42a2
No preview for this file type
libs/or-tools-src-ubuntu/examples/cpp/assignment_mip.cc
View file @
a9bd42a2
...
...
@@ -20,7 +20,7 @@
// [END import]
namespace
operations_research
{
void
IntegerProgrammingExample
()
{
void
AssignmentMip
()
{
// Data
// [START data_model]
const
std
::
vector
<
std
::
vector
<
double
>>
costs
{
...
...
@@ -34,7 +34,7 @@ void IntegerProgrammingExample() {
// Solver
// [START solver]
// Create the mip solver with the CBC backend.
MPSolver
solver
(
"
simple_mip_program
"
,
MPSolver
solver
(
"
AssignmentMip
"
,
MPSolver
::
CBC_MIXED_INTEGER_PROGRAMMING
);
// [END solver]
...
...
@@ -112,7 +112,7 @@ void IntegerProgrammingExample() {
}
// namespace operations_research
int
main
(
int
argc
,
char
**
argv
)
{
operations_research
::
IntegerProgrammingExample
();
operations_research
::
AssignmentMip
();
return
EXIT_SUCCESS
;
}
// [END program]
libs/or-tools-src-ubuntu/examples/cpp/constraint_programming_cp.cc
View file @
a9bd42a2
...
...
@@ -41,7 +41,7 @@ void RunConstraintProgrammingExample() {
solver
.
NewSearch
(
db
);
while
(
solver
.
NextSolution
())
{
LOG
(
INFO
)
<<
"Solution"
<<
": x = "
<<
x
->
Value
()
<<
"; y = "
<<
x
->
Value
()
<<
": x = "
<<
x
->
Value
()
<<
"; y = "
<<
y
->
Value
()
<<
"; z = "
<<
z
->
Value
();
}
solver
.
EndSearch
();
...
...
libs/or-tools-src-ubuntu/examples/cpp/integer_programming.cc
View file @
a9bd42a2
...
...
@@ -13,13 +13,25 @@
// Integer programming example that shows how to use the API.
#include
"ortools/base/commandlineflags.h"
#include
"ortools/base/logging.h"
#include
"ortools/linear_solver/linear_solver.h"
namespace
operations_research
{
void
RunIntegerProgrammingExample
(
MPSolver
::
OptimizationProblemType
optimization_problem_type
)
{
MPSolver
solver
(
"IntegerProgrammingExample"
,
optimization_problem_type
);
const
std
::
string
&
optimization_problem_type
)
{
LOG
(
INFO
)
<<
"---- Integer programming example with "
<<
optimization_problem_type
<<
" ----"
;
if
(
!
MPSolver
::
ParseAndCheckSupportForProblemType
(
optimization_problem_type
))
{
LOG
(
INFO
)
<<
" support for solver not linked in."
;
return
;
}
MPSolver
solver
(
"IntegerProgrammingExample"
,
MPSolver
::
ParseSolverTypeOrDie
(
optimization_problem_type
));
const
double
infinity
=
solver
.
infinity
();
// x and y are integer non-negative variables.
MPVariable
*
const
x
=
solver
.
MakeIntVar
(
0.0
,
infinity
,
"x"
);
...
...
@@ -44,9 +56,6 @@ void RunIntegerProgrammingExample(
LOG
(
INFO
)
<<
"Number of variables = "
<<
solver
.
NumVariables
();
LOG
(
INFO
)
<<
"Number of constraints = "
<<
solver
.
NumConstraints
();
solver
.
SetNumThreads
(
8
);
solver
.
EnableOutput
();
const
MPSolver
::
ResultStatus
result_status
=
solver
.
Solve
();
// Check that the problem has an optimal solution.
if
(
result_status
!=
MPSolver
::
OPTIMAL
)
{
...
...
@@ -65,32 +74,21 @@ void RunIntegerProgrammingExample(
}
void
RunAllExamples
()
{
#if defined(USE_CBC)
LOG
(
INFO
)
<<
"---- Integer programming example with CBC ----"
;
RunIntegerProgrammingExample
(
MPSolver
::
CBC_MIXED_INTEGER_PROGRAMMING
);
#endif
#if defined(USE_GLPK)
LOG
(
INFO
)
<<
"---- Integer programming example with GLPK ----"
;
RunIntegerProgrammingExample
(
MPSolver
::
GLPK_MIXED_INTEGER_PROGRAMMING
);
#endif
#if defined(USE_SCIP)
LOG
(
INFO
)
<<
"---- Integer programming example with SCIP ----"
;
RunIntegerProgrammingExample
(
MPSolver
::
SCIP_MIXED_INTEGER_PROGRAMMING
);
#endif
#if defined(USE_GUROBI)
LOG
(
INFO
)
<<
"---- Integer programming example with Gurobi ----"
;
RunIntegerProgrammingExample
(
MPSolver
::
GUROBI_MIXED_INTEGER_PROGRAMMING
);
#endif // USE_GUROBI
#if defined(USE_CPLEX)
LOG
(
INFO
)
<<
"---- Integer programming example with CPLEX ----"
;
RunIntegerProgrammingExample
(
MPSolver
::
CPLEX_MIXED_INTEGER_PROGRAMMING
);
#endif // USE_CPLEX
RunIntegerProgrammingExample
(
"CBC"
);
RunIntegerProgrammingExample
(
"SAT"
);
RunIntegerProgrammingExample
(
"SCIP"
);
RunIntegerProgrammingExample
(
"GUROBI"
);
RunIntegerProgrammingExample
(
"GLPK"
);
RunIntegerProgrammingExample
(
"CPLEX"
);
RunIntegerProgrammingExample
(
"XPRESS"
);
}
}
// namespace operations_research
int
main
(
int
argc
,
char
**
argv
)
{
google
::
InitGoogleLogging
(
argv
[
0
]);
FLAGS_logtostderr
=
1
;
absl
::
SetFlag
(
&
FLAGS_logtostderr
,
true
);
absl
::
SetFlag
(
&
FLAGS_log_prefix
,
false
);
gflags
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
operations_research
::
RunAllExamples
();
return
EXIT_SUCCESS
;
return
0
;
}
libs/or-tools-src-ubuntu/examples/cpp/integer_programming_example.cc
View file @
a9bd42a2
...
...
@@ -21,7 +21,7 @@ namespace operations_research {
void
IntegerProgrammingExample
()
{
// [START solver]
// Create the mip solver with the CBC backend.
MPSolver
solver
(
"
I
nteger
E
xample"
,
MPSolver
solver
(
"
i
nteger
_programming_e
xample"
,
MPSolver
::
CBC_MIXED_INTEGER_PROGRAMMING
);
// [END solver]
...
...
libs/or-tools-src-ubuntu/examples/cpp/linear_programming.cc
View file @
a9bd42a2
...
...
@@ -13,58 +13,82 @@
// Linear programming example that shows how to use the API.
#include
"ortools/base/commandlineflags.h"
#include
"ortools/base/logging.h"
#include
"ortools/linear_solver/linear_solver.h"
#include
"ortools/linear_solver/linear_solver.pb.h"
namespace
operations_research
{
void
RunLinearProgrammingExample
()
{
MPSolver
solver
(
"LinearProgrammingExample"
,
MPSolver
::
GLOP_LINEAR_PROGRAMMING
);
void
RunLinearProgrammingExample
(
const
std
::
string
&
optimization_problem_type
)
{
LOG
(
INFO
)
<<
"---- Linear programming example with "
<<
optimization_problem_type
<<
" ----"
;
if
(
!
MPSolver
::
ParseAndCheckSupportForProblemType
(
optimization_problem_type
))
{
LOG
(
INFO
)
<<
" support for solver not linked in."
;
return
;
}
MPSolver
solver
(
"IntegerProgrammingExample"
,
MPSolver
::
ParseSolverTypeOrDie
(
optimization_problem_type
));
const
double
infinity
=
solver
.
infinity
();
// x and y are continuous non-negative variables.
MPVariable
*
const
x
=
solver
.
MakeNumVar
(
0.0
,
infinity
,
"x"
);
MPVariable
*
const
y
=
solver
.
MakeNumVar
(
0.0
,
infinity
,
"y"
);
// x1, x2 and x3 are continuous non-negative variables.
MPVariable
*
const
x1
=
solver
.
MakeNumVar
(
0.0
,
infinity
,
"x1"
);
MPVariable
*
const
x2
=
solver
.
MakeNumVar
(
0.0
,
infinity
,
"x2"
);
MPVariable
*
const
x3
=
solver
.
MakeNumVar
(
0.0
,
infinity
,
"x3"
);
//
Objectif function: Maximize 3x + 4y
.
//
Maximize 10 * x1 + 6 * x2 + 4 * x3
.
MPObjective
*
const
objective
=
solver
.
MutableObjective
();
objective
->
SetCoefficient
(
x
,
3
);
objective
->
SetCoefficient
(
y
,
4
);
objective
->
SetCoefficient
(
x1
,
10
);
objective
->
SetCoefficient
(
x2
,
6
);
objective
->
SetCoefficient
(
x3
,
4
);
objective
->
SetMaximization
();
// x + 2y <= 14.
MPConstraint
*
const
c0
=
solver
.
MakeRowConstraint
(
-
infinity
,
14.0
);
c0
->
SetCoefficient
(
x
,
1
);
c0
->
SetCoefficient
(
y
,
2
);
// x1 + x2 + x3 <= 100.
MPConstraint
*
const
c0
=
solver
.
MakeRowConstraint
(
-
infinity
,
100.0
);
c0
->
SetCoefficient
(
x1
,
1
);
c0
->
SetCoefficient
(
x2
,
1
);
c0
->
SetCoefficient
(
x3
,
1
);
// 10 * x1 + 4 * x2 + 5 * x3 <= 600.
MPConstraint
*
const
c1
=
solver
.
MakeRowConstraint
(
-
infinity
,
600.0
);
c1
->
SetCoefficient
(
x1
,
10
);
c1
->
SetCoefficient
(
x2
,
4
);
c1
->
SetCoefficient
(
x3
,
5
);
// 3x - y >= 0.
MPConstraint
*
const
c1
=
solver
.
MakeRowConstraint
(
0.0
,
infinity
);
c1
->
SetCoefficient
(
x
,
3
);
c1
->
SetCoefficient
(
y
,
-
1
);
// 2 * x1 + 2 * x2 + 6 * x3 <= 300.
MPConstraint
*
const
c2
=
solver
.
MakeRowConstraint
(
-
infinity
,
300.0
);
c2
->
SetCoefficient
(
x1
,
2
);
c2
->
SetCoefficient
(
x2
,
2
);
c2
->
SetCoefficient
(
x3
,
6
);
// x - y <= 2.
MPConstraint
*
const
c2
=
solver
.
MakeRowConstraint
(
-
infinity
,
2.0
);
c2
->
SetCoefficient
(
x
,
1
);
c2
->
SetCoefficient
(
y
,
-
1
);
// TODO(user): Change example to show = and >= constraints.
LOG
(
INFO
)
<<
"Number of variables = "
<<
solver
.
NumVariables
();
LOG
(
INFO
)
<<
"Number of constraints = "
<<
solver
.
NumConstraints
();
const
MPSolver
::
ResultStatus
result_status
=
solver
.
Solve
();
// Check that the problem has an optimal solution.
if
(
result_status
!=
MPSolver
::
OPTIMAL
)
{
LOG
(
FATAL
)
<<
"The problem does not have an optimal solution!"
;
}
LOG
(
INFO
)
<<
"Solution:"
;
LOG
(
INFO
)
<<
"x = "
<<
x
->
solution_value
();
LOG
(
INFO
)
<<
"y = "
<<
y
->
solution_value
();
LOG
(
INFO
)
<<
"Problem solved in "
<<
solver
.
wall_time
()
<<
" milliseconds"
;
// The objective value of the solution.
LOG
(
INFO
)
<<
"Optimal objective value = "
<<
objective
->
Value
();
LOG
(
INFO
)
<<
""
;
// The value of each variable in the solution.
LOG
(
INFO
)
<<
"x1 = "
<<
x1
->
solution_value
();
LOG
(
INFO
)
<<
"x2 = "
<<
x2
->
solution_value
();
LOG
(
INFO
)
<<
"x3 = "
<<
x3
->
solution_value
();
LOG
(
INFO
)
<<
"Advanced usage:"
;
LOG
(
INFO
)
<<
"Problem solved in "
<<
solver
.
wall_time
()
<<
" milliseconds"
;
LOG
(
INFO
)
<<
"Problem solved in "
<<
solver
.
iterations
()
<<
" iterations"
;
LOG
(
INFO
)
<<
"x: reduced cost = "
<<
x
->
reduced_cost
();
LOG
(
INFO
)
<<
"y: reduced cost = "
<<
y
->
reduced_cost
();
LOG
(
INFO
)
<<
"x1: reduced cost = "
<<
x1
->
reduced_cost
();
LOG
(
INFO
)
<<
"x2: reduced cost = "
<<
x2
->
reduced_cost
();
LOG
(
INFO
)
<<
"x3: reduced cost = "
<<
x3
->
reduced_cost
();
const
std
::
vector
<
double
>
activities
=
solver
.
ComputeConstraintActivities
();
LOG
(
INFO
)
<<
"c0: dual value = "
<<
c0
->
dual_value
()
<<
" activity = "
<<
activities
[
c0
->
index
()];
...
...
@@ -73,11 +97,22 @@ void RunLinearProgrammingExample() {
LOG
(
INFO
)
<<
"c2: dual value = "
<<
c2
->
dual_value
()
<<
" activity = "
<<
activities
[
c2
->
index
()];
}
void
RunAllExamples
()
{
RunLinearProgrammingExample
(
"GLOP"
);
RunLinearProgrammingExample
(
"CLP"
);
RunLinearProgrammingExample
(
"GUROBI_LP"
);
RunLinearProgrammingExample
(
"CPLEX_LP"
);
RunLinearProgrammingExample
(
"GLPK_LP"
);
RunLinearProgrammingExample
(
"XPRESS_LP"
);
}
}
// namespace operations_research
int
main
(
int
argc
,
char
**
argv
)
{
google
::
InitGoogleLogging
(
argv
[
0
]);
FLAGS_logtostderr
=
1
;
operations_research
::
RunLinearProgrammingExample
();
absl
::
SetFlag
(
&
FLAGS_logtostderr
,
true
);
absl
::
SetFlag
(
&
FLAGS_log_prefix
,
false
);
gflags
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
operations_research
::
RunAllExamples
();
return
EXIT_SUCCESS
;
}
libs/or-tools-src-ubuntu/examples/cpp/linear_programming_example.cc
View file @
a9bd42a2
...
...
@@ -20,7 +20,8 @@
namespace
operations_research
{
void
LinearProgrammingExample
()
{
// [START solver]
MPSolver
solver
(
"LinearExample"
,
MPSolver
::
GLOP_LINEAR_PROGRAMMING
);
MPSolver
solver
(
"linear_programming_examples"
,
MPSolver
::
GLOP_LINEAR_PROGRAMMING
);
// [END solver]
// [START variables]
...
...
libs/or-tools-src-ubuntu/examples/cpp/mip_var_array.cc
View file @
a9bd42a2
...
...
@@ -33,7 +33,7 @@ struct DataModel {
};
// [END data_model]
void
IntegerProgrammingExample
()
{
void
MipVarArray
()
{
// [START data]
DataModel
data
;
// [END data]
...
...
@@ -41,8 +41,7 @@ void IntegerProgrammingExample() {
// [START solver]
// Create the mip solver with the CBC backend.
MPSolver
solver
(
"simple_mip_program"
,
MPSolver
::
CBC_MIXED_INTEGER_PROGRAMMING
);
MPSolver
solver
(
"mip_var_array"
,
MPSolver
::
CBC_MIXED_INTEGER_PROGRAMMING
);
// [END solver]
// [START program_part2]
...
...
@@ -96,7 +95,7 @@ void IntegerProgrammingExample() {
}
// namespace operations_research
int
main
(
int
argc
,
char
**
argv
)
{
operations_research
::
IntegerProgrammingExample
();
operations_research
::
MipVarArray
();
return
EXIT_SUCCESS
;
}
// [END program_part2]
...
...
libs/or-tools-src-ubuntu/examples/cpp/simple_lp_program.cc
View file @
a9bd42a2
...
...
@@ -18,7 +18,7 @@
// [END import]
namespace
operations_research
{
void
run
()
{
void
SimpleLpProgram
()
{
// [START solver]
// Create the linear solver with the GLOP backend.
MPSolver
solver
(
"simple_lp_program"
,
MPSolver
::
GLOP_LINEAR_PROGRAMMING
);
...
...
@@ -63,7 +63,7 @@ void run() {
}
// namespace operations_research
int
main
()
{
operations_research
::
run
();
operations_research
::
SimpleLpProgram
();
return
EXIT_SUCCESS
;
}
// [END program]
libs/or-tools-src-ubuntu/examples/cpp/simple_mip_program.cc
View file @
a9bd42a2
...
...
@@ -18,7 +18,7 @@
// [END import]
namespace
operations_research
{
void
s
imple
_mip_p
rogram
()
{
void
S
imple
MipP
rogram
()
{
// [START solver]
// Create the mip solver with the CBC backend.
MPSolver
solver
(
"simple_mip_program"
,
...
...
@@ -82,7 +82,7 @@ void simple_mip_program() {
}
// namespace operations_research
int
main
(
int
argc
,
char
**
argv
)
{
operations_research
::
s
imple
_mip_p
rogram
();
operations_research
::
S
imple
MipP
rogram
();
return
EXIT_SUCCESS
;
}
// [END program]
libs/or-tools-src-ubuntu/examples/cpp/uncapacitated_facility_location.cc
View file @
a9bd42a2
...
...
@@ -139,7 +139,8 @@ static void UncapacitatedFacilityLocation(int32 facilities,
std
::
cout
<<
"LP-Model:
\n
"
<<
lp_string
<<
std
::
endl
;
}
// Set options and solve
solver
.
SetNumThreads
(
8
);
if
(
optimization_problem_type
!=
MPSolver
::
SCIP_MIXED_INTEGER_PROGRAMMING
)
solver
.
SetNumThreads
(
8
);
solver
.
EnableOutput
();
const
MPSolver
::
ResultStatus
result_status
=
solver
.
Solve
();
// Check that the problem has an optimal solution.
...
...
libs/or-tools-src-ubuntu/examples/dotnet/3_jugs_regular.csproj
View file @
a9bd42a2
...
...
@@ -19,6 +19,6 @@
<ItemGroup>
<Compile Include="3_jugs_regular.cs" />
<PackageReference Include="Google.OrTools" Version="7.
7
.*" />
<PackageReference Include="Google.OrTools" Version="7.
8
.*" />
</ItemGroup>
</Project>
libs/or-tools-src-ubuntu/examples/dotnet/AssignmentMip.cs
View file @
a9bd42a2
...
...
@@ -36,7 +36,7 @@ public class AssignmentMip
// Model.
// [START model]
Solver
solver
=
Solver
.
CreateSolver
(
"AssignmentMip"
,
"CBC
_MIXED_INTEGER_PROGRAMMING
"
);
Solver
solver
=
Solver
.
CreateSolver
(
"AssignmentMip"
,
"CBC"
);
// [END model]
// Variables.
...
...
libs/or-tools-src-ubuntu/examples/dotnet/AssignmentMip.csproj
View file @
a9bd42a2
...
...
@@ -19,6 +19,6 @@
<ItemGroup>
<Compile Include="AssignmentMip.cs" />
<PackageReference Include="Google.OrTools" Version="7.
7
.*" />
<PackageReference Include="Google.OrTools" Version="7.
8
.*" />
</ItemGroup>
</Project>
libs/or-tools-src-ubuntu/examples/dotnet/AssignmentSat.csproj
View file @
a9bd42a2
...
...
@@ -19,6 +19,6 @@
<ItemGroup>
<Compile Include="AssignmentSat.cs" />
<PackageReference Include="Google.OrTools" Version="7.
7
.*" />
<PackageReference Include="Google.OrTools" Version="7.
8
.*" />
</ItemGroup>
</Project>
libs/or-tools-src-ubuntu/examples/dotnet/BalanceGroupSat.csproj
View file @
a9bd42a2
...
...
@@ -19,6 +19,6 @@
<ItemGroup>
<Compile Include="BalanceGroupSat.cs" />
<PackageReference Include="Google.OrTools" Version="7.
7
.*" />
<PackageReference Include="Google.OrTools" Version="7.
8
.*" />
</ItemGroup>
</Project>
Prev
1
2
3
4
5
…
37
Next
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment