Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projet-optimisation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aliaume Lopez
projet-optimisation
Commits
c425bb7d
Commit
c425bb7d
authored
Jan 10, 2017
by
Gaetan D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hop
parent
f9a5b148
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
18 deletions
+21
-18
testperfs.py
testperfs.py
+21
-18
No files found.
testperfs.py
View file @
c425bb7d
...
...
@@ -3,25 +3,28 @@ import numpy as np
import
random
import
time
def
testinv
():
sumnp
=
0
sumlin
=
0
sumnp
=
0
sumlin
=
0
for
i
in
range
(
100
):
n
=
100
M
=
np
.
random
.
rand
(
n
,
n
)
print
(
"Iteration"
,
i
)
if
(
np
.
linalg
.
det
(
M
)
!=
0
):
a
=
time
.
clock
()
np
.
linalg
.
inv
(
M
)
b
=
time
.
clock
()
sumnp
+=
b
-
a
print
(
"numpy done"
)
a
=
time
.
clock
()
invert
(
M
)
b
=
time
.
clock
()
sumlin
+=
b
-
a
print
(
sumnp
,
sumlin
)
for
i
in
range
(
100
):
n
=
100
M
=
np
.
random
.
rand
(
n
,
n
)
print
(
"Iteration"
,
i
)
if
(
np
.
linalg
.
det
(
M
)
!=
0
):
a
=
time
.
clock
()
np
.
linalg
.
inv
(
M
)
b
=
time
.
clock
()
sumnp
+=
b
-
a
print
(
"numpy done"
)
a
=
time
.
clock
()
invert
(
M
)
b
=
time
.
clock
()
sumlin
+=
b
-
a
print
(
"============="
)
print
(
"Numpy :"
sumnp
)
print
(
"Gauss :"
,
sumlin
)
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