From 0bcd44911c967856d2833bbfe4ded4c4bd83e0e4 Mon Sep 17 00:00:00 2001 From: hypergraphUniverse <44737387+hypergraphUniverse@users.noreply.github.com> Date: Mon, 7 Mar 2022 11:22:00 +0100 Subject: [PATCH] fix bugs 1. fix precision Error with undef initializer 2. fix a output mistake --- FileCodeOutput.jl | 2 +- JSONPhraser.jl | 4 ++-- Main.jl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/FileCodeOutput.jl b/FileCodeOutput.jl index 46c090a..a844ed4 100644 --- a/FileCodeOutput.jl +++ b/FileCodeOutput.jl @@ -109,7 +109,7 @@ function Print3DMatrix(f,M;tabLen=0,varName="",codeStyle="C") print(f,"}"); elseif codeStyle=="Julia" - print("Array{Float32,3}(undef,"*string(size(M)[1])*","*string(size(M)[2])*","*string(size(M)[3])*");\n"); + print(f,"fill(0f0,"*string(size(M)[1])*","*string(size(M)[2])*","*string(size(M)[3])*");\n"); for i in 1:size(M)[1] Print2DMatrix(f,M[i,:,:];varName=varName*"["*string(i)*",:,:]",codeStyle="Julia"); end diff --git a/JSONPhraser.jl b/JSONPhraser.jl index 570911f..b08e034 100644 --- a/JSONPhraser.jl +++ b/JSONPhraser.jl @@ -24,7 +24,7 @@ function ReliAffixECDConverter() # Initialize with empty Array # Rank, Substats, Sequence - dataSet=Array{Float32,3}(undef,5,length(LookUpTable.substatProject),4); + dataSet=fill(0f0,5,length(LookUpTable.substatProject),4); # fill in the data for i in 1:length(dict) @@ -62,7 +62,7 @@ function ReliLevelECDConverter() end # Rank, Substats, Level - dataSet=Array{Float32,3}(undef,5,length(LookUpTable.mainstatProject),21); + dataSet=fill(0f0,5,length(LookUpTable.mainstatProject),21); for i in 1:length(dict) diff --git a/Main.jl b/Main.jl index 9b73297..ba6b9ca 100644 --- a/Main.jl +++ b/Main.jl @@ -28,7 +28,7 @@ using .JSONPhraser YourVersion= "0.1" # C(suitable for C and C++),Julia -codeStyle = "C" +codeStyle = "Julia" #=======================User configured Section==========================#