diff --git a/d5/d88/md__d_i_r_e_c_t_o_r_y.html b/d5/d88/md__d_i_r_e_c_t_o_r_y.html index cc022972a..1e210e308 100644 --- a/d5/d88/md__d_i_r_e_c_t_o_r_y.html +++ b/d5/d88/md__d_i_r_e_c_t_o_r_y.html @@ -318,6 +318,7 @@ Math
  • Check Prime
  • Complex Numbers
  • Double Factorial
  • +
  • Eratosthenes
  • Eulers Totient Function
  • Extended Euclid Algorithm
  • Factorial
  • diff --git a/d7/da6/eratosthenes_8cpp.html b/d7/da6/eratosthenes_8cpp.html new file mode 100644 index 000000000..411e94da4 --- /dev/null +++ b/d7/da6/eratosthenes_8cpp.html @@ -0,0 +1,296 @@ + + + + + + + +Algorithms_in_C++: math/eratosthenes.cpp File Reference + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Algorithms_in_C++ 1.0.0 +
    +
    Set of algorithms implemented in C++.
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    eratosthenes.cpp File Reference
    +
    +
    + +

    The Sieve of Eratosthenes +More...

    +
    #include <cassert>
    +#include <chrono>
    +#include <iostream>
    +#include <string>
    +#include <vector>
    +
    +Include dependency graph for eratosthenes.cpp:
    +
    +
    +
    +
    +
    + + + + +

    +Namespaces

    namespace  math
     for IO operations
     
    + + + + + + + + + + + + + +

    +Functions

    void math::sieve (std::vector< bool > *vec)
     Performs the sieve.
     
    void math::print_primes (std::vector< bool > const &primes)
     Prints all the indexes of true values in the passed std::vector.
     
    static void test ()
     Self-tests the sieve function for major inconsistencies.
     
    int main (int argc, char *argv[])
     Main function.
     
    +

    Detailed Description

    +

    The Sieve of Eratosthenes

    +

    Store an array of booleans where a true value indicates that it's index is prime. For all the values in the array starting from 2 which we know is prime, we walk the array in multiples of the current outer value setting them to not prime. If we remove all multiples of a value as we see it, we'll be left with just primes.

    +

    Pass "print" as a command line arg to see the generated list of primes

    Author
    Keval Kapdee
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    int main (int argc,
    char * argv[] 
    )
    +
    + +

    Main function.

    +
    Parameters
    + + + +
    argccommandline argument count
    argvcommandline array of arguments
    +
    +
    +
    Returns
    0 on exit
    +
    87 {
    +
    88 test(); // run self-test implementations
    +
    89
    +
    90 // The largest prime we will check for
    +
    91 auto max = 10000;
    +
    92
    +
    93 // Store a boolean for every number which states if that index is prime or
    +
    94 // not
    +
    95 auto primes = std::vector<bool>(max, true);
    +
    96
    +
    97 // Store the algorithm start time
    + +
    99
    +
    100 // Run the sieve
    + +
    102
    +
    103 // Time difference calculation
    + + + +
    107 .count();
    +
    108
    +
    109 // Print the primes if we see that "print" was passed as an arg
    +
    110 if (argc > 1 && argv[1] == std::string("print")) {
    + +
    112 }
    +
    113
    +
    114 // Print the time taken we found earlier
    +
    115 std::cout << "Time taken: " << time << " seconds" << std::endl;
    +
    116
    +
    117 return 0;
    +
    118}
    + + +
    T duration_cast(T... args)
    + +
    T endl(T... args)
    +
    static void test()
    Self-tests the sieve function for major inconsistencies.
    Definition: eratosthenes.cpp:64
    +
    T max(T... args)
    +
    void sieve(std::vector< bool > *vec)
    Performs the sieve.
    Definition: eratosthenes.cpp:33
    +
    void print_primes(std::vector< bool > const &primes)
    Prints all the indexes of true values in the passed std::vector.
    Definition: eratosthenes.cpp:51
    + +
    std::vector< int > primes(size_t max)
    Definition: prime_numbers.cpp:12
    +
    T time(T... args)
    + +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ test()

    + +
    +
    + + + + + +
    + + + + + + + +
    static void test ()
    +
    +static
    +
    + +

    Self-tests the sieve function for major inconsistencies.

    +
    Returns
    void
    +
    64 {
    +
    65 auto primes = std::vector<bool>(10, true);
    + +
    67 assert(primes[0] == false);
    +
    68 assert(primes[1] == false);
    +
    69 assert(primes[2] == true);
    +
    70 assert(primes[3] == true);
    +
    71 assert(primes[4] == false);
    +
    72 assert(primes[5] == true);
    +
    73 assert(primes[6] == false);
    +
    74 assert(primes[7] == true);
    +
    75 assert(primes[8] == false);
    +
    76 assert(primes[9] == false);
    +
    77
    +
    78 std::cout << "All tests have successfully passed!\n";
    +
    79}
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + diff --git a/d7/da6/eratosthenes_8cpp.js b/d7/da6/eratosthenes_8cpp.js new file mode 100644 index 000000000..fb46bcbec --- /dev/null +++ b/d7/da6/eratosthenes_8cpp.js @@ -0,0 +1,7 @@ +var eratosthenes_8cpp = +[ + [ "main", "d7/da6/eratosthenes_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97", null ], + [ "print_primes", "d7/da6/eratosthenes_8cpp.html#ad09d59850865012a6fd95d89954c82e4", null ], + [ "sieve", "d7/da6/eratosthenes_8cpp.html#a91366864111e1fac29722ca45e02ea8f", null ], + [ "test", "d7/da6/eratosthenes_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ] +]; \ No newline at end of file diff --git a/d7/da6/eratosthenes_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map b/d7/da6/eratosthenes_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map new file mode 100644 index 000000000..453ff447c --- /dev/null +++ b/d7/da6/eratosthenes_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.map @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/d7/da6/eratosthenes_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 b/d7/da6/eratosthenes_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 new file mode 100644 index 000000000..ce9d0cce2 --- /dev/null +++ b/d7/da6/eratosthenes_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.md5 @@ -0,0 +1 @@ +4ae4faa6ee7ac51c6057b890e56949a6 \ No newline at end of file diff --git a/d7/da6/eratosthenes_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg b/d7/da6/eratosthenes_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg new file mode 100644 index 000000000..591aac38f --- /dev/null +++ b/d7/da6/eratosthenes_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg @@ -0,0 +1,187 @@ + + + + + + +main + + +Node1 + + +main + + + + + +Node2 + + +std::chrono::duration_cast + + + + + +Node1->Node2 + + + + + +Node3 + + +std::endl + + + + + +Node1->Node3 + + + + + +Node4 + + +std::chrono::high_resolution +_clock::now + + + + + +Node1->Node4 + + + + + +Node5 + + +primes + + + + + +Node1->Node5 + + + + + +Node7 + + +math::print_primes + + + + + +Node1->Node7 + + + + + +Node9 + + +math::sieve + + + + + +Node1->Node9 + + + + + +Node10 + + +test + + + + + +Node1->Node10 + + + + + +Node6 + + +std::vector::emplace_back + + + + + +Node5->Node6 + + + + + +Node7->Node3 + + + + + +Node7->Node5 + + + + + +Node8 + + +std::vector::size + + + + + +Node7->Node8 + + + + + +Node9->Node8 + + + + + +Node10->Node5 + + + + + +Node10->Node9 + + + + + diff --git a/d7/da6/eratosthenes_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d7/da6/eratosthenes_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map new file mode 100644 index 000000000..62763f036 --- /dev/null +++ b/d7/da6/eratosthenes_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/d7/da6/eratosthenes_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d7/da6/eratosthenes_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 new file mode 100644 index 000000000..992c5ff5e --- /dev/null +++ b/d7/da6/eratosthenes_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -0,0 +1 @@ +dfdc037a92702d14aae63a831a05ea13 \ No newline at end of file diff --git a/d7/da6/eratosthenes_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d7/da6/eratosthenes_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg new file mode 100644 index 000000000..3932ec49b --- /dev/null +++ b/d7/da6/eratosthenes_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -0,0 +1,81 @@ + + + + + + +test + + +Node1 + + +test + + + + + +Node2 + + +primes + + + + + +Node1->Node2 + + + + + +Node4 + + +math::sieve + + + + + +Node1->Node4 + + + + + +Node3 + + +std::vector::emplace_back + + + + + +Node2->Node3 + + + + + +Node5 + + +std::vector::size + + + + + +Node4->Node5 + + + + + diff --git a/d7/dd9/eratosthenes_8cpp__incl.map b/d7/dd9/eratosthenes_8cpp__incl.map new file mode 100644 index 000000000..25d52e165 --- /dev/null +++ b/d7/dd9/eratosthenes_8cpp__incl.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/d7/dd9/eratosthenes_8cpp__incl.md5 b/d7/dd9/eratosthenes_8cpp__incl.md5 new file mode 100644 index 000000000..366803544 --- /dev/null +++ b/d7/dd9/eratosthenes_8cpp__incl.md5 @@ -0,0 +1 @@ +e6bdc87cc9533c451f0145884e4b7066 \ No newline at end of file diff --git a/d7/dd9/eratosthenes_8cpp__incl.svg b/d7/dd9/eratosthenes_8cpp__incl.svg new file mode 100644 index 000000000..5317b6745 --- /dev/null +++ b/d7/dd9/eratosthenes_8cpp__incl.svg @@ -0,0 +1,96 @@ + + + + + + +math/eratosthenes.cpp + + +Node1 + + +math/eratosthenes.cpp + + + + + +Node2 + + +cassert + + + + + +Node1->Node2 + + + + + +Node3 + + +chrono + + + + + +Node1->Node3 + + + + + +Node4 + + +iostream + + + + + +Node1->Node4 + + + + + +Node5 + + +string + + + + + +Node1->Node5 + + + + + +Node6 + + +vector + + + + + +Node1->Node6 + + + + + diff --git a/dd/d47/namespacemath.html b/dd/d47/namespacemath.html index 5281b492a..0032ac58d 100644 --- a/dd/d47/namespacemath.html +++ b/dd/d47/namespacemath.html @@ -150,6 +150,12 @@ Functions T cylinder_surface_area (T radius, T height)  surface area of a cylinder (2 * pi * r * h + 2 * pi * r^2)
      +void sieve (std::vector< bool > *vec) + Performs the sieve.
    +  +void print_primes (std::vector< bool > const &primes) + Prints all the indexes of true values in the passed std::vector.
    +  double integral_approx (double lb, double ub, const std::function< double(double)> &func, double delta=.0001)  Computes integral approximation.
      @@ -244,6 +250,7 @@ Functions

    for assert

    Math algorithms.

    for std::vector

    +

    Mathematical algorithms.

    for M_PI definition and pow()

    for std::rand

    for assert

    @@ -254,6 +261,7 @@ Functions

    Mathematical algorithms

    for assert for int32_t type for atoi

    Mathematical algorithms

    +

    For assert For timing the sieve For IO operations For string handling For std::vector

    for assert for std::cin and std::cout

    Mathematical algorithms

    for assert for mathematical functions for passing in functions

    @@ -1263,6 +1271,50 @@ template<typename T >
    51 return 0;
    52}
    + + + +

    ◆ print_primes()

    + +
    +
    + + + + + + + + +
    void math::print_primes (std::vector< bool > const & primes)
    +
    + +

    Prints all the indexes of true values in the passed std::vector.

    +
    Parameters
    + + +
    primesThe vector that has been passed through sieve(...)
    +
    +
    +
    Returns
    void
    +
    51 {
    +
    52 for (uint64_t i = 0; i < primes.size(); i++) {
    +
    53 if (primes[i]) {
    +
    54 std::cout << i << std::endl;
    +
    55 }
    +
    56 }
    +
    57}
    + +
    T endl(T... args)
    +
    std::vector< int > primes(size_t max)
    Definition: prime_numbers.cpp:12
    +
    T size(T... args)
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    +
    @@ -1449,6 +1501,51 @@ template<typename T >
    42 return length * width * height;
    43}
    + + + +

    ◆ sieve()

    + +
    +
    + + + + + + + + +
    void math::sieve (std::vector< bool > * vec)
    +
    + +

    Performs the sieve.

    +
    Parameters
    + + +
    vecArray of bools, all initialised to true, where the number of elements is the highest number we wish to check for primeness
    +
    +
    +
    Returns
    void
    +
    33 {
    +
    34 (*vec)[0] = false;
    +
    35 (*vec)[1] = false;
    +
    36
    +
    37 // The sieve sets values to false as they are found not prime
    +
    38 for (uint64_t n = 2; n < vec->size(); n++) {
    +
    39 for (uint64_t multiple = n << 1; multiple < vec->size();
    +
    40 multiple += n) {
    +
    41 (*vec)[multiple] = false;
    +
    42 }
    +
    43 }
    +
    44}
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    +
    diff --git a/dd/d47/namespacemath.js b/dd/d47/namespacemath.js index 4e1cb5bab..551ef73b9 100644 --- a/dd/d47/namespacemath.js +++ b/dd/d47/namespacemath.js @@ -23,10 +23,12 @@ var namespacemath = [ "parallelogram_perimeter", "dd/d47/namespacemath.html#a0efb235330ff48e14fd31faaccbcebb3", null ], [ "power", "dd/d47/namespacemath.html#afcd07701d73ed65cd616bcba02737f3d", null ], [ "power_of_two", "dd/d47/namespacemath.html#a8a48be4d7f14e34c5c92925bc1cbf3bb", null ], + [ "print_primes", "dd/d47/namespacemath.html#ad09d59850865012a6fd95d89954c82e4", null ], [ "pyramid_volume", "dd/d47/namespacemath.html#a94db02b3c9e55a69ac1696f30e2f761c", null ], [ "rect_area", "dd/d47/namespacemath.html#ab31d141f7c5b551746b1eee0eb4dedca", null ], [ "rect_perimeter", "dd/d47/namespacemath.html#a428769a16e9525e56588d7c7709d25a6", null ], [ "rect_prism_volume", "dd/d47/namespacemath.html#a3fdc74c24697ec5bb5c3698c96117c12", null ], + [ "sieve", "dd/d47/namespacemath.html#a91366864111e1fac29722ca45e02ea8f", null ], [ "sphere_surface_area", "dd/d47/namespacemath.html#ab7f29862d30df351c317eedd60a0c656", null ], [ "sphere_volume", "dd/d47/namespacemath.html#a34d66a77c19ce9b8b3a3d14352b34551", null ], [ "square_area", "dd/d47/namespacemath.html#a971ce57e368f2f631cf1f4ff3f864049", null ], diff --git a/dd/d47/namespacemath_a91366864111e1fac29722ca45e02ea8f_cgraph.map b/dd/d47/namespacemath_a91366864111e1fac29722ca45e02ea8f_cgraph.map new file mode 100644 index 000000000..7dc2a4645 --- /dev/null +++ b/dd/d47/namespacemath_a91366864111e1fac29722ca45e02ea8f_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/dd/d47/namespacemath_a91366864111e1fac29722ca45e02ea8f_cgraph.md5 b/dd/d47/namespacemath_a91366864111e1fac29722ca45e02ea8f_cgraph.md5 new file mode 100644 index 000000000..94baddf9e --- /dev/null +++ b/dd/d47/namespacemath_a91366864111e1fac29722ca45e02ea8f_cgraph.md5 @@ -0,0 +1 @@ +e0c83919d3daa0aff3286cf2b3397853 \ No newline at end of file diff --git a/dd/d47/namespacemath_a91366864111e1fac29722ca45e02ea8f_cgraph.svg b/dd/d47/namespacemath_a91366864111e1fac29722ca45e02ea8f_cgraph.svg new file mode 100644 index 000000000..5fb269fd6 --- /dev/null +++ b/dd/d47/namespacemath_a91366864111e1fac29722ca45e02ea8f_cgraph.svg @@ -0,0 +1,36 @@ + + + + + + +math::sieve + + +Node1 + + +math::sieve + + + + + +Node2 + + +std::vector::size + + + + + +Node1->Node2 + + + + + diff --git a/dd/d47/namespacemath_ad09d59850865012a6fd95d89954c82e4_cgraph.map b/dd/d47/namespacemath_ad09d59850865012a6fd95d89954c82e4_cgraph.map new file mode 100644 index 000000000..8afe491ba --- /dev/null +++ b/dd/d47/namespacemath_ad09d59850865012a6fd95d89954c82e4_cgraph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dd/d47/namespacemath_ad09d59850865012a6fd95d89954c82e4_cgraph.md5 b/dd/d47/namespacemath_ad09d59850865012a6fd95d89954c82e4_cgraph.md5 new file mode 100644 index 000000000..f73baa116 --- /dev/null +++ b/dd/d47/namespacemath_ad09d59850865012a6fd95d89954c82e4_cgraph.md5 @@ -0,0 +1 @@ +4213445baca5cf52cd4eed5a51866b2a \ No newline at end of file diff --git a/dd/d47/namespacemath_ad09d59850865012a6fd95d89954c82e4_cgraph.svg b/dd/d47/namespacemath_ad09d59850865012a6fd95d89954c82e4_cgraph.svg new file mode 100644 index 000000000..d6be5514a --- /dev/null +++ b/dd/d47/namespacemath_ad09d59850865012a6fd95d89954c82e4_cgraph.svg @@ -0,0 +1,81 @@ + + + + + + +math::print_primes + + +Node1 + + +math::print_primes + + + + + +Node2 + + +std::endl + + + + + +Node1->Node2 + + + + + +Node3 + + +primes + + + + + +Node1->Node3 + + + + + +Node5 + + +std::vector::size + + + + + +Node1->Node5 + + + + + +Node4 + + +std::vector::emplace_back + + + + + +Node3->Node4 + + + + + diff --git a/dir_296d53ceaeaa7e099814a6def439fe8a.html b/dir_296d53ceaeaa7e099814a6def439fe8a.html index 55d498c6c..807dd4ed0 100644 --- a/dir_296d53ceaeaa7e099814a6def439fe8a.html +++ b/dir_296d53ceaeaa7e099814a6def439fe8a.html @@ -136,6 +136,9 @@ Files file  double_factorial.cpp  Compute double factorial: \(n!!\).
      +file  eratosthenes.cppThe Sieve of Eratosthenes
    +  file  eulers_totient_function.cpp  C++ Program to find Euler's Totient function.
      diff --git a/dir_296d53ceaeaa7e099814a6def439fe8a.js b/dir_296d53ceaeaa7e099814a6def439fe8a.js index cf5fd6eae..96120c623 100644 --- a/dir_296d53ceaeaa7e099814a6def439fe8a.js +++ b/dir_296d53ceaeaa7e099814a6def439fe8a.js @@ -11,6 +11,7 @@ var dir_296d53ceaeaa7e099814a6def439fe8a = [ "check_prime.cpp", "db/d93/check__prime_8cpp.html", "db/d93/check__prime_8cpp" ], [ "complex_numbers.cpp", "d5/d67/complex__numbers_8cpp.html", "d5/d67/complex__numbers_8cpp" ], [ "double_factorial.cpp", "d7/d89/double__factorial_8cpp.html", "d7/d89/double__factorial_8cpp" ], + [ "eratosthenes.cpp", "d7/da6/eratosthenes_8cpp.html", "d7/da6/eratosthenes_8cpp" ], [ "eulers_totient_function.cpp", "da/d23/eulers__totient__function_8cpp.html", "da/d23/eulers__totient__function_8cpp" ], [ "extended_euclid_algorithm.cpp", "d9/d5d/extended__euclid__algorithm_8cpp.html", "d9/d5d/extended__euclid__algorithm_8cpp" ], [ "factorial.cpp", "d9/d00/factorial_8cpp.html", "d9/d00/factorial_8cpp" ], diff --git a/files.html b/files.html index 3e1b29f24..77f421efa 100644 --- a/files.html +++ b/files.html @@ -229,54 +229,55 @@ solve-a-rat-in-a-maze-c-java-pytho/" target="_blank">Rat in a Maze algorithm  check_prime.cppReduced all possibilities of a number which cannot be prime. Eg: No even number, except 2 can be a prime number, hence we will increment our loop with i+6 jumping and check for i or i+2 to be a factor of the number; if it's a factor then we will return false otherwise true after the loop terminates at the terminating condition which is (i*i<=num)  complex_numbers.cppAn implementation of Complex Number as Objects  double_factorial.cppCompute double factorial: \(n!!\) - eulers_totient_function.cppC++ Program to find Euler's Totient function - extended_euclid_algorithm.cppGCD using [extended Euclid's algorithm] (https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm) - factorial.cppC++ program to find factorial of given number - fast_power.cppFaster computation for \(a^b\) - fibonacci.cppGenerate fibonacci sequence - fibonacci_fast.cppFaster computation of Fibonacci series - fibonacci_large.cppComputes N^th Fibonacci number given as input argument. Uses custom build arbitrary integers library to perform additions and other operations - fibonacci_matrix_exponentiation.cppThis program computes the N^th Fibonacci number in modulo mod input argument - fibonacci_sum.cppAn algorithm to calculate the sum of Fibonacci Sequence: \(\mathrm{F}(n) + + eratosthenes.cppThe Sieve of Eratosthenes + eulers_totient_function.cppC++ Program to find Euler's Totient function + extended_euclid_algorithm.cppGCD using [extended Euclid's algorithm] (https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm) + factorial.cppC++ program to find factorial of given number + fast_power.cppFaster computation for \(a^b\) + fibonacci.cppGenerate fibonacci sequence + fibonacci_fast.cppFaster computation of Fibonacci series + fibonacci_large.cppComputes N^th Fibonacci number given as input argument. Uses custom build arbitrary integers library to perform additions and other operations + fibonacci_matrix_exponentiation.cppThis program computes the N^th Fibonacci number in modulo mod input argument + fibonacci_sum.cppAn algorithm to calculate the sum of Fibonacci Sequence: \(\mathrm{F}(n) + \mathrm{F}(n+1) + .. + \mathrm{F}(m)\) - finding_number_of_digits_in_a_number.cpp[Program to count digits in an integer](https://www.geeksforgeeks.org/program-count-digits-integer-3-different-methods) - gcd_iterative_euclidean.cppCompute the greatest common denominator of two integers using iterative form of Euclidean algorithm - gcd_of_n_numbers.cppThis program aims at calculating the GCD of n numbers by division method - gcd_recursive_euclidean.cppCompute the greatest common denominator of two integers using recursive form of Euclidean algorithm - integral_approximation.cppCompute integral approximation of the function using Riemann sum - integral_approximation2.cppMonte Carlo Integration - inv_sqrt.cppImplementation of the inverse square root Root - large_factorial.cppCompute factorial of any arbitratily large number/ - large_number.hLibrary to perform arithmatic operations on arbitrarily large numbers - largest_power.cppAlgorithm to find largest x such that p^x divides n! (factorial) using Legendre's Formula - lcm_sum.cppAn algorithm to calculate the sum of LCM: \(\mathrm{LCM}(1,n) + + finding_number_of_digits_in_a_number.cpp[Program to count digits in an integer](https://www.geeksforgeeks.org/program-count-digits-integer-3-different-methods) + gcd_iterative_euclidean.cppCompute the greatest common denominator of two integers using iterative form of Euclidean algorithm + gcd_of_n_numbers.cppThis program aims at calculating the GCD of n numbers by division method + gcd_recursive_euclidean.cppCompute the greatest common denominator of two integers using recursive form of Euclidean algorithm + integral_approximation.cppCompute integral approximation of the function using Riemann sum + integral_approximation2.cppMonte Carlo Integration + inv_sqrt.cppImplementation of the inverse square root Root + large_factorial.cppCompute factorial of any arbitratily large number/ + large_number.hLibrary to perform arithmatic operations on arbitrarily large numbers + largest_power.cppAlgorithm to find largest x such that p^x divides n! (factorial) using Legendre's Formula + lcm_sum.cppAn algorithm to calculate the sum of LCM: \(\mathrm{LCM}(1,n) + \mathrm{LCM}(2,n) + \ldots + \mathrm{LCM}(n,n)\) - least_common_multiple.cpp - magic_number.cppA simple program to check if the given number is a magic number or not. A number is said to be a magic number, if the sum of its digits are calculated till a single digit recursively by adding the sum of the digits after every addition. If the single digit comes out to be 1,then the number is a magic number - miller_rabin.cpp - modular_division.cppAn algorithm to divide two numbers under modulo p Modular Division - modular_exponentiation.cppC++ Program for Modular Exponentiation Iteratively - modular_inverse_fermat_little_theorem.cppC++ Program to find the modular inverse using Fermat's Little Theorem - modular_inverse_simple.cppSimple implementation of modular multiplicative inverse - n_bonacci.cppImplementation of the N-bonacci series - n_choose_r.cppCombinations n choose r function implementation - ncr_modulo_p.cppThis program aims at calculating nCr modulo p - number_of_positive_divisors.cppC++ Program to calculate the number of positive divisors - perimeter.cppImplementations for the perimeter of various shapes - power_for_huge_numbers.cppCompute powers of large numbers - power_of_two.cppImplementation to check whether a number is a power of 2 or not - prime_factorization.cppPrime factorization of positive integers - prime_numbers.cppGet list of prime numbers - primes_up_to_billion.cppCompute prime numbers upto 1 billion - realtime_stats.cppCompute statistics for data entered in rreal-time - sieve_of_eratosthenes.cppGet list of prime numbers using Sieve of Eratosthenes - sqrt_double.cppCalculate the square root of any positive real number in \(O(\log + least_common_multiple.cpp + magic_number.cppA simple program to check if the given number is a magic number or not. A number is said to be a magic number, if the sum of its digits are calculated till a single digit recursively by adding the sum of the digits after every addition. If the single digit comes out to be 1,then the number is a magic number + miller_rabin.cpp + modular_division.cppAn algorithm to divide two numbers under modulo p Modular Division + modular_exponentiation.cppC++ Program for Modular Exponentiation Iteratively + modular_inverse_fermat_little_theorem.cppC++ Program to find the modular inverse using Fermat's Little Theorem + modular_inverse_simple.cppSimple implementation of modular multiplicative inverse + n_bonacci.cppImplementation of the N-bonacci series + n_choose_r.cppCombinations n choose r function implementation + ncr_modulo_p.cppThis program aims at calculating nCr modulo p + number_of_positive_divisors.cppC++ Program to calculate the number of positive divisors + perimeter.cppImplementations for the perimeter of various shapes + power_for_huge_numbers.cppCompute powers of large numbers + power_of_two.cppImplementation to check whether a number is a power of 2 or not + prime_factorization.cppPrime factorization of positive integers + prime_numbers.cppGet list of prime numbers + primes_up_to_billion.cppCompute prime numbers upto 1 billion + realtime_stats.cppCompute statistics for data entered in rreal-time + sieve_of_eratosthenes.cppGet list of prime numbers using Sieve of Eratosthenes + sqrt_double.cppCalculate the square root of any positive real number in \(O(\log N)\) time, with precision fixed using bisection method of root-finding - string_fibonacci.cppThis Programme returns the Nth fibonacci as a string - sum_of_binomial_coefficient.cppAlgorithm to find sum of binomial coefficients of a given positive integer - sum_of_digits.cppA C++ Program to find the Sum of Digits of input integer - vector_cross_product.cppCalculates the Cross Product and the magnitude of two mathematical 3D vectors - volume.cppImplmentations for the volume of various 3D shapes + string_fibonacci.cppThis Programme returns the Nth fibonacci as a string + sum_of_binomial_coefficient.cppAlgorithm to find sum of binomial coefficients of a given positive integer + sum_of_digits.cppA C++ Program to find the Sum of Digits of input integer + vector_cross_product.cppCalculates the Cross Product and the magnitude of two mathematical 3D vectors + volume.cppImplmentations for the volume of various 3D shapes   numerical_methods  babylonian_method.cppA babylonian method (BM) is an algorithm that computes the square root  bisection_method.cppSolve the equation \(f(x)=0\) using bisection method diff --git a/globals_func_m.html b/globals_func_m.html index 875d5b196..940074387 100644 --- a/globals_func_m.html +++ b/globals_func_m.html @@ -100,7 +100,7 @@ $(document).ready(function(){initNavTree('globals_func_m.html',''); initResizabl  

    - m -