8 TRVector::TRVector(Int_t nrows):
TRMatrix(nrows,1) {;}
10 TRVector::TRVector(Int_t nrows,
const Double_t *fArray):
TRMatrix(nrows,1,fArray){;}
12 TRVector::TRVector(Int_t nrows,
const Float_t *fArray):
TRMatrix(nrows,1,fArray){;}
14 TRVector::TRVector(
const TRMatrix& A, ETRMatrixCreatorsOp kop,
const TRVector& B) :
17 TRVector::TRVector(
const TRMatrix& S, Int_t I) {
18 if (I == 0) {
::Error(
"TRVector::TRVector(const TRMatrix&)",
"index i %d out of bounds (size: %d, this: %p)",
19 I, S.NI(),
this); I = 1;}
20 if (I > S.NI()) {
::Error(
"TRVector::TRVector(const TRMatrix&)",
"index i %d out of bounds (size: %d, this: %p)",
21 I, S.NI(),
this); I = 1;}
24 Set(fNrows,S.GetArray()+S.NJ()*(I-1));
27 TRVector::TRVector(
const TRVector& A, ETRMatrixCreatorsOp kop,
const TRMatrix& B) {
31 NI = A.GetNrows(); fNcols = NI;
33 assert (NJ == B.GetNrows());
34 NK = B.GetNcols(); fNrows = NK;
36 TCL::mxmpy(A.GetArray(),B.GetArray(),fArray,NI,NJ,NK);
39 Error(
"TRVector(ETRMatrixCreatorsOp)",
"operation %d not yet implemented", kop);
43 TRVector::TRVector(Int_t nrows,
const Char_t *s):
TRMatrix(nrows,1,s) {;}
51 TRVector::TRVector(Int_t nrows,Double_t a0, ...) :
TRMatrix(nrows,1) {
55 TRVector::TRVector(
const TVector3& A) :
TRMatrix(3,1) {
65 TRVector &TRVector::operator=(
const TVector3& A) {
81 ostream& operator<<(ostream& s,
const TRVector &target) {
82 Int_t Nrows = target.GetNrows();
83 assert(target.GetNcols() == 1);
84 const Double_t *Array = target.GetArray();
85 s <<
"Vector[" << Nrows <<
"] = ";
86 if (Array)
for (
int i = 0; i< Nrows; i++) s << Form(
"\t%10.3f",Array[i]);
92 void TRVector::Print(Option_t *opt)
const {
if (opt) {}; cout << *
this << endl;}
95 assert(fNrows == 3 && fNcols == 1 && v.GetNrows() == 3 && v.GetNcols() == 1);
97 TMath::Cross(GetArray(),v.GetArray(),out.GetArray());
102 Double_t Norm = TMath::Sqrt((*
this) * (*
this));
103 return Norm > 0 ? (*this)/Norm : *
this;