This project implements a calculator application with support for basic arithmetic operations, matrix math, and probability distributions.
Contains Text class with methods to print menus and execute math operations.
matrix_menu()
- Prints menu for matrix operationsmatrix_sum()
- Adds two matricesmatrix_diff()
- Subtracts two matricesmatrix_prod()
- Multiplies two matricesmatrix_transpose()
- Transposes a matrixmatrix_scale()
- Multiplies a matrix by a scalarmatrix_det()
- Calculates determinant of a matrixbasic_menu()
- Prints menu for basic arithmeticbye()
- Prints goodbye message
Contains Matrix class to represent matrices and perform operations.
inputMatrix()
- Inputs matrix values from userprintMatrix()
- Prints matrix contentstranspose()
- Returns transpose of matrixscaleMatrix()
- Returns matrix multiplied by scalardeterminant_2_2()
- 2x2 determinantdeterminant_3_3()
- 3x3 determinantdeterminant_4_4()
- 4x4 determinantfill()
- Fills matrix from vectorinverse_2_2()
- Finds inverse of 2x2 matrixoperator+
- Overloaded + for matrix additionoperator-
- Overloaded - for matrix subtractionoperator|
- Overloaded | for matrix multiplicationoperator[]
- Overloaded [] for element access
Implements Cramer's rule for solving a system of linear equations.
get_ratio()
- Parses equation string into coefficient ratiosis_correct()
- Checks format of equationstart_crammer()
- Implements Cramer's rule
Computes probability mass functions for various discrete distributions.
factorial()
- Computes factorialbernoulli()
- Bernoulli distribution PMFpoisson()
- Poisson distribution PMFlaplace_local()
- Localized Laplace distribution PMF
Entry point and main application loop.
- Sets up signal handler for keyboard interrupt
- Prints operation menus and reads user input
- Calls appropriate functions based on input
- Loops until the user quits
The code demonstrates good practices like separating interface and implementation (text vs matrix), overloading operators, and using const correctness. Overall, it provides a useful set of math utilities in an easy-to-use application.