Class: Chem::G98::MolecularOrbital
- Inherits:
-
Object
- Object
- Chem::G98::MolecularOrbital
- Defined in:
- lib/chem/db/g98.rb
Instance Attribute Summary collapse
-
#eigen_value ⇒ Object
Returns the value of attribute eigen_value.
-
#index ⇒ Object
Returns the value of attribute index.
Instance Method Summary collapse
- #each_ao ⇒ Object
-
#initialize(index, sym, occupy_or_virtual) ⇒ MolecularOrbital
constructor
A new instance of MolecularOrbital.
- #push(ao, coef) ⇒ Object
-
#to_s ⇒ Object
puts index.to_s + ‘ : ’ + @sym.to_s + ‘:’ + ‘ : ’ + @occupy_or_virtual + ‘:’ + ao + ‘ : ’ coef.to_s ‘ ’.
Constructor Details
#initialize(index, sym, occupy_or_virtual) ⇒ MolecularOrbital
Returns a new instance of MolecularOrbital.
564 565 566 567 568 569 |
# File 'lib/chem/db/g98.rb', line 564 def initialize index, sym, occupy_or_virtual @index = index @sym = sym @occupy_or_virtual = occupy_or_virtual @coefficient = Hash.new end |
Instance Attribute Details
#eigen_value ⇒ Object
Returns the value of attribute eigen_value.
563 564 565 |
# File 'lib/chem/db/g98.rb', line 563 def eigen_value @eigen_value end |
#index ⇒ Object
Returns the value of attribute index.
563 564 565 |
# File 'lib/chem/db/g98.rb', line 563 def index @index end |
Instance Method Details
#each_ao ⇒ Object
570 571 572 573 574 |
# File 'lib/chem/db/g98.rb', line 570 def each_ao @coefficient.each do |key, ao| yield key, ao end end |
#push(ao, coef) ⇒ Object
575 576 577 578 |
# File 'lib/chem/db/g98.rb', line 575 def push ao, coef @coefficient[ao] = coef # puts index.to_s + ' : ' + @sym.to_s + ':' + ' : ' + @occupy_or_virtual + ':' + ao + ' : ' +coef.to_s + ' ' end |
#to_s ⇒ Object
puts index.to_s + ‘ : ’ + @sym.to_s + ‘:’ + ‘ : ’ + @occupy_or_virtual + ‘:’ + ao + ‘ : ’ coef.to_s ‘ ’
579 580 581 582 583 584 585 586 587 588 |
# File 'lib/chem/db/g98.rb', line 579 def to_s s = sprintf(" %3d %s %s", @index, @sym, @occupy_or_virtual) if @coefficient.length < 1 puts '@coefficient == 0!' end @coefficient.each do |key, coef| s = s + sprintf(" %1.1f", coef) end s end |