liblinear-ruby 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +46 -0
  6. data/Rakefile +1 -0
  7. data/ext/Makefile +237 -0
  8. data/ext/blas.h +25 -0
  9. data/ext/blasp.h +430 -0
  10. data/ext/daxpy.c +49 -0
  11. data/ext/ddot.c +50 -0
  12. data/ext/dnrm2.c +62 -0
  13. data/ext/dscal.c +44 -0
  14. data/ext/extconf.rb +12 -0
  15. data/ext/liblinear_wrap.cxx +4646 -0
  16. data/ext/linear.cpp +2811 -0
  17. data/ext/linear.h +74 -0
  18. data/ext/linear.rb +357 -0
  19. data/ext/tron.cpp +235 -0
  20. data/ext/tron.h +34 -0
  21. data/lib/liblinear.rb +89 -0
  22. data/lib/liblinear/error.rb +4 -0
  23. data/lib/liblinear/model.rb +66 -0
  24. data/lib/liblinear/parameter.rb +42 -0
  25. data/lib/liblinear/problem.rb +55 -0
  26. data/lib/liblinear/version.rb +3 -0
  27. data/liblinear-1.93/COPYRIGHT +31 -0
  28. data/liblinear-1.93/Makefile +37 -0
  29. data/liblinear-1.93/Makefile.win +30 -0
  30. data/liblinear-1.93/README +531 -0
  31. data/liblinear-1.93/blas/Makefile +22 -0
  32. data/liblinear-1.93/blas/blas.a +0 -0
  33. data/liblinear-1.93/blas/blas.h +25 -0
  34. data/liblinear-1.93/blas/blasp.h +430 -0
  35. data/liblinear-1.93/blas/daxpy.c +49 -0
  36. data/liblinear-1.93/blas/daxpy.o +0 -0
  37. data/liblinear-1.93/blas/ddot.c +50 -0
  38. data/liblinear-1.93/blas/ddot.o +0 -0
  39. data/liblinear-1.93/blas/dnrm2.c +62 -0
  40. data/liblinear-1.93/blas/dnrm2.o +0 -0
  41. data/liblinear-1.93/blas/dscal.c +44 -0
  42. data/liblinear-1.93/blas/dscal.o +0 -0
  43. data/liblinear-1.93/heart_scale +270 -0
  44. data/liblinear-1.93/linear.cpp +2811 -0
  45. data/liblinear-1.93/linear.def +18 -0
  46. data/liblinear-1.93/linear.h +74 -0
  47. data/liblinear-1.93/linear.o +0 -0
  48. data/liblinear-1.93/matlab/Makefile +58 -0
  49. data/liblinear-1.93/matlab/README +197 -0
  50. data/liblinear-1.93/matlab/libsvmread.c +212 -0
  51. data/liblinear-1.93/matlab/libsvmwrite.c +106 -0
  52. data/liblinear-1.93/matlab/linear_model_matlab.c +176 -0
  53. data/liblinear-1.93/matlab/linear_model_matlab.h +2 -0
  54. data/liblinear-1.93/matlab/make.m +21 -0
  55. data/liblinear-1.93/matlab/predict.c +331 -0
  56. data/liblinear-1.93/matlab/train.c +418 -0
  57. data/liblinear-1.93/predict +0 -0
  58. data/liblinear-1.93/predict.c +245 -0
  59. data/liblinear-1.93/python/Makefile +4 -0
  60. data/liblinear-1.93/python/README +343 -0
  61. data/liblinear-1.93/python/liblinear.py +277 -0
  62. data/liblinear-1.93/python/liblinearutil.py +250 -0
  63. data/liblinear-1.93/ruby/liblinear.i +41 -0
  64. data/liblinear-1.93/ruby/liblinear_wrap.cxx +4646 -0
  65. data/liblinear-1.93/ruby/linear.h +74 -0
  66. data/liblinear-1.93/ruby/linear.o +0 -0
  67. data/liblinear-1.93/train +0 -0
  68. data/liblinear-1.93/train.c +399 -0
  69. data/liblinear-1.93/tron.cpp +235 -0
  70. data/liblinear-1.93/tron.h +34 -0
  71. data/liblinear-1.93/tron.o +0 -0
  72. data/liblinear-1.93/windows/liblinear.dll +0 -0
  73. data/liblinear-1.93/windows/libsvmread.mexw64 +0 -0
  74. data/liblinear-1.93/windows/libsvmwrite.mexw64 +0 -0
  75. data/liblinear-1.93/windows/predict.exe +0 -0
  76. data/liblinear-1.93/windows/predict.mexw64 +0 -0
  77. data/liblinear-1.93/windows/train.exe +0 -0
  78. data/liblinear-1.93/windows/train.mexw64 +0 -0
  79. data/liblinear-ruby.gemspec +24 -0
  80. metadata +152 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 80d838932a4299e6a989377e7d73f46c3718eeff
