<commit_before>// Copyright ©2013 The gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

/*
Package blas provides interfaces for the BLAS linear algebra standard.

All methods must perform appropriate parameter checking and panic if
provided parameters that do not conform to the requirements specified
by the BLAS standard.

Quick Reference Guide to the BLAS from http://www.netlib.org/lapack/lug/node145.html

Level 1 BLAS

	        dim scalar vector   vector   scalars              5-element prefixes
	                                                          struct

	_rotg (                                      a, b )                S, D
	_rotmg(                              d1, d2, a, b )                S, D
	_rot  ( n,         x, incX, y, incY,               c, s )          S, D
	_rotm ( n,         x, incX, y, incY,                      param )  S, D
	_swap ( n,         x, incX, y, incY )                              S, D, C, Z
	_scal ( n,  alpha, x, incX )                                       S, D, C, Z, Cs, Zd
	_copy ( n,         x, incX, y, incY )                              S, D, C, Z
	_axpy ( n,  alpha, x, incX, y, incY )                              S, D, C, Z
	_dot  ( n,         x, incX, y, incY )                              S, D, Ds
	_dotu ( n,         x, incX, y, incY )                              C, Z
	_dotc ( n,         x, incX, y, incY )                              C, Z
	__dot ( n,  alpha, x, incX, y, incY )                              Sds
	_nrm2 ( n,         x, incX )                                       S, D, Sc, Dz
	_asum ( n,         x, incX )                                       S, D, Sc, Dz
	I_amax( n,         x, incX )                                       s, d, c, z

Level 2 BLAS

	        options                   dim   b-width scalar matrix  vector   scalar vector   prefixes

	_gemv ( order,        trans,      m, n,         alpha, a, lda, x, incX, beta,  y, incY ) S, D, C, Z
	_gbmv ( order,        trans,      m, n, kL, kU, alpha, a, lda, x, incX, beta,  y, incY ) S, D, C, Z
	_hemv ( order, uplo,                 n,         alpha, a, lda, x, incX, beta,  y, incY ) C, Z
	_hbmv ( order, uplo,                 n, k,      alpha, a, lda, x, incX, beta,  y, incY ) C, Z
	_hpmv ( order, uplo,                 n,         alpha, ap,     x, incX, beta,  y, incY ) C, Z
	_symv ( order, uplo,                 n,         alpha, a, lda, x, incX, beta,  y, incY ) S, D
	_sbmv ( order, uplo,                 n, k,      alpha, a, lda, x, incX, beta,  y, incY ) S, D
	_spmv ( order, uplo,                 n,         alpha, ap,     x, incX, beta,  y, incY ) S, D
	_trmv ( order, uplo, trans, diag,    n,                a, lda, x, incX )                 S, D, C, Z
	_tbmv ( order, uplo, trans, diag,    n, k,             a, lda, x, incX )                 S, D, C, Z
	_tpmv ( order, uplo, trans, diag,    n,                ap,     x, incX )                 S, D, C, Z
	_trsv ( order, uplo, trans, diag,    n,                a, lda, x, incX )                 S, D, C, Z
	_tbsv ( order, uplo, trans, diag,    n, k,             a, lda, x, incX )                 S, D, C, Z
	_tpsv ( order, uplo, trans, diag,    n,                ap,     x, incX )                 S, D, C, Z

	        options                   dim   scalar vector   vector   matrix  prefixes

	_ger  ( order,                    m, n, alpha, x, incX, y, incY, a, lda ) S, D
	_geru ( order,                    m, n, alpha, x, incX, y, incY, a, lda ) C, Z
	_gerc ( order,                    m, n, alpha, x, incX, y, incY, a, lda ) C, Z
	_her  ( order, uplo,                 n, alpha, x, incX,          a, lda ) C, Z
	_hpr  ( order, uplo,                 n, alpha, x, incX,          ap )     C, Z
	_her2 ( order, uplo,                 n, alpha, x, incX, y, incY, a, lda ) C, Z
	_hpr2 ( order, uplo,                 n, alpha, x, incX, y, incY, ap )     C, Z
	_syr  ( order, uplo,                 n, alpha, x, incX,          a, lda ) S, D
	_spr  ( order, uplo,                 n, alpha, x, incX,          ap )     S, D
	_syr2 ( order, uplo,                 n, alpha, x, incX, y, incY, a, lda ) S, D
	_spr2 ( order, uplo,                 n, alpha, x, incX, y, incY, ap )     S, D

Level 3 BLAS

	        options                                 dim      scalar matrix  matrix  scalar matrix  prefixes

	_gemm ( order,             transA, transB,      m, n, k, alpha, a, lda, b, ldb, beta,  c, ldc ) S, D, C, Z
	_symm ( order, side, uplo,                      m, n,    alpha, a, lda, b, ldb, beta,  c, ldc ) S, D, C, Z
	_hemm ( order, side, uplo,                      m, n,    alpha, a, lda, b, ldb, beta,  c, ldc ) C, Z
	_syrk ( order,       uplo, trans,                  n, k, alpha, a, lda,         beta,  c, ldc ) S, D, C, Z
	_herk ( order,       uplo, trans,                  n, k, alpha, a, lda,         beta,  c, ldc ) C, Z
	_syr2k( order,       uplo, trans,                  n, k, alpha, a, lda, b, ldb, beta,  c, ldc ) S, D, C, Z
	_her2k( order,       uplo, trans,                  n, k, alpha, a, lda, b, ldb, beta,  c, ldc ) C, Z
	_trmm ( order, side, uplo, transA,        diag, m, n,    alpha, a, lda, b, ldb )                S, D, C, Z
	_trsm ( order, side, uplo, transA,        diag, m, n,    alpha, a, lda, b, ldb )                S, D, C, Z

Meaning of prefixes

	S - float32	C - complex64
	D - float64	Z - complex128

Matrix types

	GE - GEneral 		GB - General Band
	SY - SYmmetric 		SB - Symmetric Band 	SP - Symmetric Packed
	HE - HErmitian 		HB - Hermitian Band 	HP - Hermitian Packed
	TR - TRiangular 	TB - Triangular Band 	TP - Triangular Packed

Options

	trans 	= NoTrans, Trans, ConjTrans
	uplo 	= Upper, Lower
	diag 	= Nonunit, Unit
	side 	= Left, Right (A or op(A) on the left, or A or op(A) on the right)

For real matrices, Trans and ConjTrans have the same meaning.
For Hermitian matrices, trans = Trans is not allowed.
For complex symmetric matrices, trans = ConjTrans is not allowed.
*/
package blas

// Type SrotmParams contains Givens transformation parameters returned
// by the Float32 Srotm method.
type SrotmParams struct {
	Flag float32
	H    [4]float32 // Column-major 2 by 2 matrix.
}

// Type DrotmParams contains Givens transformation parameters returned
// by the Float64 Drotm method.
type DrotmParams struct {
	Flag float64
	H    [4]float64 // Column-major 2 by 2 matrix.
}

// Type Order is used to specify the matrix storage format. An implementation
// may not implement both orders and must panic if a routine is called using
// an unimplemented order.
type Order int

const (
	RowMajor Order = 101
	ColMajor Order = 102
)

// Type Transpose is used to specify the transposition operation for a
// routine.
type Transpose int

const (
	NoTrans   Transpose = 111
	Trans     Transpose = 112
	ConjTrans Transpose = 113
)

// Type Uplo is used to specify whether the matrix is an upper or lower
// triangular matrix.
type Uplo int

const (
	Upper Uplo = 121
	Lower Uplo = 122
)

// Type Diag is used to specify whether the matrix is a unit or non-unit
// triangular matrix.
type Diag int

const (
	NonUnit Diag = 131
	Unit    Diag = 132
)

// Type side is used to specify from which side a multiplication operation
// is performed.
type Side int

const (
	Left  Side = 141
	Right Side = 142
)

// Float32 implements the single precision real BLAS routines.
type Float32 interface {
	// Level 1 routines.
	Sdsdot(n int, alpha float32, x []float32, incX int, y []float32, incY int) float32
	Dsdot(n int, x []float32, incX int, y []float32, incY int) float64
	Sdot(n int, x []float32, incX int, y []float32, incY int) float32
	Snrm2(n int, x []float32, incX int) float32
	Sasum(n int, x []float32, incX int) float32
	Isamax(n int, x []float32, incX int) int
	Sswap(n int, x []float32, incX int, y []float32, incY int)
	Scopy(n int, x []float32, incX int, y []float32, incY int)
	Saxpy(n int, alpha float32, x []float32, incX int, y []float32, incY int)
	Srotg(a, b float32) (c, s, r, z float32)
	Srotmg(d1, d2, b1, b2 float32) (p *SrotmParams, rd1, rd2, rb1 float32)
	Srot(n int, x []float32, incX int, y []float32, incY int, c, s float32)
	Srotm(n int, x []float32, incX int, y []float32, incY int, p *SrotmParams)
	Sscal(n int, alpha float32, x []float32, incX int)

	// Level 2 routines.
	Sgemv(o Order, tA Transpose, m, n int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int)
	Sgbmv(o Order, tA Transpose, m, n, kL, kU int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int)
	Strmv(o Order, ul Uplo, tA Transpose, d Diag, n int, a []float32, lda int, x []float32, incX int)
	Stbmv(o Order, ul Uplo, tA Transpose, d Diag, n, k int, a []float32, lda int, x []float32, incX int)
	Stpmv(o Order, ul Uplo, tA Transpose, d Diag, n int, ap []float32, x []float32, incX int)
	Strsv(o Order, ul Uplo, tA Transpose, d Diag, n int, a []float32, lda int, x []float32, incX int)<commit_msg>Reduce documentation noise<commit_after>// Copyright ©2013 The gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

/*
Package blas provides interfaces for the BLAS linear algebra standard.

All methods must perform appropriate parameter checking and panic if
provided parameters that do not conform to the requirements specified
by the BLAS standard.

Quick Reference Guide to the BLAS from http://www.netlib.org/lapack/lug/node145.html

Level 1 BLAS

	        dim scalar vector   vector   scalars              5-element prefixes
	                                                          struct

	_rotg (                                      a, b )                S, D
	_rotmg(                              d1, d2, a, b )                S, D
	_rot  ( n,         x, incX, y, incY,               c, s )          S, D
	_rotm ( n,         x, incX, y, incY,                      param )  S, D
	_swap ( n,         x, incX, y, incY )                              S, D, C, Z
	_scal ( n,  alpha, x, incX )                                       S, D, C, Z, Cs, Zd
	_copy ( n,         x, incX, y, incY )                              S, D, C, Z
	_axpy ( n,  alpha, x, incX, y, incY )                              S, D, C, Z
	_dot  ( n,         x, incX, y, incY )                              S, D, Ds
	_dotu ( n,         x, incX, y, incY )                              C, Z
	_dotc ( n,         x, incX, y, incY )                              C, Z
	__dot ( n,  alpha, x, incX, y, incY )                              Sds
	_nrm2 ( n,         x, incX )                                       S, D, Sc, Dz
	_asum ( n,         x, incX )                                       S, D, Sc, Dz
	I_amax( n,         x, incX )                                       s, d, c, z

Level 2 BLAS

	        options                   dim   b-width scalar matrix  vector   scalar vector   prefixes

	_gemv ( order,        trans,      m, n,         alpha, a, lda, x, incX, beta,  y, incY ) S, D, C, Z
	_gbmv ( order,        trans,      m, n, kL, kU, alpha, a, lda, x, incX, beta,  y, incY ) S, D, C, Z
	_hemv ( order, uplo,                 n,         alpha, a, lda, x, incX, beta,  y, incY ) C, Z
	_hbmv ( order, uplo,                 n, k,      alpha, a, lda, x, incX, beta,  y, incY ) C, Z
	_hpmv ( order, uplo,                 n,         alpha, ap,     x, incX, beta,  y, incY ) C, Z
	_symv ( order, uplo,                 n,         alpha, a, lda, x, incX, beta,  y, incY ) S, D
	_sbmv ( order, uplo,                 n, k,      alpha, a, lda, x, incX, beta,  y, incY ) S, D
	_spmv ( order, uplo,                 n,         alpha, ap,     x, incX, beta,  y, incY ) S, D
	_trmv ( order, uplo, trans, diag,    n,                a, lda, x, incX )                 S, D, C, Z
	_tbmv ( order, uplo, trans, diag,    n, k,             a, lda, x, incX )                 S, D, C, Z
	_tpmv ( order, uplo, trans, diag,    n,                ap,     x, incX )                 S, D, C, Z
	_trsv ( order, uplo, trans, diag,    n,                a, lda, x, incX )                 S, D, C, Z
	_tbsv ( order, uplo, trans, diag,    n, k,             a, lda, x, incX )                 S, D, C, Z
	_tpsv ( order, uplo, trans, diag,    n,                ap,     x, incX )                 S, D, C, Z

	        options                   dim   scalar vector   vector   matrix  prefixes

	_ger  ( order,                    m, n, alpha, x, incX, y, incY, a, lda ) S, D
	_geru ( order,                    m, n, alpha, x, incX, y, incY, a, lda ) C, Z
	_gerc ( order,                    m, n, alpha, x, incX, y, incY, a, lda ) C, Z
	_her  ( order, uplo,                 n, alpha, x, incX,          a, lda ) C, Z
	_hpr  ( order, uplo,                 n, alpha, x, incX,          ap )     C, Z
	_her2 ( order, uplo,                 n, alpha, x, incX, y, incY, a, lda ) C, Z
	_hpr2 ( order, uplo,                 n, alpha, x, incX, y, incY, ap )     C, Z
	_syr  ( order, uplo,                 n, alpha, x, incX,          a, lda ) S, D
	_spr  ( order, uplo,                 n, alpha, x, incX,          ap )     S, D
	_syr2 ( order, uplo,                 n, alpha, x, incX, y, incY, a, lda ) S, D
	_spr2 ( order, uplo,                 n, alpha, x, incX, y, incY, ap )     S, D

Level 3 BLAS

	        options                                 dim      scalar matrix  matrix  scalar matrix  prefixes

	_gemm ( order,             transA, transB,      m, n, k, alpha, a, lda, b, ldb, beta,  c, ldc ) S, D, C, Z
	_symm ( order, side, uplo,                      m, n,    alpha, a, lda, b, ldb, beta,  c, ldc ) S, D, C, Z
	_hemm ( order, side, uplo,                      m, n,    alpha, a, lda, b, ldb, beta,  c, ldc ) C, Z
	_syrk ( order,       uplo, trans,                  n, k, alpha, a, lda,         beta,  c, ldc ) S, D, C, Z
	_herk ( order,       uplo, trans,                  n, k, alpha, a, lda,         beta,  c, ldc ) C, Z
	_syr2k( order,       uplo, trans,                  n, k, alpha, a, lda, b, ldb, beta,  c, ldc ) S, D, C, Z
	_her2k( order,       uplo, trans,                  n, k, alpha, a, lda, b, ldb, beta,  c, ldc ) C, Z
	_trmm ( order, side, uplo, transA,        diag, m, n,    alpha, a, lda, b, ldb )                S, D, C, Z
	_trsm ( order, side, uplo, transA,        diag, m, n,    alpha, a, lda, b, ldb )                S, D, C, Z

Meaning of prefixes

	S - float32	C - complex64
	D - float64	Z - complex128

Matrix types

	GE - GEneral 		GB - General Band
	SY - SYmmetric 		SB - Symmetric Band 	SP - Symmetric Packed
	HE - HErmitian 		HB - Hermitian Band 	HP - Hermitian Packed
	TR - TRiangular 	TB - Triangular Band 	TP - Triangular Packed

Options

	trans 	= NoTrans, Trans, ConjTrans
	uplo 	= Upper, Lower
	diag 	= Nonunit, Unit
	side 	= Left, Right (A or op(A) on the left, or A or op(A) on the right)

For real matrices, Trans and ConjTrans have the same meaning.
For Hermitian matrices, trans = Trans is not allowed.
For complex symmetric matrices, trans = ConjTrans is not allowed.
*/
package blas

// Type SrotmParams contains Givens transformation parameters returned
// by the Float32 Srotm method.
type SrotmParams struct {
	Flag float32
	H    [4]float32 // Column-major 2 by 2 matrix.
}

// Type DrotmParams contains Givens transformation parameters returned
// by the Float64 Drotm method.
type DrotmParams struct {
	Flag float64
	H    [4]float64 // Column-major 2 by 2 matrix.
}

// Type Order is used to specify the matrix storage format. An implementation
// may not implement both orders and must panic if a routine is called using
// an unimplemented order.
type Order int

const (
	RowMajor Order = 101 + iota
	ColMajor
)

// Type Transpose is used to specify the transposition operation for a
// routine.
type Transpose int

const (
	NoTrans Transpose = 111 + iota
	Trans
	ConjTrans
)

// Type Uplo is used to specify whether the matrix is an upper or lower
// triangular matrix.
type Uplo int

const (
	Upper Uplo = 121 + iota
	Lower
)

// Type Diag is used to specify whether the matrix is a unit or non-unit
// triangular matrix.
type Diag int

const (
	NonUnit Diag = 131 + iota
	Unit
)

// Type side is used to specify from which side a multiplication operation
// is performed.
type Side int

const (
	Left Side = 141 + iota
	Right
)

// Float32 implements the single precision real BLAS routines.
type Float32 interface {
	// Level 1 routines.
	Sdsdot(n int, alpha float32, x []float32, incX int, y []float32, incY int) float32
	Dsdot(n int, x []float32, incX int, y []float32, incY int) float64
	Sdot(n int, x []float32, incX int, y []float32, incY int) float32
	Snrm2(n int, x []float32, incX int) float32
	Sasum(n int, x []float32, incX int) float32
	Isamax(n int, x []float32, incX int) int
	Sswap(n int, x []float32, incX int, y []float32, incY int)
	Scopy(n int, x []float32, incX int, y []float32, incY int)
	Saxpy(n int, alpha float32, x []float32, incX int, y []float32, incY int)
	Srotg(a, b float32) (c, s, r, z float32)
	Srotmg(d1, d2, b1, b2 float32) (p *SrotmParams, rd1, rd2, rb1 float32)
	Srot(n int, x []float32, incX int, y []float32, incY int, c, s float32)
	Srotm(n int, x []float32, incX int, y []float32, incY int, p *SrotmParams)
	Sscal(n int, alpha float32, x []float32, incX int)

	// Level 2 routines.
	Sgemv(o Order, tA Transpose, m, n int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int)
	Sgbmv(o Order, tA Transpose, m, n, kL, kU int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int)
	Strmv(o Order, ul Uplo, tA Transpose, d Diag, n int, a []float32, lda int, x []float32, incX int)
	Stbmv(o Order, ul Uplo, tA Transpose, d Diag, n, k int, a []float32, lda int, x []float32, incX int)
	Stpmv(o Order, ul Uplo, tA Transpose, d Diag, n int, ap []float32, x []float32, incX int)
	Strsv(o Order, ul Uplo, tA Transpose, d Diag, n int, a []float32, lda int, x []float32, incX int)
{'fraction_non_alphanumeric': 0.10554720970344406, 'fraction_numerical': 0.02080899126467479, 'mean_word_length': 1.6814859018349992, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 38, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5113352', 'n_tokens_mistral': 6735, 'n_tokens_neox': 6412, 'n_words': 2572}