00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <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 Grid_Generator& x, const Congruence& y) {
00045
00046
00047 assert(x.size() <= y.size());
00048 z = 0;
00049 for (dimension_type i = x.size() - 1 ; i-- > 0; )
00050
00051
00052 add_mul_assign(z, x[i], y[i]);
00053 }
00054
00055 void
00056 PPL::Scalar_Products::assign(Coefficient& z,
00057 const Congruence& x, const Grid_Generator& y) {
00058
00059
00060 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::reduced_assign(Coefficient& z,
00070 const Linear_Row& x,
00071 const Linear_Row& y) {
00072
00073
00074 assert(!x.is_necessarily_closed());
00075 assert(x.size() - 1 <= y.size());
00076 z = 0;
00077 for (dimension_type i = x.size() - 1; i-- > 0; )
00078
00079 add_mul_assign(z, x[i], y[i]);
00080 }
00081
00082 void
00083 PPL::Scalar_Products::reduced_assign(Coefficient& z,
00084 const Grid_Generator& x,
00085 const Congruence& y) {
00086
00087
00088 assert(x.size() <= y.size());
00089 z = 0;
00090 for (dimension_type i = x.size() - 1; i-- > 0; )
00091
00092 add_mul_assign(z, x[i], y[i]);
00093 }
00094
00095 void
00096 PPL::Scalar_Products::homogeneous_assign(Coefficient& z,
00097 const Linear_Row& x,
00098 const Linear_Row& y) {
00099
00100
00101 assert(x.size() <= y.size());
00102 z = 0;
00103
00104 for (dimension_type i = x.size(); --i > 0; )
00105
00106 add_mul_assign(z, x[i], y[i]);
00107 }
00108
00109 void
00110 PPL::Scalar_Products::homogeneous_assign(Coefficient& z,
00111 const Grid_Generator& x,
00112 const Congruence& y) {
00113
00114
00115 assert(x.size() <= y.size());
00116 z = 0;
00117
00118 for (dimension_type i = x.size() - 1; --i > 0; )
00119
00120 add_mul_assign(z, x[i], y[i]);
00121 }