sip-python 0.0.3__tar.gz → 0.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sip_python
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: Python bindings for the SIP solver.
5
5
  Author-email: João Sousa-Pinto <joaospinto@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/joaospinto/sip_python
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "sip_python"
7
- version = "0.0.3"
7
+ version = "0.0.4"
8
8
  description = "Python bindings for the SIP solver."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -33,11 +33,10 @@ except Exception:
33
33
 
34
34
  def _amd_order(K_csc):
35
35
  """Compute AMD ordering on a CSC matrix via libamd."""
36
- K_sym = (K_csc + K_csc.T).tocsc()
37
- K_sym.sort_indices()
38
- n = K_sym.shape[0]
39
- Ap = K_sym.indptr.astype(np.int64)
40
- Ai = K_sym.indices.astype(np.int64)
36
+ K_csc.sort_indices()
37
+ n = K_csc.shape[0]
38
+ Ap = K_csc.indptr.astype(np.int64)
39
+ Ai = K_csc.indices.astype(np.int64)
41
40
  perm = np.empty(n, dtype=np.int64)
42
41
  ret = _libamd.amd_l_order(
43
42
  n,
@@ -72,6 +71,7 @@ def get_K(P, A, G):
72
71
 
73
72
  mod_P = spa.csc_matrix.copy(P)
74
73
  mod_P.data[:] = 1.0
74
+ mod_P = mod_P + mod_P.T
75
75
 
76
76
  Z = spa.csc_matrix((y_dim, s_dim))
77
77
 
@@ -114,8 +114,9 @@ def get_kkt_and_L_nnzs(K, perm_inv):
114
114
  permuted_K.col = perm_inv[permuted_K.col]
115
115
 
116
116
  kkt_L_nnz = getLnnz(spa.triu(permuted_K))
117
+ kkt_nnz = spa.triu(permuted_K).nnz
117
118
 
118
- return K.nnz, kkt_L_nnz
119
+ return kkt_nnz, kkt_L_nnz
119
120
 
120
121
 
121
122
  def get_kkt_perm_inv_and_nnzs(P, A, G, verbose=True):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sip_python
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: Python bindings for the SIP solver.
5
5
  Author-email: João Sousa-Pinto <joaospinto@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/joaospinto/sip_python
File without changes
File without changes
File without changes
File without changes