@@ -148,7 +148,7 @@ for (gbtrf, gbtrs, elty) in
148
148
end
149
149
ccall ((@blasfunc ($ gbtrs), liblapack), Void,
150
150
(Ptr{UInt8}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt},
151
- Ptr{$ elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$ elty}, Ptr{BlasInt},
151
+ Ptr{$ elty}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$ elty}, Ptr{BlasInt},
152
152
Ptr{BlasInt}),
153
153
& trans, & n, & kl, & ku, & size (B,2 ), AB, & max (1 ,stride (AB,2 )), ipiv,
154
154
B, & max (1 ,stride (B,2 )), info)
@@ -1040,7 +1040,7 @@ for (gesvx, elty) in
1040
1040
ldaf = stride (AF,2 )
1041
1041
nrhs = size (B,2 )
1042
1042
ldb = stride (B,2 )
1043
- rcond = Vector {$elty} (1 )
1043
+ rcond = Ref {$elty} ()
1044
1044
ferr = similar (A, $ elty, nrhs)
1045
1045
berr = similar (A, $ elty, nrhs)
1046
1046
work = Vector {$elty} (4 n)
@@ -1062,7 +1062,7 @@ for (gesvx, elty) in
1062
1062
chknonsingular (info[])
1063
1063
end
1064
1064
# WORK(1) contains the reciprocal pivot growth factor norm(A)/norm(U)
1065
- X, equed, R, C, B, rcond[1 ], ferr, berr, work[1 ]
1065
+ X, equed, R, C, B, rcond[], ferr, berr, work[1 ]
1066
1066
end
1067
1067
1068
1068
function gesvx! (A:: StridedMatrix{$elty} , B:: StridedVecOrMat{$elty} )
@@ -1109,7 +1109,7 @@ for (gesvx, elty, relty) in
1109
1109
ldaf = stride (AF,2 )
1110
1110
nrhs = size (B,2 )
1111
1111
ldb = stride (B,2 )
1112
- rcond = Vector {$relty} (1 )
1112
+ rcond = Ref {$relty} ()
1113
1113
ferr = similar (A, $ relty, nrhs)
1114
1114
berr = similar (A, $ relty, nrhs)
1115
1115
work = Vector {$elty} (2 n)
@@ -1131,7 +1131,7 @@ for (gesvx, elty, relty) in
1131
1131
chknonsingular (info[])
1132
1132
end
1133
1133
# RWORK(1) contains the reciprocal pivot growth factor norm(A)/norm(U)
1134
- X, equed, R, C, B, rcond[1 ], ferr, berr, rwork[1 ]
1134
+ X, equed, R, C, B, rcond[], ferr, berr, rwork[1 ]
1135
1135
end
1136
1136
1137
1137
# Wrapper for the no-equilibration, no-transpose calculation
@@ -1205,8 +1205,7 @@ for (gelsd, gelsy, elty) in
1205
1205
end
1206
1206
newB = [B; zeros ($ elty, max (0 , n - size (B, 1 )), size (B, 2 ))]
1207
1207
s = similar (A, $ elty, min (m, n))
1208
- rcond = convert ($ elty, rcond)
1209
- rnk = Vector {BlasInt} (1 )
1208
+ rnk = Ref {BlasInt} ()
1210
1209
info = Ref {BlasInt} ()
1211
1210
work = Vector {$elty} (1 )
1212
1211
lwork = BlasInt (- 1 )
@@ -1215,18 +1214,20 @@ for (gelsd, gelsy, elty) in
1215
1214
ccall ((@blasfunc ($ gelsd), liblapack), Void,
1216
1215
(Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt},
1217
1216
Ptr{$ elty}, Ptr{BlasInt}, Ptr{$ elty}, Ptr{BlasInt},
1218
- Ptr{$ elty}, Ptr {$ elty}, Ptr {BlasInt}, Ptr{$ elty},
1217
+ Ptr{$ elty}, Ref {$ elty}, Ref {BlasInt}, Ptr{$ elty},
1219
1218
Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}),
1220
- & m, & n, & size (B,2 ), A, & max (1 ,stride (A,2 )),
1221
- newB, & max (1 ,stride (B,2 ),n), s, & rcond, rnk, work, & lwork, iwork, info)
1219
+ & m, & n, & size (B,2 ),
1220
+ A, & max (1 ,stride (A,2 )), newB, & max (1 ,stride (B,2 ),n),
1221
+ s, $ elty (rcond), rnk, work,
1222
+ & lwork, iwork, info)
1222
1223
chklapackerror (info[])
1223
1224
if i == 1
1224
1225
lwork = BlasInt (real (work[1 ]))
1225
1226
resize! (work, lwork)
1226
1227
resize! (iwork, iwork[1 ])
1227
1228
end
1228
1229
end
1229
- subsetrows (B, newB, n), rnk[1 ]
1230
+ subsetrows (B, newB, n), rnk[]
1230
1231
end
1231
1232
1232
1233
# SUBROUTINE DGELSY( M, N, NRHS, A, LDA, B, LDB, JPVT, RCOND, RANK,
@@ -1250,28 +1251,27 @@ for (gelsd, gelsy, elty) in
1250
1251
lda = max (1 , m)
1251
1252
ldb = max (1 , m, n)
1252
1253
jpvt = zeros (BlasInt, n)
1253
- rcond = convert ($ elty, rcond)
1254
- rnk = Vector {BlasInt} (1 )
1254
+ rnk = Ref {BlasInt} ()
1255
1255
work = Vector {$elty} (1 )
1256
1256
lwork = BlasInt (- 1 )
1257
1257
info = Ref {BlasInt} ()
1258
1258
for i = 1 : 2 # first call returns lwork as work[1]
1259
1259
ccall ((@blasfunc ($ gelsy), liblapack), Void,
1260
1260
(Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$ elty},
1261
1261
Ptr{BlasInt}, Ptr{$ elty}, Ptr{BlasInt}, Ptr{BlasInt},
1262
- Ptr {$ elty}, Ptr {BlasInt}, Ptr{$ elty}, Ptr{BlasInt},
1262
+ Ref {$ elty}, Ref {BlasInt}, Ptr{$ elty}, Ptr{BlasInt},
1263
1263
Ptr{BlasInt}),
1264
1264
& m, & n, & nrhs, A,
1265
1265
& lda, newB, & ldb, jpvt,
1266
- & rcond, rnk, work, & lwork,
1266
+ $ elty ( rcond) , rnk, work, & lwork,
1267
1267
info)
1268
1268
chklapackerror (info[])
1269
1269
if i == 1
1270
1270
lwork = BlasInt (work[1 ])
1271
1271
resize! (work, lwork)
1272
1272
end
1273
1273
end
1274
- subsetrows (B, newB, n), rnk[1 ]
1274
+ subsetrows (B, newB, n), rnk[]
1275
1275
end
1276
1276
end
1277
1277
end
@@ -1298,8 +1298,7 @@ for (gelsd, gelsy, elty, relty) in
1298
1298
end
1299
1299
newB = [B; zeros ($ elty, max (0 , n - size (B, 1 )), size (B, 2 ))]
1300
1300
s = similar (A, $ relty, min (m, n))
1301
- rcond = convert ($ relty, rcond)
1302
- rnk = Vector {BlasInt} (1 )
1301
+ rnk = Ref {BlasInt} ()
1303
1302
info = Ref {BlasInt} ()
1304
1303
work = Vector {$elty} (1 )
1305
1304
lwork = BlasInt (- 1 )
@@ -1309,10 +1308,12 @@ for (gelsd, gelsy, elty, relty) in
1309
1308
ccall ((@blasfunc ($ gelsd), liblapack), Void,
1310
1309
(Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$ elty},
1311
1310
Ptr{BlasInt}, Ptr{$ elty}, Ptr{BlasInt}, Ptr{$ relty},
1312
- Ptr{$ relty}, Ptr{BlasInt}, Ptr{$ elty}, Ptr{BlasInt},
1313
- Ptr{$ relty}, Ptr{BlasInt}, Ptr{BlasInt}),
1314
- & m, & n, & size (B,2 ), A, & max (1 ,stride (A,2 )),
1315
- newB, & max (1 ,stride (B,2 ),n), s, & rcond, rnk, work, & lwork, rwork, iwork, info)
1311
+ Ref{$ relty}, Ref{BlasInt}, Ptr{$ elty}, Ptr{BlasInt},
1312
+ Ptr{$ relty}, Ref{BlasInt}, Ref{BlasInt}),
1313
+ & m, & n, & size (B,2 ), A,
1314
+ & max (1 ,stride (A,2 )), newB, & max (1 ,stride (B,2 ),n), s,
1315
+ $ relty (rcond), rnk, work, & lwork,
1316
+ rwork, iwork, info)
1316
1317
chklapackerror (info[])
1317
1318
if i == 1
1318
1319
lwork = BlasInt (real (work[1 ]))
@@ -1321,7 +1322,7 @@ for (gelsd, gelsy, elty, relty) in
1321
1322
resize! (iwork, iwork[1 ])
1322
1323
end
1323
1324
end
1324
- subsetrows (B, newB, n), rnk[1 ]
1325
+ subsetrows (B, newB, n), rnk[]
1325
1326
end
1326
1327
1327
1328
# SUBROUTINE ZGELSY( M, N, NRHS, A, LDA, B, LDB, JPVT, RCOND, RANK,
@@ -1345,8 +1346,7 @@ for (gelsd, gelsy, elty, relty) in
1345
1346
lda = max (1 , m)
1346
1347
ldb = max (1 , m, n)
1347
1348
jpvt = zeros (BlasInt, n)
1348
- rcond = convert ($ relty, rcond)
1349
- rnk = Vector {BlasInt} (1 )
1349
+ rnk = Ref {BlasInt} (1 )
1350
1350
work = Vector {$elty} (1 )
1351
1351
lwork = BlasInt (- 1 )
1352
1352
rwork = Vector {$relty} (2 n)
@@ -1355,19 +1355,19 @@ for (gelsd, gelsy, elty, relty) in
1355
1355
ccall ((@blasfunc ($ gelsy), liblapack), Void,
1356
1356
(Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}, Ptr{$ elty},
1357
1357
Ptr{BlasInt}, Ptr{$ elty}, Ptr{BlasInt}, Ptr{BlasInt},
1358
- Ptr{ $ elty }, Ptr {BlasInt}, Ptr{$ elty}, Ptr{BlasInt},
1358
+ Ref{ $ relty }, Ref {BlasInt}, Ptr{$ elty}, Ptr{BlasInt},
1359
1359
Ptr{$ relty}, Ptr{BlasInt}),
1360
1360
& m, & n, & nrhs, A,
1361
1361
& lda, newB, & ldb, jpvt,
1362
- & rcond, rnk, work, & lwork,
1362
+ $ relty ( rcond) , rnk, work, & lwork,
1363
1363
rwork, info)
1364
1364
chklapackerror (info[])
1365
1365
if i == 1
1366
1366
lwork = BlasInt (real (work[1 ]))
1367
1367
resize! (work, lwork)
1368
1368
end
1369
1369
end
1370
- subsetrows (B, newB, n), rnk[1 ]
1370
+ subsetrows (B, newB, n), rnk[]
1371
1371
end
1372
1372
end
1373
1373
end
@@ -3334,17 +3334,17 @@ for (trcon, trevc, trrfs, elty) in
3334
3334
chkdiag (diag)
3335
3335
n = checksquare (A)
3336
3336
chkuplo (uplo)
3337
- rcond = Vector {$elty} (1 )
3337
+ rcond = Ref {$elty} ()
3338
3338
work = Vector {$elty} (3 n)
3339
3339
iwork = Vector {BlasInt} (n)
3340
3340
info = Ref {BlasInt} ()
3341
3341
ccall ((@blasfunc ($ trcon), liblapack), Void,
3342
3342
(Ptr{UInt8}, Ptr{UInt8}, Ptr{UInt8}, Ptr{BlasInt},
3343
- Ptr{$ elty}, Ptr{BlasInt}, Ptr {$ elty}, Ptr{$ elty}, Ptr{BlasInt}, Ptr{BlasInt}),
3343
+ Ptr{$ elty}, Ptr{BlasInt}, Ref {$ elty}, Ptr{$ elty}, Ptr{BlasInt}, Ptr{BlasInt}),
3344
3344
& norm, & uplo, & diag, & n,
3345
3345
A, & max (1 ,stride (A,2 )), rcond, work, iwork, info)
3346
3346
chklapackerror (info[])
3347
- rcond[1 ]
3347
+ rcond[]
3348
3348
end
3349
3349
3350
3350
# SUBROUTINE DTREVC( SIDE, HOWMNY, SELECT, N, T, LDT, VL, LDVL, VR,
@@ -3462,17 +3462,17 @@ for (trcon, trevc, trrfs, elty, relty) in
3462
3462
n = checksquare (A)
3463
3463
chkuplo (uplo)
3464
3464
chkdiag (diag)
3465
- rcond = Vector {$relty} (1 )
3465
+ rcond = Ref {$relty} (1 )
3466
3466
work = Vector {$elty} (2 n)
3467
3467
rwork = Vector {$relty} (n)
3468
3468
info = Ref {BlasInt} ()
3469
3469
ccall ((@blasfunc ($ trcon), liblapack), Void,
3470
3470
(Ptr{UInt8}, Ptr{UInt8}, Ptr{UInt8}, Ptr{BlasInt},
3471
- Ptr{$ elty}, Ptr{BlasInt}, Ptr {$ relty}, Ptr{$ elty}, Ptr{$ relty}, Ptr{BlasInt}),
3471
+ Ptr{$ elty}, Ptr{BlasInt}, Ref {$ relty}, Ptr{$ elty}, Ptr{$ relty}, Ptr{BlasInt}),
3472
3472
& norm, & uplo, & diag, & n,
3473
3473
A, & max (1 ,stride (A,2 )), rcond, work, rwork, info)
3474
3474
chklapackerror (info[])
3475
- rcond[1 ]
3475
+ rcond[]
3476
3476
end
3477
3477
3478
3478
# SUBROUTINE ZTREVC( SIDE, HOWMNY, SELECT, N, T, LDT, VL, LDVL, VR,
@@ -5337,18 +5337,18 @@ for (gecon, elty) in
5337
5337
chkstride1 (A)
5338
5338
n = checksquare (A)
5339
5339
lda = max (1 , stride (A, 2 ))
5340
- rcond = Vector {$elty} (1 )
5340
+ rcond = Ref {$elty} ()
5341
5341
work = Vector {$elty} (4 n)
5342
5342
iwork = Vector {BlasInt} (n)
5343
5343
info = Ref {BlasInt} ()
5344
5344
ccall ((@blasfunc ($ gecon), liblapack), Void,
5345
5345
(Ptr{UInt8}, Ptr{BlasInt}, Ptr{$ elty}, Ptr{BlasInt},
5346
- Ptr{$ elty}, Ptr {$ elty}, Ptr{$ elty}, Ptr{BlasInt},
5346
+ Ptr{$ elty}, Ref {$ elty}, Ptr{$ elty}, Ptr{BlasInt},
5347
5347
Ptr{BlasInt}),
5348
5348
& normtype, & n, A, & lda, & anorm, rcond, work, iwork,
5349
5349
info)
5350
5350
chklapackerror (info[])
5351
- rcond[1 ]
5351
+ rcond[]
5352
5352
end
5353
5353
end
5354
5354
end
@@ -5371,18 +5371,18 @@ for (gecon, elty, relty) in
5371
5371
chkstride1 (A)
5372
5372
n = checksquare (A)
5373
5373
lda = max (1 , stride (A, 2 ))
5374
- rcond = Vector {$relty} (1 )
5374
+ rcond = Ref {$relty} ()
5375
5375
work = Vector {$elty} (2 n)
5376
5376
rwork = Vector {$relty} (2 n)
5377
5377
info = Ref {BlasInt} ()
5378
5378
ccall ((@blasfunc ($ gecon), liblapack), Void,
5379
5379
(Ptr{UInt8}, Ptr{BlasInt}, Ptr{$ elty}, Ptr{BlasInt},
5380
- Ptr{$ relty}, Ptr {$ relty}, Ptr{$ elty}, Ptr{$ relty},
5380
+ Ptr{$ relty}, Ref {$ relty}, Ptr{$ elty}, Ptr{$ relty},
5381
5381
Ptr{BlasInt}),
5382
5382
& normtype, & n, A, & lda, & anorm, rcond, work, rwork,
5383
5383
info)
5384
5384
chklapackerror (info[])
5385
- rcond[1 ]
5385
+ rcond[]
5386
5386
end
5387
5387
end
5388
5388
end
0 commit comments