Class: DancingLinks::SparseMatrix::SparseMatrixHeader
- Inherits:
-
SparseMatrixNode
- Object
- SparseMatrixNode
- DancingLinks::SparseMatrix::SparseMatrixHeader
- Defined in:
- lib/dancing_links.rb
Overview
The class for the header nodes within the matrix. Adds two attributes that are
needed by the headers.
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#index ⇒ Object
Returns the value of attribute index.
Attributes inherited from SparseMatrixNode
#down, #header, #left, #right, #row_num, #up
Instance Method Summary collapse
-
#initialize(index = nil, *args) ⇒ SparseMatrixHeader
constructor
A new instance of SparseMatrixHeader.
Constructor Details
#initialize(index = nil, *args) ⇒ SparseMatrixHeader
Returns a new instance of SparseMatrixHeader.
70 71 72 73 74 |
# File 'lib/dancing_links.rb', line 70 def initialize index=nil, *args super( -1, *args ) @index = index @count = 0 end |
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count.
76 77 78 |
# File 'lib/dancing_links.rb', line 76 def count @count end |
#index ⇒ Object
Returns the value of attribute index.
76 77 78 |
# File 'lib/dancing_links.rb', line 76 def index @index end |