]> www.ginac.de Git - ginac.git/blobdiff - ginsh/ginsh_parser.yy
* Added fsolve() numerical univariate real-valued function solver.
[ginac.git] / ginsh / ginsh_parser.yy
index 5e3dd443435149150f1949f597c640211f1fc688..005ba9e9082b9dc460707b98324be37181baeac3 100644 (file)
@@ -18,7 +18,7 @@
  *
  *  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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 
@@ -411,6 +411,14 @@ static ex f_find(const exprseq &e)
        return found;
 }
 
+static ex f_fsolve(const exprseq &e)
+{
+       CHECK_ARG(1, symbol, fsolve);
+       CHECK_ARG(2, numeric, fsolve);
+       CHECK_ARG(3, numeric, fsolve);
+       return fsolve(e[0], ex_to<symbol>(e[1]), ex_to<numeric>(e[2]), ex_to<numeric>(e[3]));
+}
+
 static ex f_integer_content(const exprseq &e)
 {
        return e[0].expand().integer_content();
@@ -588,6 +596,7 @@ static const fcn_init builtin_fcns[] = {
        {"eval_integ", f_eval_integ, 1},
        {"expand", f_expand, 1},
        {"find", f_find, 2},
+       {"fsolve", f_fsolve, 4},
        {"gcd", f_gcd, 2},
        {"has", f_has, 2},
        {"integer_content", f_integer_content, 1},