#include <magic/mobject.h>
#include <magic/mpackarray.h>
#include <math.h>
Go to the source code of this file.
Defines | |
#define | ROUND_DOUBLE_THRESHOLD 1e-15 |
Typedefs | |
typedef PackArray< double > | Vector |
Functions | |
BEGIN_NAMESPACE (MagiC) | |
int | rnd (int range) |
double | frnd () |
double | gaussrnd (double stdv) |
double | sqr (double x) |
double | sigmoid (double x) |
void | swap (double &x, double &y) |
bool | is_undef (double x) |
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 m) |
void | multiply (Vector &x, double m) |
void | multiplyToUnity (Vector &x) |
Definition in file mmath.h.
|
Threshold for rounding values in certain functions.
|
|
Vector is just an alias for the PackArray<double>, not even a subclass.
|
|
Adds a value to the Vector .
Definition at line 112 of file mmath.cc. References PackArray::size(). Referenced by multiplyToUnity(). |
|
Average of the values in Vector x.
Definition at line 58 of file mmath.cc. References PackArray::size(), and sum(). Referenced by stddev(). |
|
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 *
|
|
Returns a double-float random value between 0 and 1.
Definition at line 408 of file mobject.cc. |
|
Returns a normally distributed random value with the given standard deviation.
Definition at line 412 of file mobject.cc. |
|
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(). |
|
Retuns if the given value has an "undefined" value.
Definition at line 78 of file mmath.h. Referenced by max(), maxIndex(), min(), and minIndex(). |
|
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(). |
|
The index of the largest value in Vector x.
Definition at line 47 of file mmath.cc. References is_undef(), max(), and PackArray::size(). |
|
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(). |
|
The index of the lowest value in Vector x.
Definition at line 28 of file mmath.cc. References is_undef(), min(), and PackArray::size(). |
|
Multiplies the values in the Vector with a coefficient.
Definition at line 117 of file mmath.cc. References PackArray::size(). Referenced by multiplyToUnity(). |
|
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(). |
|
Returns a random integer value in range 0..range-1.
Definition at line 404 of file mobject.cc. |
|
Standard sigmoid (logistic) function.
|
|
Square x^2.
Definition at line 52 of file mmath.h. References sqr(). Referenced by sqr(). |
|
Standard deviation of the values in Vector x.
Definition at line 62 of file mmath.cc. References avg(), and PackArray::size(). Referenced by stdmerr(). |
|
Standard error of the values in Vector x.
Definition at line 70 of file mmath.cc. References PackArray::size(), and stddev(). |
|
Sum of values in Vector x.
Definition at line 13 of file mmath.cc. References PackArray::size(). Referenced by avg(), Matrix::multiplyToSum(), and multiplyToUnity(). |
|
Simple swap operation on doubles.
|