Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Search for

# Box Class Reference

`#include <Polygon.h>`

Inheritance diagram for Box:

List of all members.

## Public Member Functions
| Box (GiNaC::ex p0, GiNaC::ex p1, string subscript="")
| Box ()
virtual | ~Box ()
virtual int | no_vertices ()
virtual GiNaC::ex | vertex (int i)
virtual Line | line (int i)
virtual GiNaC::ex | repr (Repr_format format=SUBS_PERFORMED)
virtual string | str ()
virtual GiNaC::ex | integrate (GiNaC::ex f)

## Detailed Description

Definition at line 171 of file Polygon.h.

## Constructor & Destructor Documentation

Box::Box | ( | GiNaC::ex | p0,
|  | GiNaC::ex | p1,
|  | string | subscript = `""`
| ) |

| Definition at line 1254 of file Polygon.cpp. References Polygon::p, and Polygon::subscript.
    01254                                                    {
    01255   subscript = subscript_;
    01256   GiNaC::ex x0 = GiNaC::lst(p0.op(0),p0.op(1),p0.op(2));
    01257   GiNaC::ex x1 = GiNaC::lst(p1.op(0),p0.op(1),p0.op(2));
    01258   GiNaC::ex x2 = GiNaC::lst(p1.op(0),p1.op(1),p0.op(2));
    01259   GiNaC::ex x3 = GiNaC::lst(p0.op(0),p1.op(1),p0.op(2));
    01260
    01261   GiNaC::ex x4 = GiNaC::lst(p0.op(0),p0.op(1),p1.op(2));
    01262   GiNaC::ex x5 = GiNaC::lst(p1.op(0),p0.op(1),p1.op(2));
    01263   GiNaC::ex x6 = GiNaC::lst(p1.op(0),p1.op(1),p1.op(2));
    01264   GiNaC::ex x7 = GiNaC::lst(p0.op(0),p1.op(1),p1.op(2));
    01265
    01266   p.insert(p.end(), x0);
    01267   p.insert(p.end(), x1);
    01268   p.insert(p.end(), x2);
    01269   p.insert(p.end(), x3);
    01270
    01271   p.insert(p.end(), x4);
    01272   p.insert(p.end(), x5);
    01273   p.insert(p.end(), x6);
    01274   p.insert(p.end(), x7);
    01275
    01276 }

Box::Box | ( |  | ) | `[inline]`

| Definition at line 174 of file Polygon.h.
    00174 {}

virtual Box::~Box | ( |  | ) | `[inline, virtual]`

| Definition at line 175 of file Polygon.h.
    00175 {}

## Member Function Documentation

GiNaC::ex Box::integrate | ( | GiNaC::ex | f | ) | `[virtual]`

| Reimplemented in ReferenceBox. Definition at line 1317 of file Polygon.cpp. References Polygon::p, and repr(). Referenced by ReferenceBox::integrate(), and main().
    01317                                     {
    01318
    01319     GiNaC::ex b_repr = repr();
    01320
    01321     GiNaC::lst sub;
    01322     sub = GiNaC::lst(b_repr.op(0), b_repr.op(1), b_repr.op(2));
    01323     GiNaC::ex intf = func.subs(sub);
    01324
    01325     GiNaC::ex D =  ( p[6].op(0) - p[0].op(0))
    01326                   *( p[6].op(1) - p[0].op(1))
    01327                   *( p[6].op(2) - p[0].op(2));
    01328
    01329
    01330
    01331
    01332
    01333     intf = intf*D;
    01334
    01335     intf = GiNaC::integral(b_repr.op(3).op(0), b_repr.op(3).op(1), b_repr.op(3).op(2), intf);
    01336     intf = eval_integ(intf);
    01337
    01338     intf = GiNaC::integral(b_repr.op(4).op(0), b_repr.op(4).op(1), b_repr.op(4).op(2), intf);
    01339     intf = eval_integ(intf);
    01340
    01341     intf = GiNaC::integral(b_repr.op(5).op(0), b_repr.op(5).op(1), b_repr.op(5).op(2), intf);
    01342     intf = eval_integ(intf);
    01343
    01344     return intf;
    01345
    01346
    01347 }

Line Box::line | ( | int | i | ) | `[virtual]`

| Reimplemented in ReferenceBox. Definition at line 1284 of file Polygon.cpp. References istr(), Polygon::p, and Polygon::subscript. Referenced by ReferenceBox::line().
    01284                      {
    01285   if      ( i == 1) return Line(p[0],p[1], istr(subscript,i));
    01286   else if ( i == 2) return Line(p[1],p[2], istr(subscript,i));
    01287   else if ( i == 3) return Line(p[2],p[3], istr(subscript,i));
    01288   else if ( i == 4) return Line(p[3],p[0], istr(subscript,i));
    01289
    01290   else if ( i == 5) return Line(p[4],p[5], istr(subscript,i));
    01291   else if ( i == 6) return Line(p[5],p[6], istr(subscript,i));
    01292   else if ( i == 7) return Line(p[6],p[7], istr(subscript,i));
    01293   else if ( i == 8) return Line(p[7],p[4], istr(subscript,i));
    01294
    01295   else if ( i == 9)  return Line(p[0],p[4], istr(subscript,i));
    01296   else if ( i == 10) return Line(p[1],p[5], istr(subscript,i));
    01297   else if ( i == 11) return Line(p[2],p[6], istr(subscript,i));
    01298   else if ( i == 12) return Line(p[3],p[7], istr(subscript,i));
    01299 }

int Box::no_vertices | ( |  | ) | `[virtual]`

| Reimplemented from Polygon. Reimplemented in ReferenceBox. Definition at line 1278 of file Polygon.cpp.
    01278 { return 8; }

GiNaC::ex Box::repr | ( | Repr_format | format = `SUBS_PERFORMED` | ) | `[virtual]`

| Reimplemented in ReferenceBox. Definition at line 1301 of file Polygon.cpp. References Polygon::p, x, y, and z. Referenced by integrate(), main(), and ReferenceBox::repr().
    01301                                      {
    01302    GiNaC::lst ret;
    01303    GiNaC::symbol r("r"), s("s"), t("t");
    01304    ret.append( x == p[0].op(0) + r*( p[6].op(0) - p[0].op(0)));
    01305    ret.append( y == p[0].op(1) + s*( p[6].op(1) - p[0].op(1)));
    01306    ret.append( z == p[0].op(1) + t*( p[6].op(2) - p[0].op(2)));
    01307    ret.append( GiNaC::lst(r,0,1));
    01308    ret.append( GiNaC::lst(s,0,1));
    01309    ret.append( GiNaC::lst(t,0,1));
    01310    return ret;
    01311 }

string Box::str | ( |  | ) | `[virtual]`

| Reimplemented from Polygon. Reimplemented in ReferenceBox. Definition at line 1313 of file Polygon.cpp.
    01313                   {
    01314   return "Box";
    01315 }

GiNaC::ex Box::vertex | ( | int | i | ) | `[virtual]`

| Reimplemented from Polygon. Reimplemented in ReferenceBox. Definition at line 1280 of file Polygon.cpp. References Polygon::p. Referenced by ReferenceBox::vertex().
    01280                            {
    01281   return p[i];
    01282 }

The documentation for this class was generated from the following files:

- Polygon.h
- Polygon.cpp