A powerful object oriented programming language.

learn more… | top users | synonyms

1
vote
0answers
19 views

FEM libraries with weak forms

I need to implement a structural analysis code, and I turn to you for advice. My needs are simple: Library must be integrable in a C++ code I want to express a weak form, without manual intervention ...
-2
votes
1answer
79 views

Understanding and implementing the Fast Fourier Transform

I need to write the fast fourier transform in C++ and I am referring to this formula from wikipedia: But for some reason I am not getting the correct output when I simply enter (1,1) (1,1) (1,1) ...
1
vote
2answers
130 views

Programming language for HPC [closed]

I'm planning on building a program that will carry out HPC. I'm aware that C/C++ is significantly better than Python in terms of the speed of computation. However, I'm not yet proficient in C/C++, so ...
0
votes
0answers
46 views

Fastest way to diagonalize square matrices with c++

I am currently writing software in c++ which solves the eigenvalue problem of sparse hermitian matrices. The size of the matrix depends on the user input, but as an estimation it will roughly be ...
0
votes
0answers
27 views

How to build a regression tree in C++

I want to build a random forest that estimates facial landmarks. A random forest is a set of regression trees, built in a certain way. The problem is that I am new to machine learning, yes I ...
6
votes
3answers
224 views

What do C, C++ and Java have that Fortran 2003 don't? [closed]

As you may know, Fortran is widely and longly (?) used in science. I've heard a lot of people saying that we natural scientists should all migrate to C++ or Java. I've seen people increasingly ...
6
votes
0answers
44 views

Library with polylogarithm function

I am looking for a reliable library where I can find polylogarithm function and newton/secant method for solving non-linear equations. Basically I have something like this: ...
2
votes
1answer
75 views

Armadillo library appears slow

I have been experimenting in building a C++ project for a FDTDS system for Electro-Magnetics. I have implemented a class [see below] which I called mesh using the Armadillo library. The 3D matrices ...
4
votes
2answers
89 views

Advice on handling many “small” matrices in parallel

I'm working on a small fun project on the side for a numerical method I've been working a bit with. Roughly, the computational problem I have to solve is the following: Assume you have a collection of ...
2
votes
0answers
33 views

FFT-based Image Rotation Algorithms More Accurate Than Chirp-Z?

We're currently using a Chirp-Z based implementation (Tong and Cox, 1999) for rotation of astronomical images. I was wondering if there were any algorithms/implementations out there that could also be ...
2
votes
1answer
92 views

Topics about the deal.II finite element library class “SparsityPattern”

When learning the deal.II FE library, I am a bit confused about the mechanism of its "SparsityPattern" class. Through reading the documentation, I only got to know that it uses the Compressed Row ...
0
votes
0answers
58 views

Solving Linear Equations using Eigen

I am trying to solve linear equations in c++ using the Eigen library. For the simple equation Ax=b, I have a sparse matrix A that is n x n, and known values for b which is n x 1, but I need to find ...
0
votes
0answers
66 views

Looking for a C/C++ implementation of the Hungarian method for real-valued cost matrix

I am looking for a C/C++ implementation of the Hungarian method for solving the linear assignment problem with real-valued cost matrix. Some implementation I found, such as this one, only work for ...
3
votes
0answers
42 views

Coupled Diff Equation from Bose Einstein distribution

I am a student doing physics hons and have had very little experience in programming. This semester we are supposed to do a computational project in thermodynamics. I have to solve these two coupled ...
2
votes
1answer
49 views

overflow upper incomplete gamma function

I want to calculate the following equation: $$\frac{\theta \Gamma \left(k+1,\frac{o}{\theta }\right)-o \Gamma \left(k,\frac{o}{\theta }\right)}{\Gamma (k)}+o+s$$ with $s>0, o>0, k>0, ...
1
vote
2answers
85 views

Traveling Salesman Problem

First off some context. The Traveling Salesman Problem(TSP) is to find the most efficient route passing through a series of points only once. However, there is no perfect function to solve for this in ...
2
votes
2answers
152 views

How to implement adaptive mesh refinement using conformal triangles

I am trying to implement adaptive mesh refinement for a finite element code. The code uses (at least for now) linear triangles and so when I do the mesh refinement I want the triangular mesh to remain ...
2
votes
1answer
95 views

Kernel of a Sparse Matrix

Given a sparse rectangular matrix $A$ (let's say, with dimension $n,m$ and number of non-zero elements $O(n)\sim O(m)$) with entries in $\mathbb Z/2\mathbb Z$ I'm looking for a basis of the kernel as ...
1
vote
1answer
93 views

Kummer's confluent hypergeometric for complex arguments in C/C++?

I need to evaluate Kummer's confluent hypergeometric function for imaginary arguments: $$_1F_1(a,b;ix)$$ where $i$ is the imaginary unit, $a,b,x$ are real, and $a,b>0$. Is there a routine ...
2
votes
0answers
137 views

C++ library for numerical intergration (quadrature)

I have my own little subroutine for numerical integration (quadrature), which is a C++ adaptation of an ALGOL program published by Bulirsch & Stoer in 1967 (Numerische Mathematik, 9, 271-278). I ...
6
votes
1answer
91 views

Using Log Gamma function to avoid overflow

I have to do some numerical calculus using gamma functions. I am using the tgamma incluided in the C++ cmath library. The ...
1
vote
1answer
97 views

Is there a single C++ IDE packed with necessary scientific libraries for computing purpose?

I am basically looking for a good open source C++ IDE with scientific and visualization libraries built in. Can any one suggest few projects?
0
votes
0answers
63 views

C++ Library: What is the Most Efficient Library that Factorizes a Polynomial?

I need to know what library is the fastest one that can factorize a polynomial of large degree whose coefficients are big integers. I have tried NTL library to factorize a monic polynomial but it is ...
17
votes
6answers
883 views

Modern C++ in scientific computing?

I am looking for books or articles, or blog-posts, or any published material in general, that address specifically the uses of C++ modern features (move semantics, the STL, iterators, lazy evaluation, ...
2
votes
1answer
110 views

Recommendation for C/C++ library which offers Schur complement functions?

I need to find C/C++ libraries which offer function for computing Schur complement. I know about MUMPS and Pastix, but I need more of them to compare them in my research. Do you have any experience ...
1
vote
1answer
55 views

Interpolation using compactly supported radial basis function

I have been struggling for two days with the following problem. I would like to do a $d$-dimensional interpolation over some data. I tried first to use polyharmonic splines, but when the size of data ...
2
votes
2answers
299 views

C++ Library: What is the common libraries that do polynomial arithmetic?

I need to know what libraries (in C++) support polynomial arithmetic specially over a field. So I can give to it an array of coefficients of polynomial over a field and it returns the roots of ...
2
votes
0answers
82 views

C++: How to find the roots of polynomial modulus N [duplicate]

I need to know what library, given a vector of coefficients and modulus N return the roots of polynomial modulus N. The library should support big integer. I'm coding in C++.
4
votes
3answers
128 views

Minimization of non-linear function

Problem Summary I am trying to estimate the (x,y) coordinates of each node in a graph, where I know the distances between connected nodes. For example Given this ...
1
vote
1answer
63 views

C++ - Starting paraller instances of an executable from a C++ code

Can I start parallel run of LAMMPS from inside a C++ code. Is it possible to compile my code and then do mpirun with my compiled code. I also have one system command inside the code, which starts ...
-2
votes
1answer
149 views

How to solve this differential equation using RK4 in C++?

I have been given the following homework question to solve: I am having trouble writing a RK4 solver in C++ for this ODE. I am also not sure how to plot my solution. Here is my code so far: ...
3
votes
1answer
124 views

Why is MPI/PETSc only showing 1 processor even though it works for helloworld?

I am a beginner with Unix and MPI. For the serial program, I run the program by typing make in /directory/buildagain and then ...
1
vote
2answers
142 views

Parallelization of element-wise matrix multiplication

I use Armadillo as an interface to OpenBLAS. In my current program, I have a loop, in which I do multiplications of the form ...
1
vote
0answers
46 views

Elemental vs DPLASMA

I want to use one of these two libraries into my C++ project to basically invert a dense matrix (with Cholesky). Of course, I am interested in a distributed environment. Both libraries seem nice so ...
6
votes
6answers
3k views

Super C++ optimization of matrix multiplication with Armadillo

I'm using Armadillo to do very intensive matrix multiplications with side lengths $2^n$, where $n$ can be up to 20 or even more. I'm using Armadillo with OpenBLAS for matrix multiplication, which ...
3
votes
1answer
200 views

Software for triangulating a point set (with restrictions)

I want to triangulate a point-set like the one below. I would like the triangulation of the point-set to have the following properties The triangles must have as vertices the black and orange ...
0
votes
0answers
28 views

Solving the Wilberforce pendulum using Runge-Kutta method [duplicate]

I'm writing a program in C++ (almost from scratch) for solving the coupled equations that rise from the Wilberforce pendulum: $m\ddot{z}+kz+\frac{1}{2}\epsilon \theta = 0$ $I\ddot{\theta}+\delta ...
1
vote
1answer
1k views

eigenvalues of a general complex matrix in C++

Is there a free C or C++ library including a routine for the eigenvalues of a general complex matrix? I checked a number of linear algebra packages like Eigen, but there does not seem to be support ...
0
votes
0answers
63 views

Sparse MatrixExp acting on a vector

I am looking for a library implemented in C++ which would be able to compute action of matrix exp on a vector $$w = e^{A}v$$ I want to operate on sparse matrices with complex entries, not on real ...
3
votes
2answers
184 views

Why is SIMD programming on such a low level in CPU's compared to GPU's?

Just speaking from my experience in c++ - Its really tricky to take advantage of the SIMD capabilities of modern CPU's for more complex algorithms. If I see an opportunity from a high level OO ...
6
votes
1answer
2k views

Applying the Runge-Kutta method to second order ODEs

How can I replace the Euler method by Runge-Kutta 4th order to determine the free fall motion in not constant gravitional magnitude (eg. free fall from 10 000 km above ground)? So far I wrote simple ...
2
votes
1answer
114 views

Mathematica NIntegrate function in C++

I am working on computing a challenging integral. I am working with someone else who wrote some code in Mathematica to compute it. I do not have mathematica so I am trying to do the same thing in C++. ...
3
votes
2answers
468 views

literature on scientific computing

Maybe, this is a dump question. But anyway. I developed a finite difference code for a class of problems in dynamo theory. I used GNU Octave (MATLAB) which is good for testing. The problem size ...
0
votes
0answers
98 views

Compute left and right eigenvectors in c++ using Eigen library

The zgeev routine of the Lapack library computes the eigenvalues and left and/or right eigenvectors of a given matrix. I want to use c++ and the eigen library to do the same. A ...
0
votes
1answer
351 views

Order of eigenvalue problem using c++ Eigen library

I have the following 6x6 matrix (taken from Google Books p. 129): For background info: All the entries depend on the momentum $k$. Getting the eigenvalues of this matrix for each $k$ corresponds to ...
2
votes
0answers
50 views

Bracket Algebra, Straightening Algorithm

My apologies if the question is simple. I need to write a code for straightening algorithm. Which includes defining bracket algebra. I tried to write it in CoCoA-5, but it wasn't possible because ...
1
vote
0answers
87 views

Get a single value from a global Vec in petsc [closed]

I don't understand the concept with local and global vec's in petsc when it come to DMDAVecGetArray and VecGetValues. I'm creating some DMDA Vec in parallel which works well. Now I want to access ...
2
votes
1answer
90 views

What are the tradeoffs of using statically allocated arrays vs. pointers and dynamic allocation? [closed]

I am learning Monte Carlo simulation by C++. I begin with reading codes (from the internet and text books) of the 2D Ising model and the XY model. I find some people define spins simply by a two ...
0
votes
1answer
49 views

Unexpected behavior, values tend to converge instead of fluctuate. (MD)

I am writing a molecular dynamics program to create an lattice and populate it with atoms/molecules. These then are given random velocities and the system is initialized. Then throughout time the ...
-2
votes
1answer
63 views

Simulating dipoles/quadrupoles

Does anyone know how to simulate in C++ the beam-dynamics of particles passing through an array of magnets like a quadrupole + dipole ? Or maybe in the thin lense approximation how to simulate a FODO ...