APRONXX 0.9.14
/builddir/build/BUILD/apron-0.9.15-build/apron-0.9.15/apronxx/apxx_texpr0.hh
Go to the documentation of this file.
1/* -*- C++ -*-
2 * apxx_texpr0.hh
3 *
4 * APRON Library / C++ class wrappers
5 *
6 * Copyright (C) Antoine Mine' 2007
7 *
8 */
9/* This file is part of the APRON Library, released under LGPL license
10 with an exception allowing the redistribution of statically linked
11 executables.
12
13 Please read the COPYING file packaged in the distribution.
14*/
15
16#ifndef __APXX_TEXPR0_HH
17#define __APXX_TEXPR0_HH
18
19#include <vector>
20
21#include "ap_texpr0.h"
22#include "ap_linearize.h"
23
24#include "apxx_linexpr0.hh"
25#include "apxx_environment.hh"
26
27namespace apron {
28
29class abstract0;
30
31
33class dim {
34
35public:
36
37 ap_dim_t d;
38
40 dim(ap_dim_t d);
41
46 dim(const environment& e, const var& v);
47};
48
49
50
52bool is_unop(ap_texpr_op_t op);
53
55 bool is_binop(ap_texpr_op_t op);
56
57
58
59
60/* ================================= */
61/* texpr0 */
62/* ================================= */
63
64
92class texpr0 : public use_malloc {
93
94protected:
95
96 ap_texpr0_t l;
97
99 texpr0(ap_texpr0_t* x);
100
102 void init_from(ap_texpr0_t* x);
103
104public:
105
106 class builder;
107 class iterator;
108 class const_iterator;
109
110
111 /* constructors */
112 /* ============ */
113
116
122 texpr0(const builder& x);
123
125 texpr0(const texpr0& x);
126
128 texpr0(const const_iterator& x);
129
134 texpr0(const linexpr0& l);
135
136
141 texpr0(const texpr0& x, const dimchange& d, bool add=true);
142
144 texpr0(const texpr0& x, const dimperm& d);
145
147 texpr0(const texpr0& x, ap_dim_t dim, const texpr0& dst);
148
150
151
152 /* destructor */
153 /* ========== */
154
157
159 ~texpr0();
160
162
163 /* assignment */
164 /* ========== */
165
168
170 texpr0& operator=(const texpr0& x);
171
174
176 texpr0& operator=(const builder& x);
177
182 texpr0& operator= (const linexpr0& x);
183
185
186
187
188 /* iterators */
189 /* ========= */
190
191
194
212
213 protected:
214
215 ap_texpr0_t* l;
216
218 const_iterator(ap_texpr0_t* l);
219
220 friend class texpr0;
221 friend class tcons0;
222 friend class texpr1;
223 friend class tcons1;
224
225 public:
226
227 /* constructors */
228 /* ============ */
229
232
234 const_iterator(const texpr0& e);
235
238
240
241
242 /* access */
243 /* ====== */
244
247
248
254 ap_texpr_discr_t get_discr() const;
255
260 const coeff& get_coeff() const;
261
266 ap_dim_t get_dim() const;
267
274 ap_texpr_op_t get_op() const;
275
282 ap_texpr_rtype_t get_rtype() const;
283
289 ap_texpr_rdir_t get_rdir() const;
290
292
293
294 /* traversal */
295 /* ========= */
296
299
302
307 const_iterator child() const;
308
314 const_iterator left() const;
315
321 const_iterator right() const;
322
324
325
326 /* tests, size, dimensions */
327 /* ======================= */
328
331
332
334 bool equal(const texpr0& x) const;
335
337 bool is_zero() const;
338
340 size_t depth() const;
341
343 size_t size() const;
344
346 ap_dim_t max_dim() const;
347
349 bool has_dim(ap_dim_t d) const;
350
354 std::vector<ap_dim_t> dimlist() const;
355
357 bool is_interval_cst() const;
358
360 bool is_interval_linear() const;
361
363 bool is_interval_polynomial() const;
364
366 bool is_interval_polyfrac() const;
367
369 bool is_scalar() const;
370
372
373
374 /* print */
375 /* ===== */
376
379
384 friend std::ostream& operator<< (std::ostream& os, const const_iterator& s);
385
387 void print(char** name_of_dim = NULL, FILE* stream=stdout) const;
388
390
391
392 /* C-level compatibility */
393 /* ===================== */
394
397
399 ap_texpr0_t* get_ap_texpr0_t();
400
402 const ap_texpr0_t* get_ap_texpr0_t() const;
403
405
406 };
407
408
413 class iterator : public const_iterator {
414
415 protected:
416
418 iterator(ap_texpr0_t* l);
419
420 friend class tcons0;
421 friend class texpr1;
422 friend class tcons1;
423
424 public:
425
426 /* constructors */
427 /* ============ */
428
431
433 iterator(texpr0& e);
434
436 iterator(const iterator& i);
437
439
440
441 /* substitution */
442 /* ============ */
443
446
452 iterator& operator= (const builder& c);
453
455
456
457 /* access */
458 /* ====== */
459
462
467 coeff& get_coeff() const;
468
473 ap_dim_t& get_dim() const;
474
481 ap_texpr_op_t& get_op() const;
482
489 ap_texpr_rtype_t& get_rtype() const;
490
496 ap_texpr_rdir_t& get_rdir() const;
497
499
500
501 /* traversal */
502 /* ========= */
503
506
508 iterator& operator=(const iterator& i);
509
514 iterator child() const;
515
521 iterator left() const;
522
528 iterator right() const;
529
531
532
533 /* C-level compatibility */
534 /* ===================== */
535
538
540 ap_texpr0_t* get_ap_texpr0_t();
541
543 const ap_texpr0_t* get_ap_texpr0_t() const;
544
546
547 };
548
549
551 const_iterator root() const;
552
554 iterator root();
555
557
558
559
560 /* builders */
561 /* ======== */
562
565
581 class builder : public use_malloc {
582
583 friend class texpr1;
584
585 protected:
586
587 ap_texpr0_t* l;
588
589
591 builder& operator= (const builder& x) { assert(0); return *this; }
592
594 void init_from(ap_texpr0_t* x);
595
597 builder(ap_texpr0_t* x);
598
599 public:
600
601 /* constructors */
602 /* ============ */
603
606
608 builder(const builder& x);
609
611 builder(const const_iterator& x);
612
614 builder(const texpr0& x);
615
617 builder(const coeff& x);
618
620 builder(const scalar& x);
621
623 builder(const mpq_class& x);
624
626 builder(mpfr_t x);
627
629 builder(int x);
630
632 builder(long x);
633
635 builder(double x);
636
638 builder(const frac& x);
639
641 builder(const interval& x);
642
644 builder(const scalar& inf, const scalar& sup);
645
647 builder(const mpq_class& inf, const mpq_class& sup);
648
650 builder(mpfr_t inf, mpfr_t sup);
651
653 builder(int inf, int sup);
654
656 builder(long inf, long sup);
657
659 builder(double inf, double sup);
660
662 builder(const frac& inf, const frac& sup);
663
665 builder(top t);
666
668 builder(dim d);
669
671 builder(ap_texpr_op_t op, const builder& argA, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
672
674 builder(ap_texpr_op_t op, const builder& argA, const builder& argB, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
675
677
678
679 /* destructor */
680 /* ========== */
681
684
686 ~builder();
687
689
690
691 /* C-level compatibility */
692 /* ===================== */
693
696
698 ap_texpr0_t* get_ap_texpr0_t();
699
701 const ap_texpr0_t* get_ap_texpr0_t() const;
702
704
705
706 /* 'Intelligent' constructors */
707 /* ========================== */
708
711
727 friend builder unary(ap_texpr_op_t op, const builder& a,
728 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
729
745 friend builder binary(ap_texpr_op_t op, const builder& a, const builder& b,
746 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
747
749 friend builder add(const builder& a, const builder& b,
750 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
751
753 friend builder sub(const builder& a, const builder& b,
754 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
755
757 friend builder mul(const builder& a, const builder& b,
758 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
759
761 friend builder div(const builder& a, const builder& b,
762 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
763
765 friend builder mod(const builder& a, const builder& b,
766 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
767
769 friend builder pow(const builder& a, const builder& b,
770 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
771
773 friend builder neg(const builder& a,
774 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
775
777 friend builder cast(const builder& a, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
778
780 friend builder floor(const builder& a);
781
783 friend builder ceil(const builder& a);
784
786 friend builder trunc(const builder& a);
787
789 friend builder sqrt(const builder& a,
790 ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir);
791
793 friend builder operator+(const builder& a);
794
796 friend builder operator-(const builder& a);
797
799 friend builder operator+(const builder& a, const builder& b);
800
802 friend builder operator-(const builder& a, const builder& b);
803
805 friend builder operator*(const builder& a, const builder& b);
806
808 friend builder operator/(const builder& a, const builder& b);
809
811 friend builder operator%(const builder& a, const builder& b);
812
814 friend builder operator^(const builder& a, const builder& b);
815
817
818
820 bool is_zero() const;
821
822 };
823
824
825
826 /* print */
827 /* ===== */
828
831
836 friend std::ostream& operator<< (std::ostream& os, const texpr0& s);
837
839 void print(char** name_of_dim = NULL, FILE* stream=stdout) const;
840
842
843
844 /* tests, size, dimensions */
845 /* ======================= */
846
849
850
852 bool equal(const texpr0& x) const;
853
855 bool is_zero() const;
856
858 size_t depth() const;
859
861 size_t size() const;
862
864 ap_dim_t max_dim() const;
865
867 bool has_dim(ap_dim_t d) const;
868
872 std::vector<ap_dim_t> dimlist() const;
873
875 bool is_interval_cst() const;
876
878 bool is_interval_linear() const;
879
881 bool is_interval_polynomial() const;
882
884 bool is_interval_polyfrac() const;
885
887 bool is_scalar() const;
888
890
891 /* operations */
892 /* ========== */
893
896
898 void substitute(ap_dim_t dim, const texpr0& dst);
899
900#if 0
907 interval eval(manager& m, const abstract0& a, ap_scalar_discr_t discr=AP_SCALAR_DOUBLE,
908 bool* pexact=NULL) const;
909
910 linexpr0 intlinearize(manager& m, const abstract0& a, ap_scalar_discr_t discr=AP_SCALAR_DOUBLE,
911 bool quasilinearize=false, bool* pexact=NULL) const;
912#endif
913
915 long hash() const;
916
918
919 /* change of dimension */
920 /* =================== */
921
924
926 void add_dimensions(const dimchange& d);
927
932 void remove_dimensions(const dimchange& d);
933
935 void permute_dimensions(const dimperm& d);
936
938
939
940 /* C-level compatibility */
941 /* ===================== */
942
945
947 ap_texpr0_t* get_ap_texpr0_t();
948
950 const ap_texpr0_t* get_ap_texpr0_t() const;
951
953
954};
955
956#include "apxx_texpr0_inline.hh"
957
958}
959
960#endif /* __APXX_TEXPR0_HH */
texpr0::builder add(const texpr0::builder &a, const texpr0::builder &b, ap_texpr_rtype_t rtype=AP_RTYPE_REAL, ap_texpr_rdir_t rdir=AP_RDIR_NEAREST)
Definition apxx_texpr0_inline.hh:771
Level 0 abstract value (ap_abstract0_t* wrapper).
Definition apxx_abstract0.hh:78
Coefficient (ap_coeff_t wrapper).
Definition apxx_coeff.hh:36
Represents a dimension (i.e., variable by index) in an expression tree.
Definition apxx_texpr0.hh:33
ap_dim_t d
Dimension index.
Definition apxx_texpr0.hh:37
dim(ap_dim_t d)
Standard constructor.
Definition apxx_texpr0_inline.hh:19
Dimension change object (ap_dimchange_t wrapper).
Definition apxx_dimension.hh:102
Dimension permutation object (ap_dimperm_t wrapper).
Definition apxx_dimension.hh:292
Level 1 environment (ap_environment_t wrapper).
Definition apxx_environment.hh:51
Interval (ap_interval_t wrapper).
Definition apxx_interval.hh:47
Level 0 linear expression (ap_linexpr0_t wrapper).
Definition apxx_linexpr0.hh:44
Library manager (ap_manager_t wrapper).
Definition apxx_manager.hh:137
Scalar (ap_scalar_t wrapper).
Definition apxx_scalar.hh:89
Level 0 arbitrary constraint (ap_tcons0_t wrapper).
Definition apxx_tcons0.hh:47
Level 1 arbitrary constraint (ap_tcons1_t wrapper).
Definition apxx_tcons1.hh:39
Temporary expression nodes used when constructing a texpr0.
Definition apxx_texpr0.hh:581
friend builder sub(const builder &a, const builder &b, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_SUB expression node.
friend builder unary(ap_texpr_op_t op, const builder &a, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes a unary expression node.
friend builder neg(const builder &a, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_NEG expression node.
friend builder trunc(const builder &a)
Makes an AP_TEXPR_CAST expression node to AP_RTYPE_INT type rounded towards AP_RDIR_ZERO.
friend builder cast(const builder &a, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_CAST expression node.
friend builder mul(const builder &a, const builder &b, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_MUL expression node.
void init_from(ap_texpr0_t *x)
Internal use only: makes a shallow copy, copying only the root node.
Definition apxx_texpr0_inline.hh:626
friend builder sqrt(const builder &a, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_SQRT expression node.
friend builder operator-(const builder &a, const builder &b)
Makes a AP_TEXPR_SUB expression node using AP_RTYPE_REAL type (no rounding).
friend builder operator+(const builder &a, const builder &b)
Makes a AP_TEXPR_ADD expression node using AP_RTYPE_REAL type (no rounding).
friend builder operator*(const builder &a, const builder &b)
Makes a AP_TEXPR_MUL expression node using AP_RTYPE_REAL type (no rounding).
friend builder pow(const builder &a, const builder &b, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_POW expression node.
friend builder operator^(const builder &a, const builder &b)
Makes a AP_TEXPR_POW expression node using AP_RTYPE_REAL type (no rounding).
~builder()
Frees the memory occupied by the node, not its sub-expressions.
Definition apxx_texpr0_inline.hh:892
friend builder floor(const builder &a)
Makes an AP_TEXPR_CAST expression node to AP_RTYPE_INT type rounded towards AP_RDIR_DOWN.
friend builder operator/(const builder &a, const builder &b)
Makes a AP_TEXPR_DIV expression node using AP_RTYPE_REAL type (no rounding).
builder & operator=(const builder &x)
Not to be used. (Temporaries are not to be re-assigned).
Definition apxx_texpr0.hh:591
friend builder add(const builder &a, const builder &b, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_ADD expression node.
ap_texpr0_t * l
Definition apxx_texpr0.hh:587
friend builder operator+(const builder &a)
Makes a copy of the node.
builder(ap_texpr0_t *x)
Internal use only: makes a shallow copy, copying only the root node.
Definition apxx_texpr0_inline.hh:640
friend builder binary(ap_texpr_op_t op, const builder &a, const builder &b, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes a binary expression node.
friend builder ceil(const builder &a)
Makes an AP_TEXPR_CAST expression node to AP_RTYPE_INT type rounded towards AP_RDIR_UP.
friend builder operator-(const builder &a)
Makes a AP_TEXPR_NEG expression node using AP_RTYPE_REAL type (no rounding).
friend builder mod(const builder &a, const builder &b, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_MOD expression node.
friend builder operator%(const builder &a, const builder &b)
Makes a AP_TEXPR_MOD expression node using AP_RTYPE_REAL type (no rounding).
bool is_zero() const
Whether the expression is a single coefficient node with 0 value.
Definition apxx_texpr0_inline.hh:903
friend builder div(const builder &a, const builder &b, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_DIV expression node.
ap_texpr0_t * get_ap_texpr0_t()
Returns a pointer to the internal APRON object stored in *this.
Definition apxx_texpr0_inline.hh:912
Iterators to traverse a constant expression tree.
Definition apxx_texpr0.hh:211
size_t size() const
Returns the number of operator nodes in the expression tree.
Definition apxx_texpr0_inline.hh:439
ap_texpr0_t * l
Definition apxx_texpr0.hh:215
bool is_interval_polynomial() const
Whether the expression is polynomial and there is no rounding.
Definition apxx_texpr0_inline.hh:475
bool is_interval_cst() const
Whether the expression is constant (i.e., has no dimension leaves).
Definition apxx_texpr0_inline.hh:465
bool is_zero() const
Whether the expression is a single coefficient node with 0 value.
Definition apxx_texpr0_inline.hh:423
ap_texpr_op_t get_op() const
Returns the operator kind of an operator node.
Definition apxx_texpr0_inline.hh:352
const_iterator & operator=(const const_iterator &i)
Resets the const_iterator at position i.
Definition apxx_texpr0_inline.hh:374
friend std::ostream & operator<<(std::ostream &os, const const_iterator &s)
Printing.
bool equal(const texpr0 &x) const
Whether two expressions are syntactically, structurally equal.
Definition apxx_texpr0_inline.hh:428
const_iterator left() const
Constructs a const_iterator to the only of left sub-expression of an operator node.
Definition apxx_texpr0_inline.hh:387
bool is_scalar() const
Whether all occurring constants are scalar.
Definition apxx_texpr0_inline.hh:485
ap_texpr_discr_t get_discr() const
Returns the node kind.
Definition apxx_texpr0_inline.hh:335
ap_texpr_rdir_t get_rdir() const
Returns the rounding direction of an operator node.
Definition apxx_texpr0_inline.hh:364
size_t depth() const
Returns the depth of the expression tree (counting only operator nodes).
Definition apxx_texpr0_inline.hh:434
const coeff & get_coeff() const
Returns a reference to the coefficient of a constant node.
Definition apxx_texpr0_inline.hh:340
ap_texpr0_t * get_ap_texpr0_t()
Returns a pointer to the internal APRON object stored in *this.
Definition apxx_texpr0_inline.hh:494
ap_dim_t max_dim() const
Returns the maximal dimension occurring in the expression (or 0 if there is no variable).
Definition apxx_texpr0_inline.hh:444
const_iterator child() const
Constructs a const_iterator to the only or left sub-expression of an operator node.
Definition apxx_texpr0_inline.hh:380
void print(char **name_of_dim=NULL, FILE *stream=stdout) const
Prints to a C stream.
Definition apxx_texpr0_inline.hh:414
bool is_interval_linear() const
Whether the expression is linear and there is no rounding.
Definition apxx_texpr0_inline.hh:470
ap_dim_t get_dim() const
Returns the dimension of a dimension node.
Definition apxx_texpr0_inline.hh:346
const_iterator right() const
Constructs a const_iterator to the right sub-expression argument of a binary operator node.
Definition apxx_texpr0_inline.hh:394
const_iterator(ap_texpr0_t *l)
Internal use only.
Definition apxx_texpr0_inline.hh:320
std::vector< ap_dim_t > dimlist() const
Returns a list of all dimensions occurring in the expression (in strict increasing order)
Definition apxx_texpr0_inline.hh:454
bool has_dim(ap_dim_t d) const
Whether the given dimension occurs in the expression.
Definition apxx_texpr0_inline.hh:449
bool is_interval_polyfrac() const
Whether the expression is a polynomial fraction and there is no rounding.
Definition apxx_texpr0_inline.hh:480
ap_texpr_rtype_t get_rtype() const
Returns the destination type of an operator node.
Definition apxx_texpr0_inline.hh:358
Iterators to traverse and mutate an expression tree.
Definition apxx_texpr0.hh:413
coeff & get_coeff() const
Returns a (modifiable) reference to the coefficient of a constant node.
Definition apxx_texpr0_inline.hh:544
iterator left() const
Constructs an iterator to the only of left sub-expression of an operator node.
Definition apxx_texpr0_inline.hh:591
ap_texpr_rtype_t & get_rtype() const
Returns a (modifiable) reference to the destination type of an operator node.
Definition apxx_texpr0_inline.hh:562
iterator(ap_texpr0_t *l)
Internal use only.
Definition apxx_texpr0_inline.hh:513
iterator child() const
Constructs an iterator to the only or left sub-expression of an operator node.
Definition apxx_texpr0_inline.hh:584
iterator right() const
Constructs an iterator to the right sub-expression argument of a binary operator node.
Definition apxx_texpr0_inline.hh:598
ap_texpr_rdir_t & get_rdir() const
Returns a (modifiable) reference to the rounding direction of an operator node.
Definition apxx_texpr0_inline.hh:568
iterator & operator=(const builder &c)
Replace the sub-expression at the iterator position with a (deep) copy of c.
Definition apxx_texpr0_inline.hh:531
ap_texpr0_t * get_ap_texpr0_t()
Returns a pointer to the internal APRON object stored in *this.
Definition apxx_texpr0_inline.hh:609
ap_dim_t & get_dim() const
Returns a (modifiable) reference to the dimension of a dimension node.
Definition apxx_texpr0_inline.hh:550
ap_texpr_op_t & get_op() const
Returns a (modifiable) reference to the operator kind of an operator node.
Definition apxx_texpr0_inline.hh:556
Level 0 arbitrary expression tree (ap_texpr0_t wrapper).
Definition apxx_texpr0.hh:92
bool is_interval_linear() const
Whether the expression is linear and there is no rounding.
Definition apxx_texpr0_inline.hh:206
~texpr0()
Frees the memory occupied by the expression (and, recursively, all sub-expressions).
Definition apxx_texpr0_inline.hh:102
size_t size() const
Returns the number of operator nodes in the expression tree.
Definition apxx_texpr0_inline.hh:181
size_t depth() const
Returns the depth of the expression tree (counting only operator nodes).
Definition apxx_texpr0_inline.hh:176
ap_texpr0_t * get_ap_texpr0_t()
Returns a pointer to the internal APRON object stored in *this.
Definition apxx_texpr0_inline.hh:293
ap_dim_t max_dim() const
Returns the maximal dimension occurring in the expression (or 0 if there is no variable).
Definition apxx_texpr0_inline.hh:186
bool has_dim(ap_dim_t d) const
Whether the given dimension occurs in the expression.
Definition apxx_texpr0_inline.hh:191
texpr0(ap_texpr0_t *x)
Internal use only. Shallow copy.
Definition apxx_texpr0_inline.hh:53
const_iterator root() const
Returns a new iterator at the root of a constant expression tree.
Definition apxx_texpr0_inline.hh:315
texpr0 & operator=(const texpr0 &x)
Makes a (deep) copy of the expression.
Definition apxx_texpr0_inline.hh:123
bool is_interval_cst() const
Whether the expression is constant (i.e., has no dimension leaves).
Definition apxx_texpr0_inline.hh:201
ap_texpr0_t l
Structure managed by APRON.
Definition apxx_texpr0.hh:96
void add_dimensions(const dimchange &d)
Adds some dimensions, shifting dimension if needed.
Definition apxx_texpr0_inline.hh:272
bool is_interval_polyfrac() const
Whether the expression is a polynomial fraction and there is no rounding.
Definition apxx_texpr0_inline.hh:216
friend std::ostream & operator<<(std::ostream &os, const texpr0 &s)
Printing.
bool is_interval_polynomial() const
Whether the expression is polynomial and there is no rounding.
Definition apxx_texpr0_inline.hh:211
bool equal(const texpr0 &x) const
Whether two expressions are syntactically, structurally equal.
Definition apxx_texpr0_inline.hh:171
void permute_dimensions(const dimperm &d)
Permutes dimensions.
Definition apxx_texpr0_inline.hh:283
long hash() const
Returns a hash code.
Definition apxx_texpr0_inline.hh:261
bool is_scalar() const
Whether all occurring constants are scalar.
Definition apxx_texpr0_inline.hh:221
void init_from(ap_texpr0_t *x)
Internal use only. Shallow copy.
Definition apxx_texpr0_inline.hh:47
std::vector< ap_dim_t > dimlist() const
Returns a list of all dimensions occurring in the expression (in strict increasing order)
Definition apxx_texpr0_inline.hh:196
bool is_zero() const
Whether the expression is a single coefficient node with 0 value.
Definition apxx_texpr0_inline.hh:166
void substitute(ap_dim_t dim, const texpr0 &dst)
Substitutes each occurrence of dim with (a fresh copy of) dst.
Definition apxx_texpr0_inline.hh:230
void print(char **name_of_dim=NULL, FILE *stream=stdout) const
Prints to a C stream.
Definition apxx_texpr0_inline.hh:157
void remove_dimensions(const dimchange &d)
Removes some dimensions, shifting dimension if needed.
Definition apxx_texpr0_inline.hh:278
Level 1 arbitrary expression tree (ap_texpr1_t wrapper).
Definition apxx_texpr1.hh:42
Variable name (ap_var_t wrapper).
Definition apxx_var.hh:39
Definition apxx_abstract0.hh:27
bool is_unop(ap_texpr_op_t op)
Whether the operator is unary.
bool is_binop(ap_texpr_op_t op)
Whether the operator is binary.
A fraction with native int coefficients, to simplify initialisations and assignments.
Definition apxx_scalar.hh:41
Full interval (]-oo,+oo[) or domain, to simplify initialisations and assignments.
Definition apxx_interval.hh:27
Inherited by most wrappers to map new and delete to malloc and free.
Definition apxx_scalar.hh:69