Complex Math Library for C++
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitattributes
.gitignore
AbsFunction.o
ArgFunction.o
ComplexLibrary.a
ComplexMath.o
ComplexRunner.cpp
ComplexRunner.exe
ConjFunction.o
DivideEqualsOperator.o
DivideOperator.o
EqualsOperator.o
ExtractOperator.o
ImagFunction.o
InsertOperator.o
MinusEqualsOperator.o
MinusOperator.o
MultiplyEqualsOperator.o
MultiplyOperator.o
NormFunction.o
PlusEqualsOperator.o
PlusOperator.o
README.md
RealFunction.o
Trello.zip
lasa-complexmath.zip

README.md

lasa-complexmath

This is a C++ library built to handle mathematical operations and functions for complex numbers. It was created as a project for an Advanced Computer Programming course.

Library Compilation & Testing

Building the Static Library in Unix (Git Bash on Windows)

  1. Compile each individual C++ file in the terminal using gcc -c src/*.cpp in the main directory
    • The -c switch tells GCC to compile and assemble but not link the files
    • The *.cpp will compile every C++ file in the src folder
    • This will create object files outside of the src folder
  2. The static library can then be created using ar rsv ComplexLibrary.a *.o
    • The r switch replaces any previous libraries with that name
    • The s switch creates an archive
    • The v switch uses verbose to provide additional output
    • The *.o will add every compiled C++ file in the directory
  3. The library contents can be verified with ar -t ComplexLibrary.a

Testing the Static Library for Windows

To run the ComplexRunner.cpp file, use the command g++ ComplexRunner.cpp -o ComplexRunner.exe ComplexLibrary.a in the main directory. This will create ComplexRunner.exe that is linked to the static library. To run the file, type ComplexRunner into the terminal.