Sha256: e805f4b618dc7059643876c35c00622b14329c7a73255158940f9634659cb435

Contents?: true

Size: 537 Bytes

Versions: 9

Compression:

Stored size: 537 Bytes

Contents

puts <<EOL
#ifndef NUMO_LAPACKE_T_H
#define NUMO_LAPACKE_T_H

EOL

ARGF.each_line do |line|
  case line
  when /C-LAPACK function prototypes/
    puts line
    break
  end
end

type, name = nil,nil

ARGF.each_line do |line|
  break if /^#define / =~ line
  line.sub!(/^(\w+)\s+LAPACKE_(\w+)\s*\(/) do
    type, name = $1,$2
    "typedef #{type} (*#{name}_t)("
  end
  case name
  when /^[id]?z/; line.gsub!(/\bvoid\s*\*/,"dcomplex *")
  when /^[is]?c/; line.gsub!(/\bvoid\s*\*/,"scomplex *")
  end
  puts line
end

puts <<EOL
#endif
EOL

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
numo-linalg-0.1.7 ext/numo/linalg/lapack/gen/replace_lapacke_h.rb
numo-linalg-0.1.6 ext/numo/linalg/lapack/gen/replace_lapacke_h.rb
numo-linalg-0.1.5 ext/numo/linalg/lapack/gen/replace_lapacke_h.rb
numo-linalg-0.1.4 ext/numo/linalg/lapack/gen/replace_lapacke_h.rb
numo-linalg-0.1.3 ext/numo/linalg/lapack/gen/replace_lapacke_h.rb
numo-linalg-0.1.2 ext/numo/linalg/lapack/gen/replace_lapacke_h.rb
numo-linalg-0.1.1 ext/numo/linalg/lapack/gen/replace_lapacke_h.rb
numo-linalg-0.1.0 ext/numo/linalg/lapack/gen/replace_lapacke_h.rb
numo-linalg-0.0.1 ext/numo/linalg/lapack/gen/replace_lapacke_h.rb