Yagami.YagamiCore.ZbrentMethod
Zbrent{F,T<:AbstractFloat}(f::F, a::T, fx::T, x::T, b::T, tol::T, itermax::Int=100, __iter::Int=0)

Create a new instance of Zbrent for finding the minimum of a function f. The parameters are:

  • f: the function to find the minimum of.
  • itermax: the maximum number of iterations to perform.
  • tol: the tolerance for convergence. (note it is not the absolute tolerance)
source
Yagami.YagamiCore.ZbrentMethod
`Zbrent([type=Float64]; f::F, itermax::Int=100, tol::T=T(TOL)) where {F,T<:AbstractFloat}`

Create a new instance of Zbrent for finding the minimum of a function f. The parameters are:

  • type: the type of the floating point numbers to use (default is Float64).
  • f: the function to find the minimum of.
  • itermax: the maximum number of iterations to perform.
  • tol: the tolerance for convergence (default is T(TOL)).
source
Yagami.YagamiCore.bracketminMethod

bracketmin(z::Zbrent{F,T},min_val::T,multiplier::T) where {F,T<:AbstractFloat} Bracket the function z.f to find a minimum. This function sets the initial bounds for the Brent's method. It uses the golden section search to find a point where the function value is lower than the initial bounds.

  • z: an instance of Zbrent containing the function and parameters for the search.
  • min_val: the minimum value to start the search from. (default is 0)
  • multiplier: a factor to determine how far to search for the next point. (default is 2)
source
Yagami.YagamiCore.file_to_arrayMethod
`file_to_array(filename,header,type=Float64,spacer=" ")`

Read a file and convert its contents into a vector of type type. The file is expected to have a header of header lines, which will be skipped. The contents of the file are split by the specified spacer, and each element is parsed to the specified type.

Arguments:

  • filename::String: The path to the file to be read.
  • header::Int=0: The number of header lines to skip in the file (default is 0).
  • type::Type{T}=Float64: The type to which the elements of the file will be parsed (default is Float64).
  • spacer::S=" ": The string used to split the contents of the file (default is a single space).

Returns:

  • Vector{T}: An array of type T containing the parsed elements from the file.

Example:

julia> file_to_array("data.txt", header=1, type=Float64, spacer=",")
[1.0, 2.0, 3.0, 4.0]
source
Yagami.YagamiCore.findrayminMethod
findraymin(zb::Zbrent{F,T}) where {F,T<:AbstractFloat}

Find the minimum of the function zb.f using the Brent's method. The function zb.f must be defined such that it returns a value for a given input x. The method uses a combination of bisection, secant, and inverse quadratic interpolation to find the minimum.

source
Yagami.YagamiCore.infologgerMethod
infologger(filename::String)

Create a logger that writes log messages to a file. This logger uses the FormatLogger to format messages and write them to the specified file.

source