X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Findexed.h;h=0147185ddd4630183ee7e78b23db134015fccadd;hp=b06fad1040a702a8354248f3ef68834297c88cc8;hb=6c9a7dfd6b92368b21a2fe5aaf3638bc849099ba;hpb=745d46b8492878030cc0decd1cb9bf2de2de03ff diff --git a/ginac/indexed.h b/ginac/indexed.h index b06fad10..0147185d 100644 --- a/ginac/indexed.h +++ b/ginac/indexed.h @@ -151,11 +151,12 @@ public: // functions overriding virtual functions from base classes public: - void printraw(std::ostream & os) const; - void printtree(std::ostream & os, unsigned indent) const; - void print(std::ostream & os, unsigned upper_precedence=0) const; + void print(const print_context & c, unsigned level = 0) const; bool info(unsigned inf) const; ex eval(int level = 0) const; + int degree(const ex & s) const; + int ldegree(const ex & s) const; + ex coeff(const ex & s, int n = 1) const; exvector get_free_indices(void) const; protected: @@ -173,13 +174,18 @@ public: * @see class info_flags */ bool all_index_values_are(unsigned inf) const; + /** Return a vector containing the object's indices. */ + exvector get_indices(void) const; + /** Return a vector containing the dummy indices of the object, if any. */ exvector get_dummy_indices(void) const; + /** Return a vector containing the dummy indices in the contraction with + * another indexed object. */ + exvector get_dummy_indices(const indexed & other) const; + protected: - void printrawindices(std::ostream & os) const; - void printtreeindices(std::ostream & os, unsigned indent) const; - void printindices(std::ostream & os) const; + void printindices(const print_context & c, unsigned level) const; void assert_all_indices_of_type_idx(void) const; // member variables @@ -209,6 +215,11 @@ public: /** Register scalar product pair and its value. */ void add(const ex & v1, const ex & v2, const ex & sp); + /** Register list of vectors. This adds all possible pairs of products + * a.i * b.i with the value a*b (note that this is not a scalar vector + * product but an ordinary product of scalars). */ + void add_vectors(const lst & l); + /** Clear all registered scalar products. */ void clear(void);