Julia 1.5.3 on Ubuntu. I'm writing an iterative model, form of microsimulation and converting from R. The array sizes can get quite large as the population grows yet are all comprised of Integers, and small ones at that. Is there any advantage to using Int8 in this case in terms of either memory or speed, as opposed to what appears to me to be the default of Int64?
Is there a way to tell Julia, some global/universal setting that can be changed to use Int8 as default rather than Int64 unless otherwise instructed?
Have come across my first problem. I have a function that works with Int8 values, but when I call it as such:
Pop = InitialPop(StaNum, LayNum, MaxSts, MaxPar, MaxDay, MaxTrt)
I get this error:
ERROR: MethodError: no method matching InitialPop(::Int8, ::Int8, ....
This function simply creates an initial starting "population" or organisms so my question is:
- Is it better to just use default Int64 methods and convert the whole array to Int8 after it is produced or
- What do I need to do to make it all work in Int8 and overcome the above error?
Elucidation of glaring flaws in my logic most welcome! Thx. J