# Questions tagged [c]

For questions related to computational software and libraries written in the C programming language

136 questions
Filter by
Sorted by
Tagged with
21 views

### Understanding Code for Numerical Integration for Bivariate Poisson-Lognormal Distribution

apologies for the long post, possibly very basic since I'm not very familiar with numerical integration techniques. In R, there is a library poilog for computations involving Poisson-Lognormal ...
• 99
1 vote
87 views

### What language are best for creating data compression algorithms except for C/C++?

I've been trying to implement data compression algorithms in python, but I just can't get mine as fast as the other algorithms other have made. So I've decided on using C since I've asked people about ...
• 143
100 views

...
• 209
94 views

### float in C: Size of the exponent

This question is very related to the question Number of decimal of float and double in C. In the second table we may see that the exponent of the float are from -38 to +38. But the IEEE754 standard ...
• 513
68 views

### Number of decimal of float and double in C

I'm reading the following table (from https://www.tutorialspoint.com/cprogramming/c_data_types.htm ) Why the precision of the float is 6 decimal places, but I see that the float are in the interval [...
• 513
1 vote
57 views

### Integration in 3D

So the question was to use a nested loop to solve a 3D integral with the function conditions (written below in the code) to find $$\int dxdydz$$ and the x and y coordinate of the centre of mass of ...
• 13
76 views

### Using Monte Carlo integration to find the centre of mass of a torus

How would I go about finding the centre of mass of a torus that obeys the following conditions in C (using Monte Carlo integration)? So far this is the code I have. I'm using a specific rng that ...
1 vote
70 views

### Poisson equation fast solver on large grids

Below is kind of a broad question. Was given Poisson equation with BC, on meshgrid of NxM. Rewrote as system of N*M linear equations, Converted to sparse format (CSR/CRS/Yale), solved using Conj Grad ...
• 354
1 vote
80 views

### Memory issues with iterative solvers

Was trying to implement a poisson 2d solver using Conjugate Gradient Method, so from 10x10 grid the matrix becomes 100x100 (since we have 100 nodes to find the values at), 100x100 grid goes to ...
• 354
27 views

### Identical .so shared libraries (with no symbols) are generated when compiling different C source files [closed]

At the institution I work for we have a User Exit made in Pro*C (SQL embedded in C language). We are having some troubles because identical shared libraries are generated when compiling different ...
250 views

• 39
255 views

### OpenMP: parallelizing calculation of pair interaction forces

I recently started to learn OpenMP. Albeit I have developed some intuition I still have some doubts on how to proceed under certain circumstances that are very useful for computational physicists. My ...
• 68
233 views

304 views

### Finding a shortest path in a graph

If each edge of a graph $G$ is unweighted or has equal weights, then the shortest path between two nodes in that graph is the path that contains the fewest number of edges. Such a path can be obtained ...
• 1
250 views

### C standard for computational science

Which C standard should be used for computational science code ? Should we keep compatibility with C89/90/ANSI or jump to C99 or C11 ? Context: Code will use third-party : BLAS, LAPACK, MKL, ...
1 vote
222 views

### Wrong result of 'ddot' from BLAS

I am having trouble with a C/C++ program that uses the BLAS routine ddot. I am running Linux and so far LAPACK routines worked without any problems. I get a wrong ...
997 views

### How good are current implementations of rand() in C?

There is a lot of literature that indicates using rand() for simulations might be harmful. A couple of them are as follows: https://www.sciencedirect.com/science/...
• 61
1 vote
181 views

### MPI data broadcast or not in C

I have two slightly different but getting the same results MPI code. The first one is from an open-source package having several data exchange steps in between: ...
1 vote
123 views

### Problem with 'dsysv' from LAPACK

I am having trouble with a C program that uses the function dsysv from LAPACK. Everything compiles and works without any errors, my only problem is, that the ...
2k views

### Efficient eigen-decomposition of covariance matrix

I am looking for an C/C++/Python algorithm implementation that calculates eigenvalues and eigenvectors of a symmetric, positive semidefinite covariance matrix. A general-purpose eigen-decomposition ...
• 91
211 views

### Looking for a converter of AMPL/GAMS models into C code

I've done an extensive web search, but could not find an option. Conversion between model formats is available, but conversion of objective function and constraint equations into C code seems absent. ...
• 91
431 views

### I've developed a derivative-free optimization method, looking for comments

Here is the URL: https://github.com/avaneev/biteopt I've tested it on numerous global optimization benchmarking functions (included), and on real-world hyperparameter optimization problems I have. ...
• 91
67 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 ...
278 views

### Use of multidimensional FFTW and normalisation factor

I am using the FFTW MPI in C. I have a simple question. Quoting from fftw.org The multi-dimensional transforms of FFTW, in general, compute simply the separable product of the given 1d ...
• 33
459 views

### Potential gain - Matlab vs C/C++ - assembly and eigenvalues

I have a Matlab code computing the solution to an eigenvalue PDE. It consists of two parts: assembly of the stiffness/rigidity matrices and solving a generalized eigenvalue problem. I mention that the ...
• 965
442 views

### High precision Discrete Fourier Transform in c

I'm trying to do a high precision discrete fourier transform on a signal. To examine the precision, I use a gaussian function as the signal, because the fourier transform is also a gaussian function. ...
682 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 ...
151 views

### Using GSL for basic operations

I am learning C/C++ for Scientific Computing and I have a question regarding the usage of scientific libraries for basic operations. Suppose I have to write a small program in C for a bioinformatics ...
• 394
1 vote
162 views

### How to deal with big numbers in intermediate calculations?

I have a rather long expression (https://pastebin.com/jUsxdCCs) that is an analytical solution of a set of differential equations generated symbolically from Maple. I need to solve a set of equations ...
195 views

### lightweight implementation of semiempirical quantum chemistry (e.g. MNDO,AM-1,PM3)

I'm searching for semi-empirical quantum chemistry solver which would be easy to integrate into my own software. I found a few implementations which can be in principle used e.g. MOPAC, ORCA, SQM some ...
293 views

### minimalistic library for classical molecular mechanics force-field in C/C++/Python

I would like some classical molecular mechanics forcefield library or super-simple program which does not have any external dependences, so that I can plug it into my software without worry of "...
3k views

### Simple open-source Quantum chemistry or DFT code in C/C++

I know lot of density functional packages in fortran, including one which we are developing in our group (Fireball-DFT) but I don't like fortran very much and I would like something which is easier ...