diff --git a/doc/reference/c++/det_manip/cookbook/basic.rst b/doc/reference/c++/det_manip/cookbook/basic.rst index 87e3d7c6..91d41d38 100644 --- a/doc/reference/c++/det_manip/cookbook/basic.rst +++ b/doc/reference/c++/det_manip/cookbook/basic.rst @@ -1,7 +1,5 @@ -Basics ------- - -Here, an exemple of creation of a class det_manip, of use of insert and remove. +Creation of an empty det_manip class +------------------------------------- .. compileblock:: @@ -9,58 +7,204 @@ Here, an exemple of creation of a class det_manip, of use of insert and remove. struct fun { - typedef double result_type; - typedef double argument_type; + typedef double result_type; + typedef double argument_type; + + //gives the coefficients of the matrix (function F of the documentation) + double operator()(double x, double y) const { + return(x-y); + } - //gives the coefficients of the matrix - double operator()(double x, double y) const { - return(x-y); - } }; int main() { - - //creation of the class det_manip + fun f; - int init_size=100; - triqs::det_manip::det_manip D(f,init_size); + int init_size = 100; // maximum size of the matrix before a resize + + //creation of a class det_manip + triqs::det_manip::det_manip D(f, init_size); + //the initial matrix is empty: - std::cout< + + struct fun { + + typedef double result_type; + typedef double argument_type; + + //gives the coefficients of the matrix (function F of the documentation) + double operator()(double x, double y) const { + return(x-y); + } + + }; + + int main() { + + fun f; + std::vector initial_x{1,2}, initial_y{3,4}; + + //creation of a class det_manip with a 2 by 2 matrix + triqs::det_manip::det_manip D(f, initial_x, initial_y); + + //the initial matrix: + std::cout< + + struct fun { + typedef double result_type; + typedef double argument_type; + double operator()(double x, double y) const { return(exp(x)-y*y); } + }; + + int main() { + triqs::det_manip::det_manip D(fun(), std::vector{1,2,2.5}, std::vector{3,4,9}); + std::cout<