]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
added comments to satisfy coding conventions
authorshahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Mar 2010 18:50:06 +0000 (18:50 +0000)
committershahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Mar 2010 18:50:06 +0000 (18:50 +0000)
STEER/AliSymMatrix.cxx
STEER/AliSymMatrix.h

index d5a78cea796d4603de64f87d7bc621c8d76535e1..ef7cea57deed0797e5f643f32e9e48382a6df11d 100644 (file)
@@ -14,6 +14,7 @@
 #include <stdio.h>
 #include <iostream>
 #include <float.h>
+#include <string.h>
 //
 #include <TClass.h>
 #include <TMath.h>
@@ -32,6 +33,7 @@ Int_t         AliSymMatrix::fgCopyCnt = 0;
 AliSymMatrix::AliSymMatrix() 
 : fElems(0),fElemsAdd(0)
 {
+  // default constructor
   fSymmetric = kTRUE;
   fgCopyCnt++;
 }
@@ -40,7 +42,7 @@ AliSymMatrix::AliSymMatrix()
 AliSymMatrix::AliSymMatrix(Int_t size)
   : AliMatrixSq(),fElems(0),fElemsAdd(0)
 {
-  //
+  //constructor for matrix with defined size
   fNrows = 0;
   fNrowIndex = fNcols = fRowLwb = size;
   fElems     = new Double_t[fNcols*(fNcols+1)/2];
@@ -54,6 +56,7 @@ AliSymMatrix::AliSymMatrix(Int_t size)
 AliSymMatrix::AliSymMatrix(const AliSymMatrix &src) 
   : AliMatrixSq(src),fElems(0),fElemsAdd(0)
 {
+  // copy constructor
   fNrowIndex = fNcols = src.GetSize();
   fNrows = 0;
   fRowLwb = src.GetSizeUsed();
@@ -88,7 +91,7 @@ AliSymMatrix::~AliSymMatrix()
 //___________________________________________________________
 AliSymMatrix&  AliSymMatrix::operator=(const AliSymMatrix& src)
 {
-  //
+  // assignment operator
   if (this != &src) {
     TObject::operator=(src);
     if (GetSizeBooked()!=src.GetSizeBooked() && GetSizeAdded()!=src.GetSizeAdded()) {
@@ -131,7 +134,7 @@ AliSymMatrix&  AliSymMatrix::operator=(const AliSymMatrix& src)
 //___________________________________________________________
 AliSymMatrix& AliSymMatrix::operator+=(const AliSymMatrix& src)
 {
-  //
+  // add operator
   if (GetSizeUsed() != src.GetSizeUsed()) {
     AliError("Matrix sizes are different");
     return *this;
@@ -143,6 +146,7 @@ AliSymMatrix& AliSymMatrix::operator+=(const AliSymMatrix& src)
 //___________________________________________________________
 void AliSymMatrix::Clear(Option_t*)
 {
+  // clear dynamic part
   if (fElems) {delete[] fElems; fElems = 0;}
   //  
   if (fElemsAdd) {
@@ -166,6 +170,7 @@ Float_t AliSymMatrix::GetDensity() const
 //___________________________________________________________
 void AliSymMatrix::Print(Option_t* option) const
 {
+  // print itself
   printf("Symmetric Matrix: Size = %d (%d rows added dynamically), %d used\n",GetSize(),GetSizeAdded(),GetSizeUsed());
   TString opt = option; opt.ToLower();
   if (opt.IsNull()) return;
@@ -353,6 +358,7 @@ Bool_t AliSymMatrix::SolveChol(TVectorD &brhs, TVectorD &bsol,Bool_t invert)
 //___________________________________________________________
 void AliSymMatrix::AddRows(int nrows)
 {
+  // add empty rows
   if (nrows<1) return;
   Double_t **pnew = new Double_t*[nrows+fNrows];
   for (int ir=0;ir<fNrows;ir++) pnew[ir] = fElemsAdd[ir]; // copy old extra rows
@@ -420,6 +426,7 @@ void AliSymMatrix::AddToRow(Int_t r, Double_t *valc,Int_t *indc,Int_t n)
 //___________________________________________________________
 Double_t* AliSymMatrix::GetRow(Int_t r)
 {
+  // get pointer on the row
   if (r>=GetSize()) {
     int nn = GetSize();
     AddRows(r-GetSize()+1); 
index 1f0eaea9492932aa51a2e8de0dbb06c757871877..4e49e0cc03f79366e7e32c849b606bb8b0b44f64 100644 (file)
@@ -13,8 +13,6 @@
 /*                                                                                            */ 
 /**********************************************************************************************/
 
-#include <string.h>
-#include <TObject.h>
 #include <TVectorD.h>
 #include "AliMatrixSq.h"
 
@@ -46,14 +44,14 @@ class AliSymMatrix : public AliMatrixSq {
   //
   Double_t*     GetRow(Int_t r);
   //
-  void          Print(Option_t* option="")                       const;
+  void          Print(const Option_t* option="")                 const;
   void          AddRows(int nrows=1);
   void          SetSizeUsed(Int_t sz)                                  {fRowLwb = sz;}
   //
   void          Scale(Double_t coeff);
   void          MultiplyByVec(Double_t* vecIn, Double_t* vecOut) const;
   void          MultiplyByVec(TVectorD &vecIn, TVectorD &vecOut) const;
-  void          AddToRow(Int_t r, Double_t *valc,Int_t *indc,Int_t n);
+  void          AddToRow(Int_t r, Double_t *valc, Int_t *indc,Int_t n);
   //
   // ---------------------------------- Dummy methods of MatrixBase
   virtual       const Double_t   *GetMatrixArray  () const {return fElems;};
@@ -132,7 +130,7 @@ inline void AliSymMatrix::Scale(Double_t coeff)
 }
 
 //___________________________________________________________
-inline void AliSymMatrix::AddToRow(Int_t r, Double_t *valc,Int_t *indc,Int_t n)
+inline void AliSymMatrix::AddToRow(Int_t r, Double_t *valc, Int_t *indc,Int_t n)
 {
   for (int i=n;i--;) (*this)(indc[i],r) += valc[i];
 }