联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> C/C++编程C/C++编程

日期:2023-12-16 10:12


ASSIGNMENT: MATRIX AND VECTOR CLASSES TOTAL MARKS: 50%

Objectives

1. To understand and demonstrate your ability to use classes, their constructors, and operator overloading in C++.

Matrix and Vector Classes

In this assignment, you will create Vector and Matrix classes, which can carry out basic array and 2D-array functionalities and the mathematical operations we expect from such objects. Additionally, you can add more advanced features.

- First, you must create the two classes in question and set up their data structure (privately).

- Write suitable constructors and destructors. You are asked to use the constructors you learned about, such as default, parametrised, copy and move.

- Create some sort of access operators: how would you solve that for the matrix?

- Advanced: Create a VectorView class to read individual rows of the matrix. Use this class to recreate the [ ][ ] syntax of standard multidimensional arrays.

- Create .size() and .resize() methods.

- Make some convenient filling functions, such as zero to zero, or the identity.

- Add other functions you feel your objects should have, such as .norm( ) and .transpose( ).

- Now it is time to overload the various arithmetic operators, +, -, * (/). How does this work with combined expressions? (a+b)*c

Deliverables:

You should submit your project as a Zip file on CANVAS. I am expecting

your project organised in multiple files for clarity, i.e., lib_matrix.hpp, lib_matrix.cpp, lib_vector.hpp,lib_vector.cpp, lib_vectorview.hpp,

lib_vectorview.cpp and main.cpp.

Once you have completed and tested your project on Replit, you can download your entire project as a Zip file, as shown in the following example:

No report is necessary, but the code must have comments to help it be readable.


相关文章

版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp