This application was completed as a part of a piece of coursework for the Research Computing with C++ module.
Use this app to solve a 1D linear system, using either the normal equations or singular value decomposition.
Taken from link
- Run cmake-gui.exe
- Select source folder
- Specify new build folder (ensure it's out of source)
- Hit configure
- When asked, specify compiler
- Set flags and repeatedly configure
- When generate option is present, hit generate
- Compile, normally using Visual Studio
Out of source build
# exit source directory
cd ../
# create build directory
mkdir build
cd build
# configure and build
ccmake ../MPHY0022CW1
make
Navigate to binary application LinearRegression
cd bin
# run app
./LinearRegression
./LinearRegression -f, --file <data_file> -s, --solver <solver_method>
# for example
./LinarRegression -f data.txt -s 'normal'
# or
./LinearRegression data.txt 'normal'
Ctest is fully integrated with test explorer in visual studio, allowing you to build and run tests from there. See the following link for instructions.
If you have built the app, navigate to build directory and run tests with CTest
cd build
ctest
Otherwise, follow instructions above to build app, ensuring to select the build tests configuration in the CMake gui.
Adding to bash profile will allow you to use the application from your Terminal, without having to remember where you've stored the app binary.
Create alias in .bash_profile
(mac) .bashrc
Linux.
alias linreg='~/Path/To/App/LinearRegression'
Reset bash settings
e.g.
source ~/.bash_profile
And access from a new terminal window.