source: branches/better_matrix_class/lib/statistics/MultiDimensional.cc @ 415

Last change on this file since 415 was 415, checked in by Jari Häkkinen, 17 years ago

Removed some gslapi copy intensive operators.
Made gslapi assignment operators ignore views, and change them
into normal vectors if assigned.
Cleaning up of code aswell.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 720 bytes
Line 
1// $Id: MultiDimensional.cc 415 2005-12-01 15:52:36Z jari $
2
3#include <c++_tools/statistics/MultiDimensional.h>
4#include <c++_tools/gslapi/matrix.h>
5#include <c++_tools/gslapi/vector.h>
6
7namespace theplu {
8namespace statistics {
9namespace regression {
10
11
12  void MultiDimensional::fit(const gslapi::matrix& x, const gslapi::vector& y)
13  {
14    covariance_=gslapi::matrix(x.columns(),x.columns());
15    fit_parameters_=gslapi::vector(x.columns());
16    if (work_)
17      gsl_multifit_linear_free(work_);
18    work_=gsl_multifit_linear_alloc(x.rows(),fit_parameters_.size());
19    gsl_multifit_linear(x.gsl_matrix_p(),y.gsl_vector_p(),
20                        fit_parameters_.gsl_vector_p(),
21                        covariance_.gsl_matrix_p(),&chisquare_,work_);
22  }
23
24
25}}} // of namespaces regression, statisitcs and thep
Note: See TracBrowser for help on using the repository browser.