github.com/gonum/lapack@v0.0.0-20181123203213-e4cdc5a0bff9/cgo/lapack_test.go (about)

     1  // Copyright ©2015 The gonum Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package cgo
     6  
     7  import (
     8  	"testing"
     9  
    10  	"github.com/gonum/blas"
    11  	"github.com/gonum/lapack/testlapack"
    12  )
    13  
    14  var impl = Implementation{}
    15  
    16  // blockedTranslate transforms some blocked C calls to be the unblocked algorithms
    17  // for testing, as several of the unblocked algorithms are not defined by the C
    18  // interface.
    19  type blockedTranslate struct {
    20  	Implementation
    21  }
    22  
    23  func TestDbdsqr(t *testing.T) {
    24  	testlapack.DbdsqrTest(t, impl)
    25  }
    26  
    27  func (bl blockedTranslate) Dgebd2(m, n int, a []float64, lda int, d, e, tauQ, tauP, work []float64) {
    28  	impl.Dgebrd(m, n, a, lda, d, e, tauQ, tauP, work, len(work))
    29  }
    30  
    31  func (bl blockedTranslate) Dorm2r(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64) {
    32  	impl.Dormqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, len(work))
    33  }
    34  
    35  func (bl blockedTranslate) Dorml2(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64) {
    36  	impl.Dormlq(side, trans, m, n, k, a, lda, tau, c, ldc, work, len(work))
    37  }
    38  
    39  func (bl blockedTranslate) Dorg2r(m, n, k int, a []float64, lda int, tau, work []float64) {
    40  	impl.Dorgqr(m, n, k, a, lda, tau, work, len(work))
    41  }
    42  
    43  func (bl blockedTranslate) Dorgl2(m, n, k int, a []float64, lda int, tau, work []float64) {
    44  	impl.Dorglq(m, n, k, a, lda, tau, work, len(work))
    45  }
    46  
    47  func TestDgeqp3(t *testing.T) {
    48  	testlapack.Dgeqp3Test(t, impl)
    49  }
    50  
    51  func TestDlacn2(t *testing.T) {
    52  	testlapack.Dlacn2Test(t, impl)
    53  }
    54  
    55  func TestDlascl(t *testing.T) {
    56  	testlapack.DlasclTest(t, impl)
    57  }
    58  
    59  func TestDlacpy(t *testing.T) {
    60  	testlapack.DlacpyTest(t, impl)
    61  }
    62  
    63  func TestDlange(t *testing.T) {
    64  	testlapack.DlangeTest(t, impl)
    65  }
    66  
    67  func TestDlarfb(t *testing.T) {
    68  	testlapack.DlarfbTest(t, impl)
    69  }
    70  
    71  func TestDlarfg(t *testing.T) {
    72  	testlapack.DlarfgTest(t, impl)
    73  }
    74  
    75  func TestDlarft(t *testing.T) {
    76  	testlapack.DlarftTest(t, impl)
    77  }
    78  
    79  func TestDlantr(t *testing.T) {
    80  	testlapack.DlantrTest(t, impl)
    81  }
    82  
    83  func TestDlapmt(t *testing.T) {
    84  	testlapack.DlapmtTest(t, impl)
    85  }
    86  
    87  func TestDlapy2(t *testing.T) {
    88  	testlapack.Dlapy2Test(t, impl)
    89  }
    90  
    91  func TestDlarfx(t *testing.T) {
    92  	testlapack.DlarfxTest(t, impl)
    93  }
    94  
    95  func TestDlaset(t *testing.T) {
    96  	testlapack.DlasetTest(t, impl)
    97  }
    98  
    99  func TestDlasrt(t *testing.T) {
   100  	testlapack.DlasrtTest(t, impl)
   101  }
   102  
   103  func TestDlaswp(t *testing.T) {
   104  	testlapack.DlaswpTest(t, impl)
   105  }
   106  
   107  func TestDpotrf(t *testing.T) {
   108  	testlapack.DpotrfTest(t, impl)
   109  }
   110  
   111  func TestDgebak(t *testing.T) {
   112  	testlapack.DgebakTest(t, impl)
   113  }
   114  
   115  func TestDgebal(t *testing.T) {
   116  	testlapack.DgebalTest(t, impl)
   117  }
   118  
   119  func TestDgebd2(t *testing.T) {
   120  	testlapack.Dgebd2Test(t, blockedTranslate{impl})
   121  }
   122  
   123  func TestDgecon(t *testing.T) {
   124  	testlapack.DgeconTest(t, impl)
   125  }
   126  
   127  func TestDgeev(t *testing.T) {
   128  	testlapack.DgeevTest(t, impl)
   129  }
   130  
   131  func TestDgehrd(t *testing.T) {
   132  	testlapack.DgehrdTest(t, impl)
   133  }
   134  
   135  func TestDgelq2(t *testing.T) {
   136  	testlapack.Dgelq2Test(t, impl)
   137  }
   138  
   139  func TestDgels(t *testing.T) {
   140  	testlapack.DgelsTest(t, impl)
   141  }
   142  
   143  func TestDgelqf(t *testing.T) {
   144  	testlapack.DgelqfTest(t, impl)
   145  }
   146  
   147  func TestDgeqr2(t *testing.T) {
   148  	testlapack.Dgeqr2Test(t, impl)
   149  }
   150  
   151  func TestDgeqrf(t *testing.T) {
   152  	testlapack.DgeqrfTest(t, impl)
   153  }
   154  
   155  func TestDgerqf(t *testing.T) {
   156  	testlapack.DgerqfTest(t, impl)
   157  }
   158  
   159  func TestDgesvd(t *testing.T) {
   160  	testlapack.DgesvdTest(t, impl)
   161  }
   162  
   163  func TestDgetf2(t *testing.T) {
   164  	testlapack.Dgetf2Test(t, impl)
   165  }
   166  
   167  func TestDgetrf(t *testing.T) {
   168  	testlapack.DgetrfTest(t, impl)
   169  }
   170  
   171  func TestDgetri(t *testing.T) {
   172  	testlapack.DgetriTest(t, impl)
   173  }
   174  
   175  func TestDgetrs(t *testing.T) {
   176  	testlapack.DgetrsTest(t, impl)
   177  }
   178  
   179  func TestDggsvd3(t *testing.T) {
   180  	testlapack.Dggsvd3Test(t, impl)
   181  }
   182  
   183  func TestDggsvp3(t *testing.T) {
   184  	testlapack.Dggsvp3Test(t, impl)
   185  }
   186  
   187  func TestDhseqr(t *testing.T) {
   188  	testlapack.DhseqrTest(t, impl)
   189  }
   190  
   191  func TestDorglq(t *testing.T) {
   192  	testlapack.DorglqTest(t, blockedTranslate{impl})
   193  }
   194  
   195  func TestDorgql(t *testing.T) {
   196  	testlapack.DorgqlTest(t, impl)
   197  }
   198  
   199  func TestDorgqr(t *testing.T) {
   200  	testlapack.DorgqrTest(t, blockedTranslate{impl})
   201  }
   202  
   203  func TestDorgtr(t *testing.T) {
   204  	testlapack.DorgtrTest(t, impl)
   205  }
   206  
   207  func TestDorgl2(t *testing.T) {
   208  	testlapack.Dorgl2Test(t, blockedTranslate{impl})
   209  }
   210  
   211  func TestDorg2r(t *testing.T) {
   212  	testlapack.Dorg2rTest(t, blockedTranslate{impl})
   213  }
   214  
   215  func TestDormbr(t *testing.T) {
   216  	testlapack.DormbrTest(t, blockedTranslate{impl})
   217  }
   218  
   219  func TestDormhr(t *testing.T) {
   220  	testlapack.DormhrTest(t, impl)
   221  }
   222  
   223  func TestDorgbr(t *testing.T) {
   224  	testlapack.DorgbrTest(t, blockedTranslate{impl})
   225  }
   226  
   227  func TestDorghr(t *testing.T) {
   228  	testlapack.DorghrTest(t, impl)
   229  }
   230  
   231  func TestDormqr(t *testing.T) {
   232  	testlapack.Dorm2rTest(t, blockedTranslate{impl})
   233  }
   234  
   235  func TestDormlq(t *testing.T) {
   236  	testlapack.Dorml2Test(t, blockedTranslate{impl})
   237  }
   238  
   239  func TestDpocon(t *testing.T) {
   240  	testlapack.DpoconTest(t, impl)
   241  }
   242  
   243  func TestDsteqr(t *testing.T) {
   244  	testlapack.DsteqrTest(t, impl)
   245  }
   246  
   247  func TestDsterf(t *testing.T) {
   248  	testlapack.DsterfTest(t, impl)
   249  }
   250  
   251  func TestDsyev(t *testing.T) {
   252  	testlapack.DsyevTest(t, impl)
   253  }
   254  
   255  func TestDsytrd(t *testing.T) {
   256  	testlapack.DsytrdTest(t, impl)
   257  }
   258  
   259  func TestDtgsja(t *testing.T) {
   260  	testlapack.DtgsjaTest(t, impl)
   261  }
   262  
   263  func TestDtrexc(t *testing.T) {
   264  	testlapack.DtrexcTest(t, impl)
   265  }
   266  
   267  func TestDtrcon(t *testing.T) {
   268  	testlapack.DtrconTest(t, impl)
   269  }
   270  
   271  func TestDtrtri(t *testing.T) {
   272  	testlapack.DtrtriTest(t, impl)
   273  }