Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

mmath.cc File Reference

More...

#include <stdlib.h>
#include "magic/mmath.h"
#include "magic/mcoord.h"
#include "magic/mmagisupp.h"

Go to the source code of this file.

Functions

 BEGIN_NAMESPACE (MagiC)
double sum (const Vector &x)
double min (const Vector &x)
int minIndex (const Vector &x)
double max (const Vector &x)
int maxIndex (const Vector &x)
double avg (const Vector &x)
double stddev (const Vector &x)
double stdmerr (const Vector &x)
Vector histogram (const Vector &x, int n)
void add (Vector &x, double a)
void multiply (Vector &x, double m)
void multiplyToUnity (Vector &x)


Detailed Description

Definition in file mmath.cc.


Function Documentation

void add Vector   x,
double    m
 

Adds a value to the Vector .

Definition at line 112 of file mmath.cc.

References PackArray::size().

Referenced by multiplyToUnity().

double avg const Vector   x
 

Average of the values in Vector x.

Definition at line 58 of file mmath.cc.

References PackArray::size(), and sum().

Referenced by stddev().

BEGIN_NAMESPACE MagiC   
 

This file is part of the MagiC++ library.

* * Copyright (C) 1998-2002 Marko Grönroos <magi@iki.fi> * *

* This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, Inc., 59 Temple Place *

  • Suite 330, Boston, MA 02111-1307, USA. * *

Vector histogram const Vector   x,
int    n
 

Creates a histogram with n slots of the values in the Vector.

Definition at line 74 of file mmath.cc.

References PackArray::make(), max(), min(), and PackArray::size().

double max const Vector   x
 

Largest value in Vector x.

Definition at line 39 of file mmath.cc.

References is_undef(), max(), and PackArray::size().

Referenced by histogram(), max(), and maxIndex().

int maxIndex const Vector   x
 

The index of the largest value in Vector x.

Definition at line 47 of file mmath.cc.

References is_undef(), max(), and PackArray::size().

double min const Vector   x
 

Lowest value in Vector x.

Definition at line 20 of file mmath.cc.

References is_undef(), min(), and PackArray::size().

Referenced by histogram(), min(), and minIndex().

int minIndex const Vector   x
 

The index of the lowest value in Vector x.

Definition at line 28 of file mmath.cc.

References is_undef(), min(), and PackArray::size().

void multiply Vector   x,
double    m
 

Multiplies the values in the Vector with a coefficient.

Definition at line 117 of file mmath.cc.

References PackArray::size().

Referenced by multiplyToUnity().

void multiplyToUnity Vector   x
 

Multiplies the values in the Vector so that they sum to 1.0.

Definition at line 122 of file mmath.cc.

References add(), multiply(), PackArray::size(), and sum().

double stddev const Vector   x
 

Standard deviation of the values in Vector x.

Definition at line 62 of file mmath.cc.

References avg(), and PackArray::size().

Referenced by stdmerr().

double stdmerr const Vector   x
 

Standard error of the values in Vector x.

Definition at line 70 of file mmath.cc.

References PackArray::size(), and stddev().

double sum const Vector   x
 

Sum of values in Vector x.

Definition at line 13 of file mmath.cc.

References PackArray::size().

Referenced by avg(), Matrix::multiplyToSum(), and multiplyToUnity().


Generated on Thu Feb 10 20:06:43 2005 for LibMagiC by doxygen1.2.18