4
+ data.tar.gz: 03f5be533321002f919b025ba611200bf58244fb
5
+ SHA512:
6
+ metadata.gz: 6ce90555ad269328c7d9f632ffcf6c2341359ec7d13c85f80dcefddda6a29c8627fa2a4256a34bbdd403ef20f569b4582bdbe54b7d51bd43a7e8f619dc32b67a
7
+ data.tar.gz: f91a4dcdd15a628f5bc7e0f579f519d9f6d8b6513584f85fba2228feac8f66e6fade77ffddaca0a138bac49cdcfe646aba832aba52f98eaf94f14b712b79133b
data/.gitignore ADDED
@@ -0,0 +1,19 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ ext/*.o
12
+ ext/*.so
13
+ lib/bundler/man
14
+ pkg
15
+ rdoc
16
+ spec/reports
17
+ test/tmp
18
+ test/version_tmp
19
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in liblinear-ruby.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Kei Tsuchiya
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # Liblinear-Ruby
2
+
3
+ Liblinear-Ruby is Ruby interface to LIBLINEAR(1.9.3) using SWIG.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'liblinear-ruby'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install liblinear-ruby
18
+
19
+ ## Usage
20
+
21
+ ```ruby
22
+ require 'liblinear'
23
+ pa = Liblinear::Parameter.new({solver_type: 0})
24
+ bias = 0.5
25
+ labels = [1, 2]
26
+ # examples must be Array of Hash or Array
27
+ examples = [
28
+ {1=>0, 2=>0, 3=>0, 4=>0, 5=>0},
29
+ {1=>1, 2=>1, 3=>1, 4=>1, 5=>1}
30
+ ]
31
+ pr = Liblinear::Problem.new(labels, examples, bias)
32
+ m = Liblinear::Model.new(pr, pa)
33
+ puts m.predict({1=>1, 2=>1, 3=>1, 4=>1, 5=>1}) # => 2.0
34
+ ```
35
+
36
+ ## Contributing
37
+
38
+ 1. Fork it
39
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
40
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
41
+ 4. Push to the branch (`git push origin my-new-feature`)
42
+ 5. Create new Pull Request
43
+
44
+ ## Thanks
45
+ - http://www.csie.ntu.edu.tw/~cjlin/liblinear/
46
+ - https://github.com/tomz/liblinear-ruby-swig
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/ext/Makefile ADDED
@@ -0,0 +1,237 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ # V=0 quiet, V=1 verbose. other values don't work.
5
+ V = 0
6
+ Q1 = $(V:1=)
7
+ Q = $(Q1:0=@)
8
+ ECHO1 = $(V:1=@:)
9
+ ECHO = $(ECHO1:0=@echo)
10
+
11
+ #### Start of system configuration section. ####
12
+
13
+ srcdir = .
14
+ topdir = $(includedir)/$(RUBY_VERSION_NAME)
15
+ hdrdir = $(includedir)/$(RUBY_VERSION_NAME)
16
+ arch_hdrdir = $(rubyhdrdir)/$(arch)
17
+ PATH_SEPARATOR = :
18
+ VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
19
+ prefix = $(DESTDIR)/home/kei/.rbenv/versions/2.0.0-p195
20
+ rubysitearchprefix = $(rubylibprefix)/$(sitearch)
21
+ rubyarchprefix = $(rubylibprefix)/$(arch)
22
+ rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
23
+ exec_prefix = $(prefix)
24
+ vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
25
+ sitearchhdrdir = $(sitehdrdir)/$(sitearch)
26
+ rubyarchhdrdir = $(rubyhdrdir)/$(arch)
27
+ vendorhdrdir = $(rubyhdrdir)/vendor_ruby
28
+ sitehdrdir = $(rubyhdrdir)/site_ruby
29
+ rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
30
+ vendorarchdir = $(vendorlibdir)/$(sitearch)
31
+ vendorlibdir = $(vendordir)/$(ruby_version)
32
+ vendordir = $(rubylibprefix)/vendor_ruby
33
+ sitearchdir = $(sitelibdir)/$(sitearch)
34
+ sitelibdir = $(sitedir)/$(ruby_version)
35
+ sitedir = $(rubylibprefix)/site_ruby
36
+ rubyarchdir = $(rubylibdir)/$(arch)
37
+ rubylibdir = $(rubylibprefix)/$(ruby_version)
38
+ sitearchincludedir = $(includedir)/$(sitearch)
39
+ archincludedir = $(includedir)/$(arch)
40
+ sitearchlibdir = $(libdir)/$(sitearch)
41
+ archlibdir = $(libdir)/$(arch)
42
+ ridir = $(datarootdir)/$(RI_BASE_NAME)
43
+ mandir = $(datarootdir)/man
44
+ localedir = $(datarootdir)/locale
45
+ libdir = $(exec_prefix)/lib
46
+ psdir = $(docdir)
47
+ pdfdir = $(docdir)
48
+ dvidir = $(docdir)
49
+ htmldir = $(docdir)
50
+ infodir = $(datarootdir)/info
51
+ docdir = $(datarootdir)/doc/$(PACKAGE)
52
+ oldincludedir = $(DESTDIR)/usr/include
53
+ includedir = $(prefix)/include
54
+ localstatedir = $(prefix)/var
55
+ sharedstatedir = $(prefix)/com
56
+ sysconfdir = $(prefix)/etc
57
+ datadir = $(datarootdir)
58
+ datarootdir = $(prefix)/share
59
+ libexecdir = $(exec_prefix)/libexec
60
+ sbindir = $(exec_prefix)/sbin
61
+ bindir = $(exec_prefix)/bin
62
+ archdir = $(rubyarchdir)
63
+
64
+
65
+ CC = gcc
66
+ CXX = g++
67
+ LIBRUBY = $(LIBRUBY_A)
68
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
69
+ LIBRUBYARG_SHARED = -Wl,-R -Wl,$(libdir) -L$(libdir)
70
+ LIBRUBYARG_STATIC = -Wl,-R -Wl,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static
71
+ empty =
72
+ OUTFLAG = -o $(empty)
73
+ COUTFLAG = -o $(empty)
74
+
75
+ RUBY_EXTCONF_H =
76
+ cflags = $(optflags) $(debugflags) $(warnflags)
77
+ optflags = -O3 -fno-fast-math
78
+ debugflags = -ggdb3
79
+ warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration
80
+ CCDLFLAGS = -fPIC
81
+ CFLAGS = $(CCDLFLAGS) -Wall -O3 $(ARCH_FLAG)
82
+ INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
83
+ DEFS =
84
+ CPPFLAGS = -I'/home/kei/.rbenv/versions/2.0.0-p195/include' $(DEFS) $(cppflags)
85
+ CXXFLAGS = $(CCDLFLAGS) $(cxxflags) $(ARCH_FLAG)
86
+ ldflags = -L. -L'/home/kei/.rbenv/versions/2.0.0-p195/lib' -fstack-protector -rdynamic -Wl,-export-dynamic
87
+ dldflags =
88
+ ARCH_FLAG =
89
+ DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
90
+ LDSHARED = g++ -shared
91
+ LDSHAREDXX = $(CXX) -shared
92
+ AR = ar
93
+ EXEEXT =
94
+
95
+ RUBY_INSTALL_NAME = ruby
96
+ RUBY_SO_NAME = ruby
97
+ RUBYW_INSTALL_NAME =
98
+ RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
99
+ RUBYW_BASE_NAME = rubyw
100
+ RUBY_BASE_NAME = ruby
101
+
102
+ arch = x86_64-linux
103
+ sitearch = $(arch)
104
+ ruby_version = 2.0.0
105
+ ruby = $(bindir)/ruby
106
+ RUBY = $(ruby)
107
+ ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/defines.h $(arch_hdrdir)/ruby/config.h
108
+
109
+ RM = rm -f
110
+ RM_RF = $(RUBY) -run -e rm -- -rf
111
+ RMDIRS = rmdir --ignore-fail-on-non-empty -p
112
+ MAKEDIRS = /bin/mkdir -p
113
+ INSTALL = /usr/bin/install -c
114
+ INSTALL_PROG = $(INSTALL) -m 0755
115
+ INSTALL_DATA = $(INSTALL) -m 644
116
+ COPY = cp
117
+ TOUCH = exit >
118
+
119
+ #### End of system configuration section. ####
120
+
121
+ preload =
122
+
123
+ libpath = . $(libdir)
124
+ LIBPATH = -L. -L$(libdir) -Wl,-R$(libdir)
125
+ DEFFILE =
126
+
127
+ CLEANFILES = mkmf.log
128
+ DISTCLEANFILES =
129
+ DISTCLEANDIRS =
130
+
131
+ extout =
132
+ extout_prefix =
133
+ target_prefix =
134
+ LOCAL_LIBS =
135
+ LIBS = -lpthread -lrt -ldl -lcrypt -lm -lc
136
+ ORIG_SRCS = dnrm2.c dscal.c daxpy.c ddot.c liblinear_wrap.cxx linear.cpp tron.cpp
137
+ SRCS = $(ORIG_SRCS)
138
+ OBJS = dnrm2.o dscal.o daxpy.o ddot.o liblinear_wrap.o linear.o tron.o
139
+ HDRS = $(srcdir)/linear.h $(srcdir)/blas.h $(srcdir)/blasp.h $(srcdir)/tron.h
140
+ TARGET = liblinearswig
141
+ TARGET_NAME = liblinearswig
142
+ TARGET_ENTRY = Init_$(TARGET_NAME)
143
+ DLLIB = $(TARGET).so
144
+ EXTSTATIC =
145
+ STATIC_LIB =
146
+
147
+ BINDIR = $(bindir)
148
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
149
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
150
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
151
+ HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
152
+ ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
153
+
154
+ TARGET_SO = $(DLLIB)
155
+ CLEANLIBS = $(TARGET).so
156
+ CLEANOBJS = *.o *.bak
157
+
158
+ all: $(DLLIB)
159
+ static: $(STATIC_LIB)
160
+ .PHONY: all install static install-so install-rb
161
+ .PHONY: clean clean-so clean-static clean-rb
162
+
163
+ clean-static::
164
+ clean-rb-default::
165
+ clean-rb::
166
+ clean-so::
167
+ clean: clean-so clean-static clean-rb-default clean-rb
168
+ -$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
169
+
170
+ distclean-rb-default::
171
+ distclean-rb::
172
+ distclean-so::
173
+ distclean-static::
174
+ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
175
+ -$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
176
+ -$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
177
+ -$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
178
+
179
+ realclean: distclean
180
+ install: install-so install-rb
181
+
182
+ install-so: $(DLLIB) ./.RUBYARCHDIR.time
183
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
184
+ clean-static::
185
+ -$(Q)$(RM) $(STATIC_LIB)
186
+ install-rb: pre-install-rb install-rb-default
187
+ install-rb-default: pre-install-rb-default
188
+ pre-install-rb: Makefile
189
+ pre-install-rb-default: Makefile
190
+ pre-install-rb-default:
191
+ $(ECHO) installing default liblinearswig libraries
192
+ ./.RUBYARCHDIR.time:
193
+ $(Q) $(MAKEDIRS) $(RUBYARCHDIR)
194
+ $(Q) $(TOUCH) $@
195
+
196
+ site-install: site-install-so site-install-rb
197
+ site-install-so: install-so
198
+ site-install-rb: install-rb
199
+
200
+ .SUFFIXES: .c .m .cc .mm .cxx .cpp .C .o
201
+
202
+ .cc.o:
203
+ $(ECHO) compiling $(<)
204
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
205
+
206
+ .mm.o:
207
+ $(ECHO) compiling $(<)
208
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
209
+
210
+ .cxx.o:
211
+ $(ECHO) compiling $(<)
212
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
213
+
214
+ .cpp.o:
215
+ $(ECHO) compiling $(<)
216
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
217
+
218
+ .C.o:
219
+ $(ECHO) compiling $(<)
220
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
221
+
222
+ .c.o:
223
+ $(ECHO) compiling $(<)
224
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
225
+
226
+ .m.o:
227
+ $(ECHO) compiling $(<)
228
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
229
+
230
+ $(DLLIB): $(OBJS) Makefile
231
+ $(ECHO) linking shared-object $(DLLIB)
232
+ -$(Q)$(RM) $(@)
233
+ $(Q) $(LDSHAREDXX) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
234
+
235
+
236
+
237
+ $(OBJS): $(HDRS) $(ruby_headers)
data/ext/blas.h ADDED
@@ -0,0 +1,25 @@
1
+ /* blas.h -- C header file for BLAS Ver 1.0 */
2
+ /* Jesse Bennett March 23, 2000 */
3
+
4
+ /** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
5
+
6
+ - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
7
+
8
+ #ifndef BLAS_INCLUDE
9
+ #define BLAS_INCLUDE
10
+
11
+ /* Data types specific to BLAS implementation */
12
+ typedef struct { float r, i; } fcomplex;
13
+ typedef struct { double r, i; } dcomplex;
14
+ typedef int blasbool;
15
+
16
+ #include "blasp.h" /* Prototypes for all BLAS functions */
17
+
18
+ #define FALSE 0
19
+ #define TRUE 1
20
+
21
+ /* Macro functions */
22
+ #define MIN(a,b) ((a) <= (b) ? (a) : (b))
23
+ #define MAX(a,b) ((a) >= (b) ? (a) : (b))
24
+
25
+ #endif
data/ext/blasp.h ADDED
@@ -0,0 +1,430 @@
1
+ /* blasp.h -- C prototypes for BLAS Ver 1.0 */
2
+ /* Jesse Bennett March 23, 2000 */
3
+
4
+ /* Functions listed in alphabetical order */
5
+
6
+ #ifdef F2C_COMPAT
7
+
8
+ void cdotc_(fcomplex *dotval, int *n, fcomplex *cx, int *incx,
9
+ fcomplex *cy, int *incy);
10
+
11
+ void cdotu_(fcomplex *dotval, int *n, fcomplex *cx, int *incx,
12
+ fcomplex *cy, int *incy);
13
+
14
+ double sasum_(int *n, float *sx, int *incx);
15
+
16
+ double scasum_(int *n, fcomplex *cx, int *incx);
17
+
18
+ double scnrm2_(int *n, fcomplex *x, int *incx);
19
+
20
+ double sdot_(int *n, float *sx, int *incx, float *sy, int *incy);
21
+
22
+ double snrm2_(int *n, float *x, int *incx);
23
+
24
+ void zdotc_(dcomplex *dotval, int *n, dcomplex *cx, int *incx,
25
+ dcomplex *cy, int *incy);
26
+
27
+ void zdotu_(dcomplex *dotval, int *n, dcomplex *cx, int *incx,
28
+ dcomplex *cy, int *incy);
29
+
30
+ #else
31
+
32
+ fcomplex cdotc_(int *n, fcomplex *cx, int *incx, fcomplex *cy, int *incy);
33
+
34
+ fcomplex cdotu_(int *n, fcomplex *cx, int *incx, fcomplex *cy, int *incy);
35
+
36
+ float sasum_(int *n, float *sx, int *incx);
37
+
38
+ float scasum_(int *n, fcomplex *cx, int *incx);
39
+
40
+ float scnrm2_(int *n, fcomplex *x, int *incx);
41
+
42
+ float sdot_(int *n, float *sx, int *incx, float *sy, int *incy);
43
+
44
+ float snrm2_(int *n, float *x, int *incx);
45
+
46
+ dcomplex zdotc_(int *n, dcomplex *cx, int *incx, dcomplex *cy, int *incy);
47
+
48
+ dcomplex zdotu_(int *n, dcomplex *cx, int *incx, dcomplex *cy, int *incy);
49
+
50
+ #endif
51
+
52
+ /* Remaining functions listed in alphabetical order */
53
+
54
+ int caxpy_(int *n, fcomplex *ca, fcomplex *cx, int *incx, fcomplex *cy,
55
+ int *incy);
56
+
57
+ int ccopy_(int *n, fcomplex *cx, int *incx, fcomplex *cy, int *incy);
58
+
59
+ int cgbmv_(char *trans, int *m, int *n, int *kl, int *ku,
60
+ fcomplex *alpha, fcomplex *a, int *lda, fcomplex *x, int *incx,
61
+ fcomplex *beta, fcomplex *y, int *incy);
62
+
63
+ int cgemm_(char *transa, char *transb, int *m, int *n, int *k,
64
+ fcomplex *alpha, fcomplex *a, int *lda, fcomplex *b, int *ldb,
65
+ fcomplex *beta, fcomplex *c, int *ldc);
66
+
67
+ int cgemv_(char *trans, int *m, int *n, fcomplex *alpha, fcomplex *a,
68
+ int *lda, fcomplex *x, int *incx, fcomplex *beta, fcomplex *y,
69
+ int *incy);
70
+
71
+ int cgerc_(int *m, int *n, fcomplex *alpha, fcomplex *x, int *incx,
72
+ fcomplex *y, int *incy, fcomplex *a, int *lda);
73
+
74
+ int cgeru_(int *m, int *n, fcomplex *alpha, fcomplex *x, int *incx,
75
+ fcomplex *y, int *incy, fcomplex *a, int *lda);
76
+
77
+ int chbmv_(char *uplo, int *n, int *k, fcomplex *alpha, fcomplex *a,
78
+ int *lda, fcomplex *x, int *incx, fcomplex *beta, fcomplex *y,
79
+ int *incy);
80
+
81
+ int chemm_(char *side, char *uplo, int *m, int *n, fcomplex *alpha,
82
+ fcomplex *a, int *lda, fcomplex *b, int *ldb, fcomplex *beta,
83
+ fcomplex *c, int *ldc);
84
+
85
+ int chemv_(char *uplo, int *n, fcomplex *alpha, fcomplex *a, int *lda,
86
+ fcomplex *x, int *incx, fcomplex *beta, fcomplex *y, int *incy);
87
+
88
+ int cher_(char *uplo, int *n, float *alpha, fcomplex *x, int *incx,
89
+ fcomplex *a, int *lda);
90
+
91
+ int cher2_(char *uplo, int *n, fcomplex *alpha, fcomplex *x, int *incx,
92
+ fcomplex *y, int *incy, fcomplex *a, int *lda);
93
+
94
+ int cher2k_(char *uplo, char *trans, int *n, int *k, fcomplex *alpha,
95
+ fcomplex *a, int *lda, fcomplex *b, int *ldb, float *beta,
96
+ fcomplex *c, int *ldc);
97
+
98
+ int cherk_(char *uplo, char *trans, int *n, int *k, float *alpha,
99
+ fcomplex *a, int *lda, float *beta, fcomplex *c, int *ldc);
100
+
101
+ int chpmv_(char *uplo, int *n, fcomplex *alpha, fcomplex *ap, fcomplex *x,
102
+ int *incx, fcomplex *beta, fcomplex *y, int *incy);
103
+
104
+ int chpr_(char *uplo, int *n, float *alpha, fcomplex *x, int *incx,
105
+ fcomplex *ap);
106
+
107
+ int chpr2_(char *uplo, int *n, fcomplex *alpha, fcomplex *x, int *incx,
108
+ fcomplex *y, int *incy, fcomplex *ap);
109
+
110
+ int crotg_(fcomplex *ca, fcomplex *cb, float *c, fcomplex *s);
111
+
112
+ int cscal_(int *n, fcomplex *ca, fcomplex *cx, int *incx);
113
+
114
+ int csscal_(int *n, float *sa, fcomplex *cx, int *incx);
115
+
116
+ int cswap_(int *n, fcomplex *cx, int *incx, fcomplex *cy, int *incy);
117
+
118
+ int csymm_(char *side, char *uplo, int *m, int *n, fcomplex *alpha,
119
+ fcomplex *a, int *lda, fcomplex *b, int *ldb, fcomplex *beta,
120
+ fcomplex *c, int *ldc);
121
+
122
+ int csyr2k_(char *uplo, char *trans, int *n, int *k, fcomplex *alpha,
123
+ fcomplex *a, int *lda, fcomplex *b, int *ldb, fcomplex *beta,
124
+ fcomplex *c, int *ldc);
125
+
126
+ int csyrk_(char *uplo, char *trans, int *n, int *k, fcomplex *alpha,
127
+ fcomplex *a, int *lda, fcomplex *beta, fcomplex *c, int *ldc);
128
+
129
+ int ctbmv_(char *uplo, char *trans, char *diag, int *n, int *k,
130
+ fcomplex *a, int *lda, fcomplex *x, int *incx);
131
+
132
+ int ctbsv_(char *uplo, char *trans, char *diag, int *n, int *k,
133
+ fcomplex *a, int *lda, fcomplex *x, int *incx);
134
+
135
+ int ctpmv_(char *uplo, char *trans, char *diag, int *n, fcomplex *ap,
136
+ fcomplex *x, int *incx);
137
+
138
+ int ctpsv_(char *uplo, char *trans, char *diag, int *n, fcomplex *ap,
139
+ fcomplex *x, int *incx);
140
+
141
+ int ctrmm_(char *side, char *uplo, char *transa, char *diag, int *m,
142
+ int *n, fcomplex *alpha, fcomplex *a, int *lda, fcomplex *b,
143
+ int *ldb);
144
+
145
+ int ctrmv_(char *uplo, char *trans, char *diag, int *n, fcomplex *a,
146
+ int *lda, fcomplex *x, int *incx);
147
+
148
+ int ctrsm_(char *side, char *uplo, char *transa, char *diag, int *m,
149
+ int *n, fcomplex *alpha, fcomplex *a, int *lda, fcomplex *b,
150
+ int *ldb);
151
+
152
+ int ctrsv_(char *uplo, char *trans, char *diag, int *n, fcomplex *a,
153
+ int *lda, fcomplex *x, int *incx);
154
+
155
+ int daxpy_(int *n, double *sa, double *sx, int *incx, double *sy,
156
+ int *incy);
157
+
158
+ int dcopy_(int *n, double *sx, int *incx, double *sy, int *incy);
159
+
160
+ int dgbmv_(char *trans, int *m, int *n, int *kl, int *ku,
161
+ double *alpha, double *a, int *lda, double *x, int *incx,
162
+ double *beta, double *y, int *incy);
163
+
164
+ int dgemm_(char *transa, char *transb, int *m, int *n, int *k,
165
+ double *alpha, double *a, int *lda, double *b, int *ldb,
166
+ double *beta, double *c, int *ldc);
167
+
168
+ int dgemv_(char *trans, int *m, int *n, double *alpha, double *a,
169
+ int *lda, double *x, int *incx, double *beta, double *y,
170
+ int *incy);
171
+
172
+ int dger_(int *m, int *n, double *alpha, double *x, int *incx,
173
+ double *y, int *incy, double *a, int *lda);
174
+
175
+ int drot_(int *n, double *sx, int *incx, double *sy, int *incy,
176
+ double *c, double *s);
177
+
178
+ int drotg_(double *sa, double *sb, double *c, double *s);
179
+
180
+ int dsbmv_(char *uplo, int *n, int *k, double *alpha, double *a,
181
+ int *lda, double *x, int *incx, double *beta, double *y,
182
+ int *incy);
183
+
184
+ int dscal_(int *n, double *sa, double *sx, int *incx);
185
+
186
+ int dspmv_(char *uplo, int *n, double *alpha, double *ap, double *x,
187
+ int *incx, double *beta, double *y, int *incy);
188
+
189
+ int dspr_(char *uplo, int *n, double *alpha, double *x, int *incx,
190
+ double *ap);
191
+
192
+ int dspr2_(char *uplo, int *n, double *alpha, double *x, int *incx,
193
+ double *y, int *incy, double *ap);
194
+
195
+ int dswap_(int *n, double *sx, int *incx, double *sy, int *incy);
196
+
197
+ int dsymm_(char *side, char *uplo, int *m, int *n, double *alpha,
198
+ double *a, int *lda, double *b, int *ldb, double *beta,
199
+ double *c, int *ldc);
200
+
201
+ int dsymv_(char *uplo, int *n, double *alpha, double *a, int *lda,
202
+ double *x, int *incx, double *beta, double *y, int *incy);
203
+
204
+ int dsyr_(char *uplo, int *n, double *alpha, double *x, int *incx,
205
+ double *a, int *lda);
206
+
207
+ int dsyr2_(char *uplo, int *n, double *alpha, double *x, int *incx,
208
+ double *y, int *incy, double *a, int *lda);
209
+
210
+ int dsyr2k_(char *uplo, char *trans, int *n, int *k, double *alpha,
211
+ double *a, int *lda, double *b, int *ldb, double *beta,
212
+ double *c, int *ldc);
213
+
214
+ int dsyrk_(char *uplo, char *trans, int *n, int *k, double *alpha,
215
+ double *a, int *lda, double *beta, double *c, int *ldc);
216
+
217
+ int dtbmv_(char *uplo, char *trans, char *diag, int *n, int *k,
218
+ double *a, int *lda, double *x, int *incx);
219
+
220
+ int dtbsv_(char *uplo, char *trans, char *diag, int *n, int *k,
221
+ double *a, int *lda, double *x, int *incx);
222
+
223
+ int dtpmv_(char *uplo, char *trans, char *diag, int *n, double *ap,
224
+ double *x, int *incx);
225
+
226
+ int dtpsv_(char *uplo, char *trans, char *diag, int *n, double *ap,
227
+ double *x, int *incx);
228
+
229
+ int dtrmm_(char *side, char *uplo, char *transa, char *diag, int *m,
230
+ int *n, double *alpha, double *a, int *lda, double *b,
231
+ int *ldb);
232
+
233
+ int dtrmv_(char *uplo, char *trans, char *diag, int *n, double *a,
234
+ int *lda, double *x, int *incx);
235
+
236
+ int dtrsm_(char *side, char *uplo, char *transa, char *diag, int *m,
237
+ int *n, double *alpha, double *a, int *lda, double *b,
238
+ int *ldb);
239
+
240
+ int dtrsv_(char *uplo, char *trans, char *diag, int *n, double *a,
241
+ int *lda, double *x, int *incx);
242
+
243
+
244
+ int saxpy_(int *n, float *sa, float *sx, int *incx, float *sy, int *incy);
245
+
246
+ int scopy_(int *n, float *sx, int *incx, float *sy, int *incy);
247
+
248
+ int sgbmv_(char *trans, int *m, int *n, int *kl, int *ku,
249
+ float *alpha, float *a, int *lda, float *x, int *incx,
250
+ float *beta, float *y, int *incy);
251
+
252
+ int sgemm_(char *transa, char *transb, int *m, int *n, int *k,
253
+ float *alpha, float *a, int *lda, float *b, int *ldb,
254
+ float *beta, float *c, int *ldc);
255
+
256
+ int sgemv_(char *trans, int *m, int *n, float *alpha, float *a,
257
+ int *lda, float *x, int *incx, float *beta, float *y,
258
+ int *incy);
259
+
260
+ int sger_(int *m, int *n, float *alpha, float *x, int *incx,
261
+ float *y, int *incy, float *a, int *lda);
262
+
263
+ int srot_(int *n, float *sx, int *incx, float *sy, int *incy,
264
+ float *c, float *s);
265
+
266
+ int srotg_(float *sa, float *sb, float *c, float *s);
267
+
268
+ int ssbmv_(char *uplo, int *n, int *k, float *alpha, float *a,
269
+ int *lda, float *x, int *incx, float *beta, float *y,
270
+ int *incy);
271
+
272
+ int sscal_(int *n, float *sa, float *sx, int *incx);
273
+
274
+ int sspmv_(char *uplo, int *n, float *alpha, float *ap, float *x,
275
+ int *incx, float *beta, float *y, int *incy);
276
+
277
+ int sspr_(char *uplo, int *n, float *alpha, float *x, int *incx,
278
+ float *ap);
279
+
280
+ int sspr2_(char *uplo, int *n, float *alpha, float *x, int *incx,
281
+ float *y, int *incy, float *ap);
282
+
283
+ int sswap_(int *n, float *sx, int *incx, float *sy, int *incy);
284
+
285
+ int ssymm_(char *side, char *uplo, int *m, int *n, float *alpha,
286
+ float *a, int *lda, float *b, int *ldb, float *beta,
287
+ float *c, int *ldc);
288
+
289
+ int ssymv_(char *uplo, int *n, float *alpha, float *a, int *lda,
290
+ float *x, int *incx, float *beta, float *y, int *incy);
291
+
292
+ int ssyr_(char *uplo, int *n, float *alpha, float *x, int *incx,
293
+ float *a, int *lda);
294
+
295
+ int ssyr2_(char *uplo, int *n, float *alpha, float *x, int *incx,
296
+ float *y, int *incy, float *a, int *lda);
297
+
298
+ int ssyr2k_(char *uplo, char *trans, int *n, int *k, float *alpha,
299
+ float *a, int *lda, float *b, int *ldb, float *beta,
300
+ float *c, int *ldc);
301
+
302
+ int ssyrk_(char *uplo, char *trans, int *n, int *k, float *alpha,
303
+ float *a, int *lda, float *beta, float *c, int *ldc);
304
+
305
+ int stbmv_(char *uplo, char *trans, char *diag, int *n, int *k,
306
+ float *a, int *lda, float *x, int *incx);
307
+
308
+ int stbsv_(char *uplo, char *trans, char *diag, int *n, int *k,
309
+ float *a, int *lda, float *x, int *incx);
310
+
311
+ int stpmv_(char *uplo, char *trans, char *diag, int *n, float *ap,
312
+ float *x, int *incx);
313
+
314
+ int stpsv_(char *uplo, char *trans, char *diag, int *n, float *ap,
315
+ float *x, int *incx);
316
+
317
+ int strmm_(char *side, char *uplo, char *transa, char *diag, int *m,
318
+ int *n, float *alpha, float *a, int *lda, float *b,
319
+ int *ldb);
320
+
321
+ int strmv_(char *uplo, char *trans, char *diag, int *n, float *a,
322
+ int *lda, float *x, int *incx);
323
+
324
+ int strsm_(char *side, char *uplo, char *transa, char *diag, int *m,
325
+ int *n, float *alpha, float *a, int *lda, float *b,
326
+ int *ldb);
327
+
328
+ int strsv_(char *uplo, char *trans, char *diag, int *n, float *a,
329
+ int *lda, float *x, int *incx);
330
+
331
+ int zaxpy_(int *n, dcomplex *ca, dcomplex *cx, int *incx, dcomplex *cy,
332
+ int *incy);
333
+
334
+ int zcopy_(int *n, dcomplex *cx, int *incx, dcomplex *cy, int *incy);
335
+
336
+ int zdscal_(int *n, double *sa, dcomplex *cx, int *incx);
337
+
338
+ int zgbmv_(char *trans, int *m, int *n, int *kl, int *ku,
339
+ dcomplex *alpha, dcomplex *a, int *lda, dcomplex *x, int *incx,
340
+ dcomplex *beta, dcomplex *y, int *incy);
341
+
342
+ int zgemm_(char *transa, char *transb, int *m, int *n, int *k,
343
+ dcomplex *alpha, dcomplex *a, int *lda, dcomplex *b, int *ldb,
344
+ dcomplex *beta, dcomplex *c, int *ldc);
345
+
346
+ int zgemv_(char *trans, int *m, int *n, dcomplex *alpha, dcomplex *a,
347
+ int *lda, dcomplex *x, int *incx, dcomplex *beta, dcomplex *y,
348
+ int *incy);
349
+
350
+ int zgerc_(int *m, int *n, dcomplex *alpha, dcomplex *x, int *incx,
351
+ dcomplex *y, int *incy, dcomplex *a, int *lda);
352
+
353
+ int zgeru_(int *m, int *n, dcomplex *alpha, dcomplex *x, int *incx,
354
+ dcomplex *y, int *incy, dcomplex *a, int *lda);
355
+
356
+ int zhbmv_(char *uplo, int *n, int *k, dcomplex *alpha, dcomplex *a,
357
+ int *lda, dcomplex *x, int *incx, dcomplex *beta, dcomplex *y,
358
+ int *incy);
359
+
360
+ int zhemm_(char *side, char *uplo, int *m, int *n, dcomplex *alpha,
361
+ dcomplex *a, int *lda, dcomplex *b, int *ldb, dcomplex *beta,
362
+ dcomplex *c, int *ldc);
363
+
364
+ int zhemv_(char *uplo, int *n, dcomplex *alpha, dcomplex *a, int *lda,
365
+ dcomplex *x, int *incx, dcomplex *beta, dcomplex *y, int *incy);
366
+
367
+ int zher_(char *uplo, int *n, double *alpha, dcomplex *x, int *incx,
368
+ dcomplex *a, int *lda);
369
+
370
+ int zher2_(char *uplo, int *n, dcomplex *alpha, dcomplex *x, int *incx,
371
+ dcomplex *y, int *incy, dcomplex *a, int *lda);
372
+
373
+ int zher2k_(char *uplo, char *trans, int *n, int *k, dcomplex *alpha,
374
+ dcomplex *a, int *lda, dcomplex *b, int *ldb, double *beta,
375
+ dcomplex *c, int *ldc);
376
+
377
+ int zherk_(char *uplo, char *trans, int *n, int *k, double *alpha,
378
+ dcomplex *a, int *lda, double *beta, dcomplex *c, int *ldc);
379
+
380
+ int zhpmv_(char *uplo, int *n, dcomplex *alpha, dcomplex *ap, dcomplex *x,
381
+ int *incx, dcomplex *beta, dcomplex *y, int *incy);
382
+
383
+ int zhpr_(char *uplo, int *n, double *alpha, dcomplex *x, int *incx,
384
+ dcomplex *ap);
385
+
386
+ int zhpr2_(char *uplo, int *n, dcomplex *alpha, dcomplex *x, int *incx,
387
+ dcomplex *y, int *incy, dcomplex *ap);
388
+
389
+ int zrotg_(dcomplex *ca, dcomplex *cb, double *c, dcomplex *s);
390
+
391
+ int zscal_(int *n, dcomplex *ca, dcomplex *cx, int *incx);
392
+
393
+ int zswap_(int *n, dcomplex *cx, int *incx, dcomplex *cy, int *incy);
394
+
395
+ int zsymm_(char *side, char *uplo, int *m, int *n, dcomplex *alpha,
396
+ dcomplex *a, int *lda, dcomplex *b, int *ldb, dcomplex *beta,
397
+ dcomplex *c, int *ldc);
398
+
399
+ int zsyr2k_(char *uplo, char *trans, int *n, int *k, dcomplex *alpha,
400
+ dcomplex *a, int *lda, dcomplex *b, int *ldb, dcomplex *beta,
401
+ dcomplex *c, int *ldc);
402
+
403
+ int zsyrk_(char *uplo, char *trans, int *n, int *k, dcomplex *alpha,
404
+ dcomplex *a, int *lda, dcomplex *beta, dcomplex *c, int *ldc);
405
+
406
+ int ztbmv_(char *uplo, char *trans, char *diag, int *n, int *k,
407
+ dcomplex *a, int *lda, dcomplex *x, int *incx);
408
+
409
+ int ztbsv_(char *uplo, char *trans, char *diag, int *n, int *k,
410
+ dcomplex *a, int *lda, dcomplex *x, int *incx);
411
+
412
+ int ztpmv_(char *uplo, char *trans, char *diag, int *n, dcomplex *ap,
413
+ dcomplex *x, int *incx);
414
+
415
+ int ztpsv_(char *uplo, char *trans, char *diag, int *n, dcomplex *ap,
416
+ dcomplex *x, int *incx);
417
+
418
+ int ztrmm_(char *side, char *uplo, char *transa, char *diag, int *m,
419
+ int *n, dcomplex *alpha, dcomplex *a, int *lda, dcomplex *b,
420
+ int *ldb);
421
+
422
+ int ztrmv_(char *uplo, char *trans, char *diag, int *n, dcomplex *a,
423
+ int *lda, dcomplex *x, int *incx);
424
+
425
+ int ztrsm_(char *side, char *uplo, char *transa, char *diag, int *m,
426
+ int *n, dcomplex *alpha, dcomplex *a, int *lda, dcomplex *b,
427
+ int *ldb);
428
+
429
+ int ztrsv_(char *uplo, char *trans, char *diag, int *n, dcomplex *a,
430
+ int *lda, dcomplex *x, int *incx);