1
0

Change type of Matrix data from list to numpy.ndarray;

Restructure tests to use directly == on a Matrix using ==.all() from numpy.ndarray;
Further implementation of the Matrix class
This commit is contained in:
2023-12-15 01:47:16 +01:00
parent 4aacfe8473
commit 71fa91644e
3 changed files with 144 additions and 32 deletions

View File

@@ -1,3 +1,5 @@
import numpy
from matrix import Matrix
@@ -5,6 +7,11 @@ class Vector(Matrix):
__data__ = []
def __init__(self, data):
"""
:type data: list | int
"""
super().__init__(numpy.array([0])) # TODO: remove in future
if isinstance(data, list):
self.__data__ = data
elif isinstance(data, int):