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>
21#include "ap_texpr0.h"
22#include "ap_linearize.h"
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;
40 dim(ap_dim_t d);
41
46 dim(const environment& e, const var& v);
47};
49
50
52bool is_unop(ap_texpr_op_t op);
53
55 bool is_binop(ap_texpr_op_t op);
56
58
59
60/* ================================= */
61/* texpr0 */
62/* ================================= */
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);
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);
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);
183
185
186
188 /* iterators */
189 /* ========= */
190
191
194
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
307 const_iterator child() const;
308
314 const_iterator left() const;
315
322
324
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;
343 size_t size() const;
344
346 ap_dim_t max_dim() const;
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;
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
441 /* substitution */
442 /* ============ */
443
446
452 iterator& operator= (const builder& c);
453
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
501 /* traversal */
502 /* ========= */
503
506
508 iterator& operator=(const iterator& i);
515
521 iterator left() const;
522
528 iterator right() const;
529
531
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
552
554 iterator root();
555
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; }
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);
617 builder(const coeff& x);
618
620 builder(const scalar& x);
621
623 builder(const mpq_class& x);
624
626 builder(mpfr_t x);
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);
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
666
668 builder(dim d);
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
678
679 /* destructor */
680 /* ========== */
684
686 ~builder();
687
690
691 /* C-level compatibility */
692 /* ===================== */
696
698 ap_texpr0_t* get_ap_texpr0_t();
699
701 const ap_texpr0_t* get_ap_texpr0_t() const;
704
705
706 /* 'Intelligent' constructors */
707 /* ========================== */
708
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);
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;
822 };
823
824
825
826 /* print */
827 /* ===== */
828
831
836 friend std::ostream& operator<< (std::ostream& os, const texpr0& s);
839 void print(char** name_of_dim = NULL, FILE* stream=stdout) const;
840
843
844 /* tests, size, dimensions */
845 /* ======================= */
846
850
852 bool equal(const texpr0& x) const;
853
855 bool is_zero() const;
856
858 size_t depth() const;
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;
881 bool is_interval_polynomial() const;
882
885
887 bool is_scalar() const;
888
890
891 /* operations */
892 /* ========== */
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
915 long hash() const;
916
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 */
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.hh:20
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 add(const builder &a, const builder &b, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_ADD expression node.
Definition apxx_texpr0.hh:772
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.
Definition apxx_texpr0.hh:800
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.
Definition apxx_texpr0.hh:807
friend builder trunc(const builder &a)
Makes an AP_TEXPR_CAST expression node to AP_RTYPE_INT type rounded towards AP_RDIR_ZERO.
Definition apxx_texpr0.hh:837
friend builder sqrt(const builder &a, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_SQRT expression node.
Definition apxx_texpr0.hh:842
void init_from(ap_texpr0_t *x)
Internal use only: makes a shallow copy, copying only the root node.
Definition apxx_texpr0.hh:627
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.
Definition apxx_texpr0.hh:757
friend builder operator*(const builder &a, const builder &b)
Makes a AP_TEXPR_MUL expression node using AP_RTYPE_REAL type (no rounding).
Definition apxx_texpr0.hh:869
friend builder operator^(const builder &a, const builder &b)
Makes a AP_TEXPR_POW expression node using AP_RTYPE_REAL type (no rounding).
Definition apxx_texpr0.hh:884
~builder()
Frees the memory occupied by the node, not its sub-expressions.
Definition apxx_texpr0.hh:893
friend builder floor(const builder &a)
Makes an AP_TEXPR_CAST expression node to AP_RTYPE_INT type rounded towards AP_RDIR_DOWN.
Definition apxx_texpr0.hh:827
friend builder operator/(const builder &a, const builder &b)
Makes a AP_TEXPR_DIV expression node using AP_RTYPE_REAL type (no rounding).
Definition apxx_texpr0.hh:874
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.
Definition apxx_texpr0.hh:764
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.
Definition apxx_texpr0.hh:793
builder & operator=(const builder &x)
Not to be used. (Temporaries are not to be re-assigned).
Definition apxx_texpr0.hh:591
ap_texpr0_t * l
Definition apxx_texpr0.hh:587
friend builder operator+(const builder &a)
Makes a copy of the node.
Definition apxx_texpr0.hh:849
builder(ap_texpr0_t *x)
Internal use only: makes a shallow copy, copying only the root node.
Definition apxx_texpr0.hh:641
friend builder cast(const builder &a, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_CAST expression node.
Definition apxx_texpr0.hh:821
friend builder ceil(const builder &a)
Makes an AP_TEXPR_CAST expression node to AP_RTYPE_INT type rounded towards AP_RDIR_UP.
Definition apxx_texpr0.hh:832
friend builder operator-(const builder &a)
Makes a AP_TEXPR_NEG expression node using AP_RTYPE_REAL type (no rounding).
Definition apxx_texpr0.hh:854
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.
Definition apxx_texpr0.hh:786
friend builder operator%(const builder &a, const builder &b)
Makes a AP_TEXPR_MOD expression node using AP_RTYPE_REAL type (no rounding).
Definition apxx_texpr0.hh:879
bool is_zero() const
Whether the expression is a single coefficient node with 0 value.
Definition apxx_texpr0.hh:904
friend builder neg(const builder &a, ap_texpr_rtype_t rtype, ap_texpr_rdir_t rdir)
Makes an AP_TEXPR_NEG expression node.
Definition apxx_texpr0.hh:814
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.
Definition apxx_texpr0.hh:779
ap_texpr0_t * get_ap_texpr0_t()
Returns a pointer to the internal APRON object stored in *this.
Definition apxx_texpr0.hh:913
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.hh:440
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.hh:476
bool is_interval_cst() const
Whether the expression is constant (i.e., has no dimension leaves).
Definition apxx_texpr0.hh:466
bool is_zero() const
Whether the expression is a single coefficient node with 0 value.
Definition apxx_texpr0.hh:424
ap_texpr_op_t get_op() const
Returns the operator kind of an operator node.
Definition apxx_texpr0.hh:353
const_iterator & operator=(const const_iterator &i)
Resets the const_iterator at position i.
Definition apxx_texpr0.hh:375
friend std::ostream & operator<<(std::ostream &os, const const_iterator &s)
Printing.
Definition apxx_texpr0.hh:409
bool equal(const texpr0 &x) const
Whether two expressions are syntactically, structurally equal.
Definition apxx_texpr0.hh:429
const_iterator left() const
Constructs a const_iterator to the only of left sub-expression of an operator node.
Definition apxx_texpr0.hh:388
bool is_scalar() const
Whether all occurring constants are scalar.
Definition apxx_texpr0.hh:486
ap_texpr_discr_t get_discr() const
Returns the node kind.
Definition apxx_texpr0.hh:336
ap_texpr_rdir_t get_rdir() const
Returns the rounding direction of an operator node.
Definition apxx_texpr0.hh:365
size_t depth() const
Returns the depth of the expression tree (counting only operator nodes).
Definition apxx_texpr0.hh:435
const coeff & get_coeff() const
Returns a reference to the coefficient of a constant node.
Definition apxx_texpr0.hh:341
ap_texpr0_t * get_ap_texpr0_t()
Returns a pointer to the internal APRON object stored in *this.
Definition apxx_texpr0.hh:495
ap_dim_t max_dim() const
Returns the maximal dimension occurring in the expression (or 0 if there is no variable).
Definition apxx_texpr0.hh:445
const_iterator child() const
Constructs a const_iterator to the only or left sub-expression of an operator node.
Definition apxx_texpr0.hh:381
void print(char **name_of_dim=NULL, FILE *stream=stdout) const
Prints to a C stream.
Definition apxx_texpr0.hh:415
bool is_interval_linear() const
Whether the expression is linear and there is no rounding.
Definition apxx_texpr0.hh:471
ap_dim_t get_dim() const
Returns the dimension of a dimension node.
Definition apxx_texpr0.hh:347
const_iterator right() const
Constructs a const_iterator to the right sub-expression argument of a binary operator node.
Definition apxx_texpr0.hh:395
const_iterator(ap_texpr0_t *l)
Internal use only.
Definition apxx_texpr0.hh:321
std::vector< ap_dim_t > dimlist() const
Returns a list of all dimensions occurring in the expression (in strict increasing order)
Definition apxx_texpr0.hh:455
bool has_dim(ap_dim_t d) const
Whether the given dimension occurs in the expression.
Definition apxx_texpr0.hh:450
bool is_interval_polyfrac() const
Whether the expression is a polynomial fraction and there is no rounding.
Definition apxx_texpr0.hh:481
ap_texpr_rtype_t get_rtype() const
Returns the destination type of an operator node.
Definition apxx_texpr0.hh:359
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.hh:545
iterator left() const
Constructs an iterator to the only of left sub-expression of an operator node.
Definition apxx_texpr0.hh:592
ap_texpr_rtype_t & get_rtype() const
Returns a (modifiable) reference to the destination type of an operator node.
Definition apxx_texpr0.hh:563
iterator(ap_texpr0_t *l)
Internal use only.
Definition apxx_texpr0.hh:514
iterator child() const
Constructs an iterator to the only or left sub-expression of an operator node.
Definition apxx_texpr0.hh:585
iterator right() const
Constructs an iterator to the right sub-expression argument of a binary operator node.
Definition apxx_texpr0.hh:599
ap_texpr_rdir_t & get_rdir() const
Returns a (modifiable) reference to the rounding direction of an operator node.
Definition apxx_texpr0.hh:569
iterator & operator=(const builder &c)
Replace the sub-expression at the iterator position with a (deep) copy of c.
Definition apxx_texpr0.hh:532
ap_texpr0_t * get_ap_texpr0_t()
Returns a pointer to the internal APRON object stored in *this.
Definition apxx_texpr0.hh:610
ap_dim_t & get_dim() const
Returns a (modifiable) reference to the dimension of a dimension node.
Definition apxx_texpr0.hh:551
ap_texpr_op_t & get_op() const
Returns a (modifiable) reference to the operator kind of an operator node.
Definition apxx_texpr0.hh:557
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.hh:207
~texpr0()
Frees the memory occupied by the expression (and, recursively, all sub-expressions).
Definition apxx_texpr0.hh:103
size_t size() const
Returns the number of operator nodes in the expression tree.
Definition apxx_texpr0.hh:182
size_t depth() const
Returns the depth of the expression tree (counting only operator nodes).
Definition apxx_texpr0.hh:177
ap_texpr0_t * get_ap_texpr0_t()
Returns a pointer to the internal APRON object stored in *this.
Definition apxx_texpr0.hh:294
ap_dim_t max_dim() const
Returns the maximal dimension occurring in the expression (or 0 if there is no variable).
Definition apxx_texpr0.hh:187
bool has_dim(ap_dim_t d) const
Whether the given dimension occurs in the expression.
Definition apxx_texpr0.hh:192
texpr0(ap_texpr0_t *x)
Internal use only. Shallow copy.
Definition apxx_texpr0.hh:54
const_iterator root() const
Returns a new iterator at the root of a constant expression tree.
Definition apxx_texpr0.hh:316
texpr0 & operator=(const texpr0 &x)
Makes a (deep) copy of the expression.
Definition apxx_texpr0.hh:124
bool is_interval_cst() const
Whether the expression is constant (i.e., has no dimension leaves).
Definition apxx_texpr0.hh:202
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.hh:273
bool is_interval_polyfrac() const
Whether the expression is a polynomial fraction and there is no rounding.
Definition apxx_texpr0.hh:217
friend std::ostream & operator<<(std::ostream &os, const texpr0 &s)
Printing.
Definition apxx_texpr0.hh:153
bool is_interval_polynomial() const
Whether the expression is polynomial and there is no rounding.
Definition apxx_texpr0.hh:212
bool equal(const texpr0 &x) const
Whether two expressions are syntactically, structurally equal.
Definition apxx_texpr0.hh:172
void permute_dimensions(const dimperm &d)
Permutes dimensions.
Definition apxx_texpr0.hh:284
long hash() const
Returns a hash code.
Definition apxx_texpr0.hh:262
bool is_scalar() const
Whether all occurring constants are scalar.
Definition apxx_texpr0.hh:222
void init_from(ap_texpr0_t *x)
Internal use only. Shallow copy.
Definition apxx_texpr0.hh:48
std::vector< ap_dim_t > dimlist() const
Returns a list of all dimensions occurring in the expression (in strict increasing order)
Definition apxx_texpr0.hh:197
bool is_zero() const
Whether the expression is a single coefficient node with 0 value.
Definition apxx_texpr0.hh:167
void substitute(ap_dim_t dim, const texpr0 &dst)
Substitutes each occurrence of dim with (a fresh copy of) dst.
Definition apxx_texpr0.hh:231
void print(char **name_of_dim=NULL, FILE *stream=stdout) const
Prints to a C stream.
Definition apxx_texpr0.hh:158
void remove_dimensions(const dimchange &d)
Removes some dimensions, shifting dimension if needed.
Definition apxx_texpr0.hh:279
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.
Definition apxx_texpr0.hh:33
bool is_binop(ap_texpr_op_t op)
Whether the operator is binary.
Definition apxx_texpr0.hh:38
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.hh:772
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