#include <main_law.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. | |
| const char * | class_name () |
| Returns a string that contains the name of this law's class. | |
| 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 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. | |
| 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. | |
| law * | fsub () const |
| This returns the sublaw that is passed into this 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. | |
| 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. | |
| 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. | |
| unary_law * | make_one (law *in_sublaw) const |
| Returns a pointer to a law of this type. | |
| 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). | |
| 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. | |
| 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. | |
| 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 law * | sub_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). | |
| 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. | |
| 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 | |
| law * | deriv (int which=0) const |
| Returns a law that is a derivative of this law. | |
| virtual law * | sub_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. | |
| 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. | |
| law * | sub_law |
| This is a pointer to the sublaw that the unary law is to act upon. | |
| int | take_val |
| Specifies the cached domain dimension. | |
| 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.
| 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.
| 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.
| deriv | index of the derivative to check. |
| const char* arccos_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.
| 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 unary_law::date | ( | ) | const [virtual, inherited] |
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 law.
Reimplemented in not_law, even_law, odd_law, prime_law, int_law, floor_law, ceil_law, rand_law, surfnorm_law, and size_law.
| virtual law* unary_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.
| pm | list of items within the entity that are already deep copied. |
Reimplemented from law.
| law* arccos_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 from 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.
| 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).
| x | value at which to perform the evaluation. | |
| side | left(-1) or right (1) - 0 is the default. | |
| guess | best guess (optional). |
| void arccos_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.
| 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] |
| 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).
| 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 arccos_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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| x | array of values at which to perform the evaluation. | |
| y | output array. | |
| size | return dimension of output array. |
Reimplemented in composite_law.
| law* unary_law::fsub | ( | ) | const [inline, inherited] |
This returns the sublaw that is passed into this law.
Role: Only applications that create new laws that have parts of old laws should use this method. An example of this is the simplifier; the law "abs(x^2)" simplifies to "x^2", where "x^2" is the part of the old law used in the new law. If the sublaw is to be used elsewhere, the add method should called.
| logical law::has_derivative | ( | int | w = 0 |
) | const [inherited] |
Returns whether or not this law has a specified number of derivatives.
| w | number of derivatives. |
| static int arccos_law::id | ( | ) | [static] |
| virtual logical law::identity | ( | SPAbox & | in_box | ) | const [virtual, inherited] |
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, inherited] |
Returns TRUE if this law is the identity within a specified interval.
| in_bounds | pointer to interval within which to check. |
| logical arccos_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 from unary_law.
| logical law::is_simplified | ( | int | level | ) | const [inherited] |
| logical arccos_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 from unary_law.
| logical law::linear | ( | ) | const [inherited] |
Determines whether or not this law is linear.
Role: Sets internal flags accordingly.
Returns a pointer to a law of this type.
Role: Used by parsing to create an instance of this law. All laws derived from unary_law have a make_one method. This is used by the parser and simplifier.
If f1 is a law for "X^3" and f2 is the law for "COS(any law)", then f2->make_one(f1) returns a law which is "COS(X^3)".
| in_sub_law | pointer to sub law. |
Reimplemented from unary_law.
| law* law::nth_derivative | ( | int | n | ) | const [inherited] |
| logical law::operator!= | ( | law & | inlaw | ) | const [inherited] |
| logical law::operator== | ( | law & | inlaw | ) | const [inherited] |
| 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.
| 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, inherited] |
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, 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] |
| void law::reset_simplify | ( | law * | in_law, | |
| int | level | |||
| ) | const [inherited] |
| 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 unary_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 norm_law, frenet_law, surfnorm_law, and size_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 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.
| deriv | derivative to set. | |
| in_law | pointer to its law. | |
| no_circular_reference | no circular reference exists. |
| law* unary_law::set_domain | ( | SPAinterval * | new_domain, | |
| logical | set = FALSE | |||
| ) | [virtual, inherited] |
| void law::set_inverse | ( | law * | inv | ) | const [inherited] |
| virtual law* law::set_range | ( | SPAinterval * | new_range, | |
| logical | set = FALSE | |||
| ) | [virtual, inherited] |
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 [inherited] |
| 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".
| level | level of simplification. | |
| show_work | for debugging, shows simplification. |
| int unary_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.
| where | where discontinuities exist. | |
| type | discontinuity types. | |
| start | start. | |
| end | end. | |
| period | period. |
Reimplemented from law.
| char* unary_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;
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.
| 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.
| 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* arccos_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 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 unary_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 surfnorm_law.
| logical arccos_law::term_domain | ( | int | term, | |
| SPAinterval & | domain | |||
| ) | const [virtual] |
| int arccos_law::type | ( | ) | const [virtual] |
| 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.
| 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] |
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.
int law::return_val [mutable, protected, inherited] |
Specifies the cached range dimension.
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.
law* unary_law::sub_law [protected, inherited] |
This is a pointer to the sublaw that the unary law is to act upon.
int law::take_val [mutable, protected, inherited] |
Specifies the cached domain dimension.