Need a little help with parametric types
I want to prepare a example but aren’t able to create it. Can someone help me julia> struct ModInt{N <: Integer} <: Integer k::Integer ModInt{N}(k::Integer) where {N <: Integer} =...
View ArticleUsing ModelingToolkit Variables
I am trying to simulate a heat transfer model with location-specific boundary conditions (each discrete volume element has its own Robin BC). I am using a Physics-Informed NN and have made a similar...
View ArticleJulia REPL flow coming from Matlab
Hi, I’m new to the Julia community and I have a question about how to use REPL to interface with my scripts. In Matlab, it’s easy to get into a folder and, for example, set a sequence of scripts...
View ArticleNeed help getting started with NeuralPDE.jl
I am an absolute beginner to Julia trying to get started with the first NeuralPDE.jl tutorial at: https://neuralpde.sciml.ai/dev/examples/ode/ I am using Julia 1.5.2 and understand that I need to...
View ArticleAnnotating Types: Best practice for beginners
As a beginner I’m slightly unsure of when I should be annotating my code with types. I’ve read the section on types in the Julia manual and I’m happy with the basics (type hierarchy, parametric types,...
View ArticleHow to print a number to X digits?
Hello! Suppose I have the number, “1”, how would I make it so that it would always be printed as “1.000”? Kind regards 3 posts - 3 participants Read full topic
View ArticleHow to cancel assignment output in an if clause?
I know the semicolon at a=1; will cancel the output display at the REPL, but I get the output display 1 when I use the assignment in an if-clause: if variable == check a=1; end Sorry if this a very...
View ArticleParallel version of code not giving the right answer
I’m new to parallel computing (and Julia as well for that matter). I have a very simple code that works perfectly in the regular un-parallel set-up, but that doesn’t work when distributed across...
View ArticleConversion to Gray{Bool}
I wish to convert of type(which i loaded as a bitmap)(I tried other types before) Array{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2} to an object of type ColorTypes.Gray{Bool} I wanted to...
View ArticleDual feasibility constraints, kkt conditions
Hi everyone, I’m quite new to Julia and was looking to automatically generate dual feasibility constraints, KKT conditions, strong duality constraints and add them to the initial primal problem for...
View ArticleHow to add a function to show so that in a matrix latex is shown
Hi dear community I created my own ModInt type and want to use it in a Matrix. I want to show it as rendered latex like: julia> [ModInt{5}(i+j) for i in 1:2, j in 1:2] 2×2 Array{ModInt{5},2}: 2₅ 3₅...
View ArticleStatsModels: get levels and model matrix for each level of categorical term
I have dataframe (df) with categoricals factors and i make schema fs = apply_schema(someterm, StatsModels.schema(df)) (where someterm is InteractionTerm). Then I want to get a vector of levels and...
View ArticleBigFloat loses precision on simple operations
Consider the following operation, effectively raising 1.0003 to the zeroth power, which should give 1 to high precision. But the output answer is correct only to 2 digits. What am I doing wrong?...
View ArticleFunction Composition vs Piping: Is there a performance difference?
I noticed cases where the pipe operator (e.g. |> ) is used over function composition (e.g. f(g(x))). I see composition used throughout the base code; so I assume that it’s the preferred convention....
View ArticleCompatHelper, Travis balance depletion
Is CompatHelper somehow able to trigger Travis builds on one’s github projects and forks independent of one personally pushing commits to github? Only wondering because lately I’ve simultaneously...
View ArticleReading text or csv files and assigning values to variable names
Hi, I have several large text files write out from a VBA program. The files contain numbers only (integers, floating point). I want to read these files into a Julia program. In FORTRAN or VBA you...
View ArticleCannot install the up-to-date version despite that all requirements satisfied
Hi everyone, I wanted to install a package called Isosuite (find it here https://github.com/algorithmx/Isosuite) , which has now been updated to v0.2.6. However, when I tried to install it on an HPC,...
View ArticleDocs: error and exceptions explanation
I was reading the docs carefully, and this section seems confuse: docs.julialang.org Control Flow · The Julia Language The section starts with the example of “Suppose we want to stop execution...
View ArticleCan I overload []?
Hi, I’m wondering whether I can overload . I’m wrapping a Dict{type::UUID, Vector{Element}} in another type (MyType) in order to make sure all elements are stored under the correct key via a...
View ArticleFft() function does not return the correct analytic result
Hello, currently I’m having issues understanding how to perform with success a Fourier Transformation using the fft() function of the fftw.jl package. Let’s pick the step function: using FFTW, Plots x...
View Article