Answered step by step
Verified Expert Solution
Question
1 Approved Answer
just answer to do parts , / / = = = = = = = = = = = = = = = = =
just answer to do parts
FILE: vectordTh
#define vectordTH
#include
#include
#include
#include
#include
#include
template class vectord;
typedef vectord vectorD;
typedef vectord vectorF;
typedef vectord vectorI;
typedef vectord vectorL;
typedef vectorD vec;
template
class vectord class that serves as both vectors and points
public:
vectord;
vectordconst std::string& name, int dims;
vectordconst std::string& name, int dims, const std::initializerlist& li;
T operatorint i const;
T& operatorint i;
std::string name const;
void nameconst std::string& name;
T x const return data; readonly value of x
T y const return data;
T z const return data;
T& x return data; readwrite value of x
T& y return data;
T& z return data;
vectord& operatorconst vectord& v;
vectord& operatorconst vectord& v;
vectord& operatorT k;
vectord& operatorT k;
vectord& operatorT k;
vectord& operatorT k;
vectord operator;
friend vectord operatorconst vectord& u const vectord& v
checkequaldimsu v;
return vectorduname vname udims
u v u v u v;
friend vectord operatorconst vectord& u const vectord& v
checkequaldimsu v;
return vectorduname vname udims
u v u v u v;
friend vectord operatorconst vectord& v T k
return vectordvname std::tostringk vdims v k v
k v k;
friend vectord operatorT k const vectord& v return v k;
friend vectord operatorconst vectord& v T k
return vectordvname std::tostringk vdims v k v
k v k;
friend vectord operatorT k const vectord& v return v k;
friend vectord operatorconst vectord& v T k
return vectordvname std::tostringk vdims v k v
k v k;
;
friend vectord operatorT k const vectord& v return v k;
friend vectord operatorconst vectord& v T k
if k throw new std::invalidargumentdivide by zero";
double kinv k;
return v kinv;
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started