fix indentation to 4 spaces

This commit is contained in:
kalmarek 2018-01-01 14:06:33 +01:00
parent fc54803b58
commit 47f6d3637e
5 changed files with 477 additions and 482 deletions

View File

@ -34,11 +34,11 @@ function compute_SOS(Q::AbstractArray, pm::Array{Int,2}, l::Int)
result = @parallel (+) for i in 1:size(Q,2)
groupring_square(Q[:,i], l, pm)
end
end
println("")
println("")
return result
return result
end
function compute_SOS(Q::AbstractArray, RG::GroupRing, l::Int)

View File

@ -175,21 +175,21 @@ function rankOne_projections(BN::WreathProduct, T::Type=Rational{Int})
append!(all_projs, [Qs[N]*RBN(p, g->BN(g)) for p in SNprojs_nc[N]])
return all_projs
end
end
##############################################################################
#
# General Groups Misc
#
##############################################################################
##############################################################################
#
# General Groups Misc
#
##############################################################################
doc"""
doc"""
products(X::Vector{GroupElem}, Y::Vector{GroupElem}, op=*)
> Returns a vector of all possible products (or `op(x,y)`), where $x\in X$ and
> $y\in Y$ are group elements. You may specify which operation is used when
> forming 'products' by adding `op` (which is `*` by default).
"""
function products{T<:GroupElem}(X::AbstractVector{T}, Y::AbstractVector{T}, op=*)
> Returns a vector of all possible products (or `op(x,y)`), where $x\in X$ and
> $y\in Y$ are group elements. You may specify which operation is used when
> forming 'products' by adding `op` (which is `*` by default).
"""
function products{T<:GroupElem}(X::AbstractVector{T}, Y::AbstractVector{T}, op=*)
result = Vector{T}()
seen = Set{T}()
for x in X
@ -202,18 +202,18 @@ function products{T<:GroupElem}(X::AbstractVector{T}, Y::AbstractVector{T}, op=*
end
end
return result
end
end
doc"""
doc"""
generateGroup(gens::Vector{GroupElem}, r=2, Id=parent(first(gens))(), op=*)
> Produces all elements of a group generated by elements in `gens` in ball of
> radius `r` (word-length metric induced by `gens`).
> If `r(=2)` is specified the procedure will terminate after generating ball
> of radius `r` in the word-length metric induced by `gens`.
> The identity element `Id` and binary operation function `op` can be supplied
> to e.g. take advantage of additive group structure.
"""
function generateGroup{T<:GroupElem}(gens::Vector{T}, r=2, Id::T=parent(first(gens))(), op=*)
> Produces all elements of a group generated by elements in `gens` in ball of
> radius `r` (word-length metric induced by `gens`).
> If `r(=2)` is specified the procedure will terminate after generating ball
> of radius `r` in the word-length metric induced by `gens`.
> The identity element `Id` and binary operation function `op` can be supplied
> to e.g. take advantage of additive group structure.
"""
function generateGroup{T<:GroupElem}(gens::Vector{T}, r=2, Id::T=parent(first(gens))(), op=*)
n = 0
R = 1
elts = gens
@ -225,4 +225,4 @@ function generateGroup{T<:GroupElem}(gens::Vector{T}, r=2, Id::T=parent(first(ge
elts = products(elts, gens, op)
end
return elts
end
end

View File

@ -68,9 +68,7 @@ function time_string(elapsedtime, bytes, gctime, allocs)
return str
end
function exists(fname::String)
return isfile(fname) || islink(fname)
end
exists(fname::String) = isfile(fname) || islink(fname)
function pmΔfilenames(prefix::String)
isdir(prefix) || mkdir(prefix)
@ -168,7 +166,6 @@ function λandP(name::String, SDP_problem::JuMP.Model, varλ, varP, warmstart=fa
throw(ErrorException("Solver did not produce a valid solution!: λ = "))
end
return λ, P
end
function fillfrominternal!(m::JuMP.Model, traits)
@ -318,7 +315,6 @@ function check_property_T(name::String, S, Id, solver, upper_bound, tol, radius)
SDP_problem, λ, P = create_SDP_problem(Δ, sdp_constraints, upper_bound=upper_bound)
JuMP.setsolver(SDP_problem, solver)
λ, P = λandP(name, SDP_problem, λ, P)
end
@ -334,7 +330,6 @@ function check_property_T(name::String, S, Id, solver, upper_bound, tol, radius)
isapprox(eigvals(P), abs(eigvals(P)), atol=tol) ||
warn("The solution matrix doesn't seem to be positive definite!")
# @assert P == Symmetric(P)
@logtime LOGGER Q = real(sqrtm(Symmetric(P)))
sgap = distance_to_positive_cone(Δ, λ, Q, 2*radius, LOGGER)