gsl-ocaml / lib / poly.mli

(* gsl-ocaml - OCaml interface to GSL                       *)
(* Copyright (©) 2002-2012 - Olivier Andrieu                *)
(* Distributed under the terms of the GPL version 3         *)

(** Polynomials *)

open Gsl_complex
type poly = float array

(** {3 Polynomial Evaluation} *)

external eval : poly -> float -> float 
    = "ml_gsl_poly_eval"

(** {3 Quadratic Equations} *)

type quad_sol = 
  | Quad_0 
  | Quad_2 of float * float
external solve_quadratic : a:float -> b:float -> c:float -> quad_sol
    = "ml_gsl_poly_solve_quadratic"

external complex_solve_quadratic : 
    a:float -> b:float -> c:float -> complex * complex
	= "ml_gsl_poly_complex_solve_quadratic"

(** {3 Cubic Equations} *)

type cubic_sol =
  | Cubic_0
  | Cubic_1 of float
  | Cubic_3 of float * float * float
external solve_cubic : a:float -> b:float -> c:float -> cubic_sol
    = "ml_gsl_poly_solve_cubic"

external complex_solve_cubic :
  a:float -> b:float -> c:float -> complex * complex * complex
      = "ml_gsl_poly_complex_solve_cubic"


(** {3 General Polynomial Equations} *)

val solve : poly -> complex_array
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.