diff --git a/linear_algebra/lib/vector.ml b/linear_algebra/lib/vector.ml index 09569a4..713f089 100644 --- a/linear_algebra/lib/vector.ml +++ b/linear_algebra/lib/vector.ml @@ -73,3 +73,8 @@ let normalize v = let (%.) t i = t.{i} let set t i v = t.{i} <- v + +let pp ppf m = + let m = to_bigarray_inplace m in + Lacaml.Io.pp_fvec ppf m + diff --git a/linear_algebra/lib/vector.mli b/linear_algebra/lib/vector.mli index 4b733be..be2b279 100644 --- a/linear_algebra/lib/vector.mli +++ b/linear_algebra/lib/vector.mli @@ -142,3 +142,5 @@ val (%.) : 'a t -> int -> float val set : 'a t -> int -> float -> unit (** Modifies the value in-place at the i-th position *) + +val pp : Format.formatter -> 'a t -> unit diff --git a/top/lib/install_printers.ml b/top/lib/install_printers.ml index be8a7bd..0a3ceb4 100644 --- a/top/lib/install_printers.ml +++ b/top/lib/install_printers.ml @@ -22,6 +22,7 @@ let printers = "Gaussian.Contracted_shell.pp" ; "Gaussian.General_basis.pp" ; "Linear_algebra.Matrix.pp" ; + "Linear_algebra.Vector.pp" ; "Mo.Basis.pp" ; "Mo.Class.pp" ; "Mo.Fock.pp" ;