Class: DancingLinks::SparseMatrix::SparseMatrixHeader

Inherits:
SparseMatrixNode show all
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

Attributes inherited from SparseMatrixNode

#down, #header, #left, #right, #row_num, #up

Instance Method Summary collapse

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

#countObject

Returns the value of attribute count.



76
77
78
# File 'lib/dancing_links.rb', line 76

def count
  @count
end

#indexObject

Returns the value of attribute index.



76
77
78
# File 'lib/dancing_links.rb', line 76

def index
  @index
end