Diploma Thesis Percolation Simulation
C++ Sourcecode Documentation

www.AndreasKrueger.de/thesis/code

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

my_vector.h File Reference

#include "little_helpers.h"

Include dependency graph for my_vector.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class  myVector

Functions

int getdim (const myVector &u)
REAL length (const myVector &u)
REAL squarelength (const myVector &u)
ostream & operator<< (ostream &os, myVector &z)
istream & operator>> (istream &is, myVector &z)
myVector operator- (const myVector &u, const myVector &v)
myVector operator- (const myVector &u)
REAL short_random (REAL L)
REAL long_random (REAL L)
bool operator< (const myVector &u, const myVector &v)
bool lower (const myVector &u, COORDFLOAT border, int dir)


Function Documentation

int getdim const myVector   u
 

Definition at line 90 of file my_vector.h.

References myVector::dim.

00090                               {
00091         return u.dim;
00092 }

REAL length const myVector   u [inline]
 

Definition at line 95 of file my_vector.h.

References COORDFLOAT, myVector::dim, REAL, sqrt(), and myVector::x.

Referenced by distance(), give_fillingfactor(), give_radius(), counters::neighbour_l(), counters::neighbour_naive(), operator<(), overlap(), percolating_fillingfactor_for_two_spheres_verbose(), R_critical(), R_critical_guessed(), datafiles::write_averaged_cuts_intro(), datafiles::write_cuts_intro(), datafiles::write_intro(), datafiles::write_intro7(), datafiles::write_intro8(), and datafiles::write_intro_square().

00095                                       {
00096    COORDFLOAT temp=0;
00097         for (int i=0;i<u.dim;i++) 
00098                 {temp+=u.x[i]*u.x[i];}
00099         return sqrt(temp);
00100 }

REAL long_random REAL    L
 

Definition at line 180 of file my_vector.h.

References REAL.

Referenced by myVector::randomvect(), and graphics::svg_circles().

00180                         {
00181         REAL temp=rand()+rand()/(REAL)RAND_MAX;
00182         temp*=L/(REAL)RAND_MAX;
00183         return temp;
00184 }

bool lower const myVector   u,
COORDFLOAT    border,
int    dir
 

Definition at line 211 of file my_vector.h.

References COORDFLOAT, myVector::dim, errorout(), and myVector::x.

Referenced by counters::combine(), counters::divide_all_spheres(), and analyze::edgespheres().

00211                                                           {
00212         // is myVector u in lower (than 'border') part of this dimensional direction?
00213         if ((dir<1)||(dir>u.dim)) {
00214                 errorout("space direction < 1 or > dim");
00215                 exit(1);
00216                 return false;
00217         }
00218         else return (u.x[dir-1] < border);
00219 }

myVector operator- const myVector   u
 

Definition at line 156 of file my_vector.h.

References myVector::dim, and myVector::nullvect().

00156                                       {
00157         myVector temp(u.dim);
00158         temp.nullvect();
00159         return (temp-=u);
00160 }

myVector operator- const myVector   u,
const myVector   v
 

Definition at line 145 of file my_vector.h.

References myVector::dim, and errorout().

00145                                                           {             
00146         if (u.dim!=v.dim) {
00147                 errorout("'-' different dimensionality");
00148                 return u;
00149         }
00150         else{
00151                 myVector temp = u;
00152                 return (temp -= v);                                                             // calls myVector::operator-=(myVector)
00153         }
00154 }

bool operator< const myVector   u,
const myVector   v
 

Definition at line 195 of file my_vector.h.

References length().

00195                                                      {                  // length order
00196   return (length(u) < length(v) );
00197 }

ostream& operator<< ostream &    os,
myVector   z
 

Definition at line 109 of file my_vector.h.

References myVector::dim, and myVector::x.

00109                                               {
00110         cout <<'(';
00111         for (int i=0;i<z.dim-1;i++) {
00112                 cout<<z.x[i]<<',';
00113         }
00114         return os<<z.x[z.dim-1]<<')';
00115 }

istream& operator>> istream &    is,
myVector   z
 

Definition at line 117 of file my_vector.h.

References myVector::dim, and myVector::x.

00117                                               {
00118         for (int i=0;i<z.dim;i++) {
00119                 cin>>z.x[i];
00120         }
00121         return is;
00122 }

REAL short_random REAL    L
 

Definition at line 175 of file my_vector.h.

References REAL.

00175                            {
00176         REAL temp=rand()*L/(double)RAND_MAX;
00177         return temp;
00178 }

REAL squarelength const myVector   u
 

Definition at line 102 of file my_vector.h.

References COORDFLOAT, myVector::dim, REAL, and myVector::x.

Referenced by overlap2().

00102                                      {
00103    COORDFLOAT temp=0;
00104         for (int i=0;i<u.dim;i++) 
00105                 {temp+=u.x[i]*u.x[i];}
00106         return temp;
00107 }




Diploma Thesis Sourcecode Documentation
check out the text and the executable binaries

www.AndreasKrueger.de/thesis/code