GiNaC  1.6.2
Public Member Functions | Protected Member Functions | Friends
GiNaC::ncmul Class Reference

Non-commutative product of expressions. More...

#include <ncmul.h>

Inheritance diagram for GiNaC::ncmul:
GiNaC::container< C > GiNaC::basic GiNaC::container_storage< C > GiNaC::refcounted

List of all members.

Public Member Functions

 ncmul (const ex &lh, const ex &rh)
 ncmul (const ex &f1, const ex &f2, const ex &f3)
 ncmul (const ex &f1, const ex &f2, const ex &f3, const ex &f4)
 ncmul (const ex &f1, const ex &f2, const ex &f3, const ex &f4, const ex &f5)
 ncmul (const ex &f1, const ex &f2, const ex &f3, const ex &f4, const ex &f5, const ex &f6)
 ncmul (const exvector &v, bool discardable=false)
 ncmul (std::auto_ptr< exvector > vp)
unsigned precedence () const
 Return relative operator precedence (for parenthezing output).
bool info (unsigned inf) const
 Information about the object.
int degree (const ex &s) const
 Return degree of highest power in object s.
int ldegree (const ex &s) const
 Return degree of lowest power in object s.
ex expand (unsigned options=0) const
 Expand expression, i.e.
ex coeff (const ex &s, int n=1) const
 Return coefficient of degree n in object s.
ex eval (int level=0) const
 Perform automatic term rewriting rules in this class.
ex evalm () const
 Evaluate sums, products and integer powers of matrices.
exvector get_free_indices () const
 Return a vector containing the free indices of an expression.
ex thiscontainer (const exvector &v) const
ex thiscontainer (std::auto_ptr< exvector > vp) const
ex conjugate () const
ex real_part () const
ex imag_part () const
const exvectorget_factors () const

Protected Member Functions

ex derivative (const symbol &s) const
 Implementation of ex::diff() for a non-commutative product.
unsigned return_type () const
return_type_t return_type_tinfo () const
void do_print (const print_context &c, unsigned level) const
 Default output to stream.
void do_print_csrc (const print_context &c, unsigned level) const
size_t count_factors (const ex &e) const
void append_factors (exvector &v, const ex &e) const
std::auto_ptr< exvectorexpandchildren (unsigned options) const

Friends

class power
ex reeval_ncmul (const exvector &v)
ex hold_ncmul (const exvector &v)

Detailed Description

Non-commutative product of expressions.

Definition at line 32 of file ncmul.h.


Constructor & Destructor Documentation

GiNaC::ncmul::ncmul ( const ex lh,
const ex rh 
)

Definition at line 60 of file ncmul.cpp.

Referenced by coeff(), conjugate(), derivative(), eval(), evalm(), expand(), and thiscontainer().

GiNaC::ncmul::ncmul ( const ex f1,
const ex f2,
const ex f3 
)

Definition at line 64 of file ncmul.cpp.

GiNaC::ncmul::ncmul ( const ex f1,
const ex f2,
const ex f3,
const ex f4 
)

Definition at line 68 of file ncmul.cpp.

GiNaC::ncmul::ncmul ( const ex f1,
const ex f2,
const ex f3,
const ex f4,
const ex f5 
)

Definition at line 73 of file ncmul.cpp.

GiNaC::ncmul::ncmul ( const ex f1,
const ex f2,
const ex f3,
const ex f4,
const ex f5,
const ex f6 
)

Definition at line 78 of file ncmul.cpp.

GiNaC::ncmul::ncmul ( const exvector v,
bool  discardable = false 
)

Definition at line 83 of file ncmul.cpp.

GiNaC::ncmul::ncmul ( std::auto_ptr< exvector vp)

Definition at line 87 of file ncmul.cpp.


Member Function Documentation

unsigned GiNaC::ncmul::precedence ( ) const [inline, virtual]

Return relative operator precedence (for parenthezing output).

Reimplemented from GiNaC::container< C >.

Definition at line 57 of file ncmul.h.

Referenced by do_print(), and do_print_csrc().

bool GiNaC::ncmul::info ( unsigned  inf) const [virtual]

Information about the object.

See also:
class info_flags

Reimplemented from GiNaC::container< C >.

Definition at line 113 of file ncmul.cpp.

int GiNaC::ncmul::degree ( const ex s) const [virtual]

Return degree of highest power in object s.

Reimplemented from GiNaC::basic.

Definition at line 200 of file ncmul.cpp.

References GiNaC::container< C >::end(), GiNaC::basic::is_equal(), and GiNaC::container_storage< C >::seq.

int GiNaC::ncmul::ldegree ( const ex s) const [virtual]

Return degree of lowest power in object s.

Reimplemented from GiNaC::basic.

Definition at line 215 of file ncmul.cpp.

References GiNaC::container< C >::end(), GiNaC::basic::is_equal(), and GiNaC::container_storage< C >::seq.

ex GiNaC::ncmul::expand ( unsigned  options = 0) const [virtual]

Expand expression, i.e.

multiply it out and return the result as a new expression.

Reimplemented from GiNaC::basic.

Definition at line 120 of file ncmul.cpp.

References GiNaC::_ex1, GiNaC::status_flags::dynallocated, expandchildren(), GiNaC::status_flags::expanded, k, last, ncmul(), GiNaC::container< C >::op(), GiNaC::rename_dummy_indices_uniquely(), GiNaC::container_storage< C >::seq, and GiNaC::basic::setflag().

