# Tag Info

Accepted

### Why do libraries need hand-vectorized code instead of compiler auto vectorization

It is true that compilers are getting better and better at auto-vectorization, and for basic coefficient-wise operations like 2*A-4*B a library like Eigen cannot do ...
• 689
Accepted

### Compiled c++ code runs much faster with double than float. Explanation?

I have looked at your simple code example, and my suspicion is that what you observe in loss of speed is due to the C-heritage requirement that right-hand side expressions be evaluated using ...
• 3,359
Accepted

### Vectorised second order ode solving in python

Is there a way to solve for multiple initial conditions without resorting to a slow python for loop? I think the solution to your problem might be parallelization, ...

### Compiled c++ code runs much faster with double than float. Explanation?

There are multiple possible explanations: with floats and doubles the different number of computations happen due to, say, ...
• 8,672

### What exactly is Hardware Acceleration?

Hardware acceleration means any code run on specialized hardware, as opposed to software run on general purpose CPUs such as standard x86 processors on your PC. I suppose the term is inherently ...
• 1,243
Accepted

### How to compare 2D vector fields and minimize the difference?

We consider two thin infinite straight parallel wires at distance $2 a$ apart and carrying equal currents $I$ in opposite directions. We need to find an approximate ...
• 2,525

### How to vectorize 2 nested for loop with one complex condition in the inner loop?

Another approach is to use the fact that true is equal to $1$ and false is equal to $0$. If both conditions in the ...
Accepted

### Solving differential equation by setting vectorization on in MATLAB

You have not completely vectorized your code. z(1:10) is the first 10 numbers in the data of z, not the first 10 rows. For that ...
• 6,064
Accepted

### How to vectorize 2 nested for loop with one complex condition in the inner loop?

rmid = 0.5*(r_int + r_ot); rlen = 0.5*(r_ot - r_int); cc = double(abs(circ - rmid) <= rlen);
• 617