MCPcopy Create free account

hub / github.com/DzananGanic/numericalgo / functions

Functions103 in github.com/DzananGanic/numericalgo

↓ 12 callersMethodDim
Dim returns the dimensions of the matrix in the form (rows, columns).
matrix.go:10
↓ 8 callersMethodTranspose
Transpose returns the transposed matrix and the error.
matrix.go:248
↓ 6 callersMethodCol
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 callersMethodDim
Dim returns the dimension of the vector.
vector.go:12
↓ 6 callersMethodFit
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 callersMethodAreDimsEqual
AreDimsEqual receives another vector as a parameter. Method returns true if the dimensions of the vectors are equal.
vector.go:17
↓ 5 callersMethodInsertCol
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 callersMethodIsSimilar
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 callersMethodLeftDivide
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 callersMethodMultiplyBy
MultiplyBy receives another matrix as a parameter. It multiplies the matrices and returns the resulting matrix and error.
matrix.go:168
↓ 4 callersMethodPredict
(float64)
fit/fit.go:8
↓ 3 callersMethodFit
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 callersMethodFit
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 callersMethodFit
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 callersMethodSum
Sum returns the sum of all elements in the vector
vector.go:38
↓ 3 callersMethodareDimsEqual
(m2 Matrix)
matrix.go:338
↓ 2 callersMethodAdd
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 callersMethodDivideByScalar
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 callersMethodDot
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 callersMethodInvert
Invert returns the inverted matrix by using Gauss-Jordan elimination
matrix.go:18
↓ 2 callersMethodIsEqual
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 callersMethodLog
Log applies natural logarithm to all the elements of the matrix, and returns the resulting matrix.
matrix.go:91
↓ 2 callersMethodPower
Power receives a float as a parameter. It returns the vector whose elements are x^n.
vector.go:47
↓ 2 callersMethodSubtract
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 callersMethodcanPerformOperationsWith
(m2 Matrix)
matrix.go:355
↓ 1 callersMethodExp
Exp applies e^x to all the elements of the matrix, and returns the resulting matrix.
matrix.go:104
↓ 1 callersMethodInterpolate
(float64)
interpolate/interpolate.go:4
↓ 1 callersMethodMultiplyByScalar
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 callersMethodRow
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 callersMethodValidate
(float64)
interpolate/interpolate.go:8
↓ 1 callersFunctionWithSingle
WithSingle accepts the single float64 value, and returns the interpolated value for it, and the error
interpolate/interpolate.go:30
↓ 1 callersMethodfindNearestNeighbors
(val float64, l, r int)
interpolate/linear/linear.go:48
↓ 1 callersMethodisNil
()
matrix.go:348
↓ 1 callersMethodisSquare
()
matrix.go:162
MethodAdd
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
FunctionBackward
(f func(float64) float64, val, h float64)
differentiate/backward.go:7
FunctionBisection
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
FunctionCentral
(f func(float64) float64, val, h float64)
differentiate/central.go:7
FunctionForward
(f func(float64) float64, val, h float64)
differentiate/forward.go:7
MethodInterpolate
(val float64)
interpolate/linear/linear.go:21
MethodInterpolate
(val float64)
interpolate/lagrange/lagrange.go:21
MethodIsSimilar
IsSimilar receives another matrix and tolerance as the parameters. It checks whether the two matrices are similar within the provided tolerance.
matrix.go:263
FunctionNew
New returns the pointer to the new Linear type
fit/linear/linear.go:15
FunctionNew
New returns the pointer to the new Poly type
fit/poly/poly.go:17
FunctionNew
New returns the pointer to the new Exponential type
fit/exponential/exponential.go:15
FunctionNew
New returns the new Linear object
interpolate/linear/linear.go:16
FunctionNew
New returns the new Lagrange object.
interpolate/lagrange/lagrange.go:16
FunctionNewton
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
MethodPredict
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
MethodPredict
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
MethodPredict
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
FunctionPredictMulti
PredictMulti accepts the slice of float64, and returns the predicted values for the passed slice values, and the error
fit/fit.go:12
FunctionSimpson
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
FunctionSlicesToCoordinatePairs
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
FunctionSortCoordinatePairs
SortCoordinatePairs is a function which receives a slice of CoordinatePairs, and sorts it in ascending order.
coordinate_pair.go:14
MethodSubtract
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
FunctionTestAddMatrices
(t *testing.T)
matrix_test.go:156
FunctionTestAddVectors
(t *testing.T)
vector_test.go:68
FunctionTestBackward
(t *testing.T)
differentiate/backward_test.go:12
FunctionTestBisection
(t *testing.T)
root/bisection_test.go:11
FunctionTestCentral
(t *testing.T)
differentiate/central_test.go:12
FunctionTestCol
(t *testing.T)
matrix_test.go:273
FunctionTestCompareMatrices
(t *testing.T)
matrix_test.go:11
FunctionTestDivideVectorByScalar
(t *testing.T)
vector_test.go:188
FunctionTestFitExponentialFit
(t *testing.T)
fit/exponential/exponential_test.go:12
FunctionTestFitLinearFit
(t *testing.T)
fit/linear/linear_test.go:12
FunctionTestFitPolyFit
(t *testing.T)
fit/poly/poly_test.go:13
FunctionTestForward
(t *testing.T)
differentiate/forward_test.go:12
FunctionTestLagrangeCanFit
(t *testing.T)
interpolate/lagrange/lagrange_test.go:12
FunctionTestLagrangeCanInterpolateMultipleValues
(t *testing.T)
interpolate/lagrange/lagrange_test.go:110
FunctionTestLagrangeCanInterpolateSingleValue
(t *testing.T)
interpolate/lagrange/lagrange_test.go:40
FunctionTestLinearCanFit
(t *testing.T)
interpolate/linear/linear_test.go:13
FunctionTestLinearCanInterpolateMultipleValues
(t *testing.T)
interpolate/linear/linear_test.go:103
FunctionTestLinearCanInterpolateSingleValue
(t *testing.T)
interpolate/linear/linear_test.go:40
FunctionTestMatrixInsertCol
(t *testing.T)
matrix_test.go:68
FunctionTestMatrixInverse
(t *testing.T)
matrix_test.go:660
FunctionTestMatrixIsSimilar
(t *testing.T)
matrix_test.go:716
FunctionTestMatrixLeftDivide
(t *testing.T)
matrix_test.go:535
FunctionTestMatrixMultiplication
(t *testing.T)
matrix_test.go:425
FunctionTestMultiplyVectorByScalar
(t *testing.T)
vector_test.go:161
FunctionTestNewton
(t *testing.T)
root/newton_test.go:11
FunctionTestPredictExponentialFit
(t *testing.T)
fit/exponential/exponential_test.go:41
FunctionTestPredictLinearFit
(t *testing.T)
fit/linear/linear_test.go:41
FunctionTestPredictMultiExponentialFit
(t *testing.T)
fit/exponential/exponential_test.go:70
FunctionTestPredictMultiLinearFit
(t *testing.T)
fit/linear/linear_test.go:77
FunctionTestPredictMultiPolyFit
(t *testing.T)
fit/poly/poly_test.go:79
FunctionTestPredictPolyFit
(t *testing.T)
fit/poly/poly_test.go:41
FunctionTestRow
(t *testing.T)
matrix_test.go:318
FunctionTestSimpson
(t *testing.T)
integrate/simpson_test.go:12
FunctionTestSubtractMatrices
(t *testing.T)
matrix_test.go:208
FunctionTestSubtractVectors
(t *testing.T)
vector_test.go:99
FunctionTestTransposeMatrix
(t *testing.T)
matrix_test.go:364
FunctionTestTrapezoid
(t *testing.T)
integrate/trapezoid_test.go:12
FunctionTestVectorAreDimsEqual
(t *testing.T)
vector_test.go:38
FunctionTestVectorDim
(t *testing.T)
vector_test.go:11
FunctionTestVectorDotProduct
(t *testing.T)
vector_test.go:130
FunctionTestVectorIsSimilar
(t *testing.T)
vector_test.go:239
FunctionTestVectorPower
(t *testing.T)
vector_test.go:218
FunctionTrapezoid
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
MethodValidate
(val float64)
interpolate/linear/linear.go:35
next →1–100 of 103, ranked by callers