BRL-CAD
vm_test.cpp File Reference

Simple Test cases for Math Virtual Machine. More...

#include "common.h"
#include "pcMathGrammar.h"
#include "pcMathVM.h"
#include <iostream>
#include <cmath>
Include dependency graph for vm_test.cpp:

Go to the source code of this file.

Typedefs

typedef boost::shared_ptr< MathFunction > ct
 
typedef double(* function2_ptr) (double, double)
 
typedef double(* function1_ptr) (double)
 

Functions

double add (double a, double b)
 
double multiply (double a, double b)
 
double div (double a, double b)
 
double avg (double a, double b)
 
boost::shared_ptr< MathFunction > make_function (char const *name, function2_ptr f2_p)
 
boost::shared_ptr< MathFunction > make_function (char const *name, function1_ptr f1_p)
 
void findfunction (ct **ap, const char *s, MathVM &vm)
 
void eval ()
 
int main ()
 

Detailed Description

Simple Test cases for Math Virtual Machine.

Definition in file vm_test.cpp.

Typedef Documentation

typedef boost::shared_ptr<MathFunction> ct

Definition at line 34 of file vm_test.cpp.

typedef double(* function2_ptr) (double, double)

Definition at line 45 of file vm_test.cpp.

typedef double(* function1_ptr) (double)

Definition at line 46 of file vm_test.cpp.

Function Documentation

double add ( double  a,
double  b 
)

Definition at line 38 of file vm_test.cpp.

Referenced by ShadingContext::closure_add_allot(), eval(), rt_hyp_tess(), and rt_revolve_plot().

double multiply ( double  a,
double  b 
)

Definition at line 39 of file vm_test.cpp.

Referenced by eval().

double div ( double  a,
double  b 
)

Definition at line 40 of file vm_test.cpp.

Referenced by eval().

double avg ( double  a,
double  b 
)

Definition at line 41 of file vm_test.cpp.

Referenced by eval().

boost::shared_ptr<MathFunction> make_function ( char const *  name,
function2_ptr  f2_p 
)

Definition at line 49 of file vm_test.cpp.

Referenced by eval().

boost::shared_ptr<MathFunction> make_function ( char const *  name,
function1_ptr  f1_p 
)

Definition at line 56 of file vm_test.cpp.

void findfunction ( ct **  ap,
const char *  s,
MathVM &  vm 
)

Definition at line 68 of file vm_test.cpp.

References s.

Referenced by eval().

void eval ( )

Definition at line 79 of file vm_test.cpp.

References add(), avg(), div(), evaluate(), findfunction(), make_function(), and multiply().

Referenced by main(), OSLRenderer::QueryColor(), and rt_nurb_crv_in_range().

Here is the call graph for this function:

int main ( void  )

Definition at line 137 of file vm_test.cpp.

References eval().

Here is the call graph for this function: