# Numerics

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

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

**Page:** 41

---

## [Internal manipulation of complex hermitian matrix / explain the use of "RealHermSymComplexHerm" in symmetric.jl](https://discourse.julialang.org/t/internal-manipulation-of-complex-hermitian-matrix-explain-the-use-of-realhermsymcomplexherm-in-symmetric-jl/7136)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 7\
**Last updated:** [November 19, 2017, 2:23pm UTC](https://discourse.julialang.org/t/internal-manipulation-of-complex-hermitian-matrix-explain-the-use-of-realhermsymcomplexherm-in-symmetric-jl/7136 "2017-11-19T14:23:20Z")

</div>

Internal manipulation of complex hermitian matrix / explain the use of “RealHermSymComplexHerm” in symmetric.jl I think Julia handles matrices with complex elements correctly. My task is to modify the spectrum of a Her…

---

## [Accuracy of Computing Determinants](https://discourse.julialang.org/t/accuracy-of-computing-determinants/6782)

<div class="topic-metadata">

**Author:** [@Hans\_W\_Borchers](https://discourse.julialang.org/u/Hans_W_Borchers)\
**Replies:** 3\
**Last updated:** [November 19, 2017, 1:13am UTC](https://discourse.julialang.org/t/accuracy-of-computing-determinants/6782 "2017-11-19T01:13:54Z")

</div>

While trying out the R packages JuliaCall and XRJulia for calling Julia functions from R, I got interested in quite accurately determining the determinant of the 12-by-12 Hilbert matrix. julia\> A = \[1/(i+j-1) for i …

---

## [C callback for GSL](https://discourse.julialang.org/t/c-callback-for-gsl/7058)

<div class="topic-metadata">

**Author:** [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Replies:** 1\
**Last updated:** [November 14, 2017, 6:41am UTC](https://discourse.julialang.org/t/c-callback-for-gsl/7058 "2017-11-14T06:41:03Z")

</div>

I would like to add fixed points quadrature to GSL.jl and to understand how callbacks for GSL work, I read the blog post as linked in the documentation. Here is the code for Gauss-Legendre adaptive quadrature routine th…

---

## [Scientic rounding functions?](https://discourse.julialang.org/t/scientic-rounding-functions/6766)

<div class="topic-metadata">

**Author:** [@John\_Hearns](https://discourse.julialang.org/u/John_Hearns)\
**Replies:** 4\
**Last updated:** [October 30, 2017, 1:17pm UTC](https://discourse.julialang.org/t/scientic-rounding-functions/6766 "2017-10-30T13:17:00Z")

</div>

Is there an equivalent of Perl Math::Round package in Julia? Math::Round - Perl extension for rounding numbers - metacpan.org I have found this very useful in the past, the package properly rounds off floating point nu…

---

## [Interpolation with given values and gradients](https://discourse.julialang.org/t/interpolation-with-given-values-and-gradients/6654)

<div class="topic-metadata">

**Author:** [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Replies:** 10\
**Last updated:** [October 30, 2017, 10:12am UTC](https://discourse.julialang.org/t/interpolation-with-given-values-and-gradients/6654 "2017-10-30T10:12:58Z")

</div>

I need to build an interpolation on a function that is known on a grid. Interpolations.jl seems like the perfect package for this. I have two questions, however: 1- I know both the value of the function and its gradient…

---

## [Generating random group matrices](https://discourse.julialang.org/t/generating-random-group-matrices/6634)

<div class="topic-metadata">

**Author:** [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Replies:** 6\
**Last updated:** [October 24, 2017, 2:00pm UTC](https://discourse.julialang.org/t/generating-random-group-matrices/6634 "2017-10-24T14:00:15Z")

</div>

I was wondering if there was already a package out there for generating random matrices from SU(N) and SO(N). This mostly boils down to generating random points on n-spheres and is not difficult to implement for particu…

---

## [Reproducing Rump’s example](https://discourse.julialang.org/t/reproducing-rump-s-example/6473)

<div class="topic-metadata">

**Author:** [@Jorispilot](https://discourse.julialang.org/u/Jorispilot)\
**Replies:** 7\
**Last updated:** [October 17, 2017, 11:02am UTC](https://discourse.julialang.org/t/reproducing-rump-s-example/6473 "2017-10-17T11:02:58Z")

</div>

Hi everyone. New to Julia, I try to reproduce a tricky case study of floating-point arithmetic with the BigFloat module: the “Rump’s example” described in https://tel.archives-ouvertes.fr/tel-00657843v2/document page …

---

## [Exact linear algebra](https://discourse.julialang.org/t/exact-linear-algebra/6167)

<div class="topic-metadata">

**Author:** [@tkluck](https://discourse.julialang.org/u/tkluck)\
**Replies:** 10\
**Last updated:** [October 8, 2017, 4:06pm UTC](https://discourse.julialang.org/t/exact-linear-algebra/6167 "2017-10-08T16:06:54Z")

</div>

Hey all! I’ve been using Julia for algebra computations (think polynomial rings, ideals, Groebner basis, etc). Linear algebra is often fundamental to that, and Julia seems very suited to that! There’s a few choices in …

---

## [Special method for Eigenvectors of Sparse+Hermitian+Complex matrix?](https://discourse.julialang.org/t/special-method-for-eigenvectors-of-sparse-hermitian-complex-matrix/6233)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 19\
**Last updated:** [October 6, 2017, 12:36pm UTC](https://discourse.julialang.org/t/special-method-for-eigenvectors-of-sparse-hermitian-complex-matrix/6233 "2017-10-06T12:36:44Z")

</div>

After searching Google, the docs and discourse, I did not find any reference to any method that finds eigenvecs and eigenvals of Sparse, Hermitian and Complex matrices. I found a method specialized for Real and Symmetric…

---

## [In place lufact for sparse matrices and prellocation for lufact output](https://discourse.julialang.org/t/in-place-lufact-for-sparse-matrices-and-prellocation-for-lufact-output/6090)

<div class="topic-metadata">

**Author:** [@tryingtosolve](https://discourse.julialang.org/u/tryingtosolve)\
**Replies:** 1\
**Last updated:** [September 26, 2017, 5:41pm UTC](https://discourse.julialang.org/t/in-place-lufact-for-sparse-matrices-and-prellocation-for-lufact-output/6090 "2017-09-26T17:41:25Z")

</div>

Currently there is a lufact! for dense matrices. Is there an equivalent of lufact! for sparse matrices? Also, related to that, how do I preallocate for the output of lufact(A), assuming that A is a sparse matrix? This i…

---

## [Implementing parallel fluids code in Julia (parallel FFTW, MPI.jl, ...)](https://discourse.julialang.org/t/implementing-parallel-fluids-code-in-julia-parallel-fftw-mpi-jl/2689)

<div class="topic-metadata">

**Author:** [@John\_Gibson](https://discourse.julialang.org/u/John_Gibson)\
**Replies:** 34\
**Last updated:** [September 21, 2017, 6:46am UTC](https://discourse.julialang.org/t/implementing-parallel-fluids-code-in-julia-parallel-fftw-mpi-jl/2689 "2017-09-21T06:46:08Z")

</div>

I’m considering implementing a parallel fluid simulation code in Julia, either reimplementing my Fourier-Chebyshev http://www.channelflow.org code, or doing a simpler isotropic turbulence in a triply-periodic cube as a s…

---

## [How to check if LU factorization failed?](https://discourse.julialang.org/t/how-to-check-if-lu-factorization-failed/5553)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 29\
**Last updated:** [September 20, 2017, 10:41pm UTC](https://discourse.julialang.org/t/how-to-check-if-lu-factorization-failed/5553 "2017-09-20T22:41:17Z")

</div>

I am currently using lufact() in a project, but I couldn’t figure out by just reading the docs how one can check if the factorization failed. Normally, one would check if the pivots are zero, but how to do that with the …

---

## [Is wrapping GPUQREngine anywhere on the agenda?](https://discourse.julialang.org/t/is-wrapping-gpuqrengine-anywhere-on-the-agenda/5755)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 4\
**Last updated:** [September 9, 2017, 7:47am UTC](https://discourse.julialang.org/t/is-wrapping-gpuqrengine-anywhere-on-the-agenda/5755 "2017-09-09T07:47:39Z")

</div>

Is there any simple way to do QR decomposition of a sparse matrix on the GPU in Julia? I believe GPUQREngine of SuiteSparse is an obvious choice to wrap, so I wonder if anyone has gotten around to do it, or if it is anyw…

---

## [What is the dx used in finite difference approximation in Calculus.jl?](https://discourse.julialang.org/t/what-is-the-dx-used-in-finite-difference-approximation-in-calculus-jl/5773)

<div class="topic-metadata">

**Author:** [@vgdev](https://discourse.julialang.org/u/vgdev)\
**Replies:** 3\
**Last updated:** [September 8, 2017, 4:29pm UTC](https://discourse.julialang.org/t/what-is-the-dx-used-in-finite-difference-approximation-in-calculus-jl/5773 "2017-09-08T16:29:58Z")

</div>

I tried to find what the value of \\Delta x that is used in Calculus.jl for finite difference approximation (i.e. for a forward scheme \\frac{f(x+\\Delta x)-f(x)}{\\Delta x }), without luck. Is there a way to retreive it mys…

---

## [Accuracy of BigFloat - Calculating sin with high accuracy](https://discourse.julialang.org/t/accuracy-of-bigfloat-calculating-sin-with-high-accuracy/4604)

<div class="topic-metadata">

**Author:** [@timer](https://discourse.julialang.org/u/timer)\
**Replies:** 8\
**Last updated:** [September 7, 2017, 4:57pm UTC](https://discourse.julialang.org/t/accuracy-of-bigfloat-calculating-sin-with-high-accuracy/4604 "2017-09-07T16:57:07Z")

</div>

Hello, I’am trying to calcuate values of the sin-function to high precision. I want to get at least 1 million valid digits. Using the following code I test the accuracy of BigFloat: # Set precision to 7 million bits, …

---

## [How is the max operator dealt with in DualNumbers.jl?](https://discourse.julialang.org/t/how-is-the-max-operator-dealt-with-in-dualnumbers-jl/5743)

<div class="topic-metadata">

**Author:** [@vgdev](https://discourse.julialang.org/u/vgdev)\
**Replies:** 4\
**Last updated:** [September 6, 2017, 1:40pm UTC](https://discourse.julialang.org/t/how-is-the-max-operator-dealt-with-in-dualnumbers-jl/5743 "2017-09-06T13:40:34Z")

</div>

I am minimizing an objective function using a local optimization algorithm and I am supplying it with the gradient generated by ForwardDiff. However, my objective function contains functionals including the max(x,0) oper…

---

## [Is repeated calculations of eigenvalues without overwriting input matrix or allocating new arrays possible?](https://discourse.julialang.org/t/is-repeated-calculations-of-eigenvalues-without-overwriting-input-matrix-or-allocating-new-arrays-possible/5649)

<div class="topic-metadata">

**Author:** [@Sleort](https://discourse.julialang.org/u/Sleort)\
**Replies:** 8\
**Last updated:** [September 6, 2017, 3:28am UTC](https://discourse.julialang.org/t/is-repeated-calculations-of-eigenvalues-without-overwriting-input-matrix-or-allocating-new-arrays-possible/5649 "2017-09-06T03:28:18Z")

</div>

In my simulation, I need to repeatedly update a few entries of a square matrix A and then calculate the corresponding eigenvalues \\lambda. Doing \\lambda = eigvals(A) will allocate new memory each time, while \\lambda = ei…

---

## [ApproxFun failure](https://discourse.julialang.org/t/approxfun-failure/5704)

<div class="topic-metadata">

**Author:** [@chobbes](https://discourse.julialang.org/u/chobbes)\
**Replies:** 3\
**Last updated:** [September 4, 2017, 7:09am UTC](https://discourse.julialang.org/t/approxfun-failure/5704 "2017-09-04T07:09:52Z")

</div>

In v6.0, using ApproxFun returns an error: INFO: Precompiling module ApproxFun. ERROR: LoadError: LoadError: Expected \`func\_signature = ...\` with func\_signature as a call Expr... got: f(g::Fun{S, T}) where {S, T \<: Rea…

---

## [Why can forwarddiff get gradient wrt. to multiple parameters in 1 function call?](https://discourse.julialang.org/t/why-can-forwarddiff-get-gradient-wrt-to-multiple-parameters-in-1-function-call/5698)

<div class="topic-metadata">

**Author:** [@vgdev](https://discourse.julialang.org/u/vgdev)\
**Replies:** 5\
**Last updated:** [September 3, 2017, 8:49pm UTC](https://discourse.julialang.org/t/why-can-forwarddiff-get-gradient-wrt-to-multiple-parameters-in-1-function-call/5698 "2017-09-03T20:49:04Z")

</div>

I wonder how ForwardDiff.jl can compute the gradient wrt. to multiple parameters of a function my\_func(a,b,c,d,...) in one function evaluation? According to Giles, Michael B. “Monte Carlo evaluation of sensitivities in c…

---

## [Matrix Addition with multithreads!](https://discourse.julialang.org/t/matrix-addition-with-multithreads/5674)

<div class="topic-metadata">

**Author:** [@usefulhyun](https://discourse.julialang.org/u/usefulhyun)\
**Replies:** 10\
**Last updated:** [September 2, 2017, 6:01am UTC](https://discourse.julialang.org/t/matrix-addition-with-multithreads/5674 "2017-09-02T06:01:41Z")

</div>

Hi, there! I’d like to do matrix addition with multithreads. I can do matrix multiplication with multithreads via BLAS.set\_num\_threads(t). But I do not know how to do this with matrix addition. Can Anyone help me?

---

## [Finite difference approximation using Calculus, getting the values f(x),f(x+e),f(x-e)](https://discourse.julialang.org/t/finite-difference-approximation-using-calculus-getting-the-values-f-x-f-x-e-f-x-e/5681)

<div class="topic-metadata">

**Author:** [@vgdev](https://discourse.julialang.org/u/vgdev)\
**Replies:** 1\
**Last updated:** [September 3, 2017, 1:10am UTC](https://discourse.julialang.org/t/finite-difference-approximation-using-calculus-getting-the-values-f-x-f-x-e-f-x-e/5681 "2017-09-03T01:10:17Z")

</div>

I have a function f wich is slow to evaluate. So when doing finite differentiating by the use of Calculus.jl in order to approximate \\partial f/\\partial x \\approx \\frac{f(x-\\epsilon)-f(x)+f(x+\\epsilon)}{\\epsilon^2}, I a…

---

## [Getting the reciprocal condition number when computing the reordered schur factorization](https://discourse.julialang.org/t/getting-the-reciprocal-condition-number-when-computing-the-reordered-schur-factorization/5653)

<div class="topic-metadata">

**Author:** [@blegat](https://discourse.julialang.org/u/blegat)\
**Replies:** 0\
**Last updated:** [August 31, 2017, 7:27am UTC](https://discourse.julialang.org/t/getting-the-reciprocal-condition-number-when-computing-the-reordered-schur-factorization/5653 "2017-08-31T07:27:44Z")

</div>

When computing the reordered schur decomposition, LAPACK can optionally compute reciprocal condition numbers. Whether or not it does this computation depends on the JOB parameter. Currently, Julia sets this parameter to …

---

## [Givens rotation based compact QR for sparse matrices](https://discourse.julialang.org/t/givens-rotation-based-compact-qr-for-sparse-matrices/5603)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 4\
**Last updated:** [August 28, 2017, 7:03am UTC](https://discourse.julialang.org/t/givens-rotation-based-compact-qr-for-sparse-matrices/5603 "2017-08-28T07:03:49Z")

</div>

Is there any implementation/API for the QR factorization based on Givens rotations that don’t produce the Q matrix but gives an API for applying the Givens rotations to a vector possibly after inverting/transposing them?…

---

## [Why is my ForwardDiff derivative caluculation 5x as slow as just evaluating the function, when allocations are just 2x?](https://discourse.julialang.org/t/why-is-my-forwarddiff-derivative-caluculation-5x-as-slow-as-just-evaluating-the-function-when-allocations-are-just-2x/5555)

<div class="topic-metadata">

**Author:** [@vgdev](https://discourse.julialang.org/u/vgdev)\
**Replies:** 10\
**Last updated:** [August 25, 2017, 3:50pm UTC](https://discourse.julialang.org/t/why-is-my-forwarddiff-derivative-caluculation-5x-as-slow-as-just-evaluating-the-function-when-allocations-are-just-2x/5555 "2017-08-25T15:50:16Z")

</div>

So, I am trying to understand what impacts the speed of calculating the derivative of a function using ForwardDiff. I am evaluating the mean of several simulated paths of a stochastic variable. However, evaluating the de…

---

## [New to julia: Convolution and juliadiff](https://discourse.julialang.org/t/new-to-julia-convolution-and-juliadiff/5259)

<div class="topic-metadata">

**Author:** [@vgdev](https://discourse.julialang.org/u/vgdev)\
**Replies:** 19\
**Last updated:** [August 21, 2017, 8:37pm UTC](https://discourse.julialang.org/t/new-to-julia-convolution-and-juliadiff/5259 "2017-08-21T20:37:37Z")

</div>

Hi, I am sorry if this is the wrong place to ask this. But I am considering learning Julia for a stochastic analysis project I am working on. I have a numerical scheme to approximately simulate the stochastic integral Y…

---

## [Does there exists 1D FFT/IFFT implementation in pure Julia (i.e. no FFTW)](https://discourse.julialang.org/t/does-there-exists-1d-fft-ifft-implementation-in-pure-julia-i-e-no-fftw/5407)

<div class="topic-metadata">

**Author:** [@vgdev](https://discourse.julialang.org/u/vgdev)\
**Replies:** 10\
**Last updated:** [August 21, 2017, 8:02pm UTC](https://discourse.julialang.org/t/does-there-exists-1d-fft-ifft-implementation-in-pure-julia-i-e-no-fftw/5407 "2017-08-21T20:02:32Z")

</div>

Hi, I need a pure julia FFT implementation as I am planning to use it in correspondence with the ForwardDiff package. Does this exist?

---

## [@fastmath for matrices?](https://discourse.julialang.org/t/fastmath-for-matrices/5484)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 6\
**Last updated:** [August 21, 2017, 4:30pm UTC](https://discourse.julialang.org/t/fastmath-for-matrices/5484 "2017-08-21T16:30:50Z")

</div>

I wonder if there is a package that can figure out the fastest way to multiply out a few matrices by each other using dynamic programming or any other approach. For example, if I am doing A\*B\*c where A is 100x100, B is 1…

---

## [Using the DiffResult API](https://discourse.julialang.org/t/using-the-diffresult-api/5456)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 1\
**Last updated:** [August 18, 2017, 8:04pm UTC](https://discourse.julialang.org/t/using-the-diffresult-api/5456 "2017-08-18T20:04:05Z")

</div>

We are wrapping up the API for a GSOC project and I need some help about how to best integrate this into the existing Julia ecosystem. From a theoretical point of view, the API needs a simple function ℓ:ℝⁿ→ℝ (log poster…

---

## [Matrix Element-wise operations slow down in a certain size interval](https://discourse.julialang.org/t/matrix-element-wise-operations-slow-down-in-a-certain-size-interval/5401)

<div class="topic-metadata">

**Author:** [@usefulhyun](https://discourse.julialang.org/u/usefulhyun)\
**Replies:** 1\
**Last updated:** [August 16, 2017, 4:01am UTC](https://discourse.julialang.org/t/matrix-element-wise-operations-slow-down-in-a-certain-size-interval/5401 "2017-08-16T04:01:55Z")

</div>

Hi, there. Let’s see my code below. BLAS.set\_num\_threads(1) G = 10^9 M = 10^6 @printf(“sz\\tbin add(Mflops) bin mul(Mflops) sca add(Mflops) sca mul(Mflops)\\n”) for sz=\[100, 200, 500, 1000, 1500, 2000, 2500, 3000, …

---

## [Performance problem with Partitioned Matrix Multiplication by Matrix{Matrix} type](https://discourse.julialang.org/t/performance-problem-with-partitioned-matrix-multiplication-by-matrix-matrix-type/5391)

<div class="topic-metadata">

**Author:** [@usefulhyun](https://discourse.julialang.org/u/usefulhyun)\
**Replies:** 0\
**Last updated:** [August 15, 2017, 5:09pm UTC](https://discourse.julialang.org/t/performance-problem-with-partitioned-matrix-multiplication-by-matrix-matrix-type/5391 "2017-08-15T17:09:14Z")

</div>

Hi, there! First, I show you my example. BLAS.set\_num\_threads(1) block\_mat1 = Matrix(1,1) block\_mat2 = Matrix(2,2) block\_mat3 = Matrix(3,3) block\_mat4 = Matrix(4,4) block\_mat1\[1,1\] = ones(3000,3000) for i=1:2 …

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

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