text:
module BuildATests

# test buildA!
include(joinpath(dirname(@__FILE__), "..", "src", "AndersonMoore.jl"))
using .AndersonMoore

#tweaked= False
# test buildA! firmvalue example
function firmvalueFalse()::Bool

neq=4::Int64;nlag=1::Int64;nlead=1::Int64
qRows=(neq*nlead)::Int64;qCols=(neq*(nlag+nlead))::Int64

qq=zeros(Float64,4,8)

ia=3::Int64

js=[5 6 8]::Array{Int64,2}

    hForADense = [0.0  0.0  0.0  0.0  -1.1   0.0  0.0   0.0  1.0  1.0   0.0  0.0
             0.0  0.0  0.0  0.0   0.0  -0.4  0.0   0.0  0.0  1.0  -1.0  0.0
             0.0  0.0  0.0  0.0   0.0   0.0  0.0   0.0  0.0  0.0   1.0  0.0
             0.0  0.0  0.0  0.0   0.0   0.0  0.0  -1.0  0.0  0.0   0.0  1.0]

    aa = [1.1  -0.4  0.0
          0.0   0.4  0.0
          0.0   0.0  1.0]

(aaJulia,iaJulia,jsJulia)=buildA!(hForADense,qCols,neq)
isapprox(aaJulia,aa,rtol=0.1e-10::Float64,atol=0.0::Float64) &&
isequal(iaJulia,ia)&&
isequal(jsJulia,js)
end;

#tweaked= False
# test buildA! firmvalue3Leads2Lags example
function firmvalue3Leads2LagsFalse()::Bool

neq=4::Int64;nlag=2::Int64;nlead=3::Int64
qRows=(neq*nlead)::Int64;qCols=(neq*(nlag+nlead))::Int64

qq=zeros(Float64,12,20)

ia=6::Int64

js=[9 13 14 17 18 20]::Array{Int64,2}

    hForADense = [0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  -1.3310000000000004  0.0  0.0  0.0  0.0   1.0  0.0  0.0  0.0  0.0  0.0   0.0  1.0  0.0   0.0  0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0                 0.0  0.0  0.0  0.0  -0.4  0.0  0.0  0.0  0.0  0.0   0.0  0.0  1.0  -1.0  0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0                 0.0  0.0  0.0  0.0   0.0  0.0  0.0  0.0  0.0  0.0   0.0  0.0  0.0   1.0  0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0                 0.0  0.0  0.0  0.0   0.0  0.0  0.0  0.0  0.0  0.0  -1.0  0.0  0.0   0.0  1.0]

    aa = [0.0                 1.0   0.0  0.0  0.0  0.0
          0.0                 0.0   0.0  1.0  0.0  0.0
          0.0                 0.0   0.0  0.0  1.0  0.0
          1.3310000000000004  0.0  -1.0  0.0  0.0  0.0
          0.0                 0.0   0.4  0.0  0.0  0.0
          0.0                 0.0   0.0  0.0  0.0  1.0]

(aaJulia,iaJulia,jsJulia)=buildA!(hForADense,qCols,neq)
isapprox(aaJulia,aa,rtol=0.1e-10::Float64,atol=0.0::Float64) &&
isequal(iaJulia,ia)&&
isequal(jsJulia,js)
end;

#tweaked= False
# test buildA! example7 example
function example7False()::Bool

neq=4::Int64;nlag=1::Int64;nlead=1::Int64
qRows=(neq*nlead)::Int64;qCols=(neq*(nlag+nlead))::Int64

qq=zeros(Float64,4,8)

ia=3::Int64

js=[5 6 8]::Array{Int64,2}

    hForADense = [0.0  0.0  0.0  0.0   1.0  0.0  0.0   1.0   -1.0  -1.0   0.0   0.0
                  0.0  0.0  0.0  0.0  -0.3  1.0  0.0   0.0    0.0  -0.99  0.0   0.0
                  0.0  0.0  0.0  0.0   0.0  0.0  0.0   1.0    0.0   0.0   1.0  -1.0
                  0.0  0.0  0.0  0.0   0.0  0.0  0.0  -0.66   0.0  -1.1   0.0   1.0]

    aa = [ 1.303030303030303    -1.0101010101010102  1.0
          -0.30303030303030304   1.0101010101010102  0.0
          -0.33333333333333337   1.1111111111111112  0.66]

(aaJulia,iaJulia,jsJulia)=buildA!(hForADense,qCols,neq)
isapprox(aaJulia,aa,rtol=0.1e-10::Float64,atol=0.0::Float64) &&
isequal(iaJulia,ia)&&
isequal(jsJulia,js)
end;

#tweaked= False
# test buildA! oneEquationNoLead example
function oneEquationNoLeadFalse()::Bool

neq=1::Int64;nlag=1::Int64;nlead=1::Int64
qRows=(neq*nlead)::Int64;qCols=(neq*(nlag+nlead))::Int64

qq=zeros(Float64,1,2)

ia=1::Int64

js=hcat([2])::Array{Int64,2}

    hForADense = [0.0  2.0  3.0]
    aa = [-0.6666666666666666]

(aaJulia,iaJulia,jsJulia)=buildA!(hForADense,qCols,neq)
isapprox(aaJulia,aa,rtol=0.1e-10::Float64,atol=0.0::Float64) &&
isequal(iaJulia,ia)&&
isequal(jsJulia,js)
end;

#tweaked= False
# test buildA! reliablePaperExmpl example
function reliablePaperExmplFalse()::Bool

neq=5::Int64;nlag=1::Int64;nlead=1::Int64
qRows=(neq*nlead)::Int64;qCols=(neq*(nlag+nlead))::Int64

qq=zeros(Float64,5,10)

ia=4::Int64

js=[6 8 9 10]::Array{Int64,2}

    hForADense = [0.0  0.0  0.0  0.0  0.0   0.0  0.0  0.0  -0.5   0.0  0.0  -1.0   0.7  -0.5   1.0
                  0.0  0.0  0.0  0.0  0.0   0.0  0.0  0.0   1.0  -0.5  0.0   0.0   0.0   0.0  -0.5
                  0.0  0.0  0.0  0.0  0.0  -1.0  0.0  1.0  -0.4   0.0  0.0   0.0  -0.9   0.0   0.0
                  0.0  0.0  0.0  0.0  0.0   0.0  0.0  0.0   0.0   0.0  1.0   0.0   0.0   0.0   0.0
                  0.0  0.0  0.0  0.0  0.0   0.0  0.0  0.0   0.0   0.0  0.0   1.0   0.0   0.0   0.0]

    aa = [0.0                 0.0                  0.0                  0.0
          -1.1111111111111112  1.1111111111111112  -0.4444444444444445   0.0
          -1.5555555555555556  1.5555555555555556   2.3777777777777778  -2.0
          0.0                 0.0                  2.0                 -1.0]

(aaJulia,iaJulia,jsJulia)=buildA!(hForADense,qCols,neq)
isapprox(aaJulia,aa,rtol=0.1e-10::Float64,atol=0.0::Float64) &&
isequal(iaJulia,ia)&&
isequal(jsJulia,js)
end;

#tweaked= False
# test buildA! athan example
function athanFalse()::Bool

neq=9::Int64;nlag=1::Int64;nlead=1::Int64
qRows=(neq*nlead)::Int64;qCols=(neq*(nlag+nlead))::Int64

qq=zeros(Float64,9,18)

ia=7::Int64

js=[1 10 11 12 13 14 18]::Array{Int64,2}

    hForADense = [-0.5  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   1.0    -0.18   0.0     0.0    -1.0  0.0  0.0  0.0   0.0  -0.5   0.0  0.0  0.0  0.0   0.0  0.0   0.0  0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.293  -0.764  0.293   0.0     0.0  0.0  0.0  0.0   0.0   0.0   1.0  0.0  0.0  0.0  -1.0  0.0   0.0  0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0     0.0    0.0     0.0     0.0  0.0  0.0  0.0   0.0  -2.0  -1.0  1.0  1.0  0.0   0.0  2.0   0.0  0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0     0.0    0.0    -0.911   0.0  0.0  0.0  0.0   0.0   0.0   0.0  0.0  1.0  0.0   0.0  0.0  -1.0  0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0     0.0    0.0     0.0     0.0  0.0  0.0  0.0   0.0   0.0   0.0  0.0  0.0  1.0   0.0  0.0   0.0  0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0     0.0    0.0     0.0     0.0  0.0  0.0  0.0   0.0   0.0   0.0  0.0  0.0  0.0   1.0  0.0   0.0  0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0     0.0    0.0     0.0     0.0  0.0  0.0  0.0   0.0   0.0   0.0  0.0  0.0  0.0   0.0  1.0   0.0  0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0     0.0    0.0     0.0     0.0  0.0  0.0  0.0   0.0   0.0   0.0  0.0  0.0  0.0   0.0  0.0   1.0  0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0     0.0    0.0     0.0     0.0  0.0  0.0  0.0  -1.0   0.0   0.0  0.0  0.0  0.0   0.0  0.0   0.0  1.0]

    aa = [0.0  1.0     0.0                   0.0     0.0     0.0  0.0
          -1.0  2.0    -0.36                  0.0     0.0    -2.0  0.0
          0.0  0.293   0.764                -0.293   0.0     0.0  0.0
          -2.0  4.293   0.04400000000000004  -0.293  -0.911  -4.0  0.0
          0.0  0.0     0.0                   0.0     0.911   0.0  0.0
          0.0  0.0     0.0                   0.0     0.0     0.0  0.0
          0.0  0.0     0.0                   0.0     0.0     0.0  1.0]

(aaJulia,iaJulia,jsJulia)=buildA!(hForADense,qCols,neq)
isapprox(aaJulia,aa,rtol=0.1e-10::Float64,atol=0.0::Float64) &&
isequal(iaJulia,ia)&&
isequal(jsJulia,js)
end;

#tweaked= False
# test buildA! habitmod example
function habitmodFalse()::Bool

neq=12::Int64;nlag=4::Int64;nlead=1::Int64
qRows=(neq*nlead)::Int64;qCols=(neq*(nlag+nlead))::Int64

qq=zeros(Float64,12,60)

ia=24::Int64

js=[13 15 16 17 25 27 28 29 37 39 40 41 49 50 51 52 53 54 55 56 57 58 59 60]::Array{Int64,2}

    hForADense = [0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0       0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0        0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0      0.0   0.0      0.0       0.0      0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0                 0.0       0.0       0.0       0.0        0.0   0.0                0.0  0.0  0.0  0.0   0.0  1.0  -1.0  -1.0  0.0   0.0   3.454185377005518   0.0   0.0         -0.74118   0.0020851713324080146   0.49411642948057477  -0.1149
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0       0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0        0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0      0.0   0.0      0.0       0.0      0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0                -0.88879   0.0       0.0       0.0        0.0   0.0                0.0  0.0  0.0  0.0   0.0  0.0   1.0   0.0  0.0   0.0   0.0                 0.0   0.0          0.0       0.0                     0.0                   0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.52802  0.0  0.11279   0.031833  0.024734  0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.71526  0.0  0.042076  -0.22829  -0.012267  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.22215  0.0  -0.14172  0.26679  -0.11959  0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.42308             0.0      -0.61076  -0.10946   0.17172    0.0   0.0                0.0  0.0  0.0  0.0   0.0  0.0   0.0   1.0  0.0   0.0   0.0                 0.0   0.0          0.0       0.0                     0.0                  -0.00011277
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.46436  0.0  0.16131   0.02744   0.17087   0.0  0.0  0.0  0.0  0.0  0.0  0.0  -1.3425   0.0  0.16794   -0.35818  -0.09837   0.0  0.0  0.0  0.0  0.0  0.0  0.0  1.06382  0.0  -0.02255  0.51594   0.08949  0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.46672             0.0      -0.11369  -1.10657  -0.26021    0.0   0.0                0.0  0.0  0.0  0.0   0.0  0.0   0.0   0.0  1.0   0.0   0.0                 0.0   0.0          0.0       0.0                     0.0                  -0.00141
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.23292  0.0  0.08512  -0.04213   0.14149   0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.03313  0.0  0.15223    0.01572  -0.34762   0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.70552  0.0  -0.24697  0.21888  -0.07805  0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.56316             0.0      -0.08268  -0.16054  -0.68637    0.0   0.0                0.0  0.0  0.0  0.0   0.0  0.0   0.0   0.0  0.0   1.0   0.0                 0.0   0.0          0.0       0.0                     0.0                  -0.00348
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0       0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0        0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0      0.0   0.0      0.0       0.0      0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0                 0.0       0.0       1.0       0.0      -41.0   0.0                0.0  0.0  0.0  0.0   0.0  0.0   0.0   0.0  0.0  -1.0  40.0                 0.0   0.0          0.0       0.0                     0.0                   0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0       0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0        0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0      0.0   0.0      0.0       0.0      0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.99853             0.0       0.0       0.0       0.0        0.0  -0.00147            0.0  0.0  0.0  0.0   0.0  0.0   0.0   0.0  0.0   0.0   0.0                 1.0   0.0          0.0       0.0                     0.0                   0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0       0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0        0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0      0.0   0.0      0.0       0.0      0.0  0.0  0.0  0.0  0.0  0.0  0.0  -1.000825426258335   0.0       0.0       0.0       0.0        0.0  25.945871790089708  1.0  0.0  0.0  0.0   0.0  0.0   0.0   0.0  0.0   0.0   0.0                 0.0  -0.00146853   0.0       0.0                     0.0                   0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0       0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0        0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0      0.0   0.0      0.0       0.0      0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0                 0.0       1.0       0.0       0.0        0.0   0.0                0.0  1.0  0.0  0.0   0.0  0.0   0.0  -1.0  0.0   0.0   0.0                 0.0   0.0         -0.99578   0.0                     0.0                   0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0       0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0        0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0      0.0   0.0      0.0       0.0      0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0                 0.0       0.0       0.0       0.0        0.0   0.0                1.0  0.0  1.0  0.0   0.0  0.0   0.0   0.0  0.0   0.0   0.0                 0.0  -1.0          0.0      -0.99578                 0.0                   0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0       0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0        0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0      0.0   0.0      0.0       0.0      0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0                 0.0       0.0       0.0       0.0        0.0   1.0                0.0  0.0  0.0  1.0   0.0  0.0   0.0   0.0  0.0   0.0   0.0                -1.0   0.0          0.0       0.0                    -0.99578               0.0
                  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0       0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0      0.0  0.0        0.0       0.0       0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0      0.0   0.0      0.0       0.0      0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.0                 0.0       0.0       0.0       0.0        0.0   0.0                0.0  0.0  0.0  0.0  -1.0  0.0   0.0   0.0  0.0   0.0   0.0                 0.0   0.0          0.0       0.0                     0.0                   1.0]

    aa = [0.0                  0.0                   0.0                    0.0                    1.0                   0.0                    0.0                   0.0                    0.0                    0.0                   0.0                     0.0                       0.0                  0.0      0.0                     0.0                    0.0                   0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   0.0
          0.0                  0.0                   0.0                    0.0                    0.0                   1.0                    0.0                   0.0                    0.0                    0.0                   0.0                     0.0                       0.0                  0.0      0.0                     0.0                    0.0                   0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   0.0
          0.0                  0.0                   0.0                    0.0                    0.0                   0.0                    1.0                   0.0                    0.0                    0.0                   0.0                     0.0                       0.0                  0.0      0.0                     0.0                    0.0                   0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   0.0
          0.0                  0.0                   0.0                    0.0                    0.0                   0.0                    0.0                   1.0                    0.0                    0.0                   0.0                     0.0                       0.0                  0.0      0.0                     0.0                    0.0                   0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   0.0
          0.0                  0.0                   0.0                    0.0                    0.0                   0.0                    0.0                   0.0                    1.0                    0.0                   0.0                     0.0                       0.0                  0.0      0.0                     0.0                    0.0                   0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   0.0
          0.0                  0.0                   0.0                    0.0                    0.0                   0.0                    0.0                   0.0                    0.0                    1.0                   0.0                     0.0                       0.0                  0.0      0.0                     0.0                    0.0                   0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   0.0
          0.0                  0.0                   0.0                    0.0                    0.0                   0.0                    0.0                   0.0                    0.0                    0.0                   1.0                     0.0                       0.0                  0.0      0.0                     0.0                    0.0                   0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   0.0
          0.0                  0.0                   0.0                    0.0                    0.0                   0.0                    0.0                   0.0                    0.0                    0.0                   0.0                     1.0                       0.0                  0.0      0.0                     0.0                    0.0                   0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   0.0
          0.0                  0.0                   0.0                    0.0                    0.0                   0.0                    0.0                   0.0                    0.0                    0.0                   0.0                     0.0                       1.0                  0.0      0.0                     0.0                    0.0                   0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   0.0
          0.0                  0.0                   0.0                    0.0                    0.0                   0.0                    0.0                   0.0                    0.0                    0.0                   0.0                     0.0                       0.0                  0.0      1.0                     0.0                    0.0                   0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   0.0
          0.0                  0.0                   0.0                    0.0                    0.0                   0.0                    0.0                   0.0                    0.0                    0.0                   0.0                     0.0                       0.0                  0.0      0.0                     1.0                    0.0                   0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   0.0
          0.0                  0.0                   0.0                    0.0                    0.0                   0.0                    0.0                   0.0                    0.0                    0.0                   0.0                     0.0                       0.0                  0.0      0.0                     0.0                    1.0                   0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   0.0
          -0.155117328672782   -0.02148752400639442  -0.011777149248602205   0.00589435369873271    0.18573786571126383   0.002387817857383071   0.05972644582626968  -0.026882184152349754   0.004125839553049182   0.01490781888888476  -0.04931128875161378     0.02383666823536648      -0.8720759947473878   0.88879  0.8933397183983259      0.10047788094896162   -0.10317642234024157  -3.540540011430656      36.50128739175902       1.4238271827796114  0.7443210347667154  -0.002094008046363669  -0.49621043752693844   0.11462831878910988
          0.0                  0.0                   0.0                    0.0                    0.0                   0.0                    0.0                   0.0                    0.0                    0.0                   0.0                     0.0                       0.0                  0.88879  0.0                     0.0                    0.0                   0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   0.0
          -0.52802             -0.11279              -0.031833              -0.024734               0.71526              -0.042076               0.22829               0.012267              -0.22215                0.14172              -0.26679                 0.11959                   0.42308              0.0      0.61076                 0.10946               -0.17172               0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   0.00011277
          -0.46436             -0.16131              -0.02744               -0.17087                1.3425               -0.16794                0.35818               0.09837               -1.06382                0.02255              -0.51594                -0.08949                   0.46672              0.0      0.11369                 1.10657                0.26021               0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   0.00141
          0.23292             -0.08512               0.04213               -0.14149               -0.03313              -0.15223               -0.01572               0.34762               -0.70552                0.24697              -0.21888                 0.07805                   0.56316              0.0      0.08268                 0.16054                0.68637               0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   0.00348
          0.005823            -0.002128              0.00105325            -0.00353725            -0.00082825           -0.00380575            -0.000393              0.0086905             -0.017638               0.00617425           -0.0054719999999999994   0.0019512499999999999     0.014079             0.0      0.0020670000000000003  -0.020986499999999998   0.01715925            1.025                   0.0                    0.0                 0.0                  0.0                    0.0                   8.7e-5
          0.0                  0.0                   0.0                    0.0                    0.0                   0.0                    0.0                   0.0                    0.0                    0.0                   0.0                     0.0                       0.99853              0.0      0.0                     0.0                    0.0                   0.0                     0.00147                0.0                 0.0                  0.0                    0.0                   0.0
          0.0                  0.0                   0.0                    0.0                    0.0                   0.0                    0.0                   0.0                    0.0                    0.0                   0.0                     0.0                    -681.5151384434332      0.0      0.0                     0.0                    0.0                   0.0                 17667.92083926764        680.9530619054428     0.0                  0.0                    0.0                   0.0
          0.5302576874410011   0.11326799092168953   0.031967904557231516   0.024838819819638876  -0.718291188816807     0.042254313201711226  -0.22925746650866657  -0.012318986121432444   0.22309144590170518   -0.14232059290204666   0.26792062503765895    -0.12009680853200506      -0.42487296390769047  0.0      0.390889553917532      -0.10992387876840266    0.17244772941814457   0.0                     0.0                    0.0                 1.004237883869931    0.0                    0.0                  -0.00011324790616401213
          0.0                  0.0                   0.0                    0.0                    0.0                   0.0                    0.0                   0.0                    0.0                    0.0                   0.0                     0.0                     684.4033204557566      0.0      0.0                     0.0                    0.0                   0.0                -17742.795436007593      -682.8346240188022     0.0                  1.004237883869931      0.0                   0.0
          0.0                  0.0                   0.0                    0.0                    0.0                   0.0                    0.0                   0.0                    0.0                    0.0                   0.0                     0.0                      -1.0027616541806423   0.0      0.0                     0.0                    0.0                   0.0                     1.0027616541806423     0.0                 0.0                  0.0                    1.004237883869931     0.0
          0.0                  0.0                   0.0                    0.0                    0.0                   0.0                    0.0                   0.0                    0.0                    0.0                   0.0                     0.0                       0.0                  0.0      0.0                     0.0                    0.0                   0.0                     0.0                    0.0                 0.0                  0.0                    0.0                   1.0]

