marUtils Class Reference

#include <marUtils.h>

List of all members.

Public Member Functions

 marUtils ()
 ~marUtils ()
double obtainAverage (std::vector< double > list)
double obtainStandardDeviation (std::vector< double > list, double average)

Detailed Description

Definition at line 10 of file marUtils.h.


Constructor & Destructor Documentation

marUtils::marUtils (  ) 

Definition at line 5 of file marUtils.cpp.

00006 {
00007 
00008 }

marUtils::~marUtils (  ) 

Definition at line 11 of file marUtils.cpp.

00012 {
00013 
00014 }


Member Function Documentation

double marUtils::obtainAverage ( std::vector< double >  list  ) 

Definition at line 16 of file marUtils.cpp.

Referenced by marAxisCT::generatePoints().

00017 {
00018         double average = 0;
00019         for (int i = 0; i < list.size(); i++)
00020         {
00021                 average += list[i];
00022         }
00023 
00024         if (list.size() > 0)
00025         {
00026                 average = average / list.size();
00027         }
00028 
00029         return average;
00030 
00031 }

Here is the caller graph for this function:

double marUtils::obtainStandardDeviation ( std::vector< double >  list,
double  average 
)

Definition at line 34 of file marUtils.cpp.

Referenced by marAxisCT::generatePoints().

00035 {
00036         double std = 0;
00037 
00038         for(int i = 0; i < list.size(); i++)
00039         {
00040                 std += pow(list[i] - average,2.0);
00041         }
00042 
00043         if (list.size() > 0)
00044         {
00045                 std = sqrt(std/list.size());
00046         }
00047 
00048         return std;
00049 }

Here is the caller graph for this function:


The documentation for this class was generated from the following files:

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1