Public Member Functions

fityk::Fityk Class Reference

the public API to libfityk More...

#include <fityk.h>

List of all members.

Public Member Functions

 Fityk (Ftk *F)
execute fityk commands or change data

void execute (std::string const &s) throw (SyntaxError, ExecuteError, ExitRequestedException)
 execute command; throws exception on error
void load_data (int dataset, std::vector< realt > const &x, std::vector< realt > const &y, std::vector< realt > const &sigma, std::string const &title="") throw (ExecuteError)
 load data
void add_point (realt x, realt y, realt sigma, int dataset=0) throw (ExecuteError)
 add one data point to dataset
(alternative to exceptions) handling of program errors

void set_throws (bool state)
 If set to false, does not throw exceptions. Default: true.
bool get_throws () const
 Return error handling mode: true if exceptions are thrown.
std::string const & last_error () const
 Returns a string with last error or an empty string. Useful after calling set_throws(false). See also: clear_last_error().
void clear_last_error ()
 Clear last error message. See also: last_error().
handling text output

void set_show_message (t_show_message *func)
 general approach: set show message callback; cancels redir_messages()
void redir_messages (std::FILE *stream)
 redirect output to ...(e.g. stdout/stderr); cancels set_show_message()
void out (std::string const &s) const
 print string in the program's output (useful for embedded Lua)
get data and informations

std::string get_info (std::string const &s, int dataset=0) throw (SyntaxError, ExecuteError)
 return output of the info command
realt calculate_expr (std::string const &s, int dataset=0) throw (SyntaxError, ExecuteError)
 return expression value, similarly to the print command
int get_dataset_count ()
 returns number of datasets n, always n >= 1
std::vector< Point > const & get_data (int dataset=0) throw (ExecuteError)
 get data points
realt get_model_value (realt x, int dataset=0) throw (ExecuteError)
 returns the value of the model for a given dataset at x
std::vector< realt > get_model_vector (std::vector< realt > const &x, int dataset=0) throw (ExecuteError)
 multiple point version of the get_model_value()
int get_variable_nr (std::string const &name) throw (ExecuteError)
 returns the index of parameter hold by the variable (the same index as in get_covariance_matrix(), -1 for a compound-variable)
get fit statistics

realt get_wssr (int dataset=all_datasets) throw (ExecuteError)
 get WSSR for given dataset or for all datasets
realt get_ssr (int dataset=all_datasets) throw (ExecuteError)
 get SSR for given dataset or for all datasets
realt get_rsquared (int dataset=all_datasets) throw (ExecuteError)
 get R-squared for given dataset or for all datasets
int get_dof (int dataset=all_datasets) throw (ExecuteError)
 get number of degrees-of-freedom for given dataset or for all datasets
std::vector< std::vector< realt > > get_covariance_matrix (int dataset=all_datasets) throw (ExecuteError)
 get covariance matrix (for given dataset or for all datasets) get_variable_nr() can be used to connect variables with parameter positions

Detailed Description

the public API to libfityk

Definition at line 80 of file fityk.h.


The documentation for this class was generated from the following files:

Generated on Mon Jul 18 2011 17:25:28 for Fityk by Doxygen 1.7.1