Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tp-math
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
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
Math
2e-annee
tp-math
Commits
6695b259
Commit
6695b259
authored
2 years ago
by
juliano.souzaluz
Browse files
Options
Downloads
Patches
Plain Diff
network 4 fonctionnel
parent
2a9c90eb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Main.java
+3
-3
3 additions, 3 deletions
src/Main.java
src/Simplex.java
+2
-3
2 additions, 3 deletions
src/Simplex.java
with
5 additions
and
6 deletions
src/Main.java
+
3
−
3
View file @
6695b259
...
...
@@ -85,13 +85,13 @@ public class Main {
line
++;
}
// Print
eq
.
printEq
();
if
(
debugging
)
eq
.
printEq
();
// Tableau initial
Simplex
spx
=
new
Simplex
(
eq
.
getMat
().
getLine
(),
eq
.
getMat
().
getLine
()
+
eq
.
getMat
().
getCol
()
+
1
,
line
,
contraintes
,
debugging
);
spx
.
createSimplex
(
eq
,
contraintes
);
if
(
debugging
)
spx
.
printSimplex
(
spx
.
getMatEcart
(),
"Tableau initial"
);
if
(
debugging
)
spx
.
printSimplex
(
spx
.
getMatEcart
(),
"Tableau initial"
);
// true = phase 1 membres de droite pas admissible | false = phase 2 membres de droite admissible
if
(
spx
.
which_phase
())
{
...
...
@@ -106,7 +106,7 @@ public class Main {
// Juste le pivot sur la matrice d'écart
spx
.
pivot
(
spx
.
getMatEcart
(),
false
);
// Si mode débogue, afficher chaque pivot
if
(
debugging
)
{
if
(
debugging
)
{
spx
.
printSimplex
(
spx
.
getMatEcart
(),
"Résultat"
);
System
.
out
.
println
(
"Nombre de pivot: "
+
spx
.
getNbPivot
());
}
...
...
This diff is collapsed.
Click to expand it.
src/Simplex.java
+
2
−
3
View file @
6695b259
...
...
@@ -8,7 +8,7 @@ public class Simplex {
private
final
int
ligne
;
// Ligne
private
final
int
colonne
;
// Colonne
private
int
nbPivot
;
private
static
final
double
EPSILON
=
1
E
-
7
;
private
static
final
double
EPSILON
=
1
E
-
40
;
private
final
int
nbContraintes
;
public
Matrix
getMatEcart
()
{
...
...
@@ -186,7 +186,6 @@ public class Simplex {
int
id
=
ligneSortante
(
mat
,
firstNeg
,
phase
);
// Selection de la valeur du pivot
double
val_pivot
=
mat
.
getData
(
id
,
firstNeg
);
// Application du pivot de gauss sur la ligne du pivot, pour avoir une "référence" de coefficient pour la suite
for
(
int
i
=
0
;
i
<
mat
.
getCol
();
i
++)
{
mat
.
setData
(
id
,
i
,
mat
.
getData
(
id
,
i
)
/
val_pivot
);
...
...
@@ -233,7 +232,7 @@ public class Simplex {
int
id
=
0
;
// La première vérification permet de s'assurer qu'on ne tombe pas sur un 0
// La 2ᵉ vérification permet de vérifier qu'au plus profond de la matrice il s'agit bien d'un négatif
while
(!(
mat
.
getData
(
id
,
y
)
>
0
)
&&
mat
.
getData
(
id
,
depth
)
>=
0
)
{
while
(!(
mat
.
getData
(
id
,
y
)
>
0
))
{
id
++;
}
...
...
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