本文整理匯總了Golang中C.integer函數的典型用法代碼示例。如果您正苦於以下問題:Golang integer函數的具體用法?Golang integer怎麽用?Golang integer使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了integer函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: dgetrsHelper
func dgetrsHelper(trans bool, n, nrhs int, a []float64, lda int, ipiv []C.integer, b []float64, ldb int) error {
var (
trans_ = transChar(trans)
n_ = C.integer(n)
nrhs_ = C.integer(nrhs)
a_ = ptrFloat64(a)
lda_ = C.integer(lda)
ipiv_ = ptrInt(ipiv)
b_ = ptrFloat64(b)
ldb_ = C.integer(ldb)
)
var info_ C.integer
C.dgetrs_(&trans_, &n_, &nrhs_, a_, &lda_, ipiv_, b_, &ldb_, &info_)
info := int(info_)
switch {
case info < 0:
return errInvalidArg(-info)
case info == 0:
return nil
default:
panic(errUnknown(info))
}
}
示例2: ztrtrs
// DTRTRS: complex double-precision TRiangular Solve
//
// http://www.netlib.org/lapack/complex16/ztrtrs.f
func ztrtrs(tri Triangle, h bool, diag diagType, n, nrhs int, a []complex128, lda int, b []complex128, ldb int) error {
var (
uplo_ = uploChar(tri)
trans_ = conjTransChar(h)
diag_ = diagChar(diag)
n_ = C.integer(n)
nrhs_ = C.integer(nrhs)
a_ = ptrComplex128(a)
lda_ = C.integer(lda)
b_ = ptrComplex128(b)
ldb_ = C.integer(ldb)
)
var info_ C.integer
C.ztrtrs_(&uplo_, &trans_, &diag_, &n_, &nrhs_, a_, &lda_, b_, &ldb_, &info_)
info := int(info_)
switch {
case info < 0:
return errInvalidArg(-info)
case info > 0:
return errSingular(info)
default:
return nil
}
}
示例3: zgeevHelper
func zgeevHelper(jobvl, jobvr jobzMode, n int, a []complex128, lda int, w, vl []complex128, ldvl int, vr []complex128, ldvr int, work []complex128, lwork int, rwork []float64) error {
var (
jobvl_ = jobzChar(jobvl)
jobvr_ = jobzChar(jobvr)
n_ = C.integer(n)
a_ = ptrComplex128(a)
lda_ = C.integer(lda)
w_ = ptrComplex128(w)
vl_ = ptrComplex128(vl)
ldvl_ = C.integer(ldvl)
vr_ = ptrComplex128(vr)
ldvr_ = C.integer(ldvr)
work_ = ptrComplex128(work)
lwork_ = C.integer(lwork)
rwork_ = ptrFloat64(rwork)
)
var info_ C.integer
C.zgeev_(&jobvl_, &jobvr_, &n_, a_, &lda_, w_, vl_, &ldvl_, vr_, &ldvr_, work_, &lwork_, rwork_, &info_)
info := int(info_)
switch {
case info < 0:
return errInvalidArg(-info)
case info > 0:
return errOffDiagFailConverge(info)
default:
return nil
}
}
示例4: zhesvHelper
// Needs to be supplied ipiv and work.
func zhesvHelper(n, nrhs int, a []complex128, lda int, ipiv []C.integer, b []complex128, ldb int, work []complex128, lwork int) error {
var (
uplo_ = C.char(DefaultTri)
n_ = C.integer(n)
nrhs_ = C.integer(nrhs)
a_ = ptrComplex128(a)
lda_ = C.integer(lda)
ipiv_ = ptrInt(ipiv)
b_ = ptrComplex128(b)
ldb_ = C.integer(ldb)
work_ = ptrComplex128(work)
lwork_ = C.integer(lwork)
)
var info_ C.integer
C.zhesv_(&uplo_, &n_, &nrhs_, a_, &lda_, ipiv_, b_, &ldb_, work_, &lwork_, &info_)
info := int(info_)
switch {
case info < 0:
return errInvalidArg(-info)
case info > 0:
return errSingular(info)
default:
return nil
}
}
示例5: zgetrsHelper
func zgetrsHelper(h bool, n, nrhs int, a []complex128, lda int, ipiv []C.integer, b []complex128, ldb int) error {
var (
trans_ = conjTransChar(h)
n_ = C.integer(n)
nrhs_ = C.integer(nrhs)
a_ = ptrComplex128(a)
lda_ = C.integer(lda)
ipiv_ = ptrInt(ipiv)
b_ = ptrComplex128(b)
ldb_ = C.integer(ldb)
)
var info_ C.integer
C.zgetrs_(&trans_, &n_, &nrhs_, a_, &lda_, ipiv_, b_, &ldb_, &info_)
info := int(info_)
switch {
case info < 0:
return errInvalidArg(-info)
case info == 0:
return nil
default:
panic(errUnknown(info))
}
}
示例6: zheevHelper
func zheevHelper(jobz jobzMode, uplo Triangle, n int, a []complex128, lda int, w []float64, work []complex128, lwork int, rwork []float64) error {
var (
jobz_ = jobzChar(jobz)
uplo_ = uploChar(uplo)
n_ = C.integer(n)
a_ = ptrComplex128(a)
lda_ = C.integer(lda)
w_ = ptrFloat64(w)
work_ = ptrComplex128(work)
lwork_ = C.integer(lwork)
rwork_ = ptrFloat64(rwork)
)
var info_ C.integer
C.zheev_(&jobz_, &uplo_, &n_, a_, &lda_, w_, work_, &lwork_, rwork_, &info_)
info := int(info_)
switch {
case info < 0:
return errInvalidArg(-info)
case info > 0:
return errOffDiagFailConverge(info)
default:
return nil
}
}
示例7: dpotrf
// DPOTRF: (Double-precision) POsitive-definite TRiangular Factor
//
// http://www.netlib.org/lapack/double/dpotrf.f
func dpotrf(uplo Triangle, n int, a []float64, lda int) error {
var (
uplo_ = uploChar(uplo)
n_ = C.integer(n)
a_ = ptrFloat64(a)
lda_ = C.integer(lda)
)
var info_ C.integer
C.dpotrf_(&uplo_, &n_, a_, &lda_, &info_)
return dpotrfError(int(info_))
}
示例8: zpotrf
// ZPOTRF: complex double-precision POsitive-definite TRiangular Factor
//
// http://www.netlib.org/lapack/complex16/zpotrf.f
func zpotrf(uplo Triangle, n int, a []complex128, lda int) error {
var (
uplo_ = uploChar(uplo)
n_ = C.integer(n)
a_ = ptrComplex128(a)
lda_ = C.integer(lda)
)
var info_ C.integer
C.zpotrf_(&uplo_, &n_, a_, &lda_, &info_)
return zpotrfError(int(info_))
}
示例9: zgetrfHelper
func zgetrfHelper(m, n int, a []complex128, lda int, ipiv []C.integer) error {
var (
m_ = C.integer(m)
n_ = C.integer(n)
a_ = ptrComplex128(a)
lda_ = C.integer(lda)
ipiv_ = ptrInt(ipiv)
)
var info_ C.integer
C.zgetrf_(&m_, &n_, a_, &lda_, ipiv_, &info_)
return zgetrfError(int(info_))
}
示例10: dgetrfHelper
func dgetrfHelper(m, n int, a []float64, lda int, ipiv []C.integer) error {
var (
m_ = C.integer(m)
n_ = C.integer(n)
a_ = ptrFloat64(a)
lda_ = C.integer(lda)
ipiv_ = ptrInt(ipiv)
)
var info_ C.integer
C.dgetrf_(&m_, &n_, a_, &lda_, ipiv_, &info_)
return dgetrfError(int(info_))
}
示例11: dposv
// DPOSV: (Double-precision) POsitive-definite SolVe
//
// http://www.netlib.org/lapack/double/dposv.f
func dposv(n, nrhs int, a []float64, lda int, b []float64, ldb int) error {
var (
uplo_ = C.char(DefaultTri)
n_ = C.integer(n)
nrhs_ = C.integer(nrhs)
a_ = ptrFloat64(a)
lda_ = C.integer(lda)
b_ = ptrFloat64(b)
ldb_ = C.integer(ldb)
)
var info_ C.integer
C.dposv_(&uplo_, &n_, &nrhs_, a_, &lda_, b_, &ldb_, &info_)
return dpotrfError(int(info_))
}
示例12: dgesvHelper
func dgesvHelper(n, nrhs int, a []float64, lda int, ipiv []C.integer, b []float64, ldb int) error {
var (
n_ = C.integer(n)
nrhs_ = C.integer(nrhs)
a_ = ptrFloat64(a)
lda_ = C.integer(lda)
ipiv_ = ptrInt(ipiv)
b_ = ptrFloat64(b)
ldb_ = C.integer(ldb)
)
var info_ C.integer
C.dgesv_(&n_, &nrhs_, a_, &lda_, ipiv_, b_, &ldb_, &info_)
return dgetrfError(int(info_))
}
示例13: zposv
// ZPOSV: complex double-precision POsitive-definite SolVe
//
// http://www.netlib.org/lapack/complex16/zposv.f
func zposv(n, nrhs int, a []complex128, lda int, b []complex128, ldb int) error {
var (
uplo_ = C.char(DefaultTri)
n_ = C.integer(n)
nrhs_ = C.integer(nrhs)
a_ = ptrComplex128(a)
lda_ = C.integer(lda)
b_ = ptrComplex128(b)
ldb_ = C.integer(ldb)
)
var info_ C.integer
C.zposv_(&uplo_, &n_, &nrhs_, a_, &lda_, b_, &ldb_, &info_)
return zpotrfError(int(info_))
}
示例14: zgesvHelper
func zgesvHelper(n, nrhs int, a []complex128, lda int, ipiv []C.integer, b []complex128, ldb int) error {
var (
n_ = C.integer(n)
nrhs_ = C.integer(nrhs)
a_ = ptrComplex128(a)
lda_ = C.integer(lda)
ipiv_ = ptrInt(ipiv)
b_ = ptrComplex128(b)
ldb_ = C.integer(ldb)
)
var info_ C.integer
C.zgesv_(&n_, &nrhs_, a_, &lda_, ipiv_, b_, &ldb_, &info_)
return zgetrfError(int(info_))
}
示例15: toCInt
func toCInt(x []int) []C.integer {
if len(x) == 0 {
return nil
}
y := make([]C.integer, len(x))
for i, xi := range x {
y[i] = C.integer(xi)
}
return y
}