Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pierre-Chanteloup Edwin
Gauss-Seidel
Commits
f456b83c
Commit
f456b83c
authored
Nov 04, 2019
by
EdwinMindcraft
Browse files
main + Makefile
parent
09cf7b9d
Changes
4
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
f456b83c
.idea/**
cmake-build-debug/**
\ No newline at end of file
cmake-build-debug/**
*.o
*.exe
*.mod
*.zip
\ No newline at end of file
Makefile
0 → 100644
View file @
f456b83c
FC
=
gfortran
OPT
=
-g
main
:
main.f gauss_seidel.o
$(FC)
$(OPT)
main.f gauss_seidel.o
-o
main
gauss_seidel.o
:
gauss_seidel.f
$(FC)
$(OPT)
gauss_seidel.f
-c
\ No newline at end of file
dmain
0 → 100644
View file @
f456b83c
2
0.000001
3 1 2 4
3 3
1 1
\ No newline at end of file
main.f
View file @
f456b83c
program
main
use
gauss_seidel
implicit
none
integer
i
real
::
A
(
2
,
2
),
b
(
2
),
x
(
2
)
A
=
reshape
((/
1
,
0
,
1
,
2
/),
shape
(
A
))
b
=
(/
13
,
11
/)
x
=
(/
1
,
2
/)
integer
i
,
n
real
,
allocatable
::
A
(:,:),
b
(:),
x
(:)
real
::
prec
read
(
*
,
*
)
n
read
(
*
,
*
)
prec
allocate
(
A
(
n
,
n
))
allocate
(
b
(
n
))
allocate
(
x
(
n
))
read
(
*
,
*
)
A
read
(
*
,
*
)
b
read
(
*
,
*
)
x
do
i
=
1
,
3000000
call
solve_system
(
A
,
b
,
x
)
if
(
norm2
(
matmul
(
A
,
x
)
-
b
)
<
0.0001
)
then
if
(
norm2
(
matmul
(
A
,
x
)
-
b
)
<
prec
)
then
exit
endif
enddo
write
(
*
,
*
)
x
,
matmul
(
A
,
x
)
end
write
(
*
,
*
)
x
write
(
*
,
*
)
matmul
(
A
,
x
)
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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