Example #1
0
double Prod(CVector &vec) {
  double dProd=1;
  if(! vec.Defined()) {throw ELENotDefined; }

  for(int i=0; i<vec.m_pnDimSize[0]; i++) {
    dProd *= double(vec[i]);
  } // for i

  if(vec.Allocated()) {delete &vec; } // This should call for the destructor
  return dProd;
} // Prod
Example #2
0
double Max(CVector &vec) {
  double dMax;
  if(! vec.Defined()) {throw ELENotDefined; }
  
  dMax = vec[0];
  for(int i=0; i<vec.m_pnDimSize[0]; i++) {
    if(vec[i] > dMax) dMax = double(vec[i]);
  } // for i

  if(vec.Allocated()) {delete &vec; } // This should call for the destructor
  return dMax;
} // Max