Most Popular

1500 questions
8
votes
5 answers

Polynomial interpolation on a regular hexagon

Background We know a function $f$ on the vertices of a regular hexagon, as follows $$\left( 1, \ 0, \ f_{0}\right), \ \left( \frac{1}{2}, \ \frac{\sqrt{3}}{2}, \ f_{1}\right), \ \left( - \frac{1}{2}, \ \frac{\sqrt{3}}{2}, \ f_{2}\right), \ …
nicoguaro
  • 8,500
  • 6
  • 23
  • 49
8
votes
3 answers

Accurate Way to Calculate Matrix Powers and Matrix Exponential for Sparse Positive Semidefinite Matrices

I do need to numerically calculate the following forms for any $x\in\mathbb{R}^n$, possibly in python: $x^T M^k x$, where $M\in\mathbb{R^{n\times n}}$ is a PSD sparse matrix, $n$ can be quite large in the orders of $10^3$ or higher, and where $k$…
Cupitor
  • 183
  • 6
8
votes
3 answers

Need for quad precision in scientific computing?

Even if quad precision is not directly supported by most CPUs, many Compilers (GNU, Intel) support them. Also some software packages allow to compile with quad precision, e.g. PETSc. But is there really a need for this? I asked some days ago about…
Thomas W.
  • 810
  • 5
  • 16
8
votes
2 answers

A misunderstanding or a bug in LAPACK's solver for generalized eigenvalue problems?

In my application, I have two general real matrices $A$,$B$ defined as follows, $$ A=\begin{bmatrix} -s I_3 & A_0 & 0 & 0 \\ A_0^T & -s I_3 & 0 & 0 \\ 0 & A_1 & -s I_3 & A_0 \\ A_1^T & 0 & A_0^T & -s…
user3677630
  • 215
  • 1
  • 3
8
votes
1 answer

Can this simple quadratic optimization problem be turned into a simple eigenvalue problem?

I'm interested in a type of problem on this form $$\min_{x} x^{T}Ax+x^{T}b \quad \text{s.t} \quad x^{T}x=1 $$ where $A$ is positive definite. As you can see, if it weren't for the $x^{T}b$ term in the objective, this would be equivalent to finding…
8
votes
2 answers

Large array in GMP

If I want to use large array say mpz_t A[100000], I got "Segmentation fault (core dumped)" during my compilation. Is there any easier way to solve this?
user12290
  • 275
  • 2
  • 6
8
votes
1 answer

When and when not to use automatic differentiation

I am just learning (more) about automatic differentiation (AD) and at this stage it kind of seems like black magic to me. The second paragraph of its Wikipedia article makes it sound too good to be true: it is extremely fast and is exact (no round…
tmph
  • 337
  • 1
  • 11
8
votes
1 answer

Using algebraic multigrid for preconditioning convection-diffusion operators

I implemented a Navier Stokes based on FEM discretization and PETSc for solving the linear system of equations. To create an efficient solution procedure, I follow the paper "Efficient preconditioning of the linearized Navier-Stokes equations for…
Thomas W.
  • 810
  • 5
  • 16
8
votes
1 answer

How to get sparse complex matrices from my code to PETSc efficiently

What is the most efficient way to get a complex sparse matrix from my Fortran code to PETSc? I understand that this is problem dependent, so I tried to give as many relevant details as possible below. I've been playing with the FEAST eigenvalue…
Ondřej Čertík
  • 2,930
  • 18
  • 40
8
votes
2 answers

Is there an iterative solver for dense matrices with possible zero diagonal entries?

Is there an iterative solver that can handle potentially zero entries on the central diagonal? I am implementing a polynomial fitting algorithm (up to $10^{th}$-order) and my matrix is a "Vandermonde-like" system that results in zeros for the…
niran90
  • 233
  • 1
  • 6
8
votes
3 answers

fmincg implementation in Python

I'm trying to re-implement Neural Networks in Python. I implemented the cost function and the backpropagation algorithm correctly. I have checked them by executing its Octave equivalent code. But when I'm trying to use the scipy.optimize.fmin_cg…
garak
  • 223
  • 3
  • 4
8
votes
3 answers

Is LAPACK behind the cutting edge of dense linear algebra?

I have been digging into some numerical linear algebra lately, and reading in particular about how LAPACK solves symmetric eigenvalue problems. I noticed that the *stegr routine for computing eigenvalues and eigenvectors of a symmetric tridiagonal…
Grayscale
  • 201
  • 1
  • 3
8
votes
2 answers

What happens when I use a conjugate gradient solver with a symmetric positive semi-definite matrix?

I have a symmetric positive semi-definite matrix, i.e., a laplacian and wonder what may happen when I use a CG solver, that is an algorithm for positive definite matrices. What happens when the matrix is only positive semi-definite? Can I avoid…
allo
  • 607
  • 4
  • 12
8
votes
2 answers

Helmholtz and Biharmonic equation examples with exact solution

I'm looking for examples of Helmholtz and Biharmonic equations in Cartesian co-ordinates with exact solutions, in order to compare my numerical solutions with it. I was able to find quite a few examples on the internet, where the problem with…
Johntra Volta
  • 1,403
  • 9
  • 14
8
votes
3 answers

What should be the criteria for accepting/rejecting singular values?

I am solving a system using singular value decomposition. The singular values (before scaling)…
drjrm3
  • 2,139
  • 2
  • 19
  • 22