Borderbasix

matrix_of.hpp
Go to the documentation of this file.
1 #ifndef _MPOLY_MATRIX_OF_HPP_
2 #define _MPOLY_MATRIX_OF_HPP_
3 
4 template<class Polynomial>
5 struct matrix_of {
6  static Polynomial choose(unsigned n, unsigned d);
7 };
8 
9 template<class Polynomial>
10 Polynomial matrix_of<Polynomial>::choose(unsigned n, unsigned d) {
11  typedef typename Polynomial::monom_t Monomial;
12 
13  Polynomial L(1);
14 
15 
16  for(int i=0;i<n;i++)
17  L += Monomial(i,1);
18  Polynomial res(L);
19  for (unsigned i=1;i<d; ++i)
20  res*= L;
21  for(typename Polynomial::iterator it=res.begin();it!=res.end();it++)
22  it->SetCoeff(1);
23 
24 
25  return res;
26 }
27 
28 #endif //_MPOLY_MATRIX_OF_HPP_
Definition: matrix_of.hpp:5
static Polynomial choose(unsigned n, unsigned d)
Definition: matrix_of.hpp:10
MSKint32t MSKint32t MSKint32t i
Definition: mosek.h:2278
Home  |  Download & InstallContributions