Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
numer-60-2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rungrurdee wandee
numer-60-2
Commits
0b901981
Commit
0b901981
authored
Feb 21, 2018
by
rungrurdee wandee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
e63bf3f7
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
1 deletion
+31
-1
assignment.py
week04/assignment.py
+3
-0
back.cpython-36.pyc
week05/__pycache__/back.cpython-36.pyc
+0
-0
homew.cpython-36.pyc
week05/__pycache__/homew.cpython-36.pyc
+0
-0
back.py
week05/back.py
+11
-0
ge.py
week05/ge.py
+15
-1
readme.md
week06/readme.md
+2
-0
No files found.
week04/assignment.py
View file @
0b901981
...
...
@@ -12,3 +12,6 @@ def double_prec(v):
return
(
-
1
)
**
int
(
v
[
0
])
*
sum
([
int
(
v
[
i
])
*
2
**
(
11
-
i
)
for
i
in
range
(
1
,
23
)])
def
IEEE
(
v
):
return
(
-
1
)
^
2
*
2
^
(
e
-
1023
)
*
1.
f
week05/__pycache__/back.cpython-36.pyc
0 → 100644
View file @
0b901981
File added
week05/__pycache__/homew.cpython-36.pyc
0 → 100644
View file @
0b901981
File added
week05/back.py
0 → 100644
View file @
0b901981
import
numpy
as
np
def
upperTriSol
(
A
,
b
):
n
=
np
.
size
(
b
)
x
=
np
.
zeros_like
(
b
)
x
[
-
1
]
=
1.
/
A
[
-
1
,
-
1
]
*
b
[
-
1
]
for
i
in
xrange
(
n
-
2
,
-
1
,
-
1
):
x
[
i
]
=
1.
/
A
[
i
,
i
]
*
(
b
[
i
]
-
np
.
sum
(
A
[
i
,
i
+
1
:]
*
x
[
i
+
1
:]))
return
x
week05/ge.py
View file @
0b901981
...
...
@@ -2,4 +2,18 @@ def ge(A, b):
pass
def
solve
(
A
,
b
):
pass
import
numpy.linalg
result
=
numpy
.
linalg
.
solve
(
A
,
b
)
for
i
,
x
in
zip
(
1
,
range
(
len
(
result
)
+
1
),
result
):
print
(
'$x_{} = {}'
.
format
(
i
,
x
))
m
,
n
,
_
=
map
(
int
,
input
()
.
split
(
'x'
))
print
(
m
,
n
)
A
=
[]
for
row
in
range
(
m
):
A
.
append
(
list
(
map
(
int
,
input
()
.
split
(
','
))))
#solve(A,b)
print
(
n
,
_
)
b
=
list
(
map
(
int
,
input
()
.
split
(
','
)))
solve
(
A
,
b
)
week06/readme.md
0 → 100644
View file @
0b901981
เขียนฟังก์ชันเพื่อหา upper-triangular matrix (U) จากสมการ Ax = b
โดยเขียนฟังก์ชัน Ux = c เป็นสมการที่ลดรูปแล้ว
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