Commit ad2499dc authored by Rémi's avatar Rémi
Browse files

Rename DesignSolution to Iir2AdderGraphs

parent 08d53f4d
name = "jIIR2AG"
uuid = "6c47329b-b4fa-45de-8436-c3dbac5ca469"
version = "0.1.1"
version = "0.1.2"
[deps]
AdderGraphs = "818587fb-0c22-4279-a2b9-8b16b5360b71"
......
......@@ -11,7 +11,7 @@ function all_coefficients(
)
presolve_order = presolve
presolve_time_sec = Float64(presolve_time_sec)
solutions = Vector{DesignSolution}()
solutions = Vector{Iir2AdderGraphs}()
verbose && println("Finding bounds for b_k")
gb = get_gb_secondorder_iir(model, specifications_init, verbose=verbose)
......@@ -122,7 +122,7 @@ function all_coefficients(
coefs_fit_specs(a1/(1<<(wordlength-1-scaling[1]+a0)), a2/(1<<(wordlength-1-scaling[1]+a0)),
b0/(1<<(wordlength-1-scaling[2]+a0)), b1/(1<<(wordlength-1-scaling[2]+a0)), b2/(1<<(wordlength-1-scaling[2]+a0)),
specifications_init)
push!(solutions, DesignSolution((a1, a2), (b0, b1, b2), (wordlength-1-scaling[1]+a0, wordlength-1-scaling[2]+a0)))
push!(solutions, Iir2AdderGraphs((a1, a2), (b0, b1, b2), (wordlength-1-scaling[1]+a0, wordlength-1-scaling[2]+a0)))
nb_solution += 1
if nb_solution < 10*verbosemultiplier && nb_solution % (1*verbosemultiplier) == 0
verbose && println("nb_solution: $nb_solution")
......
......@@ -10,7 +10,7 @@ function iir_ilp1!(model::Model,
verbose::Bool = false,
debug::Bool = false,
)
solution = DesignSolution((0,0), (0,0,0), (0,0), AdderGraph(Vector{AdderNode}()), AdderGraph(Vector{AdderNode}()))
solution = Iir2AdderGraphs((0,0), (0,0,0), (0,0), AdderGraph(Vector{AdderNode}()), AdderGraph(Vector{AdderNode}()))
# Call get_gb_secondorder_iir
verbose && println("Finding bounds for b_k")
gb = get_gb_secondorder_iir(model, specifications_init, verbose=verbose)
......
......@@ -4,7 +4,7 @@ using JuMP
using Polynomials
using AdderGraphs
mutable struct DesignSolution
mutable struct Iir2AdderGraphs
coefficients_a::Tuple{Int, Int}
coefficients_b::Tuple{Int, Int, Int}
shifts::Tuple{Int, Int}
......@@ -12,16 +12,16 @@ mutable struct DesignSolution
addergraph_b::AdderGraph
end
function DesignSolution()
return DesignSolution((0,0), (0,0,0), (0,0), AdderGraph(Vector{AdderNode}()), AdderGraph(Vector{AdderNode}()))
function Iir2AdderGraphs()
return Iir2AdderGraphs((0,0), (0,0,0), (0,0), AdderGraph(Vector{AdderNode}()), AdderGraph(Vector{AdderNode}()))
end
function DesignSolution(
function Iir2AdderGraphs(
coefficients_a::Tuple{Int, Int},
coefficients_b::Tuple{Int, Int, Int},
shifts::Tuple{Int, Int}
)
return DesignSolution(coefficients_a, coefficients_b, shifts, AdderGraph(Vector{AdderNode}()), AdderGraph(Vector{AdderNode}()))
return Iir2AdderGraphs(coefficients_a, coefficients_b, shifts, AdderGraph(Vector{AdderNode}()), AdderGraph(Vector{AdderNode}()))
end
# Includes
......@@ -36,7 +36,7 @@ include("mcm_ilp2.jl")
include("presolve.jl")
include("design.jl")
export DesignSolution
export Iir2AdderGraphs
export design_second_order_iir
export all_coefficients
export get_specifications
......
......@@ -14,7 +14,7 @@ end
# end
import Base.isempty
function isempty(solution::DesignSolution)
function isempty(solution::Iir2AdderGraphs)
return solution.coefficients_a == (0,0) && solution.coefficients_b == (0,0,0)
end
......
Supports Markdown
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