Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120484167
main.py
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
Fri, Jul 4, 17:04
Size
726 B
Mime Type
text/x-objective-c
Expires
Sun, Jul 6, 17:04 (2 d)
Engine
blob
Format
Raw Data
Handle
27195413
Attached To
R9484 sp4e-homework-lars-bertil
main.py
View Options
### IMPORT LIBRARIES
import
numpy
as
np
import
scipy
as
sp
import
argparse
#import quadratic_function
#import optimizer
#import conjugate_gradient
### DEFINE PARAMETERS / COEFFICIENTS
A
=
np
.
array
([[
4.0
,
0.0
],
[
1.0
,
3.0
]])
b
=
np
.
array
([
0.0
,
1.0
])
### ARGPARSE EXAMPLE : TO DO
parser
=
argparse
.
ArgumentParser
(
description
=
'Process Minimization Schemes'
)
#parser.add_argument("A", help="Get the matrix A coefficients",
# type=string)
parser
.
add_argument
(
'A'
,
metavar
=
'N'
,
type
=
float
,
nargs
=
'+'
,
help
=
'input matrix'
)
#parser.add_argument('b', metavar='--b', type=float, nargs='+',
# help='input vector')
args
=
parser
.
parse_args
()
print
(
args
.
A
)
print
(
args
.
b
)
Event Timeline
Log In to Comment