package kernels
var (
multiplyConstantInt32Int32 func ([]int32 , []int32 , int64 ) = multiplyConstantGo [int32 , int32 ]
multiplyConstantInt32Int64 func ([]int32 , []int64 , int64 ) = multiplyConstantGo [int32 , int64 ]
multiplyConstantInt64Int32 func ([]int64 , []int32 , int64 ) = multiplyConstantGo [int64 , int32 ]
multiplyConstantInt64Int64 func ([]int64 , []int64 , int64 ) = multiplyConstantGo [int64 , int64 ]
divideConstantInt32Int32 func ([]int32 , []int32 , int64 ) = divideConstantGo [int32 , int32 ]
divideConstantInt32Int64 func ([]int32 , []int64 , int64 ) = divideConstantGo [int32 , int64 ]
divideConstantInt64Int32 func ([]int64 , []int32 , int64 ) = divideConstantGo [int64 , int32 ]
divideConstantInt64Int64 func ([]int64 , []int64 , int64 ) = divideConstantGo [int64 , int64 ]
)
func multiplyConstantGo[InT , OutT ~int32 | ~int64 ](input []InT , output []OutT , factor int64 ) {
for i , v := range input {
output [i ] = OutT (v ) * OutT (factor )
}
}
func divideConstantGo[InT , OutT ~int32 | ~int64 ](input []InT , output []OutT , factor int64 ) {
for i , v := range input {
output [i ] = OutT (v / InT (factor ))
}
}
func multiplyConstant(input , output any , factor int64 ) {
switch in := input .(type ) {
case []int32 :
switch out := output .(type ) {
case []int32 :
multiplyConstantInt32Int32 (in , out , factor )
case []int64 :
multiplyConstantInt32Int64 (in , out , factor )
}
case []int64 :
switch out := output .(type ) {
case []int32 :
multiplyConstantInt64Int32 (in , out , factor )
case []int64 :
multiplyConstantInt64Int64 (in , out , factor )
}
}
}
func divideConstant(input , output any , factor int64 ) {
switch in := input .(type ) {
case []int32 :
switch out := output .(type ) {
case []int32 :
divideConstantInt32Int32 (in , out , factor )
case []int64 :
divideConstantInt32Int64 (in , out , factor )
}
case []int64 :
switch out := output .(type ) {
case []int32 :
divideConstantInt64Int32 (in , out , factor )
case []int64 :
divideConstantInt64Int64 (in , out , factor )
}
}
}
The pages are generated with Golds v0.8.2 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .