Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/DzananGanic/numericalgo
/ functions
Functions
103 in github.com/DzananGanic/numericalgo
⨍
Functions
103
◇
Types & classes
13
↓ 12 callers
Method
Dim
Dim returns the dimensions of the matrix in the form (rows, columns).
matrix.go:10
↓ 8 callers
Method
Transpose
Transpose returns the transposed matrix and the error.
matrix.go:248
↓ 6 callers
Method
Col
Col receives the index as a parameter. It returns the vector column at provided index and the error (if there is any).
matrix.go:231
↓ 6 callers
Method
Dim
Dim returns the dimension of the vector.
vector.go:12
↓ 6 callers
Method
Fit
Fit receives two float64 slices - for the x and y coordinates where x[i] and y[i] represent a coordinate pair in a grid. It returns the error if the X
interpolate/base.go:18
↓ 5 callers
Method
AreDimsEqual
AreDimsEqual receives another vector as a parameter. Method returns true if the dimensions of the vectors are equal.
vector.go:17
↓ 5 callers
Method
InsertCol
InsertCol receives the index and the vector. It adds the provided vector as a column at index k, and returns the resulting matrix and the error (if th
matrix.go:200
↓ 5 callers
Method
IsSimilar
IsSimilar receives another vector and tolerance as a parameter. It checks whether the two vectors are similar within the provided tolerance.
vector.go:22
↓ 4 callers
Method
LeftDivide
LeftDivide receives another matrix as a parameter. The method solves the symbolic system of linear equations in matrix form, A*X = B for X. It returns
matrix.go:117
↓ 4 callers
Method
MultiplyBy
MultiplyBy receives another matrix as a parameter. It multiplies the matrices and returns the resulting matrix and error.
matrix.go:168
↓ 4 callers
Method
Predict
(float64)
fit/fit.go:8
↓ 3 callers
Method
Fit
Fit function in Linear type receives two vectors, finds and stores the coefficients in the coeff property, and returns the error if something went wro
fit/linear/linear.go:21
↓ 3 callers
Method
Fit
Fit function in Poly type receives two vectors, finds and stores the coefficients in the coeff property, and returns the error if something went wrong
fit/poly/poly.go:23
↓ 3 callers
Method
Fit
Fit function in Exponential type receives two vectors, finds and stores the coefficients in the coeff property, and returns the error if something wen
fit/exponential/exponential.go:21
↓ 3 callers
Method
Sum
Sum returns the sum of all elements in the vector
vector.go:38
↓ 3 callers
Method
areDimsEqual
(m2 Matrix)
matrix.go:338
↓ 2 callers
Method
Add
Add receives another vector as a parameter. It adds the two vectors and returns the result vector and the error (if there is any).
vector.go:60
↓ 2 callers
Method
DivideByScalar
DivideByScalar receives a scalar as a parameter. It divides all the elements of the vector by provided scalar and returns the result vector.
vector.go:116
↓ 2 callers
Method
Dot
Dot receives another vector as a parameter. It calculates the dot product between the two vectors and returns the float result and an error (if there
vector.go:90
↓ 2 callers
Method
Invert
Invert returns the inverted matrix by using Gauss-Jordan elimination
matrix.go:18
↓ 2 callers
Method
IsEqual
IsEqual receives another matrix as a parameter. It returns true if the values of the two matrices are equal, and false otherwise.
matrix.go:285
↓ 2 callers
Method
Log
Log applies natural logarithm to all the elements of the matrix, and returns the resulting matrix.
matrix.go:91
↓ 2 callers
Method
Power
Power receives a float as a parameter. It returns the vector whose elements are x^n.
vector.go:47
↓ 2 callers
Method
Subtract
Subtract receives another vector as a parameter. It subtracts the two vectors and returns the result vector and an error (if there is any).
vector.go:75
↓ 2 callers
Method
canPerformOperationsWith
(m2 Matrix)
matrix.go:355
↓ 1 callers
Method
Exp
Exp applies e^x to all the elements of the matrix, and returns the resulting matrix.
matrix.go:104
↓ 1 callers
Method
Interpolate
(float64)
interpolate/interpolate.go:4
↓ 1 callers
Method
MultiplyByScalar
MultiplyByScalar receives a scalar as a parameter. It multiplies all the elements of the vector with provided scalar and returns the result vector.
vector.go:105
↓ 1 callers
Method
Row
Row receives the index as a parameter. It returns the vector row at provided index and the error (if there is any).
matrix.go:221
↓ 1 callers
Method
Validate
(float64)
interpolate/interpolate.go:8
↓ 1 callers
Function
WithSingle
WithSingle accepts the single float64 value, and returns the interpolated value for it, and the error
interpolate/interpolate.go:30
↓ 1 callers
Method
findNearestNeighbors
(val float64, l, r int)
interpolate/linear/linear.go:48
↓ 1 callers
Method
isNil
()
matrix.go:348
↓ 1 callers
Method
isSquare
()
matrix.go:162
Method
Add
Add receives another matrix as a parameter. It adds the two matrices and returns the result matrix and the error (if there is any).
matrix.go:305
Function
Backward
(f func(float64) float64, val, h float64)
differentiate/backward.go:7
Function
Bisection
Bisection receives three parameters. First parameter is the function we want to find root of. Second one is the tolerance. Third and fourth parameters
root/bisection.go:8
Function
Central
(f func(float64) float64, val, h float64)
differentiate/central.go:7
Function
Forward
(f func(float64) float64, val, h float64)
differentiate/forward.go:7
Method
Interpolate
(val float64)
interpolate/linear/linear.go:21
Method
Interpolate
(val float64)
interpolate/lagrange/lagrange.go:21
Method
IsSimilar
IsSimilar receives another matrix and tolerance as the parameters. It checks whether the two matrices are similar within the provided tolerance.
matrix.go:263
Function
New
New returns the pointer to the new Linear type
fit/linear/linear.go:15
Function
New
New returns the pointer to the new Poly type
fit/poly/poly.go:17
Function
New
New returns the pointer to the new Exponential type
fit/exponential/exponential.go:15
Function
New
New returns the new Linear object
interpolate/linear/linear.go:16
Function
New
New returns the new Lagrange object.
interpolate/lagrange/lagrange.go:16
Function
Newton
Newton receives three parameters. First parameter is the function we want to find root of. Second one is the initial guess (reasonably close to the tr
root/newton.go:6
Method
Predict
Predict function in Linear type accepts value to be predicted, and returns the predicted value based on the y=p+q*x formula.
fit/linear/linear.go:64
Method
Predict
Predict function in Poly type accepts value to be predicted, and returns the predicted value based on the y=p1+p2*x+p3*x^2+...+p(n+1)*x^n formula.
fit/poly/poly.go:70
Method
Predict
Predict function in Exponential type accepts value to be predicted, and returns the predicted value based on the y=p*e^(q*x) formula.
fit/exponential/exponential.go:67
Function
PredictMulti
PredictMulti accepts the slice of float64, and returns the predicted values for the passed slice values, and the error
fit/fit.go:12
Function
Simpson
Simpson is a function which accepts function, left, right bounds and n number of subdivisions. It returns the integration value of the function in the
integrate/simpson.go:11
Function
SlicesToCoordinatePairs
SlicesToCoordinatePairs is a function which receives two slices of floats (x and y), turns them into a slice of CoordinatePairs, and returns the resul
coordinate_pair.go:21
Function
SortCoordinatePairs
SortCoordinatePairs is a function which receives a slice of CoordinatePairs, and sorts it in ascending order.
coordinate_pair.go:14
Method
Subtract
Subtract receives another matrix as a parameter. It subtracts the two matrices and returns the result matrix and the error (if there is any).
matrix.go:322
Function
TestAddMatrices
(t *testing.T)
matrix_test.go:156
Function
TestAddVectors
(t *testing.T)
vector_test.go:68
Function
TestBackward
(t *testing.T)
differentiate/backward_test.go:12
Function
TestBisection
(t *testing.T)
root/bisection_test.go:11
Function
TestCentral
(t *testing.T)
differentiate/central_test.go:12
Function
TestCol
(t *testing.T)
matrix_test.go:273
Function
TestCompareMatrices
(t *testing.T)
matrix_test.go:11
Function
TestDivideVectorByScalar
(t *testing.T)
vector_test.go:188
Function
TestFitExponentialFit
(t *testing.T)
fit/exponential/exponential_test.go:12
Function
TestFitLinearFit
(t *testing.T)
fit/linear/linear_test.go:12
Function
TestFitPolyFit
(t *testing.T)
fit/poly/poly_test.go:13
Function
TestForward
(t *testing.T)
differentiate/forward_test.go:12
Function
TestLagrangeCanFit
(t *testing.T)
interpolate/lagrange/lagrange_test.go:12
Function
TestLagrangeCanInterpolateMultipleValues
(t *testing.T)
interpolate/lagrange/lagrange_test.go:110
Function
TestLagrangeCanInterpolateSingleValue
(t *testing.T)
interpolate/lagrange/lagrange_test.go:40
Function
TestLinearCanFit
(t *testing.T)
interpolate/linear/linear_test.go:13
Function
TestLinearCanInterpolateMultipleValues
(t *testing.T)
interpolate/linear/linear_test.go:103
Function
TestLinearCanInterpolateSingleValue
(t *testing.T)
interpolate/linear/linear_test.go:40
Function
TestMatrixInsertCol
(t *testing.T)
matrix_test.go:68
Function
TestMatrixInverse
(t *testing.T)
matrix_test.go:660
Function
TestMatrixIsSimilar
(t *testing.T)
matrix_test.go:716
Function
TestMatrixLeftDivide
(t *testing.T)
matrix_test.go:535
Function
TestMatrixMultiplication
(t *testing.T)
matrix_test.go:425
Function
TestMultiplyVectorByScalar
(t *testing.T)
vector_test.go:161
Function
TestNewton
(t *testing.T)
root/newton_test.go:11
Function
TestPredictExponentialFit
(t *testing.T)
fit/exponential/exponential_test.go:41
Function
TestPredictLinearFit
(t *testing.T)
fit/linear/linear_test.go:41
Function
TestPredictMultiExponentialFit
(t *testing.T)
fit/exponential/exponential_test.go:70
Function
TestPredictMultiLinearFit
(t *testing.T)
fit/linear/linear_test.go:77
Function
TestPredictMultiPolyFit
(t *testing.T)
fit/poly/poly_test.go:79
Function
TestPredictPolyFit
(t *testing.T)
fit/poly/poly_test.go:41
Function
TestRow
(t *testing.T)
matrix_test.go:318
Function
TestSimpson
(t *testing.T)
integrate/simpson_test.go:12
Function
TestSubtractMatrices
(t *testing.T)
matrix_test.go:208
Function
TestSubtractVectors
(t *testing.T)
vector_test.go:99
Function
TestTransposeMatrix
(t *testing.T)
matrix_test.go:364
Function
TestTrapezoid
(t *testing.T)
integrate/trapezoid_test.go:12
Function
TestVectorAreDimsEqual
(t *testing.T)
vector_test.go:38
Function
TestVectorDim
(t *testing.T)
vector_test.go:11
Function
TestVectorDotProduct
(t *testing.T)
vector_test.go:130
Function
TestVectorIsSimilar
(t *testing.T)
vector_test.go:239
Function
TestVectorPower
(t *testing.T)
vector_test.go:218
Function
Trapezoid
Trapezoid is a function which accepts function, left, right bounds and n number of subdivisions. It returns the integration value of the function in t
integrate/trapezoid.go:11
Method
Validate
(val float64)
interpolate/linear/linear.go:35
next →
1–100 of 103, ranked by callers