mirror of
https://github.com/logos-storage/das-research.git
synced 2026-01-02 21:23:09 +00:00
add column and row accessors
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
13580cd44d
commit
8da447ac5a
12
DAS/block.py
12
DAS/block.py
@ -15,6 +15,18 @@ class Block:
|
||||
for i in range(self.blockSize*self.blockSize):
|
||||
self.data[i] = random.randint(1, 9)
|
||||
|
||||
def getColumn(self, columnID):
|
||||
column = [0] * self.blockSize
|
||||
for i in range(self.blockSize):
|
||||
column[i] = self.data[(i*self.blockSize)+columnID]
|
||||
return column
|
||||
|
||||
def getRow(self, rowID):
|
||||
row = [0] * self.blockSize
|
||||
for i in range(self.blockSize):
|
||||
row[i] = self.data[(rowID*self.blockSize)+i]
|
||||
return row
|
||||
|
||||
def print(self):
|
||||
dash = "-" * (self.blockSize+2)
|
||||
print(dash)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user