Can you help me with this error? Why is that error here? I'm calculating the inverse of matrix.
Here is code:
import numpy as np
from [login to view URL] import inv
from [login to view URL] import det
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
m = input("Enter number of rows, m = \n")
n = input("Enter number of columns, n = \n")
if rank==0:
matrix = [login to view URL]((m,n))
determinant = [login to view URL]((2))
for i in range (0,m):
for j in range(0,n):
print("Enter the value for the field: m = ", i+1, ", n = ", j+1,"\n")
matrix[i][j] = float(input())
[login to view URL](matrix, dest=1, tag=0)
[login to view URL](matrix, dest=2, tag=0)
[login to view URL](determinant, source=1, tag=0)
[login to view URL](matrix, source=2, tag=0)
if(determinant[0]==0):
print("There is no inverse matrix since the determinant is 0!")
else:
print("Inverse matrix:\n",matrix)
elif rank==1:
matrix = [login to view URL]((m,n))
determinant = [login to view URL]((2))
[login to view URL](matrix, source=0, tag=0)
determinant = [login to view URL]([[det(matrix)],[0]])
[login to view URL](determinant, dest=0)
elif rank==2:
matrix = [login to view URL]((m,n))
[login to view URL](matrix, source=0, tag=0)
matrix = inv(matrix)
[login to view URL](matrix, dest=0)
else:
exit()
Hello, how are you? I hope you have a bright day/evening from your side. I have read the details provided, but please contact me so that we can discuss more on the project.
Stay tuned, I'm still working on this proposal.
I made such codes in my beginning days in Engineering. Accept the Bid and we can discuss the code further and this code can be modified as well for better performance