@@ -11,6 +11,20 @@ function increment!(state::AbstractState)
1111 return state
1212end
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+
1428function 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
4054end
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-
5656struct AlgorithmIterator{Problem, Algorithm, State} <: AbstractAlgorithmIterator
5757 problem:: Problem
5858 algorithm:: Algorithm
0 commit comments