Prev Next Index-> contents reference index search external Up-> f2cad library initds f2cad-> license Install get_started prototype library run.cpp utility add2lib.sh whats_new library-> d9knus d9lgmc daxpy dbesks dbskes dcsevl ddot dgamlm dgamma dgefa dgesl dint dscal idamax initds xerror initds-> initds.f Headings-> Prototype Fortran Source Description

initds

Prototype
integer f2cad::initds_(doublereal *dos, integer *nos, doublereal *eta);

Fortran Source
initds.f

Description
This example uses the routine initds.f to compute the minimum value of m such that   $\sum_{i=m}^{i=n} | a_i | \leq \eta$  Note that there are m terms in the rest of the summation; i.e.,   $\sum_{i=1}^{m-1} a_i$   # include <f2cad/initds.hpp> test_result initds(void) { bool ok = true; // a_0, a_1, a_2, a_3, a_4, a_5 doublereal a[] = { 1e0, 1e-1, 1e-2, 1e-3, 1e-4, 1e-5}; integer n = sizeof(a) / sizeof(a[0]); doublereal eta = 1e-3; integer m = f2cad::initds_(a, &n, &eta); ok &= (m == 4); if( ok ) return test_pass; return test_fail; } 
Input File: example/initds.cpp