## Error in the integrating function of the MUESLI digital library

I am trying to use the numerical integration function of the MUESLI library, mfOdeSolve, but I get a compilation error. Just like in the example (#4-52) of the user's guide, I divided the code into a main program and an external module: Main: program

## digital sorting but keeping the duplicates

I'm sorting a file numerically with almost nine hundred lines. For others the commands tr '\r' '\n' < myfile.txt | sort or tr '\r' '\n' < myfile.txt | sort -n seems to do the trick, but for me, I don't get the output I want (only two hundred lines).

## Are there numerically stable versions of the centroid search algorithm for polygons?

Say I have an almost degenerate 2-D polygon such as: [[40.802,9.289],[40.875,9.394],[40.910000000000004,9.445],[40.911,9.446],[40.802,9.289]] For reference this looks like: If I use the standard centroid algorithm as shown on Wikipedia, for example t

## How to sort data from a csv file numerically to python

I am writing a program that takes students scores from a csv file and needs to sort then highest to lowest score. the csv file looks like this: josh 12 john 6 fred 8 harry 7 i have tried to put the items in a list like this: Mylist=[] csvfile = open

## Python: How to sort the contents of a .txt file in numerical order?

This question already has an answer here: Does Python have a built in function for string natural sort? 13 answers Sorting integers in a csv file - python 2 answers Hi guys I was having some trouble making a code that arranges a .txt file in numerica

## How to calculate an exponent in matlab without having inf?

The title says it all: I want to calculate an exponent in matlab with big numbers, but I get overflow and it just returns infinity. >> 100^1000 ans = Inf Last time I checked, 100^1000 is decidedly smaller than infinity :)Working with 64bit floating

## Overall overload of == and! = For floating points

Is it a bad practice to overload global operator == and != for floating points ? I'm using fast floating-points in a game environement, and i was thinking about using fuzzy comparison everywhere as i can't imagine a situation where i don't expect ext

## segmentation error 11 in mac, but not in Linux, gcc compiler

I have a code which uses standard routines of numerical recipes for finding eigen vectors of a 3x3 matrix. While the code runs perfectly on linux machines, it fails with a segmentation fault 11 on mac. With gdb, when I back tracked I find that Progra

## Force different characters at different positions

I'm currently working on a project in which I need to fetch street/city details from a DB using a zipcode. Dutch zipcodes use a "1111 AA" format, I would like to have this entered in a single input field while forcing the first four characters t

## The number of correct decimal digits in a duplicate product with a large number of terms

What is a tight lower-bound on the size of the set of irrational numbers, N, expressed as doubles in Matlab on a 64-bit machine, that I multiply together while having confidence in k decimal digits of the product? What precision, for example could I

## Numerical optimization and minimization

Lets say I have a reference node R and several test nodes T1, T2.... Tn. Any particular node has a set of properties Rp1, Rp2, ... Rpn and T1p1, T1p2, T1p3, ... T1pn, and T2p1, T2p2, T2p3, ... T2pn, and so on. So, any node can have n properties, each

## Python arithmetic with small numbers

I am getting the following unexpected result when I do arithmetic with small numbers in Python: >>> sys.float_info sys.float_info(max=1.7976931348623157e+308, max_exp=1024, max_10_exp=308, min=2.2250738585072014e-308, min_exp=-1021, min_10_exp=-3

## Divide two values ​​obtained from EditText divide one by the other

Is it possible in Java code to divide two obtained values from two EditText boxes in an android app, and then divide them by each other to create a result? Pretty much, the consumer of my application will be asked for two DIFFERENT, numerical values

## regular expression c # only numeric characters in the string

I want to check if a string with an undefined length consist of only numbers. Example: "234324" = true "er32" = false "1" = true the way I tried to solve this problem is like this: public bool Validate(string input) { return

## Get a numeric value at the end of the class name and store it as a variable using jQuery

Consider this menu output by a WordPress function: <ul id="header-cats"> <li class="cat-item cat-item-6"><a href="url" title="View all posts filed under Category I">Category I</a> </li>

## C vs C ++ digital recipes

I started to read the book "numerical recipes in C"... I try make my programs more efficients and faster... So, is the same thing, to use C or C++? I know that C++ is a super-set of C... But, are there differences between "cmath" libra

## Numeric error in simple CUDA code

I just started experimenting cuda with the following cude #include "macro.hpp" #include <algorithm> #include <iostream> #include <cstdlib> //#define double float //#define double int int RandomNumber(){return static_cast<dou

## Numeric problems in Matlab: same entry, same code - & gt; different output?

I am experiencing problems when I compare results from different runs of my Matlab software with the same input. To narrow the problem, I did the following: save all relevant variables using Matlab's save() method call a method which calculates somet

## Python floating number

i am kind of confused why python add some additional decimal number in this case, please help to explain >>> mylist = ["list item 1", 2, 3.14] >>> print mylist ['list item 1', 2, 3.1400000000000001] Floating point numbers are a

## Use logarithms to normalize a vector to avoid overflow

Problem with arithmetic using logarithms to avoid numerical underflow (take 2) Having seen the above and having seen softmax normalization I was trying to normalize a vector while avoiding overflow - that is if I have an array x[1], x[2] x[3], x[4],

## Javascript to convert the string to a number?

var str = '0.25'; How to convert the above to 0.25?There are several ways to achieve it: Using the unary plus operator: var n = +str; The Number constructor: var n = Number(str); The parseFloat function: var n = parseFloat(str);

## Java digital libraries

Most of my code is in Java. For standardized algorithms: matrix operations, FFT, ... I would prefer to not use my own pure Java implementations, and are perfectly happy using unsafe FFI/JNI calls. What are the libraries I should look into? Thanks!CER

## Scala: What is the best way to perform numerical operations in generic classes?

In Scala, I'd like to be able to write generic classes which use operators like >, /, * etc, but I don't see how to constrain T such that this will work. I looked into constraining T with Ordered[T], but that doesn't seem to work since only RichXXX (

## How to use TDD correctly to implement a numerical method?

I am trying to use Test Driven Development to implement my signal processing library. But I have a little doubt: Assume I am trying to implement a sine method (I'm not): Write the test (pseudo-code) assertEqual(0, sine(0)) Write the first implementat

## Identification of common periodic waveforms (square, sine, sawtooth, & hellip;)

Without any user interaction, how would a program identify what type of waveform is present in a recording from an ADC? For the sake of this question: triangle, square, sine, half-sine, or sawtooth waves of constant frequency. Level and frequency are

## How to determine the standard deviation (stddev) of a set of values?

I need to know if a number compared to a set of numbers is outside of 1 stddev from the mean, etc..While the sum of squares algorithm works fine most of the time, it can cause big trouble if you are dealing with very large numbers. You basically may

## Three-dimensional networks effective in C calculation

I am trying to solve numerically a set of partial differential equations in three dimensions. In each of the equations the next value of the unknown in a point depends on the current value of each unknown in the closest points. To write an efficient

## Open source alternative to the fmincon function of MATLAB?

Is there an open-source alternative to MATLAB's fmincon function for constrained linear optimization? I'm rewriting a MATLAB program to use Python / NumPy / SciPy and this is the only function I haven't found an equivalent to. A NumPy-based solution

## How to test numerical analysis routines?

Are there any good online resources for how to create, maintain and think about writing test routines for numerical analysis code? One of the limitations I can see for something like testing matrix multiplication is that the obvious tests (like havin