00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <ppl-config.h>
00024
00025 #include "Scalar_Products.defs.hh"
00026 #include "Coefficient.defs.hh"
00027
00028 namespace PPL = Parma_Polyhedra_Library;
00029
00030 void
00031 PPL::Scalar_Products::assign(Coefficient& z,
00032 const Linear_Row& x, const Linear_Row& y) {
00033
00034
00035 assert(x.size() <= y.size());
00036 z = 0;
00037 for (dimension_type i = x.size(); i-- > 0; )
00038
00039 add_mul_assign(z, x[i], y[i]);
00040 }
00041
00042 void
00043 PPL::Scalar_Products::assign(Coefficient& z,
00044 const Constraint& x, const Generator& y) {
00045
00046
00047 assert(x.size() <= y.size());
00048 z = 0;
00049 for (dimension_type i = x.size(); i-- > 0; )
00050
00051 add_mul_assign(z, x[i], y[i]);
00052 }
00053
00054 void
00055 PPL::Scalar_Products::assign(Coefficient& z,
00056 const Grid_Generator& x, const Congruence& y) {
00057
00058
00059 assert(x.size() <= y.size());
00060 z = 0;
00061 for (dimension_type i = x.size() - 1 ; i-- > 0; )
00062
00063
00064 add_mul_assign(z, x[i], y[i]);
00065 }
00066
00067 void
00068 PPL::Scalar_Products::assign(Coefficient& z,
00069 const Constraint& x,
00070 const Grid_Generator& y) {
00071
00072
00073 assert(x.size() <= y.size());
00074 z = 0;
00075 for (dimension_type i = x.size(); i-- > 0; )
00076
00077 add_mul_assign(z, x[i], y[i]);
00078 }
00079
00080 void
00081 PPL::Scalar_Products::assign(Coefficient& z,
00082 const Congruence& x, const Grid_Generator& y) {
00083
00084
00085 assert(x.size() <= y.size());
00086 z = 0;
00087 for (dimension_type i = x.size() - 1; i-- > 0; )
00088
00089
00090 add_mul_assign(z, x[i], y[i]);
00091 }
00092
00093 void
00094 PPL::Scalar_Products::reduced_assign(Coefficient& z,
00095 const Linear_Row& x,
00096 const Linear_Row& y) {
00097
00098
00099 assert(!x.is_necessarily_closed());
00100 assert(x.size() - 1 <= y.size());
00101 z = 0;
00102 for (dimension_type i = x.size() - 1; i-- > 0; )
00103
00104 add_mul_assign(z, x[i], y[i]);
00105 }
00106
00107 void
00108 PPL::Scalar_Products::reduced_assign(Coefficient& z,
00109 const Grid_Generator& x,
00110 const Congruence& y) {
00111
00112
00113 assert(x.size() <= y.size());
00114 z = 0;
00115 for (dimension_type i = x.size() - 1; i-- > 0; )
00116
00117 add_mul_assign(z, x[i], y[i]);
00118 }
00119
00120 void
00121 PPL::Scalar_Products::homogeneous_assign(Coefficient& z,
00122 const Linear_Row& x,
00123 const Linear_Row& y) {
00124
00125
00126 assert(x.size() <= y.size());
00127 z = 0;
00128
00129 for (dimension_type i = x.size(); --i > 0; )
00130
00131 add_mul_assign(z, x[i], y[i]);
00132 }
00133
00134 void
00135 PPL::Scalar_Products::homogeneous_assign(Coefficient& z,
00136 const Grid_Generator& x,
00137 const Congruence& y) {
00138
00139
00140 assert(x.size() <= y.size());
00141 z = 0;
00142
00143 for (dimension_type i = x.size() - 1; --i > 0; )
00144
00145 add_mul_assign(z, x[i], y[i]);
00146 }
00147
00148 void
00149 PPL::Scalar_Products::homogeneous_assign(Coefficient& z,
00150 const Grid_Generator& x,
00151 const Constraint& y) {
00152
00153
00154 assert(x.size() - 1 <= y.size());
00155 z = 0;
00156
00157 for (dimension_type i = x.size() - 1; --i > 0; )
00158
00159 add_mul_assign(z, x[i], y[i]);
00160 }