Skip to content

Commit

Permalink
more cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
mlubin committed Jun 12, 2013
1 parent d35a027 commit c42ccb3
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,6 @@ function timesvar(x::Expr)
return x.args[end]
end

# parses top-level expression and returns expression for array of the coefficient terms
function topcoef(x::Expr)
if x.head == :call && x.args[1] == :+
return Expr(:vcat,map(topcoef,x.args[2:end])...)
elseif x.head == :call && x.args[1] == :*
println("timescoef of $x is $(timescoef(x))")
return timescoef(x)
else
error("Unable to parse expression $x")
end
end

function topvar(x::Expr)
if x.head == :call && x.args[1] == :+
return Expr(:vcat,map(topvar,x.args[2:end])...)
elseif x.head == :call && x.args[1] == :*
return timesvar(x)
else
error("Unable to parse expression $x")
end
end

function addToExpression(aff::AffExpr,c::Number,x::Variable)
push!(aff.vars,x)
push!(aff.coeffs,c)
Expand Down

0 comments on commit c42ccb3

Please sign in to comment.