[GB.GSL]
* NEW: Added ComplexPolynomial and NewtonPolynomial class files. git-svn-id: svn://localhost/gambas/trunk@4485 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
1e80fe0d30
commit
281b7de7c3
4 changed files with 200 additions and 0 deletions
51
gb.gsl/src/c_complexpolynomial.c
Normal file
51
gb.gsl/src/c_complexpolynomial.c
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
/***************************************************************************
|
||||||
|
c_complexpolynomial.c
|
||||||
|
|
||||||
|
gb.gsl component
|
||||||
|
|
||||||
|
(c) 2012 Randall Morgan <rmorgan62@gmail.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 1, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
MA 02110-1301, USA.
|
||||||
|
|
||||||
|
***************************************************************************/
|
||||||
|
/*=========================================================================
|
||||||
|
=== NOTE THIS IS SIMPLE LEARNING CODE ===
|
||||||
|
AND NOTHING USEFUL EXISTS HERE YET
|
||||||
|
==========================================================================*/
|
||||||
|
|
||||||
|
#define __C_GSL_COMPLEXPOLYNOMIAL_C
|
||||||
|
|
||||||
|
#include "c_complexpolynomial.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define THIS ((CCOMPLEXPOLYNOMIAL *)_object)
|
||||||
|
|
||||||
|
static CCOMPLEXPOLYNOMIAL *create_plynomial()
|
||||||
|
{
|
||||||
|
return (CCOMPLEXPOLYNOMIAL *)GB.New(GB.FindClass("ComplexPolynomial"), NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GB_DESC CComplexPolynomialDesc[] =
|
||||||
|
{
|
||||||
|
GB_DECLARE("ComplexPoly", sizeof(CCOMPLEXPOLYNOMIAL)),
|
||||||
|
|
||||||
|
GB_END_DECLARE
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
48
gb.gsl/src/c_complexpolynomial.h
Normal file
48
gb.gsl/src/c_complexpolynomial.h
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
/***************************************************************************
|
||||||
|
|
||||||
|
c_complexpolynomial.h
|
||||||
|
|
||||||
|
gb.gsl component
|
||||||
|
|
||||||
|
(c) 2012 Randall Morgan <rmorgan62@gmail.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 1, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
MA 02110-1301, USA.
|
||||||
|
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __C_GSL_COMPLEXPOLYNOMIAL_H
|
||||||
|
#define __C_GSL_COMPLEXPOLYNOMIAL_H
|
||||||
|
|
||||||
|
#include "gambas.h"
|
||||||
|
#include <gsl/gsl_poly.h>
|
||||||
|
#include "c_complex.h"
|
||||||
|
|
||||||
|
GB_INTERFACE GB EXPORT;
|
||||||
|
|
||||||
|
extern GB_DESC CComplexPolynomialDesc[];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
typedef
|
||||||
|
struct {
|
||||||
|
GB_BASE ob;
|
||||||
|
gsl_complex *c; // coefficients
|
||||||
|
int len;
|
||||||
|
}
|
||||||
|
CCOMPLEXPOLYNOMIAL;
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __C_GSL_POLYNOMIAL_H */
|
53
gb.gsl/src/c_newtonpolynomial.c
Normal file
53
gb.gsl/src/c_newtonpolynomial.c
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
/***************************************************************************
|
||||||
|
|
||||||
|
c_newtonpolynomial.c
|
||||||
|
|
||||||
|
gb.gsl component
|
||||||
|
|
||||||
|
(c) 2012 Randall Morgan <rmorgan62@gmail.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 1, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
MA 02110-1301, USA.
|
||||||
|
|
||||||
|
***************************************************************************/
|
||||||
|
/*=========================================================================
|
||||||
|
=== NOTE THIS IS SIMPLE LEARNING CODE ===
|
||||||
|
AND NOTHING USEFUL EXISTS HERE YET
|
||||||
|
==========================================================================*/
|
||||||
|
|
||||||
|
#define __C_GSL_NEWTONPOLYNOMIAL_C
|
||||||
|
|
||||||
|
#include "c_newtonpolynomial.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define THIS ((CNEWTONPOLYNOMIAL *)_object)
|
||||||
|
|
||||||
|
static CNEWTONPOLYNOMIAL *create_newtonplynomial()
|
||||||
|
{
|
||||||
|
return (CNEWTONPOLYNOMIAL *)GB.New(GB.FindClass("NetonPolynomial"), NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************
|
||||||
|
Describe Class properties and methods to Gambas
|
||||||
|
**************************************************/
|
||||||
|
GB_DESC CNetwonPolynomial[] =
|
||||||
|
{
|
||||||
|
GB_DECLARE("NewtonPolynomial", sizeof(CNEWTONPOLYNOMIAL)),
|
||||||
|
|
||||||
|
GB_END_DECLARE
|
||||||
|
};
|
||||||
|
|
48
gb.gsl/src/c_newtonpolynomial.h
Normal file
48
gb.gsl/src/c_newtonpolynomial.h
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
/***************************************************************************
|
||||||
|
|
||||||
|
c_newtonpolynomial.h
|
||||||
|
|
||||||
|
gb.gsl component
|
||||||
|
|
||||||
|
(c) 2012 Randall Morgan <rmorgan62@gmail.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 1, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
MA 02110-1301, USA.
|
||||||
|
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __C_GSL_NEWTONPOLYNOMIAL_H
|
||||||
|
#define __C_GSL_NEWTONPOLYNOMIAL_H
|
||||||
|
|
||||||
|
#include "gambas.h"
|
||||||
|
#include <gsl/gsl_poly.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
|
GB_INTERFACE GB EXPORT;
|
||||||
|
|
||||||
|
extern GB_DESC CNewtonPolynomialDesc[];
|
||||||
|
|
||||||
|
typedef
|
||||||
|
struct {
|
||||||
|
GB_BASE ob;
|
||||||
|
double *dd;
|
||||||
|
double *xa;
|
||||||
|
int len;
|
||||||
|
}
|
||||||
|
CNEWTONPOLYNOMIAL;
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __C_GSL_NEWTONPOLYNOMIAL_H */
|
Loading…
Reference in a new issue