MCPcopy Index your code
hub / github.com/CadQuery/cadquery / COO

Class COO

cadquery/occ_impl/nurbs.py:101–135  ·  view source on GitHub ↗

COO sparse matrix container.

Source from the content-addressed store, hash-verified

99
100
101class COO(NamedTuple):
102 """
103 COO sparse matrix container.
104 """
105
106 i: ArrayI
107 j: ArrayI
108 v: Array
109 shape: tuple[int, int]
110
111 def coo(self):
112
113 return sp.coo_matrix((self.v, (self.i, self.j)), shape=self.shape)
114
115 def cooarr(self):
116
117 return sp.coo_array((self.v, (self.i, self.j)), shape=self.shape)
118
119 def csc(self):
120
121 return self.coo().tocsc()
122
123 def csr(self):
124
125 return self.coo().tocsr()
126
127 @classmethod
128 def fromSP(cls, sparr: sp.sparray | sp.spmatrix):
129 """
130 Helper for converting from any SciPy sparse array or matrix.
131 """
132
133 tmp = sparr.tocoo()
134
135 return cls(tmp.row, tmp.col, tmp.data, tmp.shape)
136
137
138class Curve(NamedTuple):

Callers 9

designMatrixFunction · 0.85
designMatrix2DFunction · 0.85
derMatrixFunction · 0.85
periodicDerMatrixFunction · 0.85
periodicDiscretePenaltyFunction · 0.85
discretePenaltyFunction · 0.85
penaltyMatrix2DFunction · 0.85
uIsoMatrixFunction · 0.85
vIsoMatrixFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected