Commit 1e21b0d2 authored by Alejandro Saez's avatar Alejandro Saez

truncate_data truncate whole replicum

parent 1c0a6f54
......@@ -609,6 +609,9 @@ function truncate_data!(data::YData, nc::Int64)
return nothing
end
function truncate_data!(data::Vector{YData}, nc::Vector{Int64})
if length(nc) < length(data)
data = data[1:length(nc)]
end
truncate_data!.(data, nc)
return nothing
end
......@@ -624,6 +627,14 @@ end
function truncate_data!(data::Vector{Vector{CData}}, nc::Vector{Int64})
N = length(data)
R = length(data[1])
L = length(nc)
if L < R
data = data[:][1:L]
end
R = length(data[1])
if R != L
error("Truncate config number not the same as data.")
end
for k = 1:N
for r = 1:R
data[k][r].vcfg = data[k][r].vcfg[1:nc[r]]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment