CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
magfieldparam::poly2d_term Struct Reference

#include <poly2d_base.h>

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.

27 {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.

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

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.

13 {
14  if (first_term) out << coeff;
15  else if (coeff > 0.) out << " + " << coeff;
16  else out << " - " << -coeff;
17  if (np[0] != 0) {
18  out << "*r";
19  if (np[0] != 1) out << "^" << np[0];
20  }
21  if (np[1] != 0) {
22  out << "*z";
23  if (np[1] != 1) out << "^" << np[1];
24  }
25 }
tuple out
Definition: dbtoconf.py:99

Member Data Documentation

double magfieldparam::poly2d_term::coeff
unsigned magfieldparam::poly2d_term::np[2]