# Questions tagged [c++]

A powerful object oriented programming language.

264 questions
Filter by
Sorted by
Tagged with
373 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 ...
604 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 ...
3k views

### Implementation of the Numerov Method for the 1D square well

I want to solve the Schrodinger via the Numerov Method but I had some troubles. I'm programing in C++, so here is my code: ...
330 views

### A programming model for Quantum Mechanics angular momenta in Mathematica

I'm writing prototypes for solving the Liouville Equations with Mathematica and C++. Perhaps the question about this may not be suited for this forum in a strict way, but it suits the people here ...
123 views

### How to perform an eigendecomposition of a general complex matrix with arbitrary precision in C/C++

I need to obtain the Eigenvectors of a general complex matrix, but with quadruple precision. Is anyone aware of a means to do this? I currently use Tux Eigen, and I see that in their unsupported ...
36 views

### Algorithm to join hexahedra and obtain outline volume

I would like to join several hexahedra and obtain an outline volume. First, I started with 2D implementation. In 2D, there are non-intersecting quadrangles which always touch each other as shown in ...
91 views

### Automatic differentiation via ADOL-C and the Heaviside Function

I am writting a c++ program in which I define a function $$\displaystyle F(t) = \sum_{i}r_i\,H(t-t_i)$$ where $H$ is the heaviside function, $t_i$ are optimal parameters which are mutable. The ...
2k views

### Good C++ optimization library for BFGS

To implement maximum likelihood estimators, I am looking for a good C++ optimization library that plays nicely with Eigen's matrix objects. Eigen has some capability of interfacing of its own but if ...
53 views

### Looking for a version of DSDP that is less prone to integer overflows than the original

I am working on a problem that involves semidefinite programming (constrained optimization of fairly large positive definite matrices). The software is written in C++ and calls DSDP 5.8 to solve the ...
147 views

I'm trying to numerically integrate a multi-dimensional expression. The integrand is complicated; for example this is the integrand for $N=4$: \begin{aligned}&x_1^6x_2^5x_3^3x_4^2(x_1-x_1x_2)(... 0answers 422 views ### Using C/C++ for Markov chain Monte Carlo (MCMC) methods I'm working on optimizing the parameters of a mathematical model to fit experimental data, using an existing formula for the likelihood of observing the data given a set of parameter values. At the ... 0answers 59 views ### Under what circumstances does Elemental's distributed SVD not work? [closed] I am playing around with Elemental's distributed singular value decomposition and am running into two particular issues. Building the test at tests/lapack_like/SVD.cpp, and running with ... 0answers 95 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++. 0answers 87 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 ... 0answers 122 views ### Lapack++ for QR algorithm I have recently started using Lapack++ which I found convenient for my programming purpose, in general. Now, I need to solve a matrix using QR algorithm. I've searched the user manual and I found a ... 2answers 197 views ### Inverting big symmetric and singular matrices In this post I found a very similar probem to the one I have, but not a satisfactory answer for my purposes. I have a set of matrices C_\ell. They are exactly symmetric by construction. ... 2answers 2k views ### Physics Simulation in C++ OK, I know a bit of C++ (very basic syntax), and I want to do physics simulation in C++, like stuff like (also the things mentioned here): Ripples and waves over a 2-d surface Vibrating string/... 2answers 382 views ### C++ template design pattern for groups (algebra) Having both programmed my share of c++ and studied some beginners group theory some year ago, I got curious about this... Is there any particularly popular template based (object oriented) design ... 1answer 3k 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 ... 1answer 883 views ### Improve numeric stability of subtraction in C++ [closed] I'm writing a matrix library in c++. After some debugging I found that a simple double difference is not zero for two "equals" numbers. This is due how double are represented in a computer of course. ... 2answers 492 views ### How does MPI differentiate between two computers? I am starting to dabble in MPI. I am fairly new to this area and I am currently reading the MPI standard. I would like to write my first MPI program, a simple hello world program, on a cluster that ... 2answers 839 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 ... 3answers 938 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 ... 1answer 1k views ### C+C++ library for inversion of a large scale matrix over cluster I need to implement a matrix inversion of a very big matrix that currently is exceeding the memory limits of my machine (unfortunately I have little memory running on 32-bit machines). I would like to ... 1answer 407 views ### LAPACK sorting eigenvalues differently each time I'm using LAPACK zgeev routine to get eigenvalues and eigenvectors of a symmetric matrix in C++. Problem is zgeev is being called in a loop but it sorts eigenvalues (and eigenvectors) differently ... 1answer 62 views ### Is C++ and Object-Oriented Numeric Computing for Scientists and Engineers by Daoqi Yang still relevant? I'm looking to learn C++ primarily from a scientific computation perspective. The approach of the textbook seems ideal to me as it covers C++ from first principles with an emphasis on numerical ... 2answers 168 views ### Sign of integer determinant 4 by 4 I'm in the context of this publication: http://www.gilbertbernstein.com/resources/booleans2009.pdf I applied quantization to my point coordinates: All coordinates are integer lying in [0, 2 power 20].... 2answers 912 views ### GSA Search Algorithm in C++ Is there any version of GSA (Gravitational Search Algorithm)[1] implemented with C++ or even C#? What I found was implemented using MATLAB which is not good for me. [1] Rashedi, Esmat, Hossein ... 2answers 219 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 ... 1answer 870 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)   \... 2answers 63 views ### Writing code on the CPU while developing, running it on the GPU when live - which approach? In my simulations I am using dense matrix-vector multiplications and 2D-fft transformations quite often, for matrix sizes of 8kx8k and up. Hence, I assume that using a GPU is beneficial for speeding ... 1answer 55 views ### Using adolc for the sign function in c++ Here is an implementation of the sign function in C++ using Adolc librairy for automatic differentiation. ... 2answers 2k views ### Solving the 1D Particle-in-a-Box using C++ I've just finished learning the physics behind the problem and would like to write a program in C++ than can solve the problem. I'm actually stuck at the start. I've quite a bit of research, the ... 2answers 708 views ### LU decomposition of large dense matrices I wanted to generate LU decomposition of large size dense matrices (N>10^7), the LU decomposition I'm currently using is based on Adaptive Cross Approximation and is taking very long time to ... 1answer 588 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? 1answer 70 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 ... 1answer 261 views ### LAPACK equivalent on c++ , which is the best one? [duplicate] I am following a course of computational material physics. The professor uses fortran to code and uses lapack to solve eigenvalue problems. So far I just know c++. There is an equivalent library that ... 1answer 243 views ### C++: Efficient library for dense linear algebra operations (determinant & principal minors) I usually work with Python, but my basic knowledge of c++ allows me to switch when I need to increase the speed of my code. Currently, I have a python script that (among other things) computes the ... 1answer 756 views ### Eigen - Solving Complex Generalized Eigenvalue Problem I've been using the Eigen C++ linear algebra library to solve various eigenvalue problems with complex matrices. I've recently had to use a generalized eigenvalue solution process, only to be ... 3answers 1k views ### Which C++ Multi-objective Optimization libraries allows the addition of custom problems and custom algorithms? I'm working on a custom discrete and constrained multi-objective optimization problem and I'd like to know which libraries or platforms that implement algorithms like ... 1answer 266 views ### Efficiently rotate vector in 2D (and 3D) I need to efficiently rotate a 2D (and 3D) vector in a CUDA kernel. I was thinking about generating random unitary rotation matrices. I don't need to know the angle, it just has to be randomly ... 1answer 6k 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 ... 3answers 266 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 ... 1answer 99 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 ... 1answer 239 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 ... 1answer 493 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 ... 1answer 146 views ### what went wrong with my logistic regression implementation in c++? I have implemented a simple logistic regression function with IRLS algorithm using the armadillo linear algebra libray ... 1answer 946 views ### Coding complex equations into C++ I have here equations from a paper by E. Bradlow. They're for counting the events in a Weibull-distributed data set.$$\begin{align} \Pr(N(t)=n) &= \sum_{j=n}^\infty{\frac{(-1)^{j+n}(\lambda t^c)^...
If $A\in R^{m\times n}, b\in R^m, c\in R^n$, if I need to solve the least square problems via SVD of $A$ and $A^T$, i.e. I need to solve the least square solutions to following linear systems via ...