Design and Implementation: Elementary Linear Algebra Multi-Purpose Calculator
Introduction
Linear algebra plays an essential role in fields ranging from computer science, applied
mathematics, engineering, and more. The ability to perform operations such as matrix
multiplication, row reduction, and eigenvalue computation is an essential skill in many fields.
The project focuses on implementing many core linear algebra operations learned throughout the
course into one flexible design through C++.
Objectives
•
Build a C++ program that performs multiple linear algebra computations through a textbased interface
•
Expand on existing calculators as most only perform one or two functions
•
Ensure correct implementation of each function
•
Design the code for easy testing
•
Demonstrate knowledge about linear algebra concepts learned
Implementation
The program was developed using C++ and implementing several different functions to be called
based on the user input. The separate functions handle reading matrix dimensions and values
from the user as well as ensure validity and compatibility. The program allows the user to
perform functions such as row reducing, adding matrices, subtracting matrices, multiplying
matrices, calculating determinants, finding the inverse, checking linear independence, computing
rank and nullity, as well as computing the eigenvalues and eigenvectors of a 2x2 matrix. The
program presents a text-based menu with options corresponding to each operation. When the
user selects an option, it prompts the user to input their matrix or matrices. An error message is
also prompted if dimensions are invalid, such as for matrix multiplication.
Testing and Results
Row Reduction Results
Matrix Addition Results
Matrix Subtraction Results
Matrix Multiplication Results
Determinant Calculation Results
Inverse Calculation Results
Linear Independence Results
Rank and Nullity Results
Eigenvalue and Eigenvector Results
Future Work
•
Creating a more readable interface for the user
•
Additional calculators
•
Expanding the eigenvalue and eigenvector calculator to accept larger matrices
•
An option for file I/O to save or load matrices
Conclusion
The linear algebra calculator offers a foundational tool to perform essential matrix operations
without the need to seek multiple calculators. The program sets the stage for creating a more
advanced linear algebra calculator in the future to assist with multiple career fields without
creating the hassle of clicking through multiple calculators.