Git Product home page Git Product logo

coursework-cpp's Introduction

Сoursework С++

Курсовая работа по дисциплине «Основы программирования»

Тема работы

Умножение длинных чисел используя быстрое преобразование Фурье

Задания курсовой работы:

  • Реализовать алгоритм быстрого преобразования Фурье
  • На его основе релизовать алгоритм умножения длинных чисел
  • Программа должна уметь считывать числа из файлов
  • Программа должна иметь интерфейс командной строки

Прочитать описание курсовой работы и используемых алгоримов можно здесь

Сборка

mkdir build && cd build
cmake ..
cmake --build .

При сборке проекта на Linux вместо cmake --build . можно использовать make

CMake

Запуск

multiplier [OPTIONS] [file 1] [file 2] [output]

Параметры

  • -h, --help - вывод справки
  • -v, --verbose - вывод дополнительной информации
  • -i, --interactive - интерактивный режим
  • -c, --column - использовать умножение столбиком
  • -b, --benchmark - выполнить бенчмарк (указывается количество итераций)

Примеры использования

Умножение двух чисел из файлов

> multiplier 1.txt 2.txt out.txt
Multiplying... (press Ctrl + C to interrupt)

Более подробный вывод:

> multiplier 1.txt 2.txt out.txt -v
Number 1 size: 42
Number 2 size: 4200

Multiplying... (press Ctrl + C to interrupt)

Result size: 4242
Result saved to out.txt

Использование бенчмарка:

> multiplier 1.txt 2.txt out.txt -b 100
Multiplying... (press Ctrl + C to interrupt)

Average time: 0.0042 ms / iter
Интерактивный режим

> multiplier -i
Enter two big numbers to multiply them
Press Ctrl + C or leave input empty to exit

[1] < -123456789
[1] < 123456789123456789
[1] > -15241578765432099750190521

[2] < aboba
[x] Invalid number

[3] < (pressing enter)

Bye! Have a nice day :)

Более подробный вывод:

> multiplier -i -v
Enter two big numbers to multiply them
Press Ctrl + C or leave input empty to exit

Enter first number:
[1] < 101010101010101010    
[i] Digits count: 18

Enter second number:
[1] < 424242424242424242     
[i] Digits count: 18

Result:
[1] > 42852770125497398138965411692684420
[i] Digits count: 35

Enter first number:
[2] < -00001
[i] Digits count: 1

Enter second number:
[2] < -0
[x] Invalid number

Использование бенчмарка:

> multiplier -i -v -b 100
Enter two big numbers to multiply them
Press Ctrl + C or leave input empty to exit

[i] Each operation will be repeated 100 times

Enter first number:
[1] < 011010000110100100100001
[i] Digits count: 23

Enter second number:
[1] < 424242424242424242424242 
[i] Digits count: 24

Result:
[1] > 4670909137618224284848904419999953290866624242
[i] Digits count: 46

[i] Average time: 0.0042 ms / iter

Тестирование

ctest

coursework-cpp's People

Contributors

potat-dev avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.