Overload List
| # | Signature | Description |
|---|---|---|
| 1 | double RMS(); | Root mean square (RMS). |
| 2 | double RMS(int Index, int Len); | Calculate the RMS for calling object elements [Index]..[Index+Len-1] in-place. |
Overload 1: double RMS();
Root mean square (RMS).
Remarks:
Calculate the root mean square value for all calling object elements in-place. The root mean square (RMS) is defined by the equation:
Examples
#include "Units.MtxVec.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVec;
void Example()
{
TVec* a;
CreateIt(a);
a->SetIt(true, DewArray<double>{1,2, 3,4}); // 1+2i ; 3+4i
double c = a->RMS();
FreeIt(a);
}
#include "MtxExpr.h"
#include "Units.Math387.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::Math387;
void Example()
{
Vector a;
a.SetIt(DewArray<double>{ 1.0, 2.0, 3.0, 4.0 });
double result = a.RMS();
if (Abs(result - 2.73861278752583) > 1e-10)
throw tException(DewString("Vector.RMS: expected 2.73861278752583, got ") + SampleToStr(result));
}
See Also: TMtx::StdDev
Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler
Overload 2: double RMS(int Index, int Len);
Calculate the RMS for calling object elements [Index]..[Index+Len-1] in-place.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | int | |
| 2 | Len | int |
Remarks:
An exception is raised if array borders are overrun.
Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler