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
abf31903
"slides_2023/fichiers.md" did not exist on "a85a5177c6e93c4849cbd3a4c85cb30fdb141c1f"
Commit
abf31903
authored
2 years ago
by
thibault.capt
Browse files
Options
Downloads
Patches
Plain Diff
change sign
parent
a008e66b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/Main.java
+5
-2
5 additions, 2 deletions
src/Main.java
src/Simplex.java
+11
-5
11 additions, 5 deletions
src/Simplex.java
src/input.txt
+2
-2
2 additions, 2 deletions
src/input.txt
with
18 additions
and
9 deletions
src/Main.java
+
5
−
2
View file @
abf31903
...
...
@@ -78,8 +78,11 @@ public class Main {
//System.out.println(Arrays.deepToString(spx.getMatEcart()));
// true = phase 1 membres de droite pas admissible | false = phase 2 membres de droite admissible
if
(
spx
.
which_phase
())
spx
.
tabAux
();
int
phase
=
spx
.
which_phase
();
if
(
phase
!=
-
1
)
{
spx
.
tabAux
(
phase
);
spx
.
printSimplex
(
"Tableau aux"
);
}
else
{
spx
.
pivot
();
spx
.
printSimplex
(
"pivot"
);
...
...
This diff is collapsed.
Click to expand it.
src/Simplex.java
+
11
−
5
View file @
abf31903
...
...
@@ -58,16 +58,22 @@ public class Simplex {
* Si b[i] < 0 phase 1 sinon phase 2
* @return true = phase 1 | false = phase 2
*/
boolean
which_phase
(){
boolean
res
=
false
;
int
which_phase
(){
int
res
=
-
1
;
for
(
int
i
=
0
;
i
<
x
;
i
++)
{
if
(!
signe
(
matEcart
[
i
][
y
-
1
]))
res
=
true
;
res
=
i
;
}
return
res
;
}
void
tabAux
()
{
void
tabAux
(
int
line
)
{
// TODO mettre en positif membre de droite
for
(
int
j
=
0
;
j
<
y
;
j
++)
{
if
(
matEcart
[
line
][
j
]
!=
0.0
)
{
double
res
=
matEcart
[
line
][
j
]
*
-
1
;
setMatEcartById
(
res
,
line
,
j
);
}
}
}
int
getFirstNeg
()
{
...
...
This diff is collapsed.
Click to expand it.
src/input.txt
+
2
−
2
View file @
abf31903
m
ax;
8;9;
m
in;-
8;
-
9;
2;5;<=;12;
50;5;<=;150;
5;50;<=;100;
1;2;<=;-1;
\ No newline at end of file
-1;-2;<=;-1;
\ No newline at end of file
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