Question
c++ help please! much appreciated! need a .cpp and .hpp file that can successfully run through these tests, thank you very much! printed below to
c++ help please! much appreciated!
need a .cpp and .hpp file that can successfully run through these tests, thank you very much!
printed below to be able to copy/paste into compiler
-------------------------------------------
#include "catch/catch.hpp" #include "../matrix3d.hpp"
TEST_CASE ("Default Matrix") { Matrix3D m; CHECK(0 == m.GetValue(0, 0)); }
TEST_CASE ("Specified Matrix") { /* 1 0 2 1 2 0 1 0 0 */
Matrix3D m(1,0,2, 1,2,0, 1,0,0); CHECK(1 == m.GetValue(0, 0)); CHECK(2 == m.GetValue(0, 2)); }
TEST_CASE ("Determinant for default matrix") { Matrix3D m; CHECK(0 == m.Determinant()); }
TEST_CASE ("Determinant for specified matrix") { Matrix3D m(1,0,2, 1,2,0, 1,0,0); // https://www.wolframalpha.com/input/?i=%7B%7B1%2C0%2C2%7D%2C%7B1%2C2%2C0%7D%2C%7B1%2C0%2C0%7D%7D CHECK(-4 == m.Determinant()); }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started