Skip to content

Commit

Permalink
use ndarray in ezdxf.math.lingalg.Matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
mozman committed Jan 4, 2024
1 parent 87d6e49 commit a4805bb
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 191 deletions.
12 changes: 0 additions & 12 deletions docs/source/math/linalg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ Functions

.. autofunction:: compact_banded_matrix

.. autofunction:: freeze_matrix

Matrix Class
------------

Expand All @@ -48,16 +46,10 @@ Matrix Class

.. automethod:: row

.. automethod:: iter_row

.. automethod:: col

.. automethod:: iter_col

.. automethod:: diag

.. automethod:: iter_diag

.. automethod:: rows

.. automethod:: cols
Expand All @@ -72,10 +64,6 @@ Matrix Class

.. automethod:: append_col

.. automethod:: swap_rows

.. automethod:: swap_cols

.. automethod:: transpose

.. automethod:: inverse
Expand Down
4 changes: 3 additions & 1 deletion src/ezdxf/math/bspline.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,11 +770,13 @@ def nbasis(t: float):
[1.0] + [0.0] * (count - 1), # Q0
[-1.0, +1.0] + [0.0] * (count - 2), # D0
]
ncols = len(A[0])
for f in (nbasis(t) for t in t_vector[1:-1]):
A.extend(f) # Qi, Di
A.extend([row[:ncols] for row in f]) # Qi, Di
# swapped equations!
A.append([0.0] * (count - 2) + [-1.0, +1.0]) # Dn
A.append([0.0] * (count - 1) + [+1.0]) # Qn
assert len(set(len(row) for row in A)) == 1, "inhomogeneous matrix detected"

# Build right handed matrix B
B: list[Vec3] = []
Expand Down
Loading

0 comments on commit a4805bb

Please sign in to comment.