Class: GSL::Matrix

Inherits:
Object
  • Object
show all
Defined in:
lib/gsl_extras.rb,
lib/gsl_extras.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

._load(string) ⇒ Object



39
40
41
42
# File 'lib/gsl_extras.rb', line 39

def self._load(string)
	arr = Marshal.load(string)
	return self.alloc(arr.flatten, arr.size, arr[0].size)
end

Instance Method Details

#_dump(depth) ⇒ Object



36
37
38
# File 'lib/gsl_extras.rb', line 36

def _dump(depth)
	return Marshal.dump(self.to_a)
end

#gaussian_smooth(sigmai, sigmaj = nil) ⇒ Object



1127
1128
1129
1130
1131
1132
1133
1134
1135
# File 'lib/gsl_extras.rb', line 1127

def gaussian_smooth(sigmai, sigmaj = nil)
	sigmaj ||= sigmai
	for i in 0...shape[0]
		set_row i,row(i).gaussian_smooth(sigmai)
	end
	for i in 0...shape[1]
		set_col i,col(i).gaussian_smooth(sigmaj)
	end
end

#inspectObject



43
44
45
46
# File 'lib/gsl_extras.rb', line 43

def inspect
	arr=self.to_a
	"GSL::Matrix.alloc(#{arr.flatten.inspect}, #{arr.size}, #{arr[0].size})"
end