phelm::Polynom Struct Reference
[Polynom functions and classes]

Polynom of variables (x, y). More...

#include <polynom.h>

List of all members.

Public Member Functions

 Polynom (short x_deg, short y_deg)
 Creates new empty polynom.
 Polynom (short x_deg, short y_deg, double *koef, int l)
 Creates new polynom from coefficients.
std::string print () const
 Prints polynom into the string.
double apply (double x, double y) const
 Calculates Polynom(x, y).
double k (int i, int j) const
 Returns polynom coefficient.
void operator/= (double k)
 Calculates new polynom.

Public Attributes

short x_deg_
 x degree
short y_deg_
 y degree
std::vector< double > koef_
 coefficients

Related Functions

(Note that these are not member functions.)

const Polynom P2X
 The polynom: $P(x,y)=x$.
const Polynom P2Y
 The polynom: $P(x,y)=y$.
Polynom diff (const Polynom &p, int i)
 A derivative of the polynom with respect to x or y.
double integrate (const Polynom &p, const Triangle &t, const std::vector< MeshPoint > &ps)
 Takes the integral of Polynom over the Triangle t.
double integrate_cos (const Polynom &p, const Triangle &t, const std::vector< MeshPoint > &ps)
 Takes the integral of Polynom over the Triangle t.
double integrate_sin (const Polynom &p, const Triangle &t, const std::vector< MeshPoint > &ps)
 Takes the integral of Polynom over the Triangle t.
double integrate_1_cos (const Polynom &p, const Triangle &t, const std::vector< MeshPoint > &ps)
 Takes the integral of Polynom over the Triangle t.
Polynom operator* (const Polynom &p1, const Polynom &p2)
 A product of polynom p1 by polynom p2.
Polynom operator- (const Polynom &p1, const Polynom &p2)
 A difference of two polynoms.
Polynom operator+ (const Polynom &p1, const Polynom &p2)
 A sum of two polynoms.
Polynom operator- (const Polynom &p1, double x)
 A difference between a polynom and a number.
Polynom operator* (const Polynom &p1, double x)
 A product of a polynom p1 by a number x.


Detailed Description

Polynom of variables (x, y).

Examples:

\[ x^2 y + y + x + 1, \]

x degree = 2; y degree = 1,

\[ x^2 + 1, \]

x degree = 2; y degree = 0.

\[ P(x,y) = \sum_{i=0}^{x\_deg}\sum_{j=0}^{y\_deg}k_{ij}x^i y^j. \]

Examples:

test_system_laplace.cpp.

Definition at line 77 of file polynom.h.


Constructor & Destructor Documentation

phelm::Polynom::Polynom ( short  x_deg,
short  y_deg 
) [inline]

Creates new empty polynom.

Parameters:
x_deg - x degree
y_deg - y degree

Definition at line 87 of file polynom.h.

phelm::Polynom::Polynom ( short  x_deg,
short  y_deg,
double *  koef,
int  l 
) [inline]

Creates new polynom from coefficients.

Parameters:
x_deg - x degree
y_deg - y degree
koef - the coefficients
l - the number of elements in the coefficients array

Definition at line 99 of file polynom.h.


Member Function Documentation

double phelm::Polynom::apply ( double  x,
double  y 
) const

Calculates Polynom(x, y).

Returns:
Polynom(x, y)

Definition at line 61 of file polynom.cpp.

double phelm::Polynom::k ( int  i,
int  j 
) const [inline]

Returns polynom coefficient.

Returns:
$k_{ij}$

Definition at line 124 of file polynom.h.

void phelm::Polynom::operator/= ( double  k  )  [inline]

Calculates new polynom.

Returns:
$\frac{P(x,y)}{k}$

Definition at line 134 of file polynom.h.

std::string phelm::Polynom::print (  )  const

Prints polynom into the string.

Returns:
string representation of the polynom.

Definition at line 97 of file polynom.cpp.


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

Phelm Library
Copyright © 2009 Alexey Ozeritsky. All rights reserved.
http://resetius.ru