#include <law_base.hxx>


Public Member Functions | |
| void | add () const |
| Increments the use count of this law. | |
| 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. | |
| virtual const char * | class_name ()=0 |
| Returns a string that contains the name of this law's class. | |
| logical | constant () const |
| Determines whether or not this law is constant. | |
| virtual int | date () const |
| Returns the version of ACIS in which this law class first appeared. | |
| virtual law * | deep_copy (base_pointer_map *pm=NULL) const |
| Creates a copy of an item that does not share any data with the original. | |
| virtual law * | derivative (int which=0) const |
| Returns a law that is a derivative of this law. | |
| virtual law * | enable_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. | |
| virtual void | evaluate (const double *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). | |
| virtual void | evaluate_with_side (const double *x, double *answer, const int *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. | |
| 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. | |
| law * | inverse () 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. | |
| virtual logical | isa (int t) const |
| Indicates whether or not this law is of, or derived from, a specified law type. | |
| law () | |
| Constructs a law. | |
| logical | linear () const |
| Determines whether or not this law is linear. | |
| law * | nth_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. | |
| virtual 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). | |
| virtual 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. | |
| virtual law * | set_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 law * | set_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. | |
| law * | simplify (int level=1, int show_work=0) const |
| Returns a law that is a mathematical simplification of this law. | |
| virtual 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. | |
| virtual 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 law * | sub_simplify (int level=0, const char *&what=*(const char **) NULL_REF) const |
| Returns a law that is a simplification of this law. | |
| virtual const char * | 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). | |
| virtual logical | term_domain (int term, SPAinterval &domain) const |
| Establishes the domain of a given term in this law. | |
| virtual int | type () const |
| Identifies this law's class type. | |
| law * | uv_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 law * | deriv (int which=0) const |
| Returns a law that is a derivative of this law. | |
| virtual int | return_size () const |
| Returns the dimension of this law's range (output). | |
| virtual law * | sub_inverse () const |
| Returns a pointer to the sublaws that are used to make up the inverse law of this class. | |
| virtual int | take_size () const |
| Returns the dimension of this law's domain (input). | |
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. | |
| law * | ilaw |
| Holds the cache of the inverse law. | |
| int | return_val |
| Specifies the cached range dimension. | |
| law * | slaw |
| 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. | |
Role: The law class is the base class from which all other law classes are derived. Laws are functions from n dimensional Euclidean space to m dimensional Euclidean space. The law class provides virtual methods used by all derived law class types.
A law is represented internally by a tree of C++ classes that know their dimensions, how to evaluate themselves, and how to take their exact (symbolic) derivatives with respect to any combination of variables. Laws provide the ability to solve complex, global mathematical problems.
Laws are parsed in the same way that equations are presented in mathematics textbooks. For example, the equation f(x,y) = x²+cos(x)-sin(y) becomes the law function "X^2+COS(X)-SIN(Y)", with a two-dimensional domain and a one-dimensional range.
For efficient memory management, the law classes are use-counted. That is, a data member called use_count is maintained in order to keep track of how many pointers to a particular law object are in current use. This integer is incremented and decremented by means of the add and remove methods. Accordingly, when an application is finished with a law, the remove method should be called instead of the class destructor (or delete). The remove method itself takes care of deleting the law when use_count falls to zero.
For example, consider the law f representing "X^2", which is actually an exponent_law whose arguments are an identity_law for x and a constant_law for 2. The new df law ("2*X") created using the derivative method of f is a times_law whose arguments are a constant_law for 2 and an identity_law for x. In constructing the df law, instead of creating new instances of the constant_law representing 2 and the identity_law representing x, the constructor calls their add methods, which increments their respective use counts. In this manner, memory is not taken up with duplicates of the constant_law for 2 or the identity_law for x. If the remove method of either f or df is called, the remove methods of their sublaws are also called. The sublaws decrement their own use_count members, and only actually call the law::~law destructor if use_count goes to zero.
For convenience, the law class has a number of evaluation methods. The naming convention for these is evaluateX_Y, where X refers to the input argument type and Y refers to the output. They can be any of the following:
| R | double (real) |
| M | double* (multiple) |
| D | derivative |
| V | SPAvector |
| P | SPAposition |
| PP | SPApar_pos |
| NV | SPAnvector |
| T | SPAtransf |
| MAT | SPAmatrix |
| C | complex |
use_count private data member stores the number of copies of this law that are in use. The private data member simplified_flag is set if this law cannot be simplified any more. type_flag is any one of the following values; | 0 | unknown |
| 1 | zero |
| 2 | constant |
| 3 | linear |
| 4 | polynomial |
| G infinity | |
| 6 | G 5 |
| 7 | G 4 |
| 8 | G 3 |
| 9 | G 2 |
| G 1 | |
| Continuous | |
| Bounded | |
| Rational |
not_type_flag tells what a law is known not to be. constant_law, unary_law, binary_law, multiple_law, unary_data_law, or multiple_data_law. All derived laws must have the following methods or inherit them: | virtual law* | derivative(int which=0) const; |
| virtual void | evaluate(const double* x, double* answer) const; |
| virtual logical | isa(int t) const; |
| static int | id(); |
| virtual int | type() const; |
| virtual int | return_dim() const; |
| virtual int | take_dim() const; |
| law::law | ( | ) |
Constructs a law.
Role: This sets the use_count to 1 and increments the static member how_many_laws. It sets dlaw, slaw, and lawdomain to NULL.
| void law::add | ( | ) | const |
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.
| 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 |
Sets the domain of this law.
| 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] |
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 |
Returns TRUE or FALSE, depending upon whether or not the given derivative has been cached.
| deriv | index of the derivative to check. |
| virtual const char* law::class_name | ( | ) | [pure virtual] |
Returns a string that contains the name of this law's class.
Role: It is provided as a user-friendly interface to laws.
Implemented in constant_law, identity_law, pi_law, e_law, true_law, false_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, less_than_law, greater_than_law, less_than_or_equal_law, greater_than_or_equal_law, equal_law, not_equal_law, not_law, even_law, odd_law, prime_law, int_law, and_law, or_law, set_law, negate_law, natural_log_law, exp_law, floor_law, ceil_law, rand_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.
| logical law::constant | ( | ) | const |
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.
| virtual int 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 in multiple_law, binary_law, unary_law, unary_data_law, multiple_data_law, true_law, false_law, permanent_domain_law, piecewise_law, bend_law, dbend_law, unbend_law, less_than_law, greater_than_law, less_than_or_equal_law, greater_than_or_equal_law, equal_law, not_equal_law, not_law, even_law, odd_law, prime_law, int_law, and_law, or_law, floor_law, ceil_law, rand_law, arctan_law, surfnorm_law, size_law, pcurve_law, gaussian_curvature_law, mean_curvature_law, max_curvature_law, min_curvature_law, bs3_surface_law, dpcurve_law, surfperp_law, curveperp_law, curveclosest_law, length_param_law, and length_law.
| virtual law* law::deep_copy | ( | base_pointer_map * | pm = NULL |
) | const [virtual] |
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.
| pm | list of items within the entity that are already deep copied. |
Reimplemented in constant_law, identity_law, multiple_law, binary_law, unary_law, unary_data_law, and multiple_data_law.
| virtual law* law::deriv | ( | int | which = 0 |
) | const [protected, virtual] |
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.
| 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] |
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.
| which | index of the variable with respect to which the derivative is taken (default X or A1). |
| virtual law* law::enable_branching | ( | ) | const [virtual] |
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 |
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).
| x | value at which to perform the evaluation. | |
| side | left(-1) or right (1) - 0 is the default. | |
| guess | best guess (optional). |
| virtual void law::evaluate | ( | const double * | 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.
| x | array of values at which to perform the evaluation. | |
| answer | array of answer values resulting from the evaluation. |
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, less_than_law, greater_than_law, less_than_or_equal_law, greater_than_or_equal_law, equal_law, not_equal_law, not_law, even_law, odd_law, prime_law, int_law, and_law, or_law, set_law, negate_law, natural_log_law, exp_law, floor_law, ceil_law, rand_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.
| SPAbox law::evaluate_B | ( | ) | const |
| virtual void law::evaluate_with_guess | ( | const double * | x, | |
| double * | answer, | |||
| const double * | guess | |||
| ) | const [virtual] |
Evaluates this law using a best guess as to the answer (to minimize processing).
| 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.
| virtual void law::evaluate_with_side | ( | const double * | x, | |
| double * | answer, | |||
| const int * | 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.
| x | array of values at which to perform the evaluation. | |
| answer | answer. | |
| side | left (-1) or right (1) - default is zero. |
Reimplemented in 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, plus_law, minus_law, times_law, division_law, exponent_law, composite_law, less_than_law, greater_than_law, less_than_or_equal_law, greater_than_or_equal_law, equal_law, not_equal_law, not_law, even_law, odd_law, prime_law, int_law, and_law, or_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, curve_law, wire_law, surface_law, map_law, dcurve_law, dwire_law, dsurface_law, transform_law, rotate_law, surfperp_law, curveperp_law, curveclosest_law, length_param_law, and length_law.
| double law::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.
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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 |
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.
| 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] |
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.
| x | array of values at which to perform the evaluation. | |
| y | output array. | |
| size | return dimension of output array. |
Reimplemented in composite_law.
| logical law::has_derivative | ( | int | w = 0 |
) | const |
Returns whether or not this law has a specified number of derivatives.
| w | number of derivatives. |
| static int 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 in constant_law, identity_law, multiple_law, binary_law, unary_law, unary_data_law, multiple_data_law, pi_law, e_law, true_law, false_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, less_than_law, greater_than_law, less_than_or_equal_law, greater_than_or_equal_law, equal_law, not_equal_law, not_law, even_law, odd_law, prime_law, int_law, and_law, or_law, set_law, negate_law, natural_log_law, exp_law, floor_law, ceil_law, rand_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 logical law::identity | ( | SPAbox & | in_box | ) | const [virtual] |
Returns TRUE if this law is the identity within a specified box.
| in_box | box within which to check. |
| virtual logical law::identity | ( | SPAinterval * | in_bounds = NULL |
) | const [virtual] |
Returns TRUE if this law is the identity within a specified interval.
| in_bounds | pointer to interval within which to check. |
| virtual logical law::in_domain | ( | double * | where | ) | const [virtual] |
Checks to see if a given input is within this law's domain.
| where | where to test domain. |
Reimplemented in multiple_law, binary_law, unary_law, log_law, division_law, exponent_law, composite_law, natural_log_law, exp_law, tan_law, cot_law, sec_law, csc_law, arcsin_law, arccos_law, arcsec_law, arccsc_law, sinh_law, cosh_law, coth_law, csch_law, arctanh_law, arccoth_law, arcsech_law, arccsch_law, and sqrt_law.
| logical law::is_simplified | ( | int | level | ) | const |
| virtual logical 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.
| t | id method return. |
Reimplemented in constant_law, identity_law, multiple_law, binary_law, unary_law, unary_data_law, multiple_data_law, pi_law, e_law, true_law, false_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, less_than_law, greater_than_law, less_than_or_equal_law, greater_than_or_equal_law, equal_law, not_equal_law, not_law, even_law, odd_law, prime_law, int_law, and_law, or_law, set_law, negate_law, natural_log_law, exp_law, floor_law, ceil_law, rand_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.
| logical law::linear | ( | ) | const |
Determines whether or not this law is linear.
Role: Sets internal flags accordingly.
| law* law::nth_derivative | ( | int | n | ) | const |
| logical law::operator!= | ( | law & | inlaw | ) | const |
| logical law::operator== | ( | law & | inlaw | ) | const |
| virtual law_polynomial* law::polynomial | ( | law * | in | ) | const [virtual] |
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.
| in | input law. |
Reimplemented in constant_law, plus_law, minus_law, times_law, division_law, exponent_law, and negate_law.
| virtual int 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 in plus_law, minus_law, times_law, division_law, exponent_law, composite_law, less_than_law, greater_than_law, less_than_or_equal_law, greater_than_or_equal_law, equal_law, not_equal_law, not_law, even_law, odd_law, int_law, and_law, and or_law.
| int law::ref_count | ( | ) | [inline] |
Returns the use count of this law.
| void law::remove | ( | ) |
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 | ) |
| void law::reset_simplify | ( | law * | in_law, | |
| int | level | |||
| ) | const |
| virtual int law::return_dim | ( | ) | const [virtual] |
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.
| virtual int law::return_size | ( | ) | const [protected, virtual] |
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 in multiple_law, binary_law, unary_law, vector_law, term_law, domain_law, permanent_domain_law, dot_law, surfvec_law, piecewise_law, min_rotation_law, bend_law, dbend_law, unbend_law, composite_law, norm_law, frenet_law, surfnorm_law, size_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, and surfperp_law.
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.
Reimplemented in constant_law, identity_law, multiple_law, binary_law, unary_law, unary_data_law, and multiple_data_law.
| logical law::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.
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.
| deriv | derivative to set. | |
| in_law | pointer to its law. | |
| no_circular_reference | no circular reference exists. |
| virtual law* law::set_domain | ( | SPAinterval * | new_domain, | |
| logical | set = FALSE | |||
| ) | [virtual] |
Establishes the domain of this law.
Role: Permits the law to be altered for its input array size.
| new_domain | new input domain. | |
| set | adds domain if TRUE, substitutes if FALSE. |
Reimplemented in multiple_law, binary_law, unary_law, unary_data_law, multiple_data_law, domain_law, permanent_domain_law, composite_law, curve_law, surface_law, dcurve_law, dsurface_law, and surfperp_law.
| void law::set_inverse | ( | law * | inv | ) | const |
| virtual law* law::set_range | ( | SPAinterval * | new_range, | |
| logical | set = FALSE | |||
| ) | [virtual] |
Sets a new range for this law.
| 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 |
| law* law::simplify | ( | int | level = 1, |
|
| int | show_work = 0 | |||
| ) | const |
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".
| level | level of simplification. | |
| show_work | for debugging, shows simplification. |
| virtual int law::singularities | ( | double ** | where, | |
| int ** | type, | |||
| double | start = -DBL_MAX, |
|||
| double | end = DBL_MAX, |
|||
| double ** | period = NULL | |||
| ) | const [virtual] |
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.
| where | where discontinuities exist. | |
| type | discontinuity types. | |
| start | start. | |
| end | end. | |
| period | period. |
Reimplemented in multiple_law, binary_law, unary_law, unary_data_law, derivative_law, permanent_domain_law, composite_law, curvature_law, curve_law, pcurve_law, wire_law, and dcurve_law.
| virtual char* law::string | ( | law_symbol_type | type = DEFAULT, |
|
| int & | count = *(int *) NULL_REF, |
|||
| law_data_node *& | ldn = *(law_data_node **) NULL_REF | |||
| ) | const [virtual] |
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;
Reimplemented in constant_law, identity_law, multiple_law, binary_law, unary_law, unary_data_law, multiple_data_law, pi_law, e_law, true_law, and false_law.
| char* law::string_and_data | ( | law_data *** | ld, | |
| int * | size, | |||
| law_symbol_type | type = DEFAULT | |||
| ) | const |
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.
| virtual law* law::sub_inverse | ( | ) | const [protected, virtual] |
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] |
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.
| 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.
| virtual const char* 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.
| type | type of law symbol - standard ACIS type. |
Reimplemented in pi_law, e_law, true_law, false_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, less_than_law, greater_than_law, less_than_or_equal_law, greater_than_or_equal_law, equal_law, not_equal_law, not_law, even_law, odd_law, prime_law, int_law, and_law, or_law, set_law, negate_law, natural_log_law, exp_law, floor_law, ceil_law, rand_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 int law::take_dim | ( | ) | const [virtual] |
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.
| virtual int law::take_size | ( | ) | const [protected, virtual] |
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 in constant_law, identity_law, multiple_law, binary_law, unary_law, derivative_law, term_law, domain_law, permanent_domain_law, surfvec_law, step_law, bend_law, dbend_law, unbend_law, composite_law, surfnorm_law, surface_law, gaussian_curvature_law, mean_curvature_law, max_curvature_law, min_curvature_law, bs3_surface_law, dsurface_law, transform_law, rotate_law, surfperp_law, curveperp_law, curveclosest_law, length_param_law, and length_law.
| virtual logical law::term_domain | ( | int | term, | |
| SPAinterval & | domain | |||
| ) | const [virtual] |
Establishes the domain of a given term in this law.
| term | term to bound. | |
| domain | bounds for term. |
Reimplemented in multiple_law, binary_law, unary_law, derivative_law, domain_law, permanent_domain_law, step_law, min_rotation_law, composite_law, arcsin_law, arccos_law, arcsec_law, arccosh_law, arctanh_law, arcsech_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, dcurve_law, dpcurve_law, transform_law, rotate_law, surfperp_law, length_param_law, and length_law.
| virtual int 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 in constant_law, identity_law, multiple_law, binary_law, unary_law, unary_data_law, multiple_data_law, pi_law, e_law, true_law, false_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, less_than_law, greater_than_law, less_than_or_equal_law, greater_than_or_equal_law, equal_law, not_equal_law, not_law, even_law, odd_law, prime_law, int_law, and_law, or_law, set_law, negate_law, natural_log_law, exp_law, floor_law, ceil_law, rand_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.
| law* law::uv_partials | ( | int | u_num, | |
| int | v_num | |||
| ) | const |
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.
| 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 |
Holds the cache derivatives with respect to each of the respective input variables.
int law::dlaw_size [mutable, protected] |
Tells how many cache derivatives are held by dlaw.
int law::how_many_laws [static] |
Specifies the number of laws in existence at any given time.
int law::return_val [mutable, protected] |
Specifies the cached range dimension.
Holds the cache value of the most simplified version of this law.
int law::slevel [mutable, protected] |
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] |
Specifies the cached domain dimension.