proj home

Files   Classes   Functions   Hierarchy  

util01.cpp File Reference

#include <iostream>
#include <fstream>
#include <point.h>
#include <d3func.h>
#include <d3sphere.h>
#include <rand.h>

Include dependency graph for util01.cpp:

Go to the source code of this file.

Typedefs

typedef point3< double > pt3
typedef unsigned int uint
typedef unsigned int const uintc

Functions

void d3writefile (string const name, uintc n)
void test01 ()
void test02 ()
int main (int argc, char **argv)

Variables

d3funcp3dfunc = new d3sphere(pt3(),0.6)


Typedef Documentation

typedef point3<double> pt3

Definition at line 16 of file util01.cpp.

typedef unsigned int uint

Definition at line 18 of file util01.cpp.

typedef unsigned int const uintc

Definition at line 19 of file util01.cpp.


Function Documentation

void d3writefile ( string const   name,
uintc  n 
)

Definition at line 26 of file util01.cpp.

References d3func::eval(), and r.

Referenced by test01(), and test02().

00027 {
00028   ofstream f1(name.c_str());
00029 
00030   random11<double> r;
00031 
00032   f1 << n << endl;
00033   for (uint i=0; i<n; ++i)
00034   {
00035     pt3 x(-1.0+2.0*r(),-1.0+2.0*r(),-1.0+2.0*r());
00036     f1 << x << " " << p3dfunc->eval(x) << endl;
00037   }
00038 
00039 } 

int main ( int  argc,
char **  argv 
)

Definition at line 68 of file util01.cpp.

References test01().

00069 {
00070 
00071   test01();
00072 
00073   return 0;
00074 }

void test01 (  ) 

Definition at line 41 of file util01.cpp.

References d3writefile().

00042 {
00043   cout << "Utiltiy program:  Generating files of data points." << endl;
00044   cout << "Enter the number of points n: ";
00045   uint n;
00046   cin >> n;
00047   cout << "Enter the file name: ";
00048   string name;
00049   cin >> name;
00050 
00051   d3writefile(name,n);
00052 }

void test02 (  ) 

Definition at line 54 of file util01.cpp.

References d3writefile().

00055 {
00056   cout << "Generating Test files increasing in powers of two." << endl;
00057 
00058   d3writefile("data0",50);
00059   d3writefile("data1",100);
00060   d3writefile("data2",200);
00061   d3writefile("data3",400);
00062   d3writefile("data4",800);
00063   d3writefile("data5",1600);
00064   d3writefile("data6",3200);
00065 }


Variable Documentation

d3func* p3dfunc = new d3sphere(pt3(),0.6)

Definition at line 23 of file util01.cpp.


Generated on Fri Mar 4 00:49:48 2011 for Chelton Evans Source by  doxygen 1.5.8