42 lines
731 B
Python
42 lines
731 B
Python
'''
|
|
Created on 06.08.2016
|
|
|
|
@author: wn
|
|
'''
|
|
from __future__ import print_function
|
|
|
|
import random
|
|
|
|
|
|
order = 10
|
|
lowerBound = 0.0
|
|
upperBound = 1000.0
|
|
|
|
resultForFortran = []
|
|
cntForFortran = 0
|
|
matrix = []
|
|
|
|
for i in range(order+1):
|
|
vector = []
|
|
for j in range(order):
|
|
f = random.uniform(lowerBound, upperBound)
|
|
vector.append(f)
|
|
if i < order:
|
|
print("%f, " % f, end="")
|
|
cntForFortran += 1
|
|
if (cntForFortran == 5):
|
|
cntForFortran = 0
|
|
print(" &")
|
|
else:
|
|
resultForFortran.append(f)
|
|
matrix.append(vector)
|
|
|
|
print("")
|
|
|
|
for i in range(order):
|
|
print("%f, " % resultForFortran[i], end="")
|
|
|
|
print("")
|
|
print("")
|
|
|
|
print(matrix) |