-
Notifications
You must be signed in to change notification settings - Fork 149
/
definitions.go
124 lines (106 loc) · 3.44 KB
/
definitions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// Copyright 2016 The Gosl 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 fun (functions) implements special functions such as elliptical, orthogonal polynomials,
// Bessel, discrete Fourier transform, polynomial interpolators, and more.
package fun
import (
"math"
"github.com/cpmech/gosl/la"
)
// π = 3.141592653589...
const π = math.Pi
// Ss defines a scalar function f(s) of a scalar argument s (scalar scalar)
// Input:
// s -- input scalar
// Returns:
// scalar
type Ss func(s float64) float64
// Sss defines a scalar function f(r,s) of two scalar arguments (scalar scalar scalar)
// Input:
// s1, s2 -- input scalar
// Returns:
// scalar
type Sss func(s1, s2 float64) float64
// Sv defines a scalar functioin f(v) of a vector argument v (scalar vector)
// Input:
// v -- input vector
// Returns:
// scalar
type Sv func(v la.Vector) float64
// Vs defines a vector function f(s) of a scalar argument s (vector scalar)
// Input:
// s -- input scalar
// Output:
// f -- output vector
type Vs func(f la.Vector, s float64)
// Vss defines a vector function f(a,b) of two scalar arguments (vector scalar scalar)
// Input:
// a -- first input scalar
// b -- second input scalar
// Output:
// f -- output vector
type Vss func(f la.Vector, a, b float64)
// Vvss defines two vector functions u(a,b) and v(a,b) of two scalar arguments
// (vector vector scalar scalar)
// Input:
// a -- first input scalar
// b -- second input scalar
// Output:
// u -- first output vector
// v -- second output vector
type Vvss func(u, v la.Vector, a, b float64)
// Vvvss defines three vector functions u(a,b), v(a,b) and w(a,b) of two scalar arguments
// (vector vector vector scalar scalar)
// Input:
// a -- first input scalar
// b -- second input scalar
// Output:
// u -- first output vector
// v -- second output vector
// w -- second output vector
type Vvvss func(u, v, w la.Vector, a, b float64)
// Mss defines a matrix function f(a,b) of two scalar arguments (matrix scalar scalar)
// Input:
// a -- first input scalar
// b -- second input scalar
// Output:
// m -- output matrix
type Mss func(m *la.Matrix, a, b float64)
// Vv defines a vector function f(v) of a vector argument v (vector vector)
// Input:
// v -- input vector
// Output:
// f -- output vector
type Vv func(f, v la.Vector)
// Mv defines a matrix function f(v) of a vector argument v (matrix vector))
// Input:
// v -- input vector
// Output:
// f -- output matrix
type Mv func(f *la.Matrix, v la.Vector)
// Mm defines a matrix function f(m) of a matrix argument m (matrix matrix))
// Input:
// m -- input matrix
// Output:
// M -- output matrix
type Mm func(f, m *la.Matrix)
// Tv defines a triplet (matrix) function f(v) of a vector argument v (triplet vector)
// Input:
// v -- input vector
// Output:
// f -- output triplet
type Tv func(f *la.Triplet, v la.Vector)
// Tt defines a triplet (matrix) function f(t) of a triplet (matrix) argument t (triplet triplet)
// Input:
// t -- input triplet
// Output:
// f -- output triplet
type Tt func(f, t *la.Triplet)
// Svs defines a scalar function f(v,s) of a vector and a scalar
// Input:
// s -- the scalar
// v -- the vector
// Returns:
// scalar
type Svs func(v la.Vector, s float64) float64