ruby_linear 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/AUTHORS ADDED
@@ -0,0 +1,3 @@
1
+ Frederick Cheung <frederick.cheung@gmail.com>
2
+ Tom Zeng <tom.z.zeng@gmail.com> (Ruby SWIG interface to LIBLINEAR)
3
+ Chih-Jen Lin <cjlin@csie.ntu.edu.tw> and Machine Learning Group at National Taiwan University (developers of LIBLINEAR)
data/COPYING ADDED
@@ -0,0 +1,24 @@
1
+ == LICENSE:
2
+
3
+ (The MIT License)
4
+
5
+ Copyright (c) 2012 Frederick Cheung
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining
8
+ a copy of this software and associated documentation files (the
9
+ 'Software'), to deal in the Software without restriction, including
10
+ without limitation the rights to use, copy, modify, merge, publish,
11
+ distribute, sublicense, and/or sell copies of the Software, and to
12
+ permit persons to whom the Software is furnished to do so, subject to
13
+ the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be
16
+ included in all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
19
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,109 @@
1
+ Ruby bindings for [liblinear](http://www.csie.ntu.edu.tw/~cjlin/liblinear/)
2
+
3
+ Quick Start
4
+ =====
5
+
6
+ ### Loading a problem in the libsvm format
7
+
8
+ RubyLinear::Problem.load_file("/path/to/file",bias)
9
+
10
+ ### Defining a problem from an array of samples
11
+
12
+ samples = [{1 => 1, 2=> 0.2}, {3 => 1, 4=> 0.2}, {2 => 1, 3 => 0.3}]
13
+ max_feature = samples.map {|sample| sample.keys.max}.max
14
+
15
+ labels = [1,2,1]
16
+ RubyLinear::Problem.new labels, samples, 1.0, max_feature
17
+
18
+ Your sample can of course be sparse: you only need to name features with a non-zero associated value
19
+
20
+
21
+ ### Loading a model from a file
22
+
23
+ RubyLinear::Model.load_file('/path/to/file')
24
+
25
+
26
+ ### Training a model from parameters and a problem
27
+
28
+ RubyLinear::Model.new(problem, :solver => RubyLinear::L1R_L2LOSS_SVC)
29
+
30
+ ### Changing the default parameters
31
+
32
+ RubyLinear::Model.new(problem, :solver => RubyLinear::L1R_L2LOSS_SVC,
33
+ :c => 1.1, :eps => 0.02, :weights => {2 => 0.9})
34
+ #use C=1.1, eps = 0.02 and apply a weight of 0.9 to class 2
35
+
36
+ ### Predicting a value
37
+
38
+ sample = {1 => 0.3, 4 => 0.1}
39
+ model.predict(sample)
40
+
41
+ ### Predicting a value and getting back a score for each class
42
+ sample = {1 => 0.3, 4 => 0.1}
43
+ winner, scores = model.predict_values(sample)
44
+ # winner is 1 (ie the sample has class 1)
45
+ # scores is {1=>0.10716629302903406, 2=>0.0}: class 1 scored 0.107... and class 2 scored 0
46
+
47
+ What is this
48
+ ============
49
+
50
+ Liblinear is a linear classifier. From its home page:
51
+
52
+ > LIBLINEAR is a linear classifier for data with millions of instances and features. It supports
53
+ > L2-regularized classifiers
54
+ > L2-loss linear SVM, L1-loss linear SVM, and logistic regression (LR)
55
+ > L1-regularized classifiers (after version 1.4)
56
+ > L2-loss linear SVM and logistic regression (LR)
57
+
58
+ In a nutshell if you provide a bunch of examples and what classes they should fall into, Liblinear will predict what classes future datapoints should fall in. Examples include classifying text into spam or not spam, sorting news articles into the list of topics or determining whether a tweet is expressing something positive or negative.
59
+
60
+ ## Classifying text
61
+
62
+ ### Creating the problem
63
+ If you are classifying text, you first need to break up your text into tokens. This might be individual words, pairs of words (bigrams) or triples etc. Each one of these is a feature. For example if the 3 pieces of text in our training set were
64
+
65
+ s1 = "Hello world"
66
+ s2 = "Bonjour"
67
+ s3 = "Guten tag"
68
+ s4 = "tag world"
69
+
70
+ and we were using individual words as our features then our dictionary contains the words `Hello, world, Bonjour, Guten, tag`. The feature indexes are the 1-based indexes into this list of words so s1 has features `1,2` s2 has feature `3`, s3 has features `4,5` and s4 has features `2,5`. You need to keep hold of the mapping of these words to feature numbers - You'll need this later on.
71
+
72
+ You must then assign labels: these are the classes you are trying to sort things into. For example 1 is english, 2 is french and 3 is german (these are arbitrary numbers - they don't need to be consecutive or start from 1). The code to setup such a sample set is
73
+
74
+ samples = [
75
+ { 1 => 1, 2 => 1},
76
+ { 3 => 1},
77
+ { 4 => 1, 5 => 1},
78
+ { 2 => 1, 5 => 1}
79
+ ]
80
+ labels = [1,2,3,1]
81
+
82
+ problem = RubyLinear::Problem.new labels, samples, 1.0, 5
83
+
84
+ The 3rd parameter is the bias term - check the LibLinear documentation for its interpretation. The last parameter is the maximum feature index (5 in this case). If you have saved problem data in the libsvm format, you can load it with `RubyLinear::Problem.load_file`.
85
+
86
+ #### On weights.
87
+
88
+ The weights for features are the values in the sample hashes. Here we've just used 1 to indicate the presence of a feature and nothing to indicate its absence. A more sophisticated approach would have different values depending on how relevant the feature is, for example by using tf-idf so that features that appear more often in a document or are more significant generally have higher significance.
89
+
90
+ ### Training the model
91
+
92
+ Once you have a problem instance, you can train a model:
93
+
94
+ model = RubyLinear::Model.new(problem, :solver => RubyLinear::L1R_L2LOSS_SVC)
95
+
96
+ will create and train a model from your sample data. Liblinear provides a bunch of different solvers: `RubyLinear::L2R_LR`, `RubyLinear::L2R_L2LOSS_SVC_DUAL`, `RubyLinear::L2R_L2LOSS_SVC`, `RubyLinear::L2R_L1LOSS_SVC_DUAL`, `RubyLinear::MCSVM_CS`, `RubyLinear::L1R_L2LOSS_SVC`, `RubyLinear::L1R_LR`, `RubyLinear::L2R_LR_DUAL`. The Liblinear website has more information on the differences between them.
97
+
98
+ You can set liblinear's `C` and `eps` options (the defaults are 1 and 0.01 respectively)
99
+
100
+ model = RubyLinear::Model.new(problem, :solver => RubyLinear::L1R_L2LOSS_SVC, :c => 1, :eps => 0.01)
101
+
102
+ Models can be saved to disk (`model.save(path_to_file)`) and loaded (`RubyLinear::Model.load_file(path_to_file)`). These use the standard liblinear formats so you should be able to use models trained with the liblinear command line tools.
103
+
104
+ Once you have a model you can feed it samples and it will return the class it thinks is the best match. To do this you need to turn the text into a hash of feature indexes to weights. If you have a word which isn't in your mapping (ie you come across a word which wasn't in your training set, just ignore it). For example if the text to test was "Hello bob", you would do
105
+
106
+ model.predict({1 => 1})
107
+
108
+ Feature 1 is present and so is added to the hash, but "bob" is an unknown word and so gets dropped. The returned value is the label of the predicted class.
109
+
@@ -0,0 +1,15 @@
1
+ require 'rspec/core/rake_task'
2
+
3
+ RSpec::Core::RakeTask.new('spec')
4
+ task :build do
5
+ Dir.chdir('ext') do
6
+ output = `ruby extconf.rb`
7
+ raise output unless $? == 0
8
+ output = `make`
9
+ raise output unless $? == 0
10
+ end
11
+ end
12
+
13
+ task :spec => :build
14
+
15
+ task :default => :spec
@@ -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
@@ -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);