CMS 3D CMS Logo

Public Member Functions | Public Attributes

magfieldparam::poly2d_term Struct Reference

#include <poly2d_base.h>

List of all members.

Public Member Functions

 poly2d_term ()
 poly2d_term (double C, unsigned nr, unsigned nz)
void Print (std::ostream &out=std::cout, bool first_term=true)

Public Attributes

double coeff
unsigned np [2]

Detailed Description

Definition at line 23 of file poly2d_base.h.


Constructor & Destructor Documentation

magfieldparam::poly2d_term::poly2d_term ( ) [inline]

Definition at line 27 of file poly2d_base.h.

{memset(this, 0, sizeof(*this));}
magfieldparam::poly2d_term::poly2d_term ( double  C,
unsigned  nr,
unsigned  nz 
) [inline]

Definition at line 28 of file poly2d_base.h.

References funct::C, coeff, and np.

   {
      coeff = C; np[0] = nr; np[1] = nz;
   }

Member Function Documentation

void poly2d_term::Print ( std::ostream &  out = std::cout,
bool  first_term = true 
)

Definition at line 12 of file poly2d_base.cc.

References coeff, and np.

{
   if (first_term) out << coeff;
   else if (coeff > 0.) out << " + " << coeff;
        else out << " - " << -coeff;
   if (np[0] != 0) {
      out << "*r";
      if (np[0] != 1) out << "^" << np[0];
   }
   if (np[1] != 0) {
      out << "*z";
      if (np[1] != 1) out << "^" << np[1];
   }
}

Member Data Documentation