Home

greater_than_law Class Reference
[Laws]

Provides methods for the greater than boolean function. More...

#include <main_law.hxx>

Inheritance diagram for greater_than_law:

Inheritance graph
[legend]
Collaboration diagram for greater_than_law:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void add () const
 Increments the use count of this law.
virtual int associative () const
 Returns whether or not the given law is associative.
double bounds (double *low_range, double *high_range, double *low_domain=NULL, double *high_domain=NULL, double requested_tol=SPAresfit *0.5, double *min_gaps=NULL) const
 Sets the domain of this law.
virtual int branches () const
 Returns a non-negative integer that tells the dimension of the branches of this law.
logical cached_derivative (int deriv) const
 Returns TRUE or FALSE, depending upon whether or not the given derivative has been cached.
const char * class_name ()
 Returns a string that contains the name of this law's class.
virtual int commutative () const
 Returns whether or not the given law is commutative.
logical constant () const
 Determines whether or not this law is constant.
int date () const
 Returns the version of ACIS in which this law class first appeared.
virtual lawdeep_copy (base_pointer_map *pm=NULL) const
 Creates a copy of an item that does not share any data with the original.
virtual lawderivative (int which=0) const
 Returns a law that is a derivative of this law.
virtual lawenable_branching () const
 Returns a copy of this law with branching enabled.
double eval (double x, const int &side=*(int *) NULL_REF, const double &guess=*(double *) NULL_REF) const
 Evaluates this law at a real input and returns a real result.
void evaluate (double const *x, double *answer) const
 Evaluates this law at the given input.
SPAbox evaluate_B () const
 Returns the bounding box associated with this law.
virtual void evaluate_with_guess (const double *x, double *answer, const double *guess) const
 Evaluates this law using a best guess as to the answer (to minimize processing).
void evaluate_with_side (double const *x, double *answer, int const *side) const
 Evaluates this law on a specified side of the input value.
double evaluateC_R (complex_number c, const int *side=NULL, const double *guess=NULL) const
 Evaluates this law at a complex-number input and returns a real result.
void evaluateDM (const double *x, double *answer, int n, const int *side=NULL, const double *guess=NULL) const
 Evaluates the nth derivative of this law at an array of real inputs and returns an array of real results.
double evaluateDM_R (const double *x, int n, const int *side=NULL, const double *guess=NULL) const
 Evaluates the nth derivative of this law at an array of real inputs and returns a real result.
double evaluateDR_R (double x, int n, const int &side=*(int *) NULL_REF, const double &guess=*(double *) NULL_REF) const
 Evaluates the nth derivative of this law at a real input and returns a real result.
SPAvector evaluateDR_V (double x, int n, const int &side=*(int *) NULL_REF, const double &guess=*(double *) NULL_REF) const
 Evaluates the nth derivative of this law at a real input and returns an SPAvector result.
SPAmatrix evaluateM_MAT (const double *x) const
 Evaluates this law at an array of real inputs and returns an SPAmatrix result.
SPAposition evaluateM_P (const double *x, const int *side=NULL, const double *guess=NULL) const
 Evaluates this law at an array of real inputs and returns an SPAposition result.
SPApar_pos evaluateM_PP (const double *x, const int *side=NULL, const double *guess=NULL) const
 Evaluates this law at an array of real inputs and returns an SPApar_pos result.
double evaluateM_R (const double *x, const int *side=NULL, const double *guess=NULL) const
 Evaluates this law at an array of real inputs and returns a real result.
SPAtransf evaluateM_T (const double *x) const
 Evaluates this law at an array of real inputs and returns an SPAtransf result.
SPAvector evaluateM_V (const double *x, const int *side=NULL, const double *guess=NULL) const
 Evaluates this law at an array of real inputs and returns an SPAvector result.
SPAposition evaluateNV_P (const SPAnvector &nv, const int *side=NULL, const double *guess=NULL) const
 Evaluates this law at an SPAnvector input and returns an SPAposition result.
double evaluateNV_R (const SPAnvector &nv, const int *side=NULL, const double *guess=NULL) const
 Evaluates this law at an input of type SPAnvector and returns a real result.
SPAvector evaluateNV_V (const SPAnvector &nv, const int *side=NULL, const double *guess=NULL) const
 Evaluates this law at an SPAnvector input and returns an SPAnvector result.
SPAposition evaluateP_P (SPAposition p, const int *side=NULL, const double *guess=NULL) const
 Evaluates this law at an SPAposition input and returns an SPAposition result.
SPApar_pos evaluateP_PP (const SPAposition &p, const int *side=NULL, const double *guess=NULL) const
 Evaluates this law at an SPAposition input and returns an SPApar_pos result.
SPAposition evaluatePP_P (const SPApar_pos &pp, const int *side=NULL, const double *guess=NULL) const
 Evaluates this law at an SPApar_pos input and returns an SPAposition result.
SPAvector evaluatePP_V (const SPApar_pos &pp, const int *side=NULL, const double *guess=NULL) const
 Evaluates this law at an SPApar_pos input and returns an SPAvector result.
SPAposition evaluateR_P (double x, const int &side=*(int *) NULL_REF, const double &guess=*(double *) NULL_REF) const
 Evaluates this law at a real input and returns an SPAposition result.
SPAunit_vector evaluateR_UV (double x, const int &side=*(int *) NULL_REF, const double &guess=*(double *) NULL_REF) const
 Evaluates this law at a real input and returns an SPAunit_vector result.
SPAvector evaluateR_V (double x, const int &side=*(int *) NULL_REF, const double &guess=*(double *) NULL_REF) const
 Evaluates this law at a real input and returns an SPAvector result.
virtual void evaluateVAR (const double *x, double *&y, int &size) const
 Evaluates this law at an array of real values and returns an array of real values as the result.
lawfleft () const
 This returns a pointer to the left operand (sublaw) of the binary law.
lawfright () const
 This returns a pointer to the right operand (sublaw) of the binary law.
logical has_derivative (int w=0) const
 Returns whether or not this law has a specified number of derivatives.
virtual logical identity (SPAbox &in_box) const
 Returns TRUE if this law is the identity within a specified box.
virtual logical identity (SPAinterval *in_bounds=NULL) const
 Returns TRUE if this law is the identity within a specified interval.
virtual logical in_domain (double *where) const
 Checks to see if a given input is within this law's domain.
logical integer () const
 Returns TRUE if this law is an integer law.
lawinverse () const
 Returns a pointer to a law that is the inverse of this law.
logical is_simplified (int level) const
 Returns TRUE if this law is simplified to the specified level.
logical isa (int t) const
 Indicates whether or not this law is of, or derived from, a specified law type.
logical linear () const
 Determines whether or not this law is linear.
binary_lawmake_one (law *in_left_law, law *in_right_law) const
 Returns a pointer to a law of this type.
lawnth_derivative (int n) const
 Returns a law that is the nth derivative of this law with respect to its first variable (e.g., x).
logical operator!= (law &inlaw) const
 Determines whether or not this law is not equivalent to the input law.
logical operator== (law &inlaw) const
 Determines whether or not this law is equivalent to the input law.
virtual law_polynomial * polynomial (law *in) const
 Returns the law_polynomial associated with the specified law.
int precedence () const
 Returns one of five values that indicates the precedence of this law during evaluation.
int ref_count ()
 Returns the use count of this law.
void remove ()
 Decrements the use-count of this law and destructs the law when the use-count drops to zero.
void reset_derivative (int deriv)
 Clears out the specified numbered derivative of this law, erasing the associated cached law.
void reset_simplify (law *in_law, int level) const
 Resets the simplification level of this law.
virtual int return_dim () const
 Returns the dimension of this law's range (output).
int return_size () const
 Returns the dimension of this law's range (output).
int same (const law *law1, const law *law2) const
 Determines whether or not two specified laws are the same.
logical set_derivative (int deriv, law *in_law, logical no_circular_reference=FALSE) const
 Establishes a pointer to a law which represents the specified derivative of this law.
lawset_domain (SPAinterval *new_domain, logical set=FALSE)
 Establishes the domain of this law.
void set_inverse (law *inv) const
 Sets the inverse of the given law.
virtual lawset_range (SPAinterval *new_range, logical set=FALSE)
 Sets a new range for this law.
void set_simplify (law *in_law, int level) const
 Sets the simplification level of this law.
lawsimplify (int level=1, int show_work=0) const
 Returns a law that is a mathematical simplification of this law.
int singularities (double **where, int **type, double start=-DBL_MAX, double end=DBL_MAX, double **period=NULL) const
 Specifies where in this law there might be discontinuities.
char * string (law_symbol_type type=DEFAULT, int &count=*(int *) NULL_REF, law_data_node *&ldn=*(law_data_node **) NULL_REF) const
 Returns a string that represents the type of this law.
char * string_and_data (law_data ***ld, int *size, law_symbol_type type=DEFAULT) const
 Returns a string representing this law and its data.
virtual lawsub_simplify (int level=0, const char *&what=*(const char **) NULL_REF) const
 Returns a law that is a simplification of this law.
char const * symbol (law_symbol_type type=DEFAULT) const
 Returns the string that represents this law class's symbol.
virtual int take_dim () const
 Returns the dimension of this law's domain (input).
int take_size () const
 Returns the dimension of this law's domain (input).
virtual logical term_domain (int term, SPAinterval &domain) const
 Establishes the domain of a given term in this law.
int type () const
 Identifies this law's class type.
lawuv_partials (int u_num, int v_num) const
 Returns a law that is a partial derivative in uv of this law.
logical zero (double tol=SPAresabs) const
 Determines whether this law is zero.

Static Public Member Functions

static int id ()
 Returns a unique ID that may be used to identify a law's class type.

Static Public Attributes

static int how_many_laws
 Specifies the number of laws in existence at any given time.

Protected Member Functions

virtual lawderiv (int which=0) const
 Returns a law that is a derivative of this law.
virtual lawsub_inverse () const
 Returns a pointer to the sublaws that are used to make up the inverse law of this class.

Protected Attributes

law ** dlaw
 Holds the cache derivatives with respect to each of the respective input variables.
int dlaw_size
 Tells how many cache derivatives are held by dlaw.
lawilaw
 Holds the cache of the inverse law.
lawleft_law
 Pointer to the first argument (sublaw) of the binary law.
int return_val
 Specifies the cached range dimension.
lawright_law
 Pointer to the second argument (sublaw) of the binary law.
lawslaw
 Holds the cache value of the most simplified version of this law.
int slevel
 Tells what level of simplification was used to create the law held by slaw.
int take_val
 Specifies the cached domain dimension.


Detailed Description

Provides methods for the greater than boolean function.

Member Function Documentation

void law::add (  )  const [inherited]

Increments the use count of this law.



Role: An application calls this method in order to preserve a copy of this law. It is not usually called by an application directly, but by the law constructor(s) for the law being constructed, which also call add for all of its sublaws. It increments the use_count member.

virtual int binary_law::associative (  )  const [virtual, inherited]

Returns whether or not the given law is associative.



Role: Associative means that the association of operations is irrelevant.
For example, a plus law is associative: (A+B)+C=A+(B+C).
The default is FALSE, signaling that the law is not associative. An example of a binary law that is not associative is the minus law.

Reimplemented in plus_law, and times_law.

double law::bounds ( double *  low_range,
double *  high_range,
double *  low_domain = NULL,
double *  high_domain = NULL,
double  requested_tol = SPAresfit *0.5,
double *  min_gaps = NULL 
) const [inherited]

Sets the domain of this law.



Parameters:
low_range low range.
high_range high range.
low_domain low domain.
high_domain high domain.
requested_tol tolerance.
min_gaps minimum gaps.

virtual int law::branches (  )  const [virtual, inherited]

Returns a non-negative integer that tells the dimension of the branches of this law.



Role: For example, sin(0) equals 0, but so does sin(pi), sin(2*pi), sin(n*pi), and so on. Hence, the arcsin of zero is dependent on one extra value n. The function arcsin(x)*arccos(x) requires two extra values: one to tell which branch the arcsin is on, and one to tell which branch the arccos is on. Hence, the branches method of the law arcsin(x) will return 1, while that of the function arccos(x)*arcsin(x) will return 2. For functions that do not have branches, like sin(x), it will return 0.

Reimplemented in unbend_law, composite_law, curveperp_law, and curveclosest_law.

logical law::cached_derivative ( int  deriv  )  const [inherited]

Returns TRUE or FALSE, depending upon whether or not the given derivative has been cached.



Parameters:
deriv index of the derivative to check.

const char* greater_than_law::class_name (  )  [virtual]

Returns a string that contains the name of this law's class.



Role: It is provided as a user-friendly interface to laws.

Implements law.

virtual int binary_law::commutative (  )  const [virtual, inherited]

Returns whether or not the given law is commutative.



Role: Commutative means that the order of operations is irrelevant.
For example, a plus law is commutative: A+B=B+A.
The default is FALSE, signaling that the law is not commutative. An example of a binary law that is not commutative is the minus law.

Reimplemented in plus_law, and times_law.

logical law::constant (  )  const [inherited]

Determines whether or not this law is constant.



Role: This is not the same as whether or not the law is of the constant_law class. The expression if (f->isa(constant_law::id())) is a much different test than is if (f->constant()). The former tells whether or not f is a constant_law. For example, "5" is a constant_law. The latter tells whether or not f is constant in the sense that it returns the same value for all inputs. The law "5*4" always returns the same value, but is a times_law rather than a constant_law.

int greater_than_law::date (  )  const [virtual]

Returns the version of ACIS in which this law class first appeared.



Role: If a law is part of a model that is to be saved at a previous ACIS release level, this is used to indicate whether the law can be saved or not.

Reimplemented from binary_law.

virtual law* binary_law::deep_copy ( base_pointer_map pm = NULL  )  const [virtual, inherited]

Creates a copy of an item that does not share any data with the original.



Role: Allocates new storage for all member data and any pointers. Returns a pointer to the copied item.

In a deep copy, all the information about the copied item is self-contained in a new memory block. By comparison, a shallow copy stores only the first instance of the item in memory, and increments the reference count for each copy.

The pointer_map keeps a list of all pointers in the original object that have already been deep-copied. For example, a deep_copy of a complex model results in self contained data, but identical sub-parts within the model are allowed to share a single set of data.

Parameters:
pm list of items within the entity that are already deep copied.

Reimplemented from law.

virtual law* law::deriv ( int  which = 0  )  const [protected, virtual, inherited]

Returns a law that is a derivative of this law.



Role: This method returns a law pointer that is the derivative of the given law with respect to the which variable. Variables in C++ are numbered starting at zero (0). The default is to take a derivative with respect to the first variable, which in a law function string is A1 or X. The variables X, Y, and Z are equivalent to the indices 0, 1, and 2, respectively.

The deriv method implements the code to perform the actual derivative calculation and caches its value in memory. All classes derived from law (or its children) must implement their own deriv method.

The deriv method should not be called directly by applications. Applications should call the derivative method instead, which is inherited by all classes derived from law. The derivative method accesses the cached derivative value in memory, if one exists; otherwise it calls the deriv method.

Parameters:
which index of the variable with respect to which the derivative is taken (default X or A1).

Reimplemented in constant_law, identity_law, derivative_law, max_law, min_law, vector_law, term_law, domain_law, permanent_domain_law, dot_law, cross_law, log_law, mod_law, twist_path_law, surfvec_law, step_law, piecewise_law, min_rotation_law, bend_law, dbend_law, unbend_law, plus_law, minus_law, times_law, division_law, exponent_law, composite_law, set_law, negate_law, natural_log_law, exp_law, floor_law, ceil_law, sin_law, cos_law, tan_law, cot_law, sec_law, csc_law, arcsin_law, arccos_law, arctan_law, arccot_law, arcsec_law, arccsc_law, sinh_law, cosh_law, tanh_law, coth_law, sech_law, csch_law, arcsinh_law, arccosh_law, arctanh_law, arccoth_law, arcsech_law, arccsch_law, abs_law, sqrt_law, norm_law, frenet_law, surfnorm_law, size_law, curvature_law, curve_law, pcurve_law, wire_law, surface_law, gaussian_curvature_law, mean_curvature_law, max_curvature_law, min_curvature_law, bs3_surface_law, map_law, dcurve_law, dpcurve_law, dwire_law, dsurface_law, transform_law, rotate_law, surfperp_law, curveperp_law, curveclosest_law, length_param_law, and length_law.

virtual law* law::derivative ( int  which = 0  )  const [virtual, inherited]

Returns a law that is a derivative of this law.



Role: This method returns a law pointer that is the derivative of the given law with respect to the which variable. Variables in C++ are numbered starting at zero (0). The default is to take a derivative with respect to the first variable, which in a law function string is A1 or X. The variables X, Y, and Z are equivalent to the indices 0, 1, and 2, respectively.

This method calls the deriv method to perform the actual derivative calculation. Once the derivative has been calculated, it is stored for later use. Whenever the derivative method is called, it determines if the derivative has already been calculated and, if so, retrieves this stored information rather than calling deriv again.

The derivative method is inherited by all classes derived from law. All classes derived from law (or its children) must implement their own deriv method to perform the actual derivative calculation when called by derivative.

Applications should call derivative and not deriv.

Parameters:
which index of the variable with respect to which the derivative is taken (default X or A1).

virtual law* law::enable_branching (  )  const [virtual, inherited]

Returns a copy of this law with branching enabled.



Role: Returns NULL if the operation fails, or if the necessary functionality has not been provided by a derived class.

Reimplemented in unbend_law, and composite_law.

double law::eval ( double  x,
const int &  side = *(int *) NULL_REF,
const double &  guess = *(double *) NULL_REF 
) const [inherited]

Evaluates this law at a real input and returns a real result.



Role: Works on laws that take and return one-dimensional (real) values. (All law classes inherit this method, for convenience.) It calls the main evaluate member function, first making sure that a quantity of no more than one dimension is taken or returned by calling take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

law::eval() is an ACIS direct interface function that does not involve entities. Therefore, it must be surrounded either by an API block or an EXCEPTION block (EXCEPTION block is allowed becaus it does not involve entities).

Parameters:
x value at which to perform the evaluation.
side left(-1) or right (1) - 0 is the default.
guess best guess (optional).

void greater_than_law::evaluate ( double const *  x,
double *  answer 
) const [virtual]

Evaluates this law at the given input.



Role: This method takes two pointers to memory that the caller is responsible for creating and freeing. The x argument tells where to evaluate the law. This can be more than one dimension. The answer argument returns the evaluation. This can be more than one dimension. The array x should be of the size returned by the take_dim method, and answer should be of the size returned by the return_dim method. All derived law classes must have this method or inherit it. This does no checking of the dimension of input and output arguments. It is preferable to call a more specific evaluator, if possible.

Parameters:
x array of values at which to perform the evaluation.
answer array of answer values resulting from the evaluation.

Reimplemented from law.

SPAbox law::evaluate_B (  )  const [inherited]

Returns the bounding box associated with this law.



Role: (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

virtual void law::evaluate_with_guess ( const double *  x,
double *  answer,
const double *  guess 
) const [virtual, inherited]

Evaluates this law using a best guess as to the answer (to minimize processing).



Parameters:
x array of values at which to perform the evaluation.
answer answer.
guess best guess (optional).

Reimplemented in vector_law, domain_law, permanent_domain_law, composite_law, surfperp_law, curveperp_law, and curveclosest_law.

void greater_than_law::evaluate_with_side ( double const *  x,
double *  answer,
int const *  side 
) const [virtual]

Evaluates this law on a specified side of the input value.



Role: If the input value is an endpoint, this can be important for numerical optimization.

Parameters:
x array of values at which to perform the evaluation.
answer answer.
side left (-1) or right (1) - default is zero.

Reimplemented from law.

double law::evaluateC_R ( complex_number  c,
const int *  side = NULL,
const double *  guess = NULL 
) const [inherited]

Evaluates this law at a complex-number input and returns a real result.



Role: Works on laws that have two-dimensional domains and one-dimensional ranges. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
c complex number at which to perform the evaluation.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

void law::evaluateDM ( const double *  x,
double *  answer,
int  n,
const int *  side = NULL,
const double *  guess = NULL 
) const [inherited]

Evaluates the nth derivative of this law at an array of real inputs and returns an array of real results.



Role: Works on laws whose domains and ranges are both multi-dimensional. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
x array of values at which to perform the evaluation.
answer array of answer values resulting from the evaluation.
n number of derivatives.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

double law::evaluateDM_R ( const double *  x,
int  n,
const int *  side = NULL,
const double *  guess = NULL 
) const [inherited]

Evaluates the nth derivative of this law at an array of real inputs and returns a real result.



Role: Works on laws that have multi-dimensional domains and return a one-dimensional result. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
x array of values at which to perform the evaluation.
n number of derivatives.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

double law::evaluateDR_R ( double  x,
int  n,
const int &  side = *(int *) NULL_REF,
const double &  guess = *(double *) NULL_REF 
) const [inherited]

Evaluates the nth derivative of this law at a real input and returns a real result.



Role: Works on laws that have both a one-dimensional real domain and a one-dimensional real range. (For convenience, all law classes inherit this method.) It calls the main evaluate member function, and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
x value at which to perform the evaluation.
n number of derivatives.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

SPAvector law::evaluateDR_V ( double  x,
int  n,
const int &  side = *(int *) NULL_REF,
const double &  guess = *(double *) NULL_REF 
) const [inherited]

Evaluates the nth derivative of this law at a real input and returns an SPAvector result.



Role: Works on laws that have a one-dimensional real domain and a three-dimensional vector range. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
x value at which to perform the evaluation.
n number of derivatives.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

SPAmatrix law::evaluateM_MAT ( const double *  x  )  const [inherited]

Evaluates this law at an array of real inputs and returns an SPAmatrix result.



Role: Works on laws that have a multi-dimensional domain and return a real matrix. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
x array of values at which to perform the evaluation.

SPAposition law::evaluateM_P ( const double *  x,
const int *  side = NULL,
const double *  guess = NULL 
) const [inherited]

Evaluates this law at an array of real inputs and returns an SPAposition result.



Role: Works on laws that have a multi-dimensional real domain and return a position. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
x array of values at which to perform the evaluation.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

SPApar_pos law::evaluateM_PP ( const double *  x,
const int *  side = NULL,
const double *  guess = NULL 
) const [inherited]

Evaluates this law at an array of real inputs and returns an SPApar_pos result.



Role: Works on laws that have a multi-dimensional domain and return a parameter position. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
x array of values at which to perform the evaluation.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

double law::evaluateM_R ( const double *  x,
const int *  side = NULL,
const double *  guess = NULL 
) const [inherited]

Evaluates this law at an array of real inputs and returns a real result.



Role: Works on laws that have a multi-dimensional real domain and return one-dimensional real values. (For convenience, all law classes inherit this method.) It calls the main evaluate member function, and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
x array of values at which to perform the evaluation.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

SPAtransf law::evaluateM_T ( const double *  x  )  const [inherited]

Evaluates this law at an array of real inputs and returns an SPAtransf result.



Role: Works on laws that accept a multi-dimensional domain and return a transform. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
x array of values at which to perform the evaluation.

SPAvector law::evaluateM_V ( const double *  x,
const int *  side = NULL,
const double *  guess = NULL 
) const [inherited]

Evaluates this law at an array of real inputs and returns an SPAvector result.



Role: Works on laws that accept a one-dimensional real input and return a three-dimensional vector. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using \ take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
x array of values at which to perform the evaluation.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

SPAposition law::evaluateNV_P ( const SPAnvector nv,
const int *  side = NULL,
const double *  guess = NULL 
) const [inherited]

Evaluates this law at an SPAnvector input and returns an SPAposition result.



Role: Works on laws that accept an n-dimensional vector as a single argument and return a position. (For convenience, all law classes inherit this methode.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
nv n-dimensional vector at which to perform the evaluation.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

double law::evaluateNV_R ( const SPAnvector nv,
const int *  side = NULL,
const double *  guess = NULL 
) const [inherited]

Evaluates this law at an input of type SPAnvector and returns a real result.



Role: Works on laws that accept an n-dimensional vector as a single argument and return a one-dimensional real value. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
nv n-dimensional vector at which to perform the evaluation.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

SPAvector law::evaluateNV_V ( const SPAnvector nv,
const int *  side = NULL,
const double *  guess = NULL 
) const [inherited]

Evaluates this law at an SPAnvector input and returns an SPAnvector result.



Role: Works on laws that accept an n-dimensional vector as a single argument and return a three-dimensional vector. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
nv n-dimensional vector at which to perform the evaluation.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

SPAposition law::evaluateP_P ( SPAposition  p,
const int *  side = NULL,
const double *  guess = NULL 
) const [inherited]

Evaluates this law at an SPAposition input and returns an SPAposition result.



Role: Works on laws that accept a position input and return a position result. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
p position at which to perform the evaluation.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

SPApar_pos law::evaluateP_PP ( const SPAposition p,
const int *  side = NULL,
const double *  guess = NULL 
) const [inherited]

Evaluates this law at an SPAposition input and returns an SPApar_pos result.



Role: Works on laws that accept a position input and return a parameter position result. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
p position at which to perform the evaluation.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

SPAposition law::evaluatePP_P ( const SPApar_pos pp,
const int *  side = NULL,
const double *  guess = NULL 
) const [inherited]

Evaluates this law at an SPApar_pos input and returns an SPAposition result.



Role: Works on laws that accept a parameter position input and returns a position. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
pp parameter position at which to perform the evaluation.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

SPAvector law::evaluatePP_V ( const SPApar_pos pp,
const int *  side = NULL,
const double *  guess = NULL 
) const [inherited]

Evaluates this law at an SPApar_pos input and returns an SPAvector result.



Role: Works on laws that accept a parameter position input and return a three-dimensional vector. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
pp parameter position at which to perform the evaluation.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

SPAposition law::evaluateR_P ( double  x,
const int &  side = *(int *) NULL_REF,
const double &  guess = *(double *) NULL_REF 
) const [inherited]

Evaluates this law at a real input and returns an SPAposition result.



Role: Works on laws that accept a one-dimensional real input and return a position result. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
x value at which to perform the evaluation.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

SPAunit_vector law::evaluateR_UV ( double  x,
const int &  side = *(int *) NULL_REF,
const double &  guess = *(double *) NULL_REF 
) const [inherited]

Evaluates this law at a real input and returns an SPAunit_vector result.



Role: Works on laws that accept a one-dimensional real input and return a unit vector result. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
x value at which to perform the evaluation.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

SPAvector law::evaluateR_V ( double  x,
const int &  side = *(int *) NULL_REF,
const double &  guess = *(double *) NULL_REF 
) const [inherited]

Evaluates this law at a real input and returns an SPAvector result.



Role: Works on laws that accept a one-dimensional real input and returns a vector result. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

If the input value is an endpoint, be sure to specify which side to use for evaluation.

Parameters:
x value at which to perform the evaluation.
side left(-1) or right (1) - 0 is default.
guess best guess (optional).

virtual void law::evaluateVAR ( const double *  x,
double *&  y,
int &  size 
) const [virtual, inherited]

Evaluates this law at an array of real values and returns an array of real values as the result.



Role: Works on laws that accept an array of real values and return an array of real results. (For convenience, all law classes inherit this method.) It calls the main evaluate member function and does some checking using take_dim and return_dim.

Parameters:
x array of values at which to perform the evaluation.
y output array.
size return dimension of output array.

Reimplemented in composite_law.

law* binary_law::fleft (  )  const [inline, inherited]

This returns a pointer to the left operand (sublaw) of the binary law.



Role: Only applications that create new laws that have parts of old laws should use this method. If the sublaw is to be used elsewhere, the add method should be called.

law* binary_law::fright (  )  const [inline, inherited]

This returns a pointer to the right operand (sublaw) of the binary law.



Role: Only applications that create new laws that have parts of old laws should use this method. If the sublaw is to be used elsewhere, the add method should be called.

logical law::has_derivative ( int  w = 0  )  const [inherited]

Returns whether or not this law has a specified number of derivatives.



Parameters:
w number of derivatives.

static int greater_than_law::id (  )  [static]

Returns a unique ID that may be used to identify a law's class type.



Role: This method should not be called directly by the application. All derived law classes must have this method. The isa, id, and type methods are used to identify a law's class type.

Reimplemented from binary_law.

virtual logical law::identity ( SPAbox in_box  )  const [virtual, inherited]

Returns TRUE if this law is the identity within a specified box.



Parameters:
in_box box within which to check.

virtual logical law::identity ( SPAinterval in_bounds = NULL  )  const [virtual, inherited]

Returns TRUE if this law is the identity within a specified interval.



Parameters:
in_bounds pointer to interval within which to check.

virtual logical binary_law::in_domain ( double *  where  )  const [virtual, inherited]

Checks to see if a given input is within this law's domain.



Parameters:
where where to test domain.

Reimplemented from law.

Reimplemented in division_law, exponent_law, and composite_law.

logical law::integer (  )  const [inherited]

Returns TRUE if this law is an integer law.

law* law::inverse (  )  const [inherited]

Returns a pointer to a law that is the inverse of this law.

logical law::is_simplified ( int  level  )  const [inherited]

Returns TRUE if this law is simplified to the specified level.



Parameters:
level simplify level.

logical greater_than_law::isa ( int  t  )  const [virtual]

Indicates whether or not this law is of, or derived from, a specified law type.



Role: All derived law classes must have this method. The isa, id, and type methods are used to identify a law's class type. The methods should be the same for all law classes with the exception of the isa method, which calls the isa method of its parent class. For example, the call test_law->isa(constant_law::id()) returns TRUE if test_law refers to a constant_law object, or to an object derived from the constant_law class.

Parameters:
t id method return.

Reimplemented from binary_law.

logical law::linear (  )  const [inherited]

Determines whether or not this law is linear.



Role: Sets internal flags accordingly.

binary_law* greater_than_law::make_one ( law in_left_law,
law in_right_law 
) const [virtual]

Returns a pointer to a law of this type.



Role: Used by parsing to create an instance of this law. All laws derived from binary_law have a make_one method. This is used by the parser and simplifier.

Parameters:
in_left_law pointer to 1st sublaw.
in_right_law pointer to 2nd sublaw.

Reimplemented from binary_law.

law* law::nth_derivative ( int  n  )  const [inherited]

Returns a law that is the nth derivative of this law with respect to its first variable (e.g., x).



Parameters:
n number of derivatives.

logical law::operator!= ( law inlaw  )  const [inherited]

Determines whether or not this law is not equivalent to the input law.



Role: This is inherited by all laws and calls the same method, which the major law subclasses override. This is used for simplification.

Parameters:
inlaw law to compare this to.

logical law::operator== ( law inlaw  )  const [inherited]

Determines whether or not this law is equivalent to the input law.



Role: This is inherited by all laws and calls the same method, which the major law subclasses override. This is used for simplification.

Parameters:
inlaw law to compare this to.

virtual law_polynomial* law::polynomial ( law in  )  const [virtual, inherited]

Returns the law_polynomial associated with the specified law.



Role: This is used to help determine the degree of the polynomial from the top-level law.

Parameters:
in input law.

Reimplemented in constant_law, plus_law, minus_law, times_law, division_law, exponent_law, and negate_law.

int greater_than_law::precedence (  )  const [virtual]

Returns one of five values that indicates the precedence of this law during evaluation.



Role: For example, minus has the PRECEDENCE_PLUS. The default for the law class is PRECEDENCE_FUNCTION.

The valid precedence values are PRECEDENCE_PLUS (1), PRECEDENCE_TIMES (2), PRECEDENCE_POWER (3), PRECEDENCE_FUNCTION(4), and PRECEDENCE_CONSTANT (5).

This is used for simplification and parsing. For a law to be saved and restored, it must have or inherit this method.

Reimplemented from law.

int law::ref_count (  )  [inline, inherited]

Returns the use count of this law.

void law::remove (  )  [inherited]

Decrements the use-count of this law and destructs the law when the use-count drops to zero.



Role: For efficient memory management, the law classes are use-counted. Applications should accordingly call this method rather than the tilde (~) destructor to get rid of a law. It decrements use_count and calls the law destructor when this number reaches zero. Destructors of derived laws should call this method on all of their sublaw members.

void law::reset_derivative ( int  deriv  )  [inherited]

Clears out the specified numbered derivative of this law, erasing the associated cached law.



Parameters:
deriv derivative to set.

void law::reset_simplify ( law in_law,
int  level 
) const [inherited]

Resets the simplification level of this law.



Parameters:
in_law law to simplify.
level level of simplification.

virtual int law::return_dim (  )  const [virtual, inherited]

Returns the dimension of this law's range (output).



Role: The return_size tells how many values are returned in the answer argument of the evaluate method. The default is 1. All derived law classes must have this method or inherit it.

int binary_law::return_size (  )  const [virtual, inherited]

Returns the dimension of this law's range (output).



Role: The return_size tells how many values are returned in the answer argument of the evaluate method. The default is 1. All derived law classes must have this method or inherit it.

Reimplemented from law.

Reimplemented in composite_law.

int binary_law::same ( const law law1,
const law law2 
) const [virtual, inherited]

Determines whether or not two specified laws are the same.



Role: This method should not be called directly by the application. It is used for simplification. For a law to be saved and restored, it must have or inherit this method. It is called by the == method, to see if two laws are the same.

Parameters:
law1 1st law to test.
law2 2nd law to test.

Reimplemented from law.

logical law::set_derivative ( int  deriv,
law in_law,
logical  no_circular_reference = FALSE 
) const [inherited]

Establishes a pointer to a law which represents the specified derivative of this law.



Role: This is useful if the calculation derivative is rather complex and it is known at the onset what it is. If a circular reference "might" exists (for example, if in_law is a numerical derivative, and references the this_law) then set_derivative does a deep_copy of in_law to break such a bad cycle. This takes more time, but is safer (the default). If you know that no such cycles exist, pass in TRUE for the last parameter, and you will get better performance.

Parameters:
deriv derivative to set.
in_law pointer to its law.
no_circular_reference no circular reference exists.

law* binary_law::set_domain ( SPAinterval new_domain,
logical  set = FALSE 
) [virtual, inherited]

Establishes the domain of this law.



Role: Permits the law to be altered for its input array size.

Parameters:
new_domain new input domain.
set adds domain if TRUE, substitutes if FALSE.

Reimplemented from law.

Reimplemented in composite_law.

void law::set_inverse ( law inv  )  const [inherited]

Sets the inverse of the given law.



Parameters:
inv law to invert.

virtual law* law::set_range ( SPAinterval new_range,
logical  set = FALSE 
) [virtual, inherited]

Sets a new range for this law.



Parameters:
new_range new range.
set set or not.

Reimplemented in composite_law, curveperp_law, and curveclosest_law.

void law::set_simplify ( law in_law,
int  level 
) const [inherited]

Sets the simplification level of this law.



Parameters:
in_law law to simplify.
level level of simplification.

law* law::simplify ( int  level = 1,
int  show_work = 0 
) const [inherited]

Returns a law that is a mathematical simplification of this law.



Role: This returns another law or a copy of the given law if it cannot be simplified any further.

When the show_work argument is set to a positive integer, debugging information is provided. Because laws cache their simplified version, simplifying a law twice does not result in any debugging information on the second call. To trick the simplifier into not using its cached value, the level argument should be set to "666".

Parameters:
level level of simplification.
show_work for debugging, shows simplification.

int binary_law::singularities ( double **  where,
int **  type,
double  start = -DBL_MAX,
double  end = DBL_MAX,
double **  period = NULL 
) const [virtual, inherited]

Specifies where in this law there might be discontinuities.



Role: The array where notes where the discontinuity occurs. The type indicates 0 if there is a discontinuity, 1 if the discontinuity in the 1st derivative, and any integer n if the discontinuity is in the nth derivative. The value -1 means that the type is not defined.

Parameters:
where where discontinuities exist.
type discontinuity types.
start start.
end end.
period period.

Reimplemented from law.

Reimplemented in composite_law.

char* binary_law::string ( law_symbol_type  type = DEFAULT,
int &  count = *(int *) NULL_REF,
law_data_node *&  ldn = *(law_data_node **) NULL_REF 
) const [virtual, inherited]

Returns a string that represents the type of this law.



Role: The law function is composed of its symbol, associated parentheses, and the strings associated with its sublaws. It is provided as a user-friendly interface to laws. A derived class must override this function to be able to save a law.

It the caller's responsibility to delete the resulting string when finished with it. Use the array delete operator, e.g.,

 char *str == someLaw->string();
 delete [] str;
Parameters:
type type of law symbol - standard ACIS type.
count count.
ldn law data node.

Reimplemented from law.

char* law::string_and_data ( law_data ***  ld,
int *  size,
law_symbol_type  type = DEFAULT 
) const [inherited]

Returns a string representing this law and its data.



Role: This method calls the string to obtain a string that represents the current law function. This is placed together with the law_data of a law for the saving of a law. It is provided as a user-friendly interface to laws. A derived class must have or inherit this method to be able to save a law.

Parameters:
ld array of law data.
size size of array.
type type of law symbol - standard ACIS type.

virtual law* law::sub_inverse (  )  const [protected, virtual, inherited]

Returns a pointer to the sublaws that are used to make up the inverse law of this class.

Reimplemented in identity_law, permanent_domain_law, bend_law, plus_law, composite_law, curve_law, surface_law, and transform_law.

virtual law* law::sub_simplify ( int  level = 0,
const char *&  what = *(const char **) NULL_REF 
) const [virtual, inherited]

Returns a law that is a simplification of this law.



Role: This is a member function that may be overloaded by derived classes to provide assistance to the simplifier. It helps the simplifier in dealing with this particular law. This method is called by the simplifier but generally not called directly by the application.

For example, a law class such as plus_law might use an equation X + X. The sub_simplify method could return this equation as 2*X. The sub_simplify method can access the private members of the law that the simplifier does not have access to. Most laws simply inherit a function that returns NULL.

Parameters:
level level of simplification.
what text string that describes the simplified law.

Reimplemented in vector_law, term_law, domain_law, dot_law, cross_law, twist_path_law, bend_law, unbend_law, plus_law, minus_law, times_law, division_law, exponent_law, composite_law, negate_law, sin_law, cos_law, sqrt_law, norm_law, frenet_law, surfnorm_law, size_law, curve_law, dcurve_law, and transform_law.

char const* greater_than_law::symbol ( law_symbol_type  type = DEFAULT  )  const [virtual]

Returns the string that represents this law class's symbol.



Role: The symbol is used for parsing the law and for saving and restoring law-based geometry. For a law to be saved and restored, it must have or inherit this method.

This is the top-level class. The default law symbol for this class is an error message. Derived classes need to define their own symbol methods to override this error message.

Parameters:
type type of law symbol - standard ACIS type.

Reimplemented from law.

virtual int law::take_dim (  )  const [virtual, inherited]

Returns the dimension of this law's domain (input).



Role: The default is 1. All derived law classes must have this method or inherit it.

int binary_law::take_size (  )  const [virtual, inherited]

Returns the dimension of this law's domain (input).



Role: The default is 1. All derived law classes must have this method or inherit it.

Reimplemented from law.

Reimplemented in composite_law.

virtual logical binary_law::term_domain ( int  term,
SPAinterval domain 
) const [virtual, inherited]

Establishes the domain of a given term in this law.



Parameters:
term term to bound.
domain bounds for term.

Reimplemented from law.

Reimplemented in composite_law.

int greater_than_law::type (  )  const [virtual]

Identifies this law's class type.



Role: All derived law classes must have this method. The isa, id and type methods are used to identify a law's class type. The methods should be the same for all law classes.

Reimplemented from binary_law.

law* law::uv_partials ( int  u_num,
int  v_num 
) const [inherited]

Returns a law that is a partial derivative in uv of this law.



Role: This is a convenience function. Instead of calling the derivative method repeatedly when taking a number of partial derivatives with respect to u and a number of partial derivatives with respect to v, you may use this method. If a given derivative has not already been calculated, it is calculated and cached. If it has been calculated, the cached value is used.

Parameters:
u_num number of derivatives with respect to u.
v_num number of derivatives with respect to v.

logical law::zero ( double  tol = SPAresabs  )  const [inherited]

Determines whether this law is zero.



Role: The law function vec(0, 0, 0) is considered zero by this method.

Parameters:
tol tolerance to use in determination.


Member Data Documentation

law** law::dlaw [mutable, protected, inherited]

Holds the cache derivatives with respect to each of the respective input variables.

int law::dlaw_size [mutable, protected, inherited]

Tells how many cache derivatives are held by dlaw.

int law::how_many_laws [static, inherited]

Specifies the number of laws in existence at any given time.

law* law::ilaw [mutable, protected, inherited]

Holds the cache of the inverse law.

law* binary_law::left_law [protected, inherited]

Pointer to the first argument (sublaw) of the binary law.

int law::return_val [mutable, protected, inherited]

Specifies the cached range dimension.

law* binary_law::right_law [protected, inherited]

Pointer to the second argument (sublaw) of the binary law.

law* law::slaw [mutable, protected, inherited]

Holds the cache value of the most simplified version of this law.

int law::slevel [mutable, protected, inherited]

Tells what level of simplification was used to create the law held by slaw.



Note: See simplify for a discussion of the levels.

int law::take_val [mutable, protected, inherited]

Specifies the cached domain dimension.