Commit 6b282347 authored by Daniel Brown's avatar Daniel Brown

CMatrix now returns sparse matrix in COO format. Update to sagnac test....

CMatrix now returns sparse matrix in COO format. Update to sagnac test. Getting different results after merging not, and numpy is also saying it is a singular matrix even though KLU solves it... more debugging to go
parent 14c50667
......@@ -341,6 +341,17 @@ cdef class CCSMatrix(object):
ccol += 1
print(" ({}, {}) = {}".format(ccol, self.row_idx[i], self.values[i]))
def get_sparse_matrix(self):
M = []
ccol = -1
for i in range(self.__nnz):
if self.col_ptr[ccol+1] == i:
ccol += 1
M.append((ccol, self.row_idx[i], self.values[i]))
return M
def print_rhs(self):
print("")
......
......@@ -106,7 +106,7 @@ class Simulation(object):
int
The number of equations describing the system.
"""
return len(self.__model.network.nodes) * self.Nf * self.Nh * self.Np
return len(self.__model.network.nodes) * len(self.__frequencies) * len(self.__HOMs) * len(self.polarisations)
def nindex(self, node):
"""
......
This diff was suppressed by a .gitattributes entry.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment