Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions python_numpy/numpy_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def judge_matrix_type(matrix):
for j in range(matrix.shape[1]):
zero_flag = False

if matrix[i][j] == 0.0:
if matrix[i, j] == 0.0:
zero_flag = True
sparse_flag = True
dense_flag = False
Expand Down Expand Up @@ -137,7 +137,7 @@ def generate_matrix_cpp_code(matrix_in):
for i in range(matrix.shape[0]):
code_text += " ColumnAvailable<"
for j in range(matrix.shape[1]):
if matrix[i][j] != 0:
if matrix[i, j] != 0:
code_text += "true"
else:
code_text += "false"
Expand Down Expand Up @@ -165,10 +165,10 @@ def generate_matrix_cpp_code(matrix_in):
for j in range(matrix.shape[1]):
if i == matrix.shape[0] - 1 and j == matrix.shape[1] - 1:
code_text += NumpyDeploy.value_to_string_with_type(
matrix[i][j], type_name)
matrix[i, j], type_name)
else:
code_text += NumpyDeploy.value_to_string_with_type(
matrix[i][j], type_name)
matrix[i, j], type_name)

if j != matrix.shape[1] - 1:
code_text += ", "
Expand All @@ -187,10 +187,10 @@ def generate_matrix_cpp_code(matrix_in):
code_text += " "
if i == matrix.shape[0] - 1:
code_text += NumpyDeploy.value_to_string_with_type(
matrix[i][i], type_name) + "\n"
matrix[i, i], type_name) + "\n"
else:
code_text += NumpyDeploy.value_to_string_with_type(
matrix[i][i], type_name) + ",\n"
matrix[i, i], type_name) + ",\n"

code_text += " );\n\n"

Expand All @@ -201,14 +201,14 @@ def generate_matrix_cpp_code(matrix_in):
sparse_count = 0
for i in range(matrix.shape[0]):
for j in range(matrix.shape[1]):
if matrix[i][j] != 0:
if matrix[i, j] != 0:
if sparse_count == 0:
code_text += " " + NumpyDeploy.value_to_string_with_type(
matrix[i][j], type_name)
matrix[i, j], type_name)
sparse_count += 1
else:
code_text += ",\n " + NumpyDeploy.value_to_string_with_type(
matrix[i][j], type_name)
matrix[i, j], type_name)

code_text += "\n );\n\n"

Expand Down
2 changes: 1 addition & 1 deletion python_numpy/python_numpy_linalg_solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class LinalgSolver {
: X_1(), decay_rate(static_cast<Value_Type>(0)),
division_min(
static_cast<Value_Type>(DEFAULT_DIVISION_MIN_LINALG_SOLVER)),
rho(), rep_num() {}
rho({}), rep_num({}) {}

/* Copy Constructor */
LinalgSolver(
Expand Down