Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ADerrors.jl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alberto Ramos
ADerrors.jl
Commits
7939eaf6
Commit
7939eaf6
authored
4 years ago
by
Alberto Ramos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved check on MC length consistency
parent
13cfc4a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
19 deletions
+25
-19
src/ADerrorsCF.jl
src/ADerrorsCF.jl
+15
-17
src/ADerrorsIO.jl
src/ADerrorsIO.jl
+10
-2
No files found.
src/ADerrorsCF.jl
View file @
7939eaf6
...
...
@@ -90,12 +90,25 @@ function get_name_from_id(id::Int64, ws::wspace)
return
str
end
function
add_maps
(
id
::
Int64
,
ws
::
wspace
)
function
add_maps
(
id
::
Int64
,
ws
::
wspace
,
iv
::
Vector
{
Int64
}
)
ws
.
nob
+=
1
push!
(
ws
.
map_nob
,
id
)
if
(
!
haskey
(
ws
.
map_ids
,
id
))
ws
.
map_ids
[
id
]
=
ws
.
nob
else
if
(
sum
(
iv
)
!=
ws
.
fluc
[
ws
.
map_ids
[
id
]]
.
nd
)
println
(
stderr
,
"ID: "
,
ws
.
id2str
[
id
])
println
(
stderr
,
"DB length: "
,
ws
.
fluc
[
ws
.
map_ids
[
id
]]
.
nd
)
println
(
stderr
,
"obs length: "
,
sum
(
iv
))
error
(
"Mistmatch in data length for the same ensemble ID"
)
end
if
(
iv
!=
ws
.
fluc
[
ws
.
map_ids
[
id
]]
.
ivrep
)
println
(
stderr
,
"ID: "
,
ws
.
id2str
[
id
])
println
(
stderr
,
"DB replica: "
,
ws
.
fluc
[
ws
.
map_ids
[
id
]]
.
ivrep
)
println
(
stderr
,
"obs replica: "
,
iv
)
error
(
"Mistmatch in replica vector for the same ensemble ID"
)
end
end
return
nothing
...
...
@@ -115,21 +128,6 @@ function add_DB(delta::Vector{Float64}, id::Int64, iv::Vector{Int64}, ws::wspace
ArgumentError
(
"Sum of replica length does not match number of measurements"
)
end
if
(
haskey
(
ws
.
map_ids
,
id
))
if
(
length
(
delta
)
!=
ws
.
fluc
[
ws
.
map_ids
[
id
]]
.
nd
)
println
(
stderr
,
"ID: "
,
id
)
println
(
stderr
,
"DB length: "
,
ws
.
fluc
[
ws
.
map_ids
[
id
]]
.
nd
)
println
(
stderr
,
"obs length: "
,
length
(
delta
))
error
(
"Mistmatch in data length for the same ensemble ID"
)
end
if
(
iv
!=
ws
.
fluc
[
ws
.
map_ids
[
id
]]
.
ivrep
)
println
(
stderr
,
"ID: "
,
id
)
println
(
stderr
,
"DB replica: "
,
ws
.
fluc
[
ws
.
map_ids
[
id
]]
.
ivrep
)
println
(
stderr
,
"obs replica: "
,
iv
)
error
(
"Mistmatch in replica vector for the same ensemble ID"
)
end
end
fseries
=
Dict
{
Int64
,
Vector
{
Complex
{
Float64
}}}()
nbin
=
get_nbin_vec
(
iv
)
is
=
1
...
...
@@ -150,7 +148,7 @@ function add_DB(delta::Vector{Float64}, id::Int64, iv::Vector{Int64}, ws::wspace
end
if
do_maps
add_maps
(
id
,
ws
)
add_maps
(
id
,
ws
,
iv
)
end
return
nothing
...
...
This diff is collapsed.
Click to expand it.
src/ADerrorsIO.jl
View file @
7939eaf6
...
...
@@ -284,20 +284,28 @@ function read_bdio(fb, ws::wspace, mapids::Dict{Int64, Int64})
end
if
BDIO
.
BDIO_eor
(
fb
)
is
=
1
for
i
in
1
:
nid
ie
=
is
+
nrep
[
i
]
-
1
id
=
convert
(
Int64
,
ids
[
i
])
add_maps
(
id
,
ws
)
add_maps
(
id
,
ws
,
convert
(
Vector
{
Int64
},
ivrep
[
is
:
ie
])
)
get_name_from_id
(
id
,
ws
)
is
=
ie
+
1
end
else
name
=
BDIO
.
BDIO_read_str
(
fb
)
is
=
1
for
i
in
1
:
nid
ie
=
is
+
nrep
[
i
]
-
1
BDIO
.
BDIO_read
(
fb
,
ifoo
)
str
=
BDIO
.
BDIO_read_str
(
fb
)
id
=
get_id_from_name
(
str
,
ws
)
add_maps
(
id
,
ws
)
add_maps
(
id
,
ws
,
convert
(
Vector
{
Int64
},
ivrep
[
is
:
ie
]))
is
=
ie
+
1
end
end
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment