Ronis,
I want you to know that I have incorporated your pretty table into my module
module PDFPs
import Base: ==, +, -, *, /, \, ^, <, <=, %, ÷, mod, fld, cld, floor, ceil
import Base: float, inv, round, <<, >>
import Base: sqrt, cbrt, show, factorial
# Unfortunately getproperty slows down PDFP so we disable it from version 2.1.5
# import Base: getproperty
using PrettyTables, SpecialFunctions, ForwardDiff, LinearAlgebra, Statistics, Distributions
function prettytable1D(vector,label::String)
len = length(vector)
matrix = Array{Any,2}(undef,len,2);
for row in 1:len
matrix[row,1] = row - 1
matrix[row,2] = vector[row]
end
pretty_table(matrix,["depth",label])
end
function prettytable2D(vector)
len = length(vector)
matrix = Array{Any,2}(undef,len,3);
for row in 1:len
matrix[row,1] = row - 1
matrix[row,2] = vector[row][1]
matrix[row,3] = vector[row][2]
end
pretty_table(matrix,["depth","x","y"])
end
result = PDFP_newtonRaphson_multifunc_multivariate(f,value,20,true,DiffMethod="Automatic",LogDict=logdict)
tracklog = logdict["tracklog"]
tracklog_string = PDFP_convertVecVectoString(tracklog)
println()
println("=== tracklog ===")
prettytable2D(tracklog_string)
=== tracklog ===
┌───────┬───────────────────┬────────────────────┐
│ depth │ x │ y │
├───────┼───────────────────┼────────────────────┤
│ 0 │ 2.000000000000000 │ 3.000000000000000 │
│ 1 │ 1.499999999999999 │ 1.500000000000000 │
│ 2 │ 1.583333333333333 │ 0.9166666666666665 │
│ 3 │ 1.675484094052559 │ 0.8940179806362377 │
│ 4 │ 1.674148101652140 │ 0.8959765160151239 │
│ 5 │ 1.674149228035889 │ 0.8959774761302971 │
│ 6 │ 1.674149228035540 │ 0.8959774761298381 │
└───────┴───────────────────┴────────────────────┘
=== vectordiff ===
┌───────┬────────────────────────┬────────────────────────┐
│ depth │ x │ y │
├───────┼────────────────────────┼────────────────────────┤
│ 0 │ -0.5000000000000007 │ -1.500000000000000 │
│ 1 │ 0.08333333333333420 │ -0.5833333333333335 │
│ 2 │ 0.09215076071922585 │ -0.02264868603042876 │
│ 3 │ -0.001335992400419135 │ 0.001958535378886226 │
│ 4 │ 1.126383749322501E-6 │ 9.601151732034509E-7 │
│ 5 │ -3.489329826610390E-13 │ -4.589578360097503E-13 │
│ 6 │ -9.286509053016300E-17 │ 4.969988818226068E-17 │
└───────┴────────────────────────┴────────────────────────┘
=== score ===
┌───────┬───────────────────────┐
│ depth │ score │
├───────┼───────────────────────┤
│ 0 │ 130.0000000000000 │
│ 1 │ 6.250000000000003 │
│ 2 │ 0.1205632716049392 │
│ 3 │ 8.108508457272838E-5 │
│ 4 │ 3.159267906972166E-11 │
│ 5 │ 4.793890810000000E-24 │
│ 6 │ 1.600000000000000E-31 │
└───────┴───────────────────────┘