Skip to content

Commit a181013

Browse files
committed
double keyword in more places
1 parent fda22be commit a181013

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/SymbolicControlSystems.jl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -542,14 +542,15 @@ end
542542

543543
print_c_array(a::AbstractArray, args...; kwargs...) =
544544
print_c_array(stdout, a, args...; kwargs...)
545-
function print_c_array(io, a::AbstractVector, name = "vec"; cse = false, s = "", struct_name=nothing)
545+
function print_c_array(io, a::AbstractVector, name = "vec"; cse = false, s = "", struct_name=nothing, double=true)
546546
l = length(a)
547547
a = float.(a)
548548
if cse
549549
a = write_array_cse(io, a, name, s)
550550
end
551551
if struct_name === nothing
552-
s == "" && println(io, "double $name[$l];")
552+
ty = double ? "double" : "float"
553+
s == "" && println(io, "$ty $name[$l];")
553554
struct_name = ""
554555
else
555556
struct_name = struct_name*"->"
@@ -559,14 +560,15 @@ function print_c_array(io, a::AbstractVector, name = "vec"; cse = false, s = "",
559560
end
560561
println(io)
561562
end
562-
function print_c_array(io, a::AbstractMatrix, name = "mat"; cse = false, s = "", struct_name=nothing)
563+
function print_c_array(io, a::AbstractMatrix, name = "mat"; cse = false, s = "", struct_name=nothing, double=true)
563564
r, c = size(a)
564565
a = float.(a)
565566
if cse
566567
a = write_array_cse(io, a, name, s)
567568
end
568569
if struct_name === nothing
569-
s == "" && println(io, "double $name[$r][$c];")
570+
ty = double ? "double" : "float"
571+
s == "" && println(io, "$ty $name[$r][$c];")
570572
struct_name = ""
571573
else
572574
struct_name = struct_name*"->"
@@ -577,14 +579,15 @@ function print_c_array(io, a::AbstractMatrix, name = "mat"; cse = false, s = "",
577579
println(io)
578580
end
579581

580-
function print_c_array(io, a::AbstractArray{<:Any,3}, name = "array"; cse = false, s = "", struct_name=nothing)
582+
function print_c_array(io, a::AbstractArray{<:Any,3}, name = "array"; cse = false, s = "", struct_name=nothing, double=true)
581583
r, c, d = size(a)
582584
a = float.(a)
583585
if cse
584586
a = write_array_cse(io, a, name, s)
585587
end
586588
if struct_name === nothing
587-
s == "" && println(io, "double $name[$r][$c][$d];")
589+
ty = double ? "double" : "float"
590+
s == "" && println(io, "$ty $name[$r][$c][$d];")
588591
struct_name = ""
589592
else
590593
struct_name = struct_name*"->"

0 commit comments

Comments
 (0)