MADNESS  0.10.1
Classes | Functions
y_varx.cc File Reference
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cassert>
#include <cstdio>
#include <qd/qd_real.h>
#include <ls.h>
Include dependency graph for y_varx.cc:

Classes

class  Func< FLOAT >
 
class  matrix< FLOAT >
 

Functions

template<typename t >
convert (const char *c)
 
template<>
double convert< double > (const char *c)
 
template<>
float convert< float > (const char *c)
 
template<typename FLOAT >
FLOAT fit (const FLOAT &x, const vector< FLOAT > &p)
 
template<typename FLOAT >
void fit (const FLOAT &x, const vector< FLOAT > &p, FLOAT &f, FLOAT &g, FLOAT &h)
 
template<typename FLOAT >
void jacobi (int n, matrix< FLOAT > &a, vector< FLOAT > &e, matrix< FLOAT > &v)
 
template<typename FLOAT >
void LSQ (int n, const matrix< FLOAT > &a, const vector< FLOAT > &b, vector< FLOAT > &x, const FLOAT &tol)
 
int main ()
 
template<typename FLOAT >
void makedata (const vector< FLOAT > &x, const vector< FLOAT > &f, const vector< FLOAT > &p, FLOAT &d0, vector< FLOAT > &d1, matrix< FLOAT > &d2, bool d0only=false)
 
template<typename t >
std::ostream & operator<< (std::ostream &s, const matrix< t > &c)
 
template<typename t >
std::ostream & operator<< (std::ostream &s, const std::vector< t > &c)
 easy printing of vectors More...
 
template<typename FLOAT >
vector< FLOAT > opt (const vector< FLOAT > &x, const vector< FLOAT > &f, const vector< FLOAT > &w, const vector< FLOAT > &guess, int maxiter)
 
template<typename FLOAT >
void plot (int npt, const FLOAT &a, const FLOAT &b, const vector< FLOAT > &p)
 
template<typename FLOAT >
FLOAT target (const FLOAT &x)
 
template<typename FLOAT >
void target (const FLOAT &x, FLOAT &f, FLOAT &d1f, FLOAT &d2f)
 
template<typename FLOAT >
void test ()
 
template<typename FLOAT >
vector< FLOAT > updatex (const vector< FLOAT > &x, const vector< FLOAT > &p)
 
template<typename FLOAT >
FLOAT weight (const FLOAT &x)
 
template<typename FLOAT >
void weight (const FLOAT &x, FLOAT &f, FLOAT &d1f, FLOAT &d2f)
 

Function Documentation

◆ convert()

template<typename t >
t convert ( const char *  c)

References c.

◆ convert< double >()

template<>
double convert< double > ( const char *  c)

References c.

◆ convert< float >()

template<>
float convert< float > ( const char *  c)

References c.

◆ fit() [1/2]

template<typename FLOAT >
FLOAT fit ( const FLOAT &  x,
const vector< FLOAT > &  p 
)

References p(), and sum.

Referenced by opt(), plot(), and updatex().

◆ fit() [2/2]

template<typename FLOAT >
void fit ( const FLOAT &  x,
const vector< FLOAT > &  p,
FLOAT &  f,
FLOAT &  g,
FLOAT &  h 
)

References f, g(), h(), and p().

◆ jacobi()

template<typename FLOAT >
void jacobi ( int  n,
matrix< FLOAT > &  a,
vector< FLOAT > &  e,
matrix< FLOAT > &  v 
)

References a, c, e(), epsilon, k, max, madness::swap(), u(), and v.

Referenced by LSQ(), opt(), and test().

◆ LSQ()

template<typename FLOAT >
void LSQ ( int  n,
const matrix< FLOAT > &  a,
const vector< FLOAT > &  b,
vector< FLOAT > &  x,
const FLOAT &  tol 
)

References a, b, jacobi(), k, sum, and v.

Referenced by test().

◆ main()

int main ( void  )

◆ makedata()

template<typename FLOAT >
void makedata ( const vector< FLOAT > &  x,
const vector< FLOAT > &  f,
const vector< FLOAT > &  p,
FLOAT &  d0,
vector< FLOAT > &  d1,
matrix< FLOAT > &  d2,
bool  d0only = false 
)

References f, g(), mu, p(), sum, w(), and weight().

Referenced by Func< FLOAT >::operator()(), opt(), and test().

◆ operator<<() [1/2]

template<typename t >
std::ostream& operator<< ( std::ostream &  s,
const matrix< t > &  c 
)

References c, and m.

◆ operator<<() [2/2]

template<typename t >
std::ostream& operator<< ( std::ostream &  s,
const std::vector< t > &  c 
)

easy printing of vectors

References c.

◆ opt()

template<typename FLOAT >
vector<FLOAT> opt ( const vector< FLOAT > &  x,
const vector< FLOAT > &  f,
const vector< FLOAT > &  w,
const vector< FLOAT > &  guess,
int  maxiter 
)

References e(), epsilon, f, fit(), func(), guess(), std::isnan(), jacobi(), k, makedata(), maxiter, p(), print(), sum, v, and w().

Referenced by test().

◆ plot()

template<typename FLOAT >
void plot ( int  npt,
const FLOAT &  a,
const FLOAT &  b,
const vector< FLOAT > &  p 
)

References a, b, fit(), h(), p(), pow(), target(), and weight().

Referenced by test().

◆ target() [1/2]

template<typename FLOAT >
FLOAT target ( const FLOAT &  x)

Referenced by plot(), test(), and updatex().

◆ target() [2/2]

template<typename FLOAT >
void target ( const FLOAT &  x,
FLOAT &  f,
FLOAT &  d1f,
FLOAT &  d2f 
)

References f.

◆ test()

template<typename FLOAT >
void test ( )

◆ updatex()

template<typename FLOAT >
vector<FLOAT> updatex ( const vector< FLOAT > &  x,
const vector< FLOAT > &  p 
)

References a, b, f, fit(), g(), h(), p(), pow(), target(), w(), and weight().

Referenced by test().

◆ weight() [1/2]

template<typename FLOAT >
FLOAT weight ( const FLOAT &  x)

Referenced by makedata(), plot(), test(), and updatex().

◆ weight() [2/2]

template<typename FLOAT >
void weight ( const FLOAT &  x,
FLOAT &  f,
FLOAT &  d1f,
FLOAT &  d2f 
)

References f.