# Numerics

**URL:** https://discourse.julialang.org/c/domain/numerics/20.md?page=37

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 38

---

## [MatrixDepot](https://discourse.julialang.org/t/matrixdepot/17921)

<div class="topic-metadata">

**Author:** [@klacru](https://discourse.julialang.org/u/klacru)\
**Replies:** 0\
**Last updated:** [November 23, 2018, 6:36pm UTC](https://discourse.julialang.org/t/matrixdepot/17921 "2018-11-23T18:36:33Z")

</div>

A new version of MatrixDepot is available. It has a refreshed API and essential improvements accessing the remote SuiteSparse and NIST MatrixMarket matrix collections. MatrixDepot

---

## [Incorrect results for sinpi and cospi when using fastmath mode?](https://discourse.julialang.org/t/incorrect-results-for-sinpi-and-cospi-when-using-fastmath-mode/17662)

<div class="topic-metadata">

**Author:** [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Replies:** 4\
**Last updated:** [November 18, 2018, 3:35pm UTC](https://discourse.julialang.org/t/incorrect-results-for-sinpi-and-cospi-when-using-fastmath-mode/17662 "2018-11-18T15:35:25Z")

</div>

When firing up Julia with the --math-mode=fast option, I get incorrect results for sinpi and cospi functions. Is this a bug or am I missing something? With the default math mode: julia\> a = rand(5) 5-element Array{Floa…

---

## [Is the MAT package going to be updated to version 1.0?](https://discourse.julialang.org/t/is-the-mat-package-going-to-be-updated-to-version-1-0/16525)

<div class="topic-metadata">

**Author:** [@Evian](https://discourse.julialang.org/u/Evian)\
**Replies:** 3\
**Last updated:** [November 12, 2018, 1:13pm UTC](https://discourse.julialang.org/t/is-the-mat-package-going-to-be-updated-to-version-1-0/16525 "2018-11-12T13:13:30Z")

</div>

HDF5, which depends on, has already been updated but not the MAT package…

---

## [Left matrix division with singular matrix](https://discourse.julialang.org/t/left-matrix-division-with-singular-matrix/15503)

<div class="topic-metadata">

**Author:** [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Replies:** 8\
**Last updated:** [November 9, 2018, 1:45pm UTC](https://discourse.julialang.org/t/left-matrix-division-with-singular-matrix/15503 "2018-11-09T13:45:22Z")

</div>

I am confused by the result of a left matrix division (the backslash operator, documented in Base.:\\ at Linear Algebra · The Julia Language) in the case of a singular matrix: julia\> \[1.0 0; 0 0\] \\ randn(2) 2-element Arr…

---

## [Pure Julia FFT](https://discourse.julialang.org/t/pure-julia-fft/17180)

<div class="topic-metadata">

**Author:** [@bdeonovic](https://discourse.julialang.org/u/bdeonovic)\
**Replies:** 1\
**Last updated:** [November 5, 2018, 5:20pm UTC](https://discourse.julialang.org/t/pure-julia-fft/17180 "2018-11-05T17:20:03Z")

</div>

@stevengj I was told you are working on a pure julia FFT. Any updates on this endeavor?

---

## [Drastic performance hit matrix multiply different types. Internal cast julia vs numpy?](https://discourse.julialang.org/t/drastic-performance-hit-matrix-multiply-different-types-internal-cast-julia-vs-numpy/17120)

<div class="topic-metadata">

**Author:** [@davidbp](https://discourse.julialang.org/u/davidbp)\
**Replies:** 15\
**Last updated:** [November 4, 2018, 7:48am UTC](https://discourse.julialang.org/t/drastic-performance-hit-matrix-multiply-different-types-internal-cast-julia-vs-numpy/17120 "2018-11-04T07:48:00Z")

</div>

Because of several performance problems I have seen in discourse I wanted to ask why this is happening. And how is it possible it is not happening in numpy? I know we can avoid the problem I present here beeing careful…

---

## [Question on array of SVectors and \\](https://discourse.julialang.org/t/question-on-array-of-svectors-and/17010)

<div class="topic-metadata">

**Author:** [@cserteGT3](https://discourse.julialang.org/u/cserteGT3)\
**Replies:** 2\
**Last updated:** [October 31, 2018, 8:01pm UTC](https://discourse.julialang.org/t/question-on-array-of-svectors-and/17010 "2018-10-31T20:01:57Z")

</div>

I’m learning about ICP (Iterative Closest Point) and at this stage try to implement the basics myself (I know about the existing packages). I have two arrays of points, that I want to match and therefore I want to compu…

---

## [Julia 0.7 flattening of Nested Tuples](https://discourse.julialang.org/t/julia-0-7-flattening-of-nested-tuples/16860)

<div class="topic-metadata">

**Author:** [@Ultima](https://discourse.julialang.org/u/Ultima)\
**Replies:** 1\
**Last updated:** [October 28, 2018, 4:01pm UTC](https://discourse.julialang.org/t/julia-0-7-flattening-of-nested-tuples/16860 "2018-10-28T16:01:09Z")

</div>

I’ve implemented a Julia Version of a “Multiplicative Partitions of a Number”. Since 0.7 the State, start … iteration changed. I got a pre 0.7 Version of a Tuple flattener on this Page: Nested list comprehensions in Juli…

---

## [Continued development of GSL.jl](https://discourse.julialang.org/t/continued-development-of-gsl-jl/16131)

<div class="topic-metadata">

**Author:** [@ludvigak](https://discourse.julialang.org/u/ludvigak)\
**Replies:** 10\
**Last updated:** [October 19, 2018, 4:47pm UTC](https://discourse.julialang.org/t/continued-development-of-gsl-jl/16131 "2018-10-19T16:47:48Z")

</div>

I would like to check if anybody knows what the status is of the GSL package, and what the community interest is for continued development. Currently there has not been any development in a while, things are not working…

---

## [Data approximation with a curve](https://discourse.julialang.org/t/data-approximation-with-a-curve/16124)

<div class="topic-metadata">

**Author:** [@Andrey.Borzunov](https://discourse.julialang.org/u/Andrey.Borzunov)\
**Replies:** 18\
**Last updated:** [October 18, 2018, 10:38pm UTC](https://discourse.julialang.org/t/data-approximation-with-a-curve/16124 "2018-10-18T22:38:13Z")

</div>

I have a dataset with 130k points. I want to approximate them with some polynomial p(not more than 11th degree for example), so that later i could call y = p(x) for x \\in \[-90.,90\] to get approximated value. Cubic spline…

---

## [Inv() producing NaNs when called on a Tridiagonal](https://discourse.julialang.org/t/inv-producing-nans-when-called-on-a-tridiagonal/16269)

<div class="topic-metadata">

**Author:** [@mdsalerno](https://discourse.julialang.org/u/mdsalerno)\
**Replies:** 2\
**Last updated:** [October 13, 2018, 6:53pm UTC](https://discourse.julialang.org/t/inv-producing-nans-when-called-on-a-tridiagonal/16269 "2018-10-13T18:53:20Z")

</div>

I’m creating a 90x90 tridiagonal matrix using the function below, which I store in the variable A90. When I call inv(A90), I get a matrix of all NaNs, but if I call inv(Matrix(A90)), the inverse is successfully computed…

---

## [Time-dependent problems with Method of Lines using JuliaDiffEq](https://discourse.julialang.org/t/time-dependent-problems-with-method-of-lines-using-juliadiffeq/15895)

<div class="topic-metadata">

**Author:** [@mzilhao](https://discourse.julialang.org/u/mzilhao)\
**Replies:** 7\
**Last updated:** [October 5, 2018, 3:20pm UTC](https://discourse.julialang.org/t/time-dependent-problems-with-method-of-lines-using-juliadiffeq/15895 "2018-10-05T15:20:46Z")

</div>

I’m writing a code to integrate a time-dependent PDE system that I convert to a large ODE system using Method of Lines. These are very long time integrations, for now in 2+1 dimensions, which I’ll eventually generalize t…

---

## [Trouble understanding rem\_pio2\_kernel](https://discourse.julialang.org/t/trouble-understanding-rem-pio2-kernel/15409)

<div class="topic-metadata">

**Author:** [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Replies:** 2\
**Last updated:** [September 24, 2018, 4:21pm UTC](https://discourse.julialang.org/t/trouble-understanding-rem-pio2-kernel/15409 "2018-09-24T16:21:31Z")

</div>

I’m having trouble understanding Base.Math.rem\_pio2\_kernel. Consider the following: julia\> const rempio2 = Base.Math.rem\_pio2\_kernel rem\_pio2\_kernel (generic function with 2 methods) julia\> rempio2(0.0) (-1, Base.Math…

---

## [\[API Design\] Callable objects with side effect in Julia](https://discourse.julialang.org/t/api-design-callable-objects-with-side-effect-in-julia/15243)

<div class="topic-metadata">

**Author:** [@Roger-luo](https://discourse.julialang.org/u/Roger-luo)\
**Replies:** 0\
**Last updated:** [September 20, 2018, 6:13pm UTC](https://discourse.julialang.org/t/api-design-callable-objects-with-side-effect-in-julia/15243 "2018-09-20T18:13:42Z")

</div>

In a recent package we developed (https://github.com/QuantumBFS/Yao.jl) we represent quantum circuit as a tree (just think about operators compiled as a tree), which is called block in the packages. It looks natural and…

---

## [System of equation, domain error: initial value setting problem?](https://discourse.julialang.org/t/system-of-equation-domain-error-initial-value-setting-problem/15057)

<div class="topic-metadata">

**Author:** [@axelle](https://discourse.julialang.org/u/axelle)\
**Replies:** 3\
**Last updated:** [September 17, 2018, 12:31pm UTC](https://discourse.julialang.org/t/system-of-equation-domain-error-initial-value-setting-problem/15057 "2018-09-17T12:31:04Z")

</div>

Good afternoon, I have been blocked for a very long time on this so any help would really help me as I am completely stuck there. I am new to Julia so please pardon my errors. I have a system of equations (very simplif…

---

## [The integrator module](https://discourse.julialang.org/t/the-integrator-module/14365)

<div class="topic-metadata">

**Author:** [@sysk\_msk](https://discourse.julialang.org/u/sysk_msk)\
**Replies:** 4\
**Last updated:** [September 7, 2018, 9:22pm UTC](https://discourse.julialang.org/t/the-integrator-module/14365 "2018-09-07T21:22:22Z")

</div>

I want to calculate the following formula: but I can’t find the integrator module as Int() in MATLAB. how could I solve the problem using Julia?

---

## [Symplectic integration and dynamic Hamiltonian Monte Carlo](https://discourse.julialang.org/t/symplectic-integration-and-dynamic-hamiltonian-monte-carlo/14602)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 6\
**Last updated:** [September 6, 2018, 4:08pm UTC](https://discourse.julialang.org/t/symplectic-integration-and-dynamic-hamiltonian-monte-carlo/14602 "2018-09-06T16:08:22Z")

</div>

In A Conceptual Introduction to Hamiltonian Monte Carlo, Michael Betancourt talks about the instability of computing Hamiltonian trajectories, and introduces symplectic integration, especially “leapfrog” as a solution. D…

---

## [Right multiplication of Diagonal matrix](https://discourse.julialang.org/t/right-multiplication-of-diagonal-matrix/12590)

<div class="topic-metadata">

**Author:** [@pochoi](https://discourse.julialang.org/u/pochoi)\
**Replies:** 2\
**Last updated:** [August 29, 2018, 2:28am UTC](https://discourse.julialang.org/t/right-multiplication-of-diagonal-matrix/12590 "2018-08-29T02:28:56Z")

</div>

In Julia 0.7 using SparseArrays n = 1000 @time Diagonal(1:n) \* sparse(1:n, n:-1:1, 1:n) @time sparse(1:n, n:-1:1, 1:n) \* Diagonal(1:n) 0.002262 seconds (42 allocations: 110.125 KiB) 0.893608 seconds (39 allocations:…

---

## [How does cache works in JuliaDiffEq?](https://discourse.julialang.org/t/how-does-cache-works-in-juliadiffeq/14214)

<div class="topic-metadata">

**Author:** [@wsrinin](https://discourse.julialang.org/u/wsrinin)\
**Replies:** 1\
**Last updated:** [August 29, 2018, 12:15am UTC](https://discourse.julialang.org/t/how-does-cache-works-in-juliadiffeq/14214 "2018-08-29T00:15:28Z")

</div>

Hi, I am trying to understand the internal of JuliaDiffEq package. I have encountered many files names sth\_cache.jl. Can anyone explain to me what do these files do and why we need it? I tried to find the explanations i…

---

## [Repeated Solving of Linear System with the Same Structure](https://discourse.julialang.org/t/repeated-solving-of-linear-system-with-the-same-structure/14153)

<div class="topic-metadata">

**Author:** [@Juser](https://discourse.julialang.org/u/Juser)\
**Replies:** 7\
**Last updated:** [August 28, 2018, 10:57pm UTC](https://discourse.julialang.org/t/repeated-solving-of-linear-system-with-the-same-structure/14153 "2018-08-28T22:57:34Z")

</div>

UPDATE WITH MORE COMPLETE EXAMPLE The advice already provided has been extremely helpful, and I am adding this update to provide greater detail and a more concrete example in case it spurs any other thoughts/advice. The…

---

## [Finding jumps/discontinuities in a univariate function](https://discourse.julialang.org/t/finding-jumps-discontinuities-in-a-univariate-function/13919)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 4\
**Last updated:** [August 23, 2018, 8:20am UTC](https://discourse.julialang.org/t/finding-jumps-discontinuities-in-a-univariate-function/13919 "2018-08-23T08:20:32Z")

</div>

I want to find jumps (or at least one jump, if it exists) in a univariate function on a given interval. Eg looking for a jump in f(x) = x \> 0 ? one(x) : zero(x) on \[-2,2\] should give me \\approx 0. I searched the liter…

---

## [Question About Transposes and Matrix Multiplication Speed](https://discourse.julialang.org/t/question-about-transposes-and-matrix-multiplication-speed/13870)

<div class="topic-metadata">

**Author:** [@Juser](https://discourse.julialang.org/u/Juser)\
**Replies:** 9\
**Last updated:** [August 22, 2018, 6:00pm UTC](https://discourse.julialang.org/t/question-about-transposes-and-matrix-multiplication-speed/13870 "2018-08-22T18:00:48Z")

</div>

I’ve noticed that for Julia 0.7.0 that A\*c is faster than A'\*c in the following case, when I would have expected that A' would make the align the memory more easily for the computer to perform the matrix multiplication. …

---

## [How to make Julia use AVX2 instructions?](https://discourse.julialang.org/t/how-to-make-julia-use-avx2-instructions/13797)

<div class="topic-metadata">

**Author:** [@YingboMa](https://discourse.julialang.org/u/YingboMa)\
**Replies:** 1\
**Last updated:** [August 21, 2018, 3:44am UTC](https://discourse.julialang.org/t/how-to-make-julia-use-avx2-instructions/13797 "2018-08-21T03:44:30Z")

</div>

How can I make Julia use AVX2 instructions for the following code? kc = 2 Ac = rand(4\*kc) Bc = rand(kc\*4) AB = zeros(4\*4) function micro\_ker!(AB, Ac, Bc, kc::Int, offsetA::Int, offsetB::Int) MR = 4 NR = 4 fi…

---

## [No overflow nor underflow rounding mode for Floats](https://discourse.julialang.org/t/no-overflow-nor-underflow-rounding-mode-for-floats/12487)

<div class="topic-metadata">

**Author:** [@milankl](https://discourse.julialang.org/u/milankl)\
**Replies:** 6\
**Last updated:** [August 19, 2018, 3:51pm UTC](https://discourse.julialang.org/t/no-overflow-nor-underflow-rounding-mode-for-floats/12487 "2018-08-19T15:51:40Z")

</div>

Hey there, I see from the manual that different rounding modes for floats exist. However, I was wondering whether there is a smart way to set or emulate a rounding mode that is similar to RoundNearest, but without overf…

---

## [Domain Troubles with Differential Equations Solver (with non-auto-differentiable function inside the ODE def)](https://discourse.julialang.org/t/domain-troubles-with-differential-equations-solver-with-non-auto-differentiable-function-inside-the-ode-def/13650)

<div class="topic-metadata">

**Author:** [@shoshievass](https://discourse.julialang.org/u/shoshievass)\
**Replies:** 33\
**Last updated:** [August 19, 2018, 12:26pm UTC](https://discourse.julialang.org/t/domain-troubles-with-differential-equations-solver-with-non-auto-differentiable-function-inside-the-ode-def/13650 "2018-08-19T12:26:26Z")

</div>

I’m trying to solve an ODE that uses a non-auto-differentiable function inside its definition (in particular, I solve a constrained quadratic program with JuMP to define du/dt in each iteration). In principle, the soluti…

---

## [Logabsdet(singular)](https://discourse.julialang.org/t/logabsdet-singular/13706)

<div class="topic-metadata">

**Author:** [@improbable22](https://discourse.julialang.org/u/improbable22)\
**Replies:** 2\
**Last updated:** [August 19, 2018, 9:56am UTC](https://discourse.julialang.org/t/logabsdet-singular/13706 "2018-08-19T09:56:57Z")

</div>

I have lots of matrices with very small positive eigenvalues. In Julia 0.6 I was calling ld, s = logabsdet(m), but updating to v0.7, this now gives an error when det(m)==0. (It’s not physically zero, just numerical preci…

---

## [Slow exp()?](https://discourse.julialang.org/t/slow-exp/13606)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 12\
**Last updated:** [August 17, 2018, 11:10am UTC](https://discourse.julialang.org/t/slow-exp/13606 "2018-08-17T11:10:44Z")

</div>

julia\> exp(1.3) 3.6692966676192444 julia\> exp(1) 2.718281828459045 julia\> 2.718281828459045 ^ 1.3 3.669296667619244 julia\> @benchmark exp(1.3) BenchmarkTools.Trial: memory estimate: 0 bytes allocs estimate: 0 …

---

## [Comparison of automatic differentiation tools from 2016 still accurate?](https://discourse.julialang.org/t/comparison-of-automatic-differentiation-tools-from-2016-still-accurate/8341)

<div class="topic-metadata">

**Author:** [@anriseth](https://discourse.julialang.org/u/anriseth)\
**Replies:** 41\
**Last updated:** [August 16, 2018, 6:18pm UTC](https://discourse.julialang.org/t/comparison-of-automatic-differentiation-tools-from-2016-still-accurate/8341 "2018-08-16T18:18:50Z")

</div>

I was made aware of a comprehensive comparison of AD tools at a talk I attended yesterday. The best reference I could find online was these slides: http://www.autodiff.org/ad16/Oral/Srajer\_Benchmark.pdf Does anyone know…

---

## [Choosing order in QuadGK](https://discourse.julialang.org/t/choosing-order-in-quadgk/13534)

<div class="topic-metadata">

**Author:** [@sverek](https://discourse.julialang.org/u/sverek)\
**Replies:** 3\
**Last updated:** [August 16, 2018, 10:10am UTC](https://discourse.julialang.org/t/choosing-order-in-quadgk/13534 "2018-08-16T10:10:01Z")

</div>

Anybody has a rough idea how I should set the order of QuadGK for a standard mass matrix element calculation (Lagrange element) with order p^2 and BigFloat precision N i read this in documentation: It is advisable to i…

---

## [Implementing parallel computing in finite element problems](https://discourse.julialang.org/t/implementing-parallel-computing-in-finite-element-problems/13473)

<div class="topic-metadata">

**Author:** [@thehalfspace](https://discourse.julialang.org/u/thehalfspace)\
**Replies:** 6\
**Last updated:** [August 15, 2018, 3:00pm UTC](https://discourse.julialang.org/t/implementing-parallel-computing-in-finite-element-problems/13473 "2018-08-15T15:00:13Z")

</div>

Hi all, I am very new to parallel programming, and relatively new to Julia. I have a spectral element code (higher order finite element) for numerical simulation of earthquakes, that I wish to parallelize. I have read …

[Previous page](https://discourse.julialang.org/c/domain/numerics/20.md?page=36)

[Next page](https://discourse.julialang.org/c/domain/numerics/20.md?page=38)
