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