Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F65536599
GaussSeidel.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Jun 4, 12:18
Size
856 B
Mime Type
text/x-c
Expires
Thu, Jun 6, 12:18 (2 d)
Engine
blob
Format
Raw Data
Handle
18055295
Attached To
R7934 PCSC_project
GaussSeidel.cpp
View Options
#include <iostream>
#include "GaussSeidel.h"
using
namespace
std
;
int
main
()
{
int
size_system
=
5
;
Vector
x
(
size_system
);
for
(
int
j
=
1
;
j
<=
size_system
;
++
j
)
{
x
(
j
)
=
1
;
}
Matrix
A
(
size_system
,
size_system
);
cout
<<
"La matrice A vaut : "
<<
endl
;
for
(
int
i
=
1
;
i
<=
size_system
;
++
i
)
{
for
(
int
j
=
1
;
j
<=
size_system
;
++
j
)
{
if
(
i
==
j
)
{
A
(
i
,
j
)
=
25
;
cout
<<
A
(
i
,
j
)
<<
" "
;
}
else
{
A
(
i
,
j
)
=
0
;
cout
<<
A
(
i
,
j
)
<<
" "
;
}
}
cout
<<
endl
;
}
cout
<<
endl
;
Vector
b
(
size_system
);
int
l
=
length
(
b
);
for
(
int
j
=
1
;
j
<=
l
;
++
j
)
{
b
(
j
)
=
2
;
}
GaussSeidel
linearSystem
(
A
,
b
);
cout
<<
endl
;
TerminalPrint
(
linearSystem
.
Solve
(),
"La valeur de x est: "
);
return
0
;
}
Event Timeline
Log In to Comment