MADNESS
version 0.9
|
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cassert>
#include <cstdio>
#include <qd/qd_real.h>
#include <ls.h>
#include <stdlib.h>
Functions | |
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 t > | |
t | convert (const char *c) |
template<> | |
double | convert< double > (const char *c) |
template<> | |
float | convert< float > (const char *c) |
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) |
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 > | |
FLOAT | weight (const FLOAT &x) |
template<typename FLOAT > | |
void | weight (const FLOAT &x, FLOAT &f, FLOAT &d1f, FLOAT &d2f) |
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 | plot (int npt, const FLOAT &a, const FLOAT &b, const vector< FLOAT > &p) |
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 FLOAT > | |
vector< FLOAT > | opt (const vector< FLOAT > &x, const vector< FLOAT > &f, const vector< FLOAT > &w, const vector< FLOAT > &guess, int maxiter, bool conly=false) |
template<typename FLOAT > | |
vector< FLOAT > | updatex (const vector< FLOAT > &x, const vector< FLOAT > &p) |
template<typename FLOAT > | |
void | test () |
int | main () |
t convert | ( | const char * | c | ) |
References c.
FLOAT fit | ( | const FLOAT & | x, |
const vector< FLOAT > & | p | ||
) |
References mpfr::exp(), and mpfr::sum().
void fit | ( | const FLOAT & | x, |
const vector< FLOAT > & | p, | ||
FLOAT & | f, | ||
FLOAT & | g, | ||
FLOAT & | h | ||
) |
References mpfr::exp().
void jacobi | ( | int | n, |
matrix< FLOAT > & | a, | ||
vector< FLOAT > & | e, | ||
matrix< FLOAT > & | v | ||
) |
References a(), c, epsilon, mpfr::fabs(), k, max, mpfr::min(), one(), sqrt(), and std::swap().
void LSQ | ( | int | n, |
const matrix< FLOAT > & | a, | ||
const vector< FLOAT > & | b, | ||
vector< FLOAT > & | x, | ||
const FLOAT & | tol | ||
) |
References mpfr::fabs(), jacobi(), k, and mpfr::sum().
Referenced by test().
int main | ( | ) |
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 mpfr::exp(), madness::g, mu, one(), mpfr::sum(), and weight().
std::ostream& operator<< | ( | std::ostream & | s, |
const matrix< t > & | c | ||
) |
std::ostream& operator<< | ( | std::ostream & | s, |
const std::vector< t > & | c | ||
) |
easy printing of vectors
References c.
vector<FLOAT> opt | ( | const vector< FLOAT > & | x, |
const vector< FLOAT > & | f, | ||
const vector< FLOAT > & | w, | ||
const vector< FLOAT > & | guess, | ||
int | maxiter, | ||
bool | conly = false |
||
) |
References epsilon, mpfr::fabs(), fit(), func(), guess(), jacobi(), k, makedata(), maxiter, mpfr::min(), one(), print(), sqrt(), and mpfr::sum().
Referenced by test().
void plot | ( | int | npt, |
const FLOAT & | a, | ||
const FLOAT & | b, | ||
const vector< FLOAT > & | p | ||
) |
FLOAT target | ( | const FLOAT & | x | ) |
void target | ( | const FLOAT & | x, |
FLOAT & | f, | ||
FLOAT & | d1f, | ||
FLOAT & | d2f | ||
) |
References sqrt().
void test | ( | ) |
References a(), mpfr::atan(), b(), mpfr::cos(), epsilon, mpfr::exp(), madness::f, mpfr::fabs(), jacobi(), k, mpfr::log(), LSQ(), makedata(), mu, one(), opt(), pi, plot(), sqrt(), mpfr::sum(), target(), updatex(), and weight().
vector<FLOAT> updatex | ( | const vector< FLOAT > & | x, |
const vector< FLOAT > & | p | ||
) |
References a(), b(), madness::f, fit(), madness::g, one(), target(), and weight().
Referenced by test().
FLOAT weight | ( | const FLOAT & | x | ) |
References sqrt().
Referenced by makedata(), plot(), test(), and updatex().
void weight | ( | const FLOAT & | x, |
FLOAT & | f, | ||
FLOAT & | d1f, | ||
FLOAT & | d2f | ||
) |
References sqrt().