Skip to content

Commit de21c3b

Browse files
committed
Code reorganization
1 parent d74c9e3 commit de21c3b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/AlgorithmsInterface.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ function increment!(state::AbstractState)
1111
return state
1212
end
1313

14+
#=
15+
State(state, iteration::Int)
16+
17+
The "state", which stores both the tensor network state (the `iterate`) and the current
18+
`iteration`, which is the integer corresponding to which region or sweep we are on
19+
(`which_region` or `which_sweep` in ITensorNetworks.jl). For `alg::Sweep`, the
20+
current region is `alg.regions[iteration]`, while for `alg::Sweeping`, the current sweep is
21+
`alg.sweeps[iteration]`.
22+
=#
23+
mutable struct State{Iterate} <: AbstractState
24+
iterate::Iterate
25+
iteration::Int
26+
end
27+
1428
function solve!(
1529
problem::AbstractProblem, algorithm::AbstractAlgorithm, state::AbstractState
1630
)
@@ -39,20 +53,6 @@ function Base.iterate(itr::AbstractAlgorithmIterator, init = nothing)
3953
return itr.state, nothing
4054
end
4155

42-
#=
43-
State(state, iteration::Int)
44-
45-
The "state", which stores both the tensor network state (the `iterate`) and the current
46-
`iteration`, which is the integer corresponding to which region or sweep we are on
47-
(`which_region` or `which_sweep` in ITensorNetworks.jl). For `alg::Sweep`, the
48-
current region is `alg.regions[iteration]`, while for `alg::Sweeping`, the current sweep is
49-
`alg.sweeps[iteration]`.
50-
=#
51-
mutable struct State{Iterate} <: AbstractState
52-
iterate::Iterate
53-
iteration::Int
54-
end
55-
5656
struct AlgorithmIterator{Problem, Algorithm, State} <: AbstractAlgorithmIterator
5757
problem::Problem
5858
algorithm::Algorithm

0 commit comments

Comments
 (0)