Skip to main content

Questions tagged [c++]

For questions about writing C++ computational code or utilizing libraries written with C++.

Filter by
Sorted by
Tagged with
1 vote
1 answer
749 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?
dexterdev's user avatar
1 vote
0 answers
148 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 ...
user13676's user avatar
  • 161
28 votes
9 answers
5k 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, ...
a06e's user avatar
  • 1,739
2 votes
1 answer
639 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 ...
Eenoku's user avatar
  • 141
2 votes
1 answer
745 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 ...
PinkFloyd's user avatar
  • 262
3 votes
2 answers
5k 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 ...
user13676's user avatar
  • 161
2 votes
0 answers
102 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++.
user13676's user avatar
  • 161
5 votes
3 answers
936 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 ...
Cory Kramer's user avatar
1 vote
1 answer
175 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 ...
user1313321's user avatar
-2 votes
1 answer
478 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: ...
Amir Shuhaimi's user avatar
3 votes
1 answer
989 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 <...
M K's user avatar
  • 31
1 vote
2 answers
1k 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 ...
The Quantum Physicist's user avatar
1 vote
0 answers
105 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 ...
gsamaras's user avatar
  • 113
9 votes
6 answers
14k 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 ...
The Quantum Physicist's user avatar
3 votes
1 answer
579 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 points ...
smilingbuddha's user avatar
1 vote
1 answer
4k 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 ...
Holger's user avatar
  • 13
3 votes
2 answers
1k 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 ...
user14729's user avatar
11 votes
1 answer
11k 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 ...
Marcin W.'s user avatar
  • 113
2 votes
1 answer
371 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++. ...
Progo's user avatar
  • 123
4 votes
2 answers
834 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 ...
sebastian_g's user avatar
0 votes
1 answer
2k 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 ...
DaPhil's user avatar
  • 267
3 votes
0 answers
107 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 ...
Sepehr Jafari's user avatar
1 vote
3 answers
1k views

C++ mixed integer nonlinear programming (MINLP) solver

Doing research project in material involving (mixed integer nonlinear programming) MINLP problem, we want to implement MINLP based on C++, because the majority of our project is based on C++. What ...
user40780's user avatar
  • 243
1 vote
0 answers
514 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 ...
Geeja's user avatar
  • 11
2 votes
1 answer
178 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 ...
SimMach's user avatar
  • 121
0 votes
1 answer
77 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 ...
Tommy Yardley's user avatar
1 vote
1 answer
80 views

LAPACK DGGEVX: BALANC option

I'm using DGGEVX routine from LAPACKE with BALANC option as shown below, but to my surprise changing BALANC option from 'N' to ...
Megidd's user avatar
  • 165
0 votes
1 answer
206 views

How to give a simple estimation of errors for results obtained from 4th order Runge-Kutta

This question is a follow up of another one I have asked a while ago. I have successfully implemented my problem using odeint library and I get the results I expect. However I would like to give an ...
James C's user avatar
  • 277
2 votes
1 answer
3k views

Parallel vs Serial Thomas Algorithm

I am currently writing a code that solves a large tridiagonal matrix every iteration and runs for 1,000's of iterations. I am currently using a Thomas algorithm to solve the matrix serially. I found a ...
mjaisit's user avatar
  • 21
1 vote
0 answers
708 views

Can you provide me with the source code of DMRG writen by C++?

I want to study the Density matrix renormalization Group(DMRG). Can some one provide me with the souce code which is writen by C++ for study purpose only? The code is not necessiary very professional, ...
Roger209's user avatar
  • 111
5 votes
5 answers
2k views

Speed of solving linear system with block diagonal matrix

I have a bunch of 3x3 linear systems of the form $Ax=b$. In general, would it be faster to solve each individual system, or to formulate it as a giant block diagonal system and solve that? I expect ...
Azmisov's user avatar
  • 171
0 votes
1 answer
467 views

Debugging in parallel mode using Netbeans

I want to debug a c++ code with Netbeans. I can use the debugger in sequential mode but I dont know how to debug it when I want to run it in parallel. I would be grateful if anyone help me on this ...
Nazi's user avatar
  • 5
0 votes
2 answers
2k views

Simulating a traveling sine wave

I'm trying to make an animation of a travelling sine wave (amplitude vs. position) would anyon here happen to know how to do so?
user2804865's user avatar
3 votes
1 answer
334 views

non-smooth convex c++ solver

I happened to know that there are advanced established techniques for non-smooth convex optimization in research. For example, these two papers: Nesterov, "Smooth minimization of non-smooth functions"...
user40780's user avatar
  • 243
1 vote
1 answer
1k views

How can I call the Boost C++ odeint Runge-Kutta integrator for a system of ODEs?

I would like to use Boost C++ odeint Runge-Kutta integrator on a system that looks like this : $$\ddot x = - \frac A{||x||^3} * x $$ $ x $ is a vector in 3D space, so basicaly $ x(i, j, k) $ $ \...
James C's user avatar
  • 277
-3 votes
1 answer
446 views

Solving electron density function for Hydrogen and drawing in 3D

I recently stumbled upon interesting site that has interactive 3D representation of radial electron distribution (atomic orbital). here is the url: http://winter.group.shef.ac.uk/orbitron/AOs/1s/e-...
Chem Ninjas's user avatar
3 votes
1 answer
428 views

Computing the (non-convex) boundary of a set of paths between two points

I have a set of paths between two fixed points (marked in red below). Each of these paths consists of an ordered series of $\{x, y\}$ points (marked in blue). I am trying to find the ordered set of ...
metacubed's user avatar
  • 131
9 votes
2 answers
10k views

Programming Finite Element Methods in C++

I am trying to develop a library for finite element methods in C++ and for that I am looking at the data structures for meshes. Based on what I've read up on fenics and deal.ii, the general ...
gk1's user avatar
  • 332
0 votes
1 answer
1k views

Domain Decomposition with PETSc

Does anyone have any experience on Domain Decomposition using PETSc library? I have used PETSc for creating my vectors and matrix within my C++ code. I also used KSP to solve the linear system. I ...
Nazi's user avatar
  • 5
3 votes
0 answers
1k views

total memory usage of MPI shared memory

I am trying to use the MPI share memory feature. I have several SMP nodes, and each of them has four cores. I need an array of size N for each node that should be accessed by all four cores in each ...
user4147776's user avatar
1 vote
1 answer
272 views

Windows C++ library for operations on mesh with a mex-interface in Matlab?

Please recommend me a well documented C++ library that I could wrap with a mex-interface in Matlab. The library should have the capability to read meshes (optimal in different formats, at least in ...
the_naive's user avatar
  • 111
0 votes
2 answers
128 views

How to determine the number of c points in algebraic multi grid

I am trying to write an algebraic multi-grid solver (in c++). At a given level I determine which nodes are c-points and which nodes are f-points (where the total number of c and f points equals the ...
James's user avatar
  • 1,929
8 votes
3 answers
8k views

Should I pass command line arguments to MPI_Init or not?

When writing MPI 3.0 code, should I pass argc and argv to the MPI_Init call or not, and why? ...
gnzlbg's user avatar
  • 1,085
0 votes
1 answer
668 views

Fastest linear solver for sparse positive semidefinite, striclty diagonally dominant matrix

What is the state of the art for fastest linear solver for sparse, positive semi definite and strictly diagonally dominant matrix with N varies from ~700 to ~3000, and about a 1/16 of the matrix is ...
rursw1's user avatar
  • 93
0 votes
1 answer
1k views

How can I use Scipy to fit data generated from a C++ model?

I currently have a functioning and blazing fast model written in C++ and CUDA. However, I'd like to use Scipy.minimize to fit the model to some experimental data. I was hoping it would be easy, but ...
Hair of Slytherin's user avatar
5 votes
2 answers
708 views

Machine precision and local error

I'm working with an RKF45 integrator that I have programmed using CUDA C++ on my GPU and am pondering a few questions as I'm trying to track down some issues with my code. I'm using double ...
Hair of Slytherin's user avatar
14 votes
4 answers
5k views

Looking for Runge-Kutta 8th order in C/C++

I would like to use Runge-Kutta 8th order method (89) in a celestial mechanics / astrodynamics application, written in C++, using a Windows machine. Therefore I wonder if anyone knows a good library / ...
James C's user avatar
  • 277
0 votes
2 answers
4k views

Most efficient library to diagonalize exactly large hermitian or unitary matrices

I am working on a physics problem which requires obtaining the exact eigenvalues and eigenvectors of Hermitian and Unitary matrices numerically. Naturally I would like to ask the experts what are the ...
lagoa's user avatar
  • 101
1 vote
1 answer
641 views

How to minimize the artefact of a cartesian to polar transform followed by a polar to cartesian transform?

I'm transforming cartesian images into polar images. (x,y) => (angle, radius) I fill the polar image by iterating on each of its pixels and filling them by doing the reverse polar transform. For a ...
Master of the Elephants's user avatar
3 votes
2 answers
431 views

Suggestions for open source C++ library for medium scale non-linear solver

I need to find the root of a nonlinear system (which comes out of collocation, so I will change the order to test). I will likely have about 50-300 variables, and the Jacobian is going to be ...
jlperla's user avatar
  • 376

1
3 4
5
6 7