Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What would be a way to make a 3x3 matrix that would pass these tests but are also using two seperate classes. one that is

What would be a way to make a 3x3 matrix that would pass these tests but are also using two seperate classes. one that is matrix3d.hpp and matrix3d.cpp.

The bottom part got cut out but it is:

CHECK(-4 == m.Determinant());

}

image text in transcribed

test > 6 test-3-matrix3d.cpp 1 #include "catch/catch.hpp" 2 #include "../matrix3d.hpp" 3 4 TEST_CASE ("Default Matrix") 5 { 6 Matrix3D m; 7 CHECK (0 == m. GetValue(0, 0)); 8 } 9 10 TEST_CASE ("Specified Matrix") 11 { 12 13 1 0 2 14 1 2 0 15 1 00 16 * 17 18 Matrix3D m(1,0,2, 1,2,0, 1,0,0); 19 CHECK(1 == m. GetValue(0, 0)); 20 CHECK ( 2 == m.GetValue(0, 2)); 21 } 22 23 TEST_CASE ("Determinant for default matrix") 24 { 25 Matrix3D m; 26 CHECK (0 == m.Determinant(); 27 } 28 29 TEST_CASE ("Determinant for specified matrix") 30 31 Matrix3D m(1,2,2, 1,2,0, 1,0,0);|| 32 CHECK(-4 == m.Determinant()); 22 test > 6 test-3-matrix3d.cpp 1 #include "catch/catch.hpp" 2 #include "../matrix3d.hpp" 3 4 TEST_CASE ("Default Matrix") 5 { 6 Matrix3D m; 7 CHECK (0 == m. GetValue(0, 0)); 8 } 9 10 TEST_CASE ("Specified Matrix") 11 { 12 13 1 0 2 14 1 2 0 15 1 00 16 * 17 18 Matrix3D m(1,0,2, 1,2,0, 1,0,0); 19 CHECK(1 == m. GetValue(0, 0)); 20 CHECK ( 2 == m.GetValue(0, 2)); 21 } 22 23 TEST_CASE ("Determinant for default matrix") 24 { 25 Matrix3D m; 26 CHECK (0 == m.Determinant(); 27 } 28 29 TEST_CASE ("Determinant for specified matrix") 30 31 Matrix3D m(1,2,2, 1,2,0, 1,0,0);|| 32 CHECK(-4 == m.Determinant()); 22

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago