diff --git a/Makefile.am b/Makefile.am index 8755b2d..88dedfc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ lib_LTLIBRARIES = libla.la -include_HEADERS = simple.h vecmat3.h quaternion.h fortran.h cuda_la.h auxstorage.h davidson.h laerror.h mat.h qsort.h vec.h bisection.h diis.h la.h noncblas.h smat.h bitvector.h fourindex.h la_traits.h nonclass.h sparsemat.h sparsesmat.h csrmat.h conjgrad.h gmres.h matexp.h permutation.h polynomial.h -libla_la_SOURCES = simple.cc quaternion.cc vecmat3.cc vec.cc mat.cc smat.cc sparsemat.cc sparsesmat.cc csrmat.cc laerror.cc noncblas.cc bitvector.cc strassen.cc nonclass.cc cuda_la.cc fourindex.cc permutation.cc polynomial.cc +include_HEADERS = simple.h vecmat3.h quaternion.h fortran.h cuda_la.h auxstorage.h davidson.h laerror.h mat.h qsort.h vec.h bisection.h diis.h la.h noncblas.h smat.h bitvector.h fourindex.h la_traits.h nonclass.h sparsemat.h sparsesmat.h csrmat.h conjgrad.h gmres.h matexp.h permutation.h polynomial.h contfrac.h +libla_la_SOURCES = simple.cc quaternion.cc vecmat3.cc vec.cc mat.cc smat.cc sparsemat.cc sparsesmat.cc csrmat.cc laerror.cc noncblas.cc bitvector.cc strassen.cc nonclass.cc cuda_la.cc fourindex.cc permutation.cc polynomial.cc contfrac.cc check_PROGRAMS = t test t_SOURCES = t.cc t2.cc test_SOURCES = test.cc diff --git a/contfrac.cc b/contfrac.cc new file mode 100644 index 0000000..70aaf27 --- /dev/null +++ b/contfrac.cc @@ -0,0 +1,43 @@ +/* + LA: linear algebra C++ interface library + Copyright (C) 2022 Jiri Pittner or + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "contfrac.h" +#include +#include +#include + + +namespace LA { + + +/***************************************************************************//** + * forced instantization in the corresponding object file + ******************************************************************************/ +template class ContFrac; +template class ContFrac; + +#define INSTANTIZE(T) \ + + + +INSTANTIZE(int) +INSTANTIZE(unsigned int) + + + +}//namespace diff --git a/contfrac.h b/contfrac.h new file mode 100644 index 0000000..8e5731c --- /dev/null +++ b/contfrac.h @@ -0,0 +1,45 @@ +/* + LA: linear algebra C++ interface library + Copyright (C) 2022 Jiri Pittner or + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +#ifndef _CONTFRAC_H +#define _CONTFRAC_H + +#include "la_traits.h" +#include "vec.h" + +namespace LA { + + +template +class ContFrac : public NRVec { +public: + ContFrac(): NRVec() {}; + template ContFrac(const T (&a)[SIZE]) : NRVec(a) {}; + ContFrac(const NRVec &v) : NRVec(v) {}; //allow implicit conversion from NRVec + ContFrac(const int n) : NRVec(n+1) {}; + + int length() const {return NRVec::size()-1;}; + void resize(const int n, const bool preserve=true) {NRVec::resize(n+1,preserve);} + +}; + + + +}//namespace +#endif diff --git a/la.h b/la.h index 0201ed4..1a41bbb 100644 --- a/la.h +++ b/la.h @@ -42,6 +42,7 @@ #include "csrmat.h" #include "vec.h" #include "polynomial.h" +#include "contfrac.h" using namespace LA; typedef NRMat NRIMat; diff --git a/t.cc b/t.cc index e83d40d..da887d2 100644 --- a/t.cc +++ b/t.cc @@ -24,6 +24,7 @@ #include "quaternion.h" #include "permutation.h" #include "polynomial.h" +#include "contfrac.h" #include "simple.h" using namespace std;