#!/usr/bin/ruby # Main program for getting LS.in for surface # # Written by k-fleak # # Usage: # # > ./getLSinSurf.rb [cout.sort.bulk] [cout.sort.surf] [LS.in.bulk] require "#{ENV["HOME"]}/myRuby/identifyCluster.rb" require "#{ENV["HOME"]}/myRuby/parseClusterOutSort.rb" parse = ParseClusterOutSearch.new(ARGV[1]) numCluster = parse.maxClusterNew LSinFile = open(ARGV[2], "r") indexBulk = Array.new() LSinFile.each do |lines| unless lines.strip.empty? then index = lines.strip.split indexBulk.push(index[0]) end end indexBulk.delete_at(0) #p indexBulk p numCluster indexBulk.each do |index| ids = IdentifyCluster.new(ARGV[0], ARGV[1], index) ids.start() unless ids.nBody == 0 then sameCluster = ids.getSameCluster end case ids.nBody when 0 print "0\n" when 1 sameCluster.each do |sc| p sc[1][1].to_i end else sameCluster.each do |sc| p sc[sc.size - 1].to_i end end end