(aaJulia,iaJulia,jsJulia)=buildA!(hForADense,qCols,neq)
isapprox(aaJulia,aa,rtol=0.1e-10::Float64,atol=0.0::Float64) &&
isequal(iaJulia,ia)&&
isequal(jsJulia,js)
end;

#tweaked= True
# test buildA! firmvalue example
function firmvalueTrue()::Bool

neq=4::Int64;nlag=1::Int64;nlead=1::Int64
qRows=(neq*nlead)::Int64;qCols=(neq*(nlag+nlead))::Int64

qq=zeros(Float64,4,8)

ia=5::Int64

js=[2 4 5 6 8]::Array{Int64,2}

    hForADense = [0.0  0.15118578920369088  0.0  0.3779644730092272  2.9103264421710495  -0.3779644730092272  0.0  -0.3779644730092272   -2.6457513110645907      -2.6457513110645907    0.0   0.0
                  0.0  0.0                  0.0  0.0                 0.0                 -0.3674571928024606  0.0   0.08135701799384851  -1.1102230246251565e-16   0.9186429820061515   -1.0  -0.08135701799384851
                  0.0  0.0                  0.0  0.0                 0.0                  0.0325428071975394  0.0   0.08135701799384851  -1.1102230246251565e-16  -0.08135701799384851   1.0  -0.08135701799384851
                  0.0  0.0                  0.0  0.0                 0.0                  0.0325428071975394  0.0  -0.9186429820061515    0.0                     -0.08135701799384851   0.0   0.9186429820061515]

    aa = [0.0                     0.0                     0.0                      1.0                     0.0
          0.0                     0.0                     0.0                      0.0                     1.0
          0.05714285714285713     0.1428571428571428      1.0999999999999996      -0.5428571428571428     -0.1428571428571428
          1.541941732419527e-17   3.854854331048817e-17   2.9682378349075893e-16   0.3999999999999999     -3.168156367324296e-17
          1.3655770928110281e-18  3.4139427320275695e-18  2.628735903661229e-17   -5.974399781048249e-18   1.0]

(aaJulia,iaJulia,jsJulia)=buildA!(hForADense,qCols,neq)
isapprox(aaJulia,aa,rtol=0.1e-10::Float64,atol=0.0::Float64) &&
isequal(iaJulia,ia)&&
isequal(jsJulia,js)
end;

#tweaked= True
# test buildA! firmvalue3Leads2Lags example
function firmvalue3Leads2LagsTrue()::Bool

neq=4::Int64;nlag=2::Int64;nlead=3::Int64
qRows=(neq*nlead)::Int64;qCols=(neq*(nlag+nlead))::Int64

qq=zeros(Float64,12,20)

ia=12::Int64

js=[2 6 8 9 10 12 13 14 16 17 18 20]::Array{Int64,2}

    hForADense = [0.0  0.15118578920369088  0.0  0.0  0.0  0.0  0.0  0.3779644730092272  3.521494995026971  -0.3779644730092272  0.0  -0.3779644730092272  0.0  -2.6457513110645907   0.0  0.0  0.0  0.0  0.0   0.0                  -2.6457513110645907      0.0                  0.0                  0.0
                  0.0  0.0                  0.0  0.0  0.0  0.0  0.0  0.0                 0.0                 0.0                 0.0   0.0                 0.0   0.3141101189565458   0.0  0.0  0.0  0.0  0.0  -0.10915189360855129   4.965068306494546e-17  -0.7852752973913645   0.4472135954999578   0.10915189360855129
                  0.0  0.0                  0.0  0.0  0.0  0.0  0.0  0.0                 0.0                 0.0                 0.0   0.0                 0.0   0.19343902401445667  0.0  0.0  0.0  0.0  0.0   0.03638396453618376  -9.930136612989092e-17  -0.4835975600361417   1.3416407864998738  -0.03638396453618376
                  0.0  0.0                  0.0  0.0  0.0  0.0  0.0  0.0                 0.0                 0.0                 0.0   0.0                 0.0   0.0325428071975394   0.0  0.0  0.0  0.0  0.0  -0.9186429820061515    0.0                    -0.08135701799384851  0.0                  0.9186429820061515]

    aa = [0.0                    1.0  0.0                     0.0                      0.0                      0.0                     0.0   0.0                     0.0  0.0  0.0  0.0
          0.0                    0.0  0.0                     0.0                      1.0                      0.0                     0.0   0.0                     0.0  0.0  0.0  0.0
          0.0                    0.0  0.0                     0.0                      0.0                      1.0                     0.0   0.0                     0.0  0.0  0.0  0.0
          0.0                    0.0  0.0                     0.0                      0.0                      0.0                     1.0   0.0                     0.0  0.0  0.0  0.0
          0.0                    0.0  0.0                     0.0                      0.0                      0.0                     0.0   1.0                     0.0  0.0  0.0  0.0
          0.0                    0.0  0.0                     0.0                      0.0                      0.0                     0.0   0.0                     1.0  0.0  0.0  0.0
          0.0                    0.0  0.0                     0.0                      0.0                      0.0                     0.0   0.0                     0.0  1.0  0.0  0.0
          0.0                    0.0  0.0                     0.0                      0.0                      0.0                     0.0   0.0                     0.0  0.0  1.0  0.0
          0.0                    0.0  0.0                     0.0                      0.0                      0.0                     0.0   0.0                     0.0  0.0  0.0  1.0
          0.05714285714285714    0.0  0.14285714285714285     1.3310000000000004      -0.14285714285714285     -0.14285714285714285     0.0  -1.0                     0.0  0.0  0.0  0.0
          7.709708662097634e-18  0.0  1.9274271655244088e-17  1.7957838901190924e-16  -1.9274271655244088e-17  -1.9274271655244088e-17  0.0   0.39999999999999986     0.0  0.0  0.0  0.0
          6.827885464055141e-19  0.0  1.7069713660137848e-18  1.590385221715044e-17   -1.7069713660137848e-18  -1.7069713660137848e-18  0.0  -1.5701192297648506e-17  0.0  0.0  0.0  1.0]

(aaJulia,iaJulia,jsJulia)=buildA!(hForADense,qCols,neq)
isapprox(aaJulia,aa,rtol=0.1e-10::Float64,atol=0.0::Float64) &&
isequal(iaJulia,ia)&&
isequal(jsJulia,js)
end;

#tweaked= True
# test buildA! example7 example
function example7True()::Bool

neq=4::Int64;nlag=1::Int64;nlead=1::Int64
qRows=(neq*nlead)::Int64;qCols=(neq*(nlag+nlead))::Int64

qq=zeros(Float64,4,8)

ia=5::Int64

js=[4 5 6 7 8]::Array{Int64,2}

    hForADense = [0.0  0.0  0.0  -0.1333588423723936      -1.785936255891603   -2.1170666951254504  -0.3922318893305694     -2.5504927879083263   2.550492787908326        5.0735293435635125       0.0                   0.0
                  0.0  0.0  0.0  -0.00018586476390038354   0.9167506148849223  -0.7100580642063363  -0.0005466610702952457   0.7035527974698239  -0.7035527974698239       2.0166160408230382e-16   0.0                   0.0
                  0.0  0.0  0.0   0.0                      0.0                  0.0                  0.0                     0.9714485500374335   1.1102230246251565e-16   0.09237233811418613      0.9160251471689219   -0.9999999999999998
                  0.0  0.0  0.0   0.0                      0.0                  0.0                  0.0                    -0.6885514499625667   1.1102230246251565e-16  -1.007627661885814       -0.08397485283107814   1.0000000000000004]

    aa = [0.0                     0.0                  0.0                  0.0                     1.0
          -0.0002641802641803053   1.3030303030303032  -1.0092463092463095  -0.0007770007770009198   1.0
          0.026418026418026434   -0.3030303030303031   0.9246309246309247   0.07770007770007775     7.932817421603975e-17
          0.029059829059829047   -0.3333333333333333   1.0170940170940161   0.08547008547008543    -0.34000000000000047
          0.02905982905982906    -0.3333333333333333   1.0170940170940166   0.08547008547008547     0.6599999999999998]

(aaJulia,iaJulia,jsJulia)=buildA!(hForADense,qCols,neq)
isapprox(aaJulia,aa,rtol=0.1e-10::Float64,atol=0.0::Float64) &&
isequal(iaJulia,ia)&&
isequal(jsJulia,js)
end;

#tweaked= True
# test buildA! oneEquationNoLead example
function oneEquationNoLeadTrue()::Bool

neq=1::Int64;nlag=1::Int64;nlead=1::Int64
qRows=(neq*nlead)::Int64;qCols=(neq*(nlag+nlead))::Int64

qq=zeros(Float64,1,2)

ia=1::Int64

js=hcat([2])::Array{Int64,2}

    hForADense = [0.0  2.0  3.0]
    aa = [-0.6666666666666666]

(aaJulia,iaJulia,jsJulia)=buildA!(hForADense,qCols,neq)
isapprox(aaJulia,aa,rtol=0.1e-10::Float64,atol=0.0::Float64) &&
isequal(iaJulia,ia)&&
isequal(jsJulia,js)
end;

#tweaked= True
# test buildA! reliablePaperExmpl example
function reliablePaperExmplTrue()::Bool

neq=5::Int64;nlag=1::Int64;nlead=1::Int64
qRows=(neq*nlead)::Int64;qCols=(neq*(nlag+nlead))::Int64

qq=zeros(Float64,5,10)

ia=6::Int64

js=[4 6 7 8 9 10]::Array{Int64,2}

    hForADense = [0.0  0.0  0.0  0.17677669529663687  0.0   2.474873734152916     0.0                     -3.075914498161482    -1.1667261889578033   0.8838834764831843   0.0                 0.0                  2.5455844122715705      0.0                   1.237436867076458
                  0.0  0.0  0.0  0.04564354645876366  0.0  -0.09128709291752783  -4.3021142204224816e-16  -0.06390096504226897  -1.3236628473041516   0.5933661039639303   0.0                 0.0                 -1.3877787807814457e-16  0.0                   0.6846531968814576
                  0.0  0.0  0.0  0.0                  0.0   0.0                   0.0                      0.0                   0.3969847178042136   0.0                 -0.1850509058906917  0.6089185297177357  -0.5557786049258988      0.39698471780421335  -0.7939694356084271
                  0.0  0.0  0.0  0.0                  0.0   0.0                   0.0                      0.0                   0.17185720889240505  0.0                  0.9076903413717945  0.2514047591566049  -0.2406000924493667      0.17185720889240488  -0.34371441778481004
                  0.0  0.0  0.0  0.0                  0.0   0.0                   0.0                      0.0                   0.17185720889240505  0.0                 -0.0923096586282055  1.2514047591566049  -0.24060009244936675     0.17185720889240486  -0.3437144177848101]

    aa = [0.0                     0.0                      0.0                      0.0                      1.0                      0.0
          7.990962997312301e-18   2.696617480125864e-16    8.478666614897874e-32   -2.325857155830202e-16    2.335410683562626e-16   -8.237001106537891e-17
          -8.150798377340605e-18   1.3041277403744967e-16   1.3513478014550685e-31  -4.3470924679149895e-17   2.6082554807489935e-16  -1.3041277403744967e-16
          -0.037037037037037174   -1.037037037037037       -3.0545472267451886e-16   1.1629629629629634      -0.48148148148148145      0.07407407407407422
          -0.18518518518518493    -1.1851851851851856       8.290913901165517e-16    1.814814814814815        2.1925925925925935      -1.629629629629631
          -0.0666666666666664      0.13333333333333333      6.283640009304387e-16    0.09333333333333296      1.9333333333333333      -0.866666666666667]

(aaJulia,iaJulia,jsJulia)=buildA!(hForADense,qCols,neq)
isapprox(aaJulia,aa,rtol=0.1e-10::Float64,atol=0.0::Float64) &&
isequal(iaJulia,ia)&&
isequal(jsJulia,js)
end;

#tweaked= True
# test buildA! athan example
function athanTrue()::Bool

neq=9::Int64;nlag=1::Int64;nlead=1::Int64
qRows=(neq*nlead)::Int64;qCols=(neq*(nlag+nlead))::Int64

qq=zeros(Float64,9,18)

ia=12::Int64

js=[1 2 3 4 9 10 11 12 13 14 16 18]::Array{Int64,2}

    hForADense = [1.8166326220051578  0.22054780283043704  -0.08458181443628017  0.26298304761587454  0.0  0.0  0.0  0.0  0.28867513459481287  -2.886751345948129      0.6235382907247957    -0.28867513459481287   -0.5773502691896257   3.175426480542942  0.0  -0.8660254037844386  0.0  -0.28867513459481287   1.7320508075688776    0.0                      0.0                   0.0                   0.0                    0.0   0.0                   0.0   0.0
                  0.0                 0.0                   0.0                  0.0                  0.0  0.0  0.0  0.0  0.0                  -0.2775204536090702    -0.7236369507076094     0.27752045360907       0.04812923809603137  0.0                0.0   0.0                 0.0   0.05283121635129678   0.10566243270259362   1.0                     -0.05283121635129678  -0.10566243270259355  -0.052831216351296846  -1.0  -0.15849364905389032   0.0  -0.05283121635129678
                  0.0                 0.0                   0.0                  0.0                  0.0  0.0  0.0  0.0  0.0                   0.015479546390929903   0.040363049292390735  -0.015479546390929955   0.04812923809603137  0.0                0.0   0.0                 0.0   0.05283121635129678  -1.894337567297406    -1.0000000000000007       0.9471687836487033    0.8943375672974065   -0.0528312163512969     0.0   1.8415063509461098    0.0  -0.05283121635129678
                  0.0                 0.0                   0.0                  0.0                  0.0  0.0  0.0  0.0  0.0                   0.015479546390929876   0.040363049292390735  -0.015479546390929955  -0.8628707619039687   0.0                0.0   0.0                 0.0   0.05283121635129678   0.10566243270259362  -2.7755575615628914e-17  -0.05283121635129678   0.8943375672974065   -0.05283121635129696    0.0  -0.15849364905389032  -1.0  -0.05283121635129678
                  0.0                 0.0                   0.0                  0.0                  0.0  0.0  0.0  0.0  0.0                   0.015479546390929848   0.040363049292390735  -0.015479546390929955   0.04812923809603137  0.0                0.0   0.0                 0.0   0.05283121635129678   0.10566243270259368  -2.7755575615628914e-17  -0.05283121635129678  -0.10566243270259355   0.9471687836487028     0.0  -0.15849364905389032   0.0  -0.05283121635129678
                  0.0                 0.0                   0.0                  0.0                  0.0  0.0  0.0  0.0  0.0                   0.01547954639092982    0.040363049292390735  -0.015479546390929955   0.04812923809603137  0.0                0.0   0.0                 0.0   0.05283121635129678   0.10566243270259373  -1.3877787807814457e-17  -0.05283121635129678  -0.10566243270259355  -0.05283121635129701    1.0  -0.15849364905389032   0.0  -0.05283121635129678
                  0.0                 0.0                   0.0                  0.0                  0.0  0.0  0.0  0.0  0.0                   0.015479546390929792   0.040363049292390735  -0.015479546390929955   0.04812923809603137  0.0                0.0   0.0                 0.0   0.05283121635129678   0.10566243270259379   0.0                     -0.05283121635129678  -0.10566243270259355  -0.05283121635129707    0.0   0.8415063509461097    0.0  -0.05283121635129678
                  0.0                 0.0                   0.0                  0.0                  0.0  0.0  0.0  0.0  0.0                   0.015479546390929768   0.040363049292390735  -0.015479546390929955   0.04812923809603137  0.0                0.0   0.0                 0.0   0.05283121635129678   0.10566243270259384   1.3877787807814457e-17  -0.05283121635129678  -0.10566243270259355  -0.052831216351297124   0.0  -0.15849364905389032   1.0  -0.05283121635129678
                  0.0                 0.0                   0.0                  0.0                  0.0  0.0  0.0  0.0  0.0                   0.015479546390929744   0.040363049292390735  -0.015479546390929955   0.04812923809603137  0.0                0.0   0.0                 0.0  -0.9471687836487033    0.1056624327025939    2.7755575615628914e-17  -0.05283121635129678  -0.10566243270259355  -0.05283121635129717    0.0  -0.15849364905389032   0.0   0.9471687836487033]

    aa = [0.0                      0.0                     0.0                      0.0                      0.0                      1.0                      0.0                      0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                     0.0                      0.0                      0.0                      0.0                      1.0                      0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      1.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      0.0                      1.0                      0.0                      0.0                      0.0
          0.0                      0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      0.0                      0.0                      0.0                      0.0                      1.0
          -1.0488333333333335      -0.12733333333333327     0.04883333333333332     -0.1518333333333333      -0.16666666666666663      1.6666666666666665      -0.3599999999999998       0.16666666666666663      0.3333333333333332      -1.833333333333333        0.49999999999999983      0.16666666666666663
          6.304623063517449e-16    7.654110949511089e-17  -2.935411659956479e-17    9.126826014403933e-17    1.0018469829202999e-16   0.2929999999999995       0.7640000000000003      -0.29300000000000004     -2.152437643345152e-16    1.10203168121233e-15    -3.0055409487609004e-16  -8.721741474738215e-17
          -2.097666666666667       -0.2546666666666666      0.09766666666666665     -0.30366666666666664     -0.3333333333333333       3.626333333333333        0.04400000000000066      0.04033333333333321     -0.2443333333333335      -3.666666666666667        0.9999999999999998       0.3333333333333333
          7.323507114720839e-16    8.891084436114285e-17  -3.4098007065202694e-17   1.0601803561911145e-16   1.1637545073448017e-16  -6.61835592350909e-16     3.602504626006205e-16   -1.4750943238491045e-16   0.9109999999999998       1.2801299580792824e-15  -3.491263522034405e-16   -1.1135953957625494e-16
          3.0795340995299117e-16   3.738700225712461e-17  -1.4338208980808262e-17   4.4580574680943096e-17   4.8935866828697136e-17  -2.5975712622625137e-16   1.81346476627398e-16    -7.263524130929158e-17   -1.0689674538757803e-16   5.382945351156686e-16   -1.4680760048609143e-16  -2.79075831793463e-17
          4.389527879648556e-16    5.329094708487997e-17  -2.043749672234271e-17    6.354457172032153e-17    6.97525485404188e-17    -4.203023144809528e-16    1.9247646244926505e-16  -8.20929537003171e-17    -1.4159121490711417e-16   7.67278033944607e-16    -2.0925764562125641e-16  -6.562217008726207e-17
          5.408411930851947e-16    6.566068195091192e-17  -2.5181387187980613e-17   7.829434719539367e-17    8.594330098286899e-17   -5.409303590711106e-16    2.1115596483858328e-16  -9.09909286497608e-17    -1.7628568442665029e-16   9.453763108115593e-16   -2.57829902948607e-16     1.0]

(aaJulia,iaJulia,jsJulia)=buildA!(hForADense,qCols,neq)
isapprox(aaJulia,aa,rtol=0.1e-10::Float64,atol=0.0::Float64) &&
isequal(iaJulia,ia)&&
isequal(jsJulia,js)
end;

#tweaked= True
# test buildA! habitmod example
function habitmodTrue()::Bool

neq=12::Int64;nlag=4::Int64;nlead=1::Int64
qRows=(neq*nlead)::Int64;qCols=(neq*(nlag+nlead))::Int64

qq=zeros(Float64,12,60)

ia=31::Int64

js=[1 3 4 5 13 15 16 17 25 27 28 29 37 38 39 40 41 43 48 49 50 51 52 53 54 55 56 57 58 59 60]::Array{Int64,2}

    hForADense = [-0.19609172880737902   0.0  -0.09275020517497523   -0.004426303566935583    -0.08703729654042955   0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.5227572181487948    0.0  -0.09353151501535015    0.1473670163231922      0.11832144861886483   0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.5142005069425739    0.0   0.10618171141962257   -0.25861458995965403    0.027924209926155477   0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.6329719962262681    0.22948459121837936    0.20840006988162618    0.35542884565924965    0.2000679917094853    0.0  0.00037955236792832687  0.0  0.0  0.0  0.0  0.25819888974716115    3.3595693047216795    5.551115123125783e-17   -3.6147844564602556      -4.131182235954578     -0.25819888974716115   157.90045036518043     -97.66171740233433        -7.229568912920511   -3.423412603357455     -3.615322845383216       -3.7423647699579714    -0.22724012765555193    0.0                   0.0                    3.6147844564602556      0.0                   3.8729833462074166     -154.91933384829667         3.6147844564602556       3.6200928758781017       3.599530066053994       3.599530066053994        3.599530066053994        0.0
                  -0.036440929199013906  0.0  -0.017236339750440807  -0.0008225671520010209   -0.016174674884012842  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.09714718152924384   0.0  -0.01738153535225817    0.027386116899293163    0.021988400826840802  0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.09555703538111843   0.0   0.019732398972694385  -0.04805993613228388    0.005189327275792476   0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.11762907002619045   0.042646529722159945   0.03872826374581952    0.06605152332905824    0.03717986253278371   0.0  7.053454549620841e-5    0.0  0.0  0.0  0.0  0.04798268401102613    0.6253856599119051    4.440892098500626e-16   -0.6717575761543659      -0.047982684011026025  -0.04798268401102613    -0.16574108546036315  -18.176459744448092       -2.063255412474126   -0.6361937704190737    -1.3905424781742832      -0.6954666086547895    -0.04222942728606933    0.0                   0.0                    0.6717575761543664      0.0                  -9.71445146547012e-17      1.3322676295501878e-15   0.6717575761543664       1.391430472112074        0.6689227591829949      1.3845747590191702       0.6689227591829949       0.0
                  -0.021481097087259884  0.0  -0.010160429378355004  -0.00048488458558304135  -0.009534602140379713  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.05726604902928258   0.0  -0.010246018875874355   0.01614349164215834     0.0129616610590636    0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.05632869412254385   0.0   0.011631799391889961  -0.02833023681769989    0.003058990137712529   0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.06933965541101136   0.025139157138210712   0.022829428662523462   0.038935867349708095   0.021916681443438987  0.0  4.1578506726189655e-5   0.0  0.0  0.0  0.0  0.028284698453190243   0.36744508653329294   3.122502256758253e-17   -1.2174050649691517      -0.028284698453190225  -0.028284698453190243   -0.097700591790018    -10.683356622485737       -0.3948227468626885  -1.196441012169616      0.000521683325315471    -0.40996171255328756   -0.024893284760038045   0.0                   0.0                    1.2174050649691515      0.0                   7.632783294297951e-17    -5.773159728050814e-15    0.3959857783446626       2.0122792321330962e-16   1.2122676155949819     -0.0005782113750163326    0.394314718360048        0.0
                  -0.015327421901668019  0.0  -0.007249778125927869  -0.00034598003010072374  -0.006803231188635174  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.040861083144305275  0.0  -0.007310848858651704   0.011518876636527287    0.009248542883618184  0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.040192251656377936  0.0   0.008299645778371407  -0.020214493259591924   0.0021826833258702205  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.049475971766413065  0.017937559992604418   0.01628949785307101    0.027781936069284894   0.01563822470535176   0.0  2.9667540351633974e-5   0.0  0.0  0.0  0.0  0.020182000239206785   0.2621833439936799    1.0408340855860843e-17  -3.191891195797325e-16   -0.020182000239206896  -0.020182000239206785   -0.06971237010498565   -8.491558629145203       -0.2817181446998356   0.014958494937295078   0.00037223706003898516  -1.1611761301818164    -0.01776212250638525    0.0                   0.0                    9.71445146547012e-17    0.0                   9.71445146547012e-17     -4.773959005888173e-15    1.1512038722838436       8.326672684688674e-17   -2.42861286636753e-17   -0.0004125715580175736    1.1463457919428055       0.0
                  -0.011916343170580507  0.0  -0.005636358456977222  -0.00026898305503023556  -0.005289189403976049  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.031767553094899474  0.0  -0.005683838053577662   0.008955379960246505    0.007190303205331015  0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.03124756835222301   0.0   0.006452580735614149  -0.015715809236938234   0.0016969327073161039  0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.03846522018176911   0.013945601673113308   0.012664311567785866   0.021599136910865534   0.01215797760139568   0.0  2.3065104759636238e-5   0.0  0.0  0.0  0.0  0.015690547455534855   1.1008976137839335    9.789391519632318e-14    2.1999416177642672e-13  -0.015690547455534717  -0.01569054745553481    -0.05419805957888091  -28.96265024068274        -1.1140288693459617   0.01162951996325651    0.0016056733618589093   -0.007752957285432984  -0.013809207352774503   0.0                   0.0                   -1.700029006457271e-16   0.0                  -5.898059818321144e-17    -4.107825191113079e-15   -1.4224732503009818e-16  -1.8735013540549517e-16  -2.463307335887066e-16  -0.0016314768322519234   -1.9081958235744878e-16   0.0
                  0.0                   0.0   0.0                    0.0                      0.0                   0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.3906896489081941    0.0  -0.04034891598592209   -0.029821373503046544    0.04767756798661511   0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.31131626563150777   0.0   0.034891641307890534   0.11587360020757319   -0.08733887614430949    0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.20148966579817226   0.0                    0.059476825800625556  -0.06219635331504484    0.1024599094040698    0.0  0.0                     0.0  0.0  0.0  0.0  0.0                   -0.09023682106260444   0.1918562158355075       0.46752005891506343     -0.1857805913035267    -0.350659846250979       0.0                   -0.00032166684667857845   0.0                  0.0                    0.0                      0.0                   -0.21882098413508738   -0.20699983216771603  -0.008862425323440754  -0.6288275559548042      0.21882098413508733   0.21882098413508744      -0.7150157933160823       0.21882098413677653      6.511458039426543e-14    0.1534241356060192     -0.00043163011584931854  -0.10228201797375835      0.24162948649328847
                  0.0                   0.0   0.0                    0.0                      0.0                   0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.10973971095957126   0.0  -0.05376923362461419    0.0012751668937180834  -0.02936753091680626   0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.1379237635115031    0.0  -0.04049770627558791    0.05150763970169496    0.09147602078244549    0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.16343996414672046   0.0                    0.13016821012173285   -0.11505851171391082    0.08669868221571009   0.0  0.0                     0.0  0.0  0.0  0.0  0.0                    0.5714627981269527   -0.4826131332094451       0.2806141465237663      -0.046598223800856764   0.08507629711263573     0.0                    0.0004166833090864455    0.0                  0.0                    0.0                      0.0                    0.2834580333921396     0.49785893766781497   0.04514124596344121   -0.9426204480042174      0.12722934057770885  -0.2834580333921397        1.719697062302977       -0.28345803339736353     -2.0183854587685346e-13  -0.36900308742048205     0.0010381211844073257    0.2460002806653132      -0.3398048289886377
                  0.0                   0.0   0.0                    0.0                      0.0                   0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.169139760316821     0.0  -0.08347052466007733    0.034455815229675994   -0.13135198752771252   0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.051836840375820314  0.0  -0.14070877563018824    0.008424488613156691   0.3051957615909518     0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.6674566491237345    0.0                    0.21623301447128682   -0.21960542108971337    0.06433596581055886   0.0  0.0                     0.0  0.0  0.0  0.0  0.0                    0.2687129665288699    0.17089259263487835      0.08591979219508177      0.19797776080202134    0.6032857113241733      0.0                   -0.0003643862884180001    0.0                  0.0                    0.0                      0.0                   -0.04917848236448588   -0.14596006955960728  -0.04631548781041184    0.131807606027575      -0.05236012434833889  -0.8626416428532838       -0.5041731378994139       0.2478818288563911       2.3647750424515834e-14   0.10818268435617237    -0.0003043517527218931   -0.07212126841751801      0.06902671102265515
                  0.0                   0.0   0.0                    0.0                      0.0                   0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.05730889005407926   0.0   0.026731158855228178   0.0018993527124059797   0.028375548401975346  0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.17684970390179078   0.0   0.02908680073506784   -0.04787137199228462   -0.030400945665953624   0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.16927461598534033   0.0                   -0.019747805471213256   0.08002564696374621    0.003063913561676057  0.0  0.0                     0.0  0.0  0.0  0.0  0.0                    0.12064124965744825  -0.3774252020158946      -0.03497515590816981     -0.14224242397531336   -0.06230916011041324     0.0                    0.00032021490718923956   0.0                  0.0                    0.0                      0.0                    0.31850356505029687   -0.7674771245012717    1.1921277191477038     0.7955827882867935      0.11806663812627077   0.05305206344805852      -2.651008260638177       -0.21783327019407217      1.0347278589506459e-13   0.5688386951377756     -0.0016003212982887982   -0.3792230564665357      -0.23067470806137508
                  0.0                   0.0   0.0                    0.0                      0.0                   0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.15322288821768182   0.0   0.05551275033860382    0.008111685931683828    0.05599037028702489   0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.4257825120306623    0.0   0.05633944497679536   -0.11517108469806882   -0.041268653284723955   0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.3458643590837511    0.0                   -0.021903345581088064   0.17118796099394581    0.017707035901048215  0.0  0.0                     0.0  0.0  0.0  0.0  0.0                    0.48187343524807613   0.5042730875446421      -0.06554636648868406     -0.33422599474759623   -0.09131169063787736     0.0                    0.0009687260585619737    0.0                  0.0                    0.0                      0.0                    0.16702772350495387    0.10405768060612999  -0.6714280240445754    -0.055789703842402866    0.2922866355966741    0.03430272616684392       0.3594345187148571      -0.6589973187492388       1.5487611193520934e-14  -0.07712547171166315     0.00021697809251677858   0.05141660960113861     -0.17952089182959158
                  0.0                   0.0   0.0                    0.0                      0.0                   0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.5361526280813891    0.0  -0.1459605204847139    -0.03659027144870569    -0.1295637043375792    0.0  0.0  0.0  0.0  0.0  0.0  0.0   1.3016116804402749    0.0  -0.12818328267526416    0.35490503214137903    0.02922087290991436    0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.8480942326632923    0.0                    0.002391408011177272  -0.45964505022591357   -0.07070327679330324   0.0  0.0                     0.0  0.0  0.0  0.0  0.0                    0.541578401872057     0.019378263395178702     0.19079711258732496      0.9581622706970071     0.08147522577658256     0.0                    0.00022990431616534278   0.0                  0.0                    0.0                      0.0                    0.03191658235565936    0.04482615531032252  -0.06662912721047314   -0.21755221145869397    -0.8733429165696778    0.1691752497664621        0.15483785018012353     -0.15639749399131198     -4.929390229335695e-14   -0.03322424979286842     9.34702139949728e-5      0.022149339809253765    -0.03640494564028194
                  0.0                   0.0   0.0                    0.0                      0.0                   0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.023624456534571542  0.0  -0.017705158864297493   0.005842595010810099   -0.02663972146593241   0.0  0.0  0.0  0.0  0.0  0.0  0.0   0.030699393960607196  0.0  -0.028277719039605985   0.007175883377943578   0.057066029644507806   0.0  0.0  0.0  0.0  0.0  0.0  0.0  -0.13847405462801546   0.0                    0.03954840368068632   -0.048099698223440325   0.010131530428061994  0.0  0.0                     0.0  0.0  0.0  0.0  0.0                    0.5838042963437544   -0.19563327365422795      0.01694555839555         0.053935549655261775   0.11404429933742109     0.0                    0.0007106534163971031    0.0                  0.0                    0.0                      0.0                   -0.8176591051718378    -0.12530821531056058   0.3454201356226913     0.12359580124719816    -0.02582432295295789  -0.15679386920289456      -0.43283780494436286     -0.48343769822905003      1.021405182655144e-14    0.09287594302387359    -0.0002612890982808258   -0.06191684793383212      0.8326392671801437]

    aa = [0.0                      0.0                      0.0                      0.0                       1.0                      0.0                      0.0                      0.0                       0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      0.0                       0.0                      0.0                     0.0                      0.0                        0.0                      0.0                     0.0                      0.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      1.0                      0.0                      0.0                       0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      0.0                       0.0                      0.0                     0.0                      0.0                        0.0                      0.0                     0.0                      0.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      1.0                      0.0                       0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      0.0                       0.0                      0.0                     0.0                      0.0                        0.0                      0.0                     0.0                      0.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      0.0                      1.0                       0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      0.0                       0.0                      0.0                     0.0                      0.0                        0.0                      0.0                     0.0                      0.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      0.0                      0.0                       1.0                     0.0                      0.0                      0.0                      0.0                      0.0                      0.0                       0.0                      0.0                     0.0                      0.0                        0.0                      0.0                     0.0                      0.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      0.0                      0.0                       0.0                     1.0                      0.0                      0.0                      0.0                      0.0                      0.0                       0.0                      0.0                     0.0                      0.0                        0.0                      0.0                     0.0                      0.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      0.0                      0.0                       0.0                     0.0                      1.0                      0.0                      0.0                      0.0                      0.0                       0.0                      0.0                     0.0                      0.0                        0.0                      0.0                     0.0                      0.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      0.0                      0.0                       0.0                     0.0                      0.0                      1.0                      0.0                      0.0                      0.0                       0.0                      0.0                     0.0                      0.0                        0.0                      0.0                     0.0                      0.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      0.0                      0.0                       0.0                     0.0                      0.0                      0.0                      1.0                      0.0                      0.0                       0.0                      0.0                     0.0                      0.0                        0.0                      0.0                     0.0                      0.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      0.0                      0.0                       0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      1.0                       0.0                      0.0                     0.0                      0.0                        0.0                      0.0                     0.0                      0.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      0.0                      0.0                       0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      0.0                       1.0                      0.0                     0.0                      0.0                        0.0                      0.0                     0.0                      0.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      0.0                      0.0                       0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      0.0                       0.0                      1.0                     0.0                      0.0                        0.0                      0.0                     0.0                      0.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      0.0                      0.0                       0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      0.0                       0.0                      0.0                     0.0                      0.0                        1.0                      0.0                     0.0                      0.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      0.0                      0.0                       0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      0.0                       0.0                      0.0                     0.0                      0.0                        0.0                      1.0                     0.0                      0.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      0.0                      0.0                       0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      0.0                       0.0                      0.0                     0.0                      0.0                        0.0                      0.0                     1.0                      0.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      0.0                      0.0                       0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      0.0                       0.0                      0.0                     0.0                      0.0                        0.0                      0.0                     0.0                      1.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      0.0                      0.0                       0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      0.0                       0.0                      0.0                     0.0                      0.0                        0.0                      0.0                     0.0                      0.0                      1.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      0.0                      0.0                       0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      0.0                       0.0                      0.0                     0.0                      0.0                        0.0                      0.0                     0.0                      0.0                      0.0                      0.0                          1.0                        0.0                      0.0                      0.0                      0.0                      0.0
          0.0                      0.0                      0.0                      0.0                       0.0                      0.0                      0.0                      0.0                       0.0                     0.0                      0.0                      0.0                      0.0                      0.0                      0.0                       0.0                      0.0                     0.0                      0.0                        0.0                      0.0                     0.0                      0.0                      0.0                      0.0                          0.0                        0.0                      0.0                      0.0                      0.0                      1.0
          0.018807785312837628     0.008895969030730231     0.0004245409417454512    0.008348025679095372     -0.20525664658010778     -0.01251661704824165     -0.025911591440817183    -0.0054542351329462755     0.23505648206055       -0.0077964099255830414    0.08453099886023938     -0.02956048449940928     -0.056584530468506235    -0.02201060162259453     -0.005080498809945386     -0.08340160690936062      0.004647506821317957   -3.640408238731114e-5    -0.024764681896131964      -0.8473113130288004       0.8887899999996406      0.8933397183978182       0.1252425628450715      -0.0784117404440801      -3.4549982093569334          36.52605207844886           1.4238271829645528       0.7259659478385401      -0.0020423694416161734   -0.4839738013309336       0.13642364672766724
          7.043675973635937e-13    3.334618889426236e-13    1.590742729801663e-14    3.126912836085451e-13    -1.8630340571903142e-12   3.3807295996659033e-13  -5.282151558722675e-13   -4.258785031712942e-13     1.830139830325947e-12  -3.815603147863768e-13    9.23140869795674e-13    -9.772573836183471e-14   -2.2741610256337737e-12  -8.243295039064767e-13   -7.499120714658763e-13    -1.2717857629838792e-12  -7.220367575663816e-13  -1.3618321888729265e-15  -9.266936613919391e-13     -6.252666897517854e-11    0.8887899999999141     -8.640669077361608e-14    9.18961268289454e-13     9.37417642486291e-13     3.5510588390259557e-12       1.7109318987243735e-9      6.59580841192769e-11    -7.595375635579745e-13    2.283938216612894e-15    5.05906321169047e-13     8.052924206419491e-13
          -2.8775763321843457e-13  -1.3546267151693504e-13  -6.473080534160725e-15   -1.2767514779848906e-13   -0.5280199999992375      -0.11279000000013795     -0.0318329999997841      -0.02473399999982649       0.7152599999992563     -0.042075999999843676     0.22828999999962232      0.012267000000039992    -0.22214999999907248      3.374879390181338e-13    0.1417200000003065       -0.2667899999994806       0.11959000000029214     5.600206558457133e-16    3.7934139755693764e-13     0.4230800000255922       3.530949153277415e-14   0.610760000000035        0.10945999999962691     -0.1717200000003829      -1.4215815620275938e-12      -6.966520243640828e-10     -2.674209286330007e-11    3.098009581066941e-13   -8.850776975901948e-16   -2.0728570669604353e-13   0.00011276999967151988
          -2.872571867914047e-13   -1.35915206752153e-13    -6.494658063360529e-15   -1.2750598206625473e-13   -0.46435999999924116     -0.16131000000013787     -0.027439999999784675    -0.17086999999982655       1.342499999999253      -0.16793999999984469      0.35817999999962385      0.09837000000003986     -1.0638199999990723       3.3586168484978467e-13   0.022550000000305884     -0.5159399999994806      -0.08948999999970583     5.551803572255046e-16    3.783476353535065e-13      0.4667200000255334       3.525091730129014e-14   0.11369000000003536      1.106569999999626        0.2602099999996177      -1.4492823025714805e-12      -6.984290184366317e-10     -2.6881061408359475e-11   3.092237998200572e-13   -9.4553220429343e-16     -2.0670623140405467e-13   0.0014099999996718762
          -2.898098051143405e-13   -1.3723115087984297e-13  -6.561963705489215e-15   -1.2855861453879421e-13    0.23292000000076296     -0.0851200000001392       0.04213000000021712     -0.14148999999982537      -0.033130000000756166   -0.15222999999984366     -0.015720000000379084     0.3476200000000402      -0.7055199999990615       3.376104953719657e-13    0.24697000000030894      -0.21887999999947508      0.07805000000029733     5.601071931129778e-16    3.8343755521552616e-13     0.5631600000257975       3.545082914311692e-14   0.08268000000003563      0.1605399999996221       0.6863699999996145      -1.4544645397536916e-12      -7.059928413651845e-10     -2.716096990596664e-11    3.1167401266637873e-13  -1.1411869108152716e-15  -2.0901331258384004e-13   0.0034799999996682597
          -0.00026741549296515965  -0.00012648591549646802  -6.036267605800808e-6    -0.00011869507042582496    0.006535897887343414    -0.0022555514084542606    0.0012542183098647125   -0.003375891901403966     -0.0015294788732587647  -0.003660947183094591    -0.0007456795774744759    0.008728580985916522    -0.01677479929575067      0.0003129542253601543    0.006458450704233267     -0.004987292253507781     0.002224088028176598    5.176056338171924e-7     0.0003521126760661395      0.013726887324587234     3.41185213518284e-16    0.002066999999999682    -0.021338612676065988     0.016807137323933807     1.0237837375432755          -0.00035211269363529885    -6.777762770952267e-13    0.0002609788732465099   -7.342152579052863e-7    -0.0001739846582725398   -0.00022289339085368736
          -2.8917578003478466e-13  -1.3677827576107658e-13  -6.527577341203864e-15   -1.2835235513415264e-13    7.646883168529761e-13   -1.3877489574220566e-13   2.1684528070389364e-13   1.7476074179230548e-13   -7.511425960694888e-13   1.5669689987033664e-13  -3.7901637874657147e-13   4.006683582666931e-14    9.336857354995558e-13    3.3842000271354736e-13   3.0791834453308646e-13    5.222711050966102e-13    2.960097579094214e-13   5.59721250628895e-16     3.8076551685767066e-13     0.9985300000256833       3.518896165149845e-14   3.5245374109888496e-14  -3.768520100737674e-13   -3.850082832307384e-13   -1.463924535010574e-12        0.001469999297829899      -2.7047706709682007e-11   3.116057796017674e-13   -1.0698123622186187e-15  -2.0787410717503448e-13  -3.3056785360062375e-13
          7.283895949201494        3.445238857704362        0.16441659634103425      3.233030865483526       -19.417999967913712        3.474260885384921       -5.473999437767281       -4.395091651954318        19.100157933104047      -3.9441568616512104       9.606329525820556       -1.037254558378479      -23.511966503183825       -8.524285519633768       -7.741093589496474       -13.202528963727207       -7.431595627417161      -0.014098605647863204    -9.590888195825308       -671.9242502474497         -5.972867740859557e-11  -1.3409600064732342e-10   9.590888195825169        9.590888195825357       33.12870575898167         17677.51172746284            680.9530619054192         -7.1085745130812175       0.01999864511857762      4.739015430934961        8.440914134370134
          0.01074195075077179      0.005080877924699448     0.00024247394427682898   0.004767923454007673      0.5016209248089589       0.11839166918211758      0.02389510494829534      0.018357143200466584     -0.6901231648252217      0.03643765422461244     -0.21509049880598455     -0.013848680869931714     0.18841709195810105     -0.012571219560951419    -0.15373679745458518       0.248450149772354       -0.1310565798942147     -2.079196745534263e-5    -0.014144195547852144      -0.4107287683858205      -1.388667356705615e-14   0.3908895539175455      -0.09577968322055427      0.1865919249660004       0.04885667343084969          0.014144196246357764       2.6920761305334952e-11   0.993754489013781        2.9493071076575164e-5    0.006988879401975928     0.012335019416080008
          -7.304022303604385       -3.4547585019629232      -0.16487090083834652     -3.2419641513854676       19.47165443413277        -3.4838607212907355       5.4891248120798855       4.407235863354005       -19.152934160331043       3.955055081418736       -9.632873067064967        1.0401206279919841      23.576933132835347        8.547839232179493        7.762483240602795        13.239009273000095        7.452130095292525       0.014137561933872014     9.617389070661233        674.7859313849361          6.000325181523519e-11   1.3471271608582654e-10  -9.617389070661094       -9.617389070661282      -33.22024469331992        -17752.41282507762           -682.8346240187783          7.128216431492565        0.9841839798868605      -4.7521099485873055      -8.464237480905737
          0.010741950750774443     0.005080877924700697     0.00024247394427688994   0.00476792345400884      -0.028636762632048642     0.005123678260429366    -0.008072799608938119    -0.006481676619173938      0.028168023991591747   -0.005816658977100251     0.014166967702685277    -0.0015296947484994762   -0.03467435394361277     -0.01257121956095449     -0.01141620455254133      -0.019470475265309695    -0.010959771362212378   -2.079196745534773e-5    -0.014144195547855601      -0.9886174586590167      -1.375190826273626e-14   1.3325133050506192e-14   0.014144195547851705     0.014144195547859876     0.048856673430890354         1.016905850433434          2.7168766969487143e-11  -0.010483394856152984     2.9493071076576144e-5    1.0112267632719085       0.012448267322247079
          -2.876656373225876e-13   -1.3606481968308377e-13  -6.493457768436233e-15   -1.2768297445621528e-13    7.606995454313998e-13   -1.380816111637093e-13    2.1571968063941803e-13   1.738038063507579e-13    -7.469910512285068e-13   1.5584418680366583e-13  -3.7699984162344216e-13   3.993306226343568e-14    9.286304461263705e-13    3.3665514780517503e-13   3.063277451759062e-13     5.194313770913483e-13    2.944563576161103e-13   5.567995156300265e-16    3.787785922453069e-13      2.5543568066438405e-11   3.517944446889553e-14   3.5259362640185036e-14  -3.7481259885295144e-13  -3.82840614533361e-13    -1.4494010569708088e-12      -6.985071195854644e-10     -2.6906494768284916e-11   3.101537579856855e-13   -9.766251226417756e-16   -2.06784191894656e-13     0.9999999999996712]

(aaJulia,iaJulia,jsJulia)=buildA!(hForADense,qCols,neq)
isapprox(aaJulia,aa,rtol=0.1e-10::Float64,atol=0.0::Float64) &&
isequal(iaJulia,ia)&&
isequal(jsJulia,js)
end;

end


text:
using BinaryBuilder

cuda_version = v"11.0.2"   # NOTE: could be less specific

sources_linux_x64 = [
    ArchiveSource("https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.0.1.13/11.0_20200626/cudnn-11.0-linux-x64-v8.0.1.13.tgz",
                  "03cbe5844ff01b3550ba5d0bbf6eab1c33630f18669978af2a7ebf7366a5c442")
]
sources_linux_ppc64le = [
    ArchiveSource("https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.0.1.13/11.0_20200626/cudnn-11.0-linux-ppc64le-v8.0.1.13.tgz",
                  "2529819229eed31c56562b2791f10cba6ce5c729e1d1816933c8ac2b6535075d")
]
sources_windows = [
    ArchiveSource("https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.0.1.13/11.0_20200626/cudnn-11.0-windows-x64-v8.0.1.13.zip",
                  "72cbf300a23fa1ef737dc217d93c7cbcf10ed4a3f5d3be2b4261dfab1ba14d8d")
]

include("../common.jl")

ext: jl


text:
printstyled("  read_nodal\n", color=:light_green)

segy_nodal = string(path, "/SampleFiles/SEGY/FORGE_78-32_iDASv3-P11_UTC190428135038.sgy")

printstyled("    Nodal SEG Y\n", color=:light_green)
S = read_nodal("segy", segy_nodal)
@test S.n == 33
@test S.id[1] == "N0.00001..OG0"
@test S.id[2] == "N0.00002..OG0"
@test S.id[S.n] == "N0.00033..OG0"
@test isapprox(S.fs[1], 2000.0)
@test isapprox(S.fs[2], 2000.0)
@test isapprox(S.fs[S.n], 2000.0)
@test S.name[1] == "43249_1"
@test S.gain[1] != NaN
@test S.units[1] == "m/m"
@test S.t[1][1,2] == 1556458718000000

printstyled("      channel unit tests\n", color=:light_green)
redirect_stdout(out) do
  S = read_nodal("segy", segy_nodal, chans=2:10, v=3)
end

printstyled("        defaults\n", color=:light_green)
S1 = read_nodal("segy", segy_nodal)

printstyled("        start channel only\n", color=:light_green)
S = read_nodal("segy", segy_nodal, chans=2:33)
@test size(S.data) == (30000, 32)
@test S1.data[:, 2:end] == S.data

printstyled("        end channel only\n", color=:light_green)
S = read_nodal("segy", segy_nodal, chans=1:32)
@test size(S.data) == (30000, 32)
@test S1.data[:, 1:end-1] == S.data

printstyled("        only one channel\n", color=:light_green)
j = 31
S = read_nodal("segy", segy_nodal, chans=j)
@test size(S.data) == (30000, 1)
@test S1.data[:, j:j] == S.data
@test S1.name[j] == S.name[1]

printstyled("        start & end channel\n", color=:light_green)
S = read_nodal("segy", segy_nodal, chans=collect(11:30))
@test size(S.data) == (30000, 20)
@test S1.data[:, 11:30] == S.data

printstyled("    Silixa TDMS\n", color=:light_green)

# Base read, no modifiers
S1 = read_nodal("silixa", fstr)
@test isapprox(S1.data, XX)
@test_throws ErrorException read_nodal("foo", fstr)

# Start and end time unit tests
printstyled("      time & channel unit tests\n", color=:light_green)
redirect_stdout(out) do
  S = read_nodal("silixa", fstr, s=2.0, t=40.0, chans=2:10, v=3)
end

printstyled("        defaults\n", color=:light_green)
S1 = read_nodal("silixa", fstr)

printstyled("        start time only\n", color=:light_green)
S = read_nodal("silixa", fstr, s=1.0)
@test size(S.data) == (59000, 448)
@test S1.data[1001:end, :] == S.data

printstyled("        start index in chunk > 1\n", color=:light_green)
S = read_nodal("silixa", fstr, s=2.0)
@test size(S.data) == (58000, 448)
@test S1.data[2001:end, :] == S.data

printstyled("        end time only\n", color=:light_green)
S = read_nodal("silixa", fstr, t=59.0)
@test size(S.data) == (59000, 448)
@test S1.data[1:59000, :] == S.data

printstyled("          end index in chunk < last\n", color=:light_green)
S = read_nodal("silixa", fstr, t=59.0)
@test size(S.data) == (59000, 448)
@test S1.data[1:59000, :] == S.data

printstyled("        start & end time\n", color=:light_green)
S = read_nodal("silixa", fstr, s=1.0, t=59.0)
@test size(S.data) == (58000, 448)
@test S1.data[1001:59000, :] == S.data

printstyled("        start channel only\n", color=:light_green)
S = read_nodal("silixa", fstr, chans=2:448)
@test size(S.data) == (60000, 447)
@test S1.data[:, 2:end] == S.data

printstyled("        end channel only\n", color=:light_green)
S = read_nodal("silixa", fstr, chans=1:447)
@test size(S.data) == (60000, 447)
@test S1.data[:, 1:end-1] == S.data

printstyled("        only one channel\n", color=:light_green)
S = read_nodal("silixa", fstr, chans=23)
@test size(S.data) == (60000, 1)
@test S1.data[:, 23:23] == S.data
@test S1.name[23] == S.name[1]

printstyled("        start & end channel\n", color=:light_green)
S = read_nodal("silixa", fstr, chans=collect(101:200))
@test size(S.data) == (60000, 100)
@test S1.data[:, 101:200] == S.data

printstyled("        all four\n", color=:light_green)
S = read_nodal("silixa", fstr, s=2.0, t=40.0, chans=2:10)
@test size(S.data) == (38000, 9)
@test S1.data[2001:40000, 2:10] == S.data