Polymetic  1.1
A c++ library for polynomial and matrix arithmetic, focused on applications in Kinematics.
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
boost_matrix.cpp
Go to the documentation of this file.
1 // Copyright 2018 Dhruvesh Nikhilkumar Patel
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 #include <boost/numeric/ublas/matrix.hpp>
16 #include "../include/Polynomial.ipp"
17 #include <gmpxx.h>
18 #include <iostream>
19 int main()
20 {
21  using namespace boost::numeric::ublas;
22  using coefT = mpz_class;
23  using entryT= Polynomial<coefT>;
24  entryT p1 {1,2,3};
25  entryT p2 {4,5,6};
26  entryT p3 {1};
27  entryT p4 {7,8,9,10};
28  matrix<entryT> m (2,2);
29  m(0,0)=p1;
30  m(0,1)=p2;
31  m(1,0)=p3;
32  m(1,1)=p4;
33  std::cout<<"m(0,0)= "<<m(0,0)<<std::endl;
34  std::cout<<"m(0,1)= "<<m(0,1)<<std::endl;
35  std::cout<<"m(1,0)= "<<m(1,0)<<std::endl;
36  std::cout<<"m(1,1)= "<<m(1,1)<<std::endl;
37 
38  matrix<entryT> m2 (2,2);
39  m2 = prod(m,m);
40  std::cout<<"m2=m*m"<<std::endl;
41  std::cout<<"m2(0,0)= "<<m2(0,0)<<std::endl;
42  std::cout<<"m2(0,1)= "<<m2(0,1)<<std::endl;
43  std::cout<<"m2(1,0)= "<<m2(1,0)<<std::endl;
44  std::cout<<"m2(1,1)= "<<m2(1,1)<<std::endl;
45 
46 
47  return 0;
48 }
int main()
Contains the definition for the abstract base class which will be used by different multiplication al...
Definition: Polynomial.hpp:40