GiNaC 1.8.7
Public Member Functions | Public Attributes | List of all members
GiNaC::expair Class Reference

A pair of expressions. More...

#include <expair.h>

Public Member Functions

 expair ()
 
 expair (const ex &r, const ex &c)
 Construct an expair from two ex. More...
 
bool is_equal (const expair &other) const
 Member-wise check for canonical ordering equality. More...
 
bool is_less (const expair &other) const
 Member-wise check for canonical ordering lessness. More...
 
int compare (const expair &other) const
 Member-wise check for canonical ordering. More...
 
void print (std::ostream &os) const
 
bool is_canonical_numeric () const
 True if this is of the form (numeric,ex(1)). More...
 
void swap (expair &other)
 Swap contents with other expair. More...
 
const expair conjugate () const
 

Public Attributes

ex rest
 first member of pair, an arbitrary expression More...
 
ex coeff
 second member of pair, must be numeric More...
 

Detailed Description

A pair of expressions.

This is similar to STL's pair<>. It is slightly extended since we need to account for methods like .compare(). Also, since this is meant for use by class expairseq it must satisfy the invariance that the member coeff must be of type numeric.

Definition at line 37 of file expair.h.

Constructor & Destructor Documentation

◆ expair() [1/2]

GiNaC::expair::expair ( )
inline

Definition at line 40 of file expair.h.

Referenced by conjugate().

◆ expair() [2/2]

GiNaC::expair::expair ( const ex r,
const ex c 
)
inline

Construct an expair from two ex.

Definition at line 43 of file expair.h.

References coeff, and GINAC_ASSERT.

Member Function Documentation

◆ is_equal()

bool GiNaC::expair::is_equal ( const expair other) const
inline

Member-wise check for canonical ordering equality.

Definition at line 49 of file expair.h.

References coeff, GiNaC::ex::is_equal(), and rest.

Referenced by GiNaC::expairseq::evalchildren(), GiNaC::mul::expair_needs_further_processing(), and GiNaC::expairseq::subschildren().

◆ is_less()

bool GiNaC::expair::is_less ( const expair other) const
inline

Member-wise check for canonical ordering lessness.

Definition at line 55 of file expair.h.

References coeff, GiNaC::ex::compare(), and rest.

Referenced by GiNaC::expair_is_less::operator()().

◆ compare()

int GiNaC::expair::compare ( const expair other) const
inline

Member-wise check for canonical ordering.

Definition at line 63 of file expair.h.

References coeff, GiNaC::ex::compare(), and rest.

◆ print()

void GiNaC::expair::print ( std::ostream &  os) const

Definition at line 30 of file expair.cpp.

References c, coeff, GiNaC::ex::print(), and rest.

◆ is_canonical_numeric()

bool GiNaC::expair::is_canonical_numeric ( ) const
inline

True if this is of the form (numeric,ex(1)).

Definition at line 75 of file expair.h.

References coeff, GINAC_ASSERT, GiNaC::ex::is_equal(), and rest.

◆ swap()

void GiNaC::expair::swap ( expair other)
inline

Swap contents with other expair.

Definition at line 82 of file expair.h.

References coeff, rest, and GiNaC::ex::swap().

Referenced by GiNaC::mul::derivative(), GiNaC::expair_swap::operator()(), and GiNaC::swap().

◆ conjugate()

const expair GiNaC::expair::conjugate ( ) const

Definition at line 38 of file expair.cpp.

References GiNaC::are_ex_trivially_equal(), coeff, GiNaC::ex::conjugate(), expair(), and rest.

Member Data Documentation

◆ rest

ex GiNaC::expair::rest

◆ coeff

ex GiNaC::expair::coeff

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

This page is part of the GiNaC developer's reference. It was generated automatically by doxygen. For an introduction, see the tutorial.