Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

Code snippets to solve mathematical problems.

- Add two to all elements in a std::vector, AddTwo
- AddTwo, add two to all elements in a std::vector
- Calculate a factorial
- Calculate an angle between two coordinats
- Calculate the distance between two coordinats
- Calculate the greatest common divisor
- Calculate the impulses after a perfect elastic collision, DoPerfectElasticCollision
- Calculate the product of std::vector elements, Product
- Calculate the product of all non-zero positive values in a std::vector, ProductNonZeroPositives
- Calculate X to the power of Y for integers, IntPower
- Convolution, perform a convolution on an image, DoFilterOperation
- Count the number of non-zero positive values in a std::vector, CountNonZeroPositives
- CountNonZeroPositives, count the number of non-zero positive values in a std::vector
- Cryptography algorithm (a very simple one)
- DivideTerms, divide two product term sets (for example {1,2,3,4}/{1,2,3} = 4)
- Divide two product term sets, DivideTerms (for example {1,2,3,4}/{1,2,3} = 4)
- DoFilterOperation, perform a convolution on an image
- DoFilterOperation, perform a filter operation on an image
- DoPerfectElasticCollision, calculate the impulses after a perfect elastic collision
- Factorial: Calculate a factorial
- Filter operation, perform a filter operation on an image, DoFilterOperation
- FindEquilibrium: Finding an equilibrium or a cycle (uses the logistic growth equation)
- Finding a sum for any combination of values (a.k.a. The Combinator)
- Finding an equilibrium or a cycle (uses the logistic growth equation)
- Fmod: modulus on floating point numbers
- Gcd: Calculate the greatest common divisor
- Get the cumulative std::vector of a std::vector, GetCumulativeHistogram
- Get the mean and standard deviation
- Get the mean value of all elements in a container, GetMean
- Get the mean value of all elements in a container, GetMean
- Get the product terms of a factorial, GetFactorialTerms
- Get the standard deviation of the values in a container, GetStdDev
- GetAngle: Calculate an angle between two coordinats
- GetCumulativeHistogram, get the cumulative std::vector of a std::vector
- GetDistance: Calculate the distance between two coordinats
- GetFactorialTerms, get the product terms of a factorial
- GetMean, get the mean value of all elements in a container
- GetStdDev, get the standard deviation of the values in a container
- GetSum, get the sum of all elements in a container
- GetSumProperDivisors, get the sum of all proper divisors of an integer
- Halve, replace all values in std::vector by their halves
- IntPower, calculate X to the power of Y for integers
- IsPerfectNumber, determines if a number is a perfect number
- IsPrime, is a number prime?
- MakeAbs, replace all values in a std::vector by their absolutes
- MakeSquare, square all values in a std::vector
- Maze code snippets
- MeanAndStdDev: Get the mean and standard deviation
- Modulus on floating point numbers
- Normal Distribution code snippets
- Perfect elastic collision
- Perform a convolution on an image, DoFilterOperation
- Perform a filter operation on an image, DoFilterOperation
- Prime, IsPrime, is a number prime?
- Prime, PrimeExpert, to determine whether a number is prime quicker
- PrimeExpert, to determine whether a number is prime quicker
- Product, calculate the product of std::vector elements
- ProductNonZeroPositives, calculate the product of all non-zero positive values in a std::vector
- Random number code snippets
- Reciprocal, replace all values in a std::vector by their reciprocals
- Replace all values in a std::vector by their absolutes, MakeAbs
- Replace all values in std::vector by their halves, Halve
- Replace all values in a std::vector by their reciprocals, Reciprocal
- Replace all negative values in a std::vector by zeroes, ReplaceNegativeByZero
- Replace all zeroes in a std::vector by a ones, ReplaceZeroByOne
- Replace identical product terms by 1, StripeAwayTerms (for example {1,2,3,4} and {1,2,3} become {1,1,1,4} and {1,1,1})
- ReplaceNegativeByZero, replace all negative values in a std::vector by zeroes
- ReplaceZeroByOne, replace all zeroes in a std::vector by ones
- Rescale a 2D std::vector from a certain range to a new range, Rescale
- Rescale a double from a certain range to a new range, Rescale
- Rescale, rescale a 2D std::vector from a certain range to a new range
- Rescale, rescale a double from a certain range to a new range
- Round a double to an integer, RoundOff
- RoundOff, round a double to an integer
- Statistics code snippets
- Solve a quadratic equation, SolveQuadratic
- SolveQuadratic, solve a quadratic equation
- Square all values in a std::vector, MakeSquare
- StripeAwayTerms, replace identical product terms by 1 (for example {1,2,3,4} and {1,2,3} become {1,1,1,4} and {1,1,1})
- Sum all positive values in a std::vector, SumPositives
- SumPositives, sum all positive values in a std::vector
- The Combinator: Finding a sum for any combination of values
- Triple, triple all values in a std::vector
- Triple all values in a std::vector, Triple

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.