Is there a way to improve the Python code that I cited below? Now it seems to me too slow.
C_abs = abs(C) _, n = C_abs.shape G = np.zeros((n, n)) for i in xrange(n): for j in xrange(n): G[i,j] = C_abs[i,j]+C_abs[j,i]
Just add C_abswith transposed version-
C_abs
transposed version
G = C_abs + C_abs.T
To understand, look at the computational part of the code:
G[i,j] = C_abs[i,j]+C_abs[j,i]
- C_abs[i,j], , - G[i,j]. , . - C_abs[j,i], - G[i,j]. C_abs. , , C_abs , .
C_abs[i,j]
G[i,j]
C_abs[j,i]
Source: https://habr.com/ru/post/1648938/More articles:How to get permission for the camera in android. (In particular, Marshmallow) - androidLaravel 5: find a function on a model that extends the user - phpwait () / notify () does not work as expected - javaMultiparameter subclass in Idris - idrisDisable in-app purchases on xcode - iosSwift: case foo (let bar): no type or job? - iosWhich API to use to access location history for an Android app? - androidJSonConverter not starting property of my model in C # WebAPI - jsonMySQL query with time and random selection - phpCustom type serialization and deserialization using Newtonsoft.Json without attributes - c #All Articles