ex GiNaC::ncmul::coeff ( const ex s,
int  n = 1 
) const [virtual]
ex GiNaC::ncmul::eval ( int  level = 0) const [virtual]

Perform automatic term rewriting rules in this class.

In the following x, x1, x2,... stand for a symbolic variables of type ex and c, c1, c2... stand for such expressions that contain a plain number.

  • ncmul(...,*(x1,x2),...,ncmul(x3,x4),...) -> ncmul(...,x1,x2,...,x3,x4,...) (associativity)
  • ncmul(x) -> x
  • ncmul() -> 1
  • ncmul(...,c1,...,c2,...) -> *(c1,c2,ncmul(...)) (pull out commutative elements)
  • ncmul(x1,y1,x2,y2) -> *(ncmul(x1,x2),ncmul(y1,y2)) (collect elements of same type)
  • ncmul(x1,x2,x3,...) -> x::eval_ncmul(x1,x2,x3,...)
Parameters:
levelcut-off in recursive evaluation

Reimplemented from GiNaC::container< C >.

Definition at line 304 of file ncmul.cpp.

References GiNaC::_ex1, append_factors(), GiNaC::ex::begin(), GiNaC::return_types::commutative, count_factors(), GiNaC::status_flags::dynallocated, GiNaC::container< C >::evalchildren(), GiNaC::status_flags::evaluated, GiNaC::factor(), factors, GiNaC::basic::flags, GINAC_ASSERT, GiNaC::make_flat_inserter::handle_factor(), ncmul(), GiNaC::return_types::noncommutative, GiNaC::return_types::noncommutative_composite, GiNaC::container_storage< C >::reserve(), GiNaC::container_storage< C >::seq, and GiNaC::basic::setflag().

ex GiNaC::ncmul::evalm ( ) const [virtual]

Evaluate sums, products and integer powers of matrices.

Reimplemented from GiNaC::basic.

Definition at line 447 of file ncmul.cpp.

References GiNaC::status_flags::dynallocated, GiNaC::matrix::mul(), ncmul(), GiNaC::container_storage< C >::seq, and GiNaC::basic::setflag().

exvector GiNaC::ncmul::get_free_indices ( ) const [virtual]

Return a vector containing the free indices of an expression.

Reimplemented from GiNaC::basic.

Definition at line 503 of file indexed.cpp.

References GiNaC::find_free_and_dummy(), GiNaC::ex::get_free_indices(), GiNaC::container< C >::nops(), and GiNaC::container< C >::op().

ex GiNaC::ncmul::thiscontainer ( const exvector v) const

Definition at line 476 of file ncmul.cpp.

References GiNaC::status_flags::dynallocated, and ncmul().

ex GiNaC::ncmul::thiscontainer ( std::auto_ptr< exvector vp) const

Definition at line 481 of file ncmul.cpp.

References GiNaC::status_flags::dynallocated, and ncmul().

ex GiNaC::ncmul::conjugate ( ) const [virtual]
ex GiNaC::ncmul::real_part ( ) const [virtual]

Reimplemented from GiNaC::container< C >.

Definition at line 505 of file ncmul.cpp.

ex GiNaC::ncmul::imag_part ( ) const [virtual]

Reimplemented from GiNaC::container< C >.

Definition at line 510 of file ncmul.cpp.

ex GiNaC::ncmul::derivative ( const symbol s) const [protected, virtual]

Implementation of ex::diff() for a non-commutative product.

It applies the product rule.

See also:
ex::diff

Reimplemented from GiNaC::basic.

Definition at line 520 of file ncmul.cpp.

References GiNaC::status_flags::dynallocated, ncmul(), GiNaC::container_storage< C >::seq, GiNaC::basic::setflag(), and GiNaC::ex::swap().

unsigned GiNaC::ncmul::return_type ( ) const [protected, virtual]
return_type_t GiNaC::ncmul::return_type_tinfo ( ) const [protected, virtual]

Reimplemented from GiNaC::basic.

Definition at line 572 of file ncmul.cpp.

References GiNaC::container< C >::end(), GiNaC::return_types::noncommutative, and GiNaC::container_storage< C >::seq.

Referenced by conjugate().

void GiNaC::ncmul::do_print ( const print_context c,
unsigned  level 
) const [protected]

Default output to stream.

Reimplemented from GiNaC::container< C >.

Definition at line 102 of file ncmul.cpp.

References precedence(), and GiNaC::container< C >::printseq().

void GiNaC::ncmul::do_print_csrc ( const print_context c,
unsigned  level 
) const [protected]
size_t GiNaC::ncmul::count_factors ( const ex e) const [protected]
void GiNaC::ncmul::append_factors ( exvector v,
const ex e 
) const [protected]
std::auto_ptr< exvector > GiNaC::ncmul::expandchildren ( unsigned  options) const [protected]
const exvector & GiNaC::ncmul::get_factors ( ) const

Definition at line 629 of file ncmul.cpp.

References GiNaC::container_storage< C >::seq.


Friends And Related Function Documentation

friend class power [friend]

Definition at line 36 of file ncmul.h.

ex reeval_ncmul ( const exvector v) [friend]

Definition at line 638 of file ncmul.cpp.

ex hold_ncmul ( const exvector v) [friend]

Definition at line 643 of file ncmul.cpp.


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.