search for: funv

Displaying 12 results from an estimated 12 matches for "funv".

Did you mean: func
2006 Aug 31
2
Wish: keep names in mapply() result
...rgs, environment(), PACKAGE="base") + if(isNamed) names(answer) <- namesX if (USE.NAMES && length(dots) && is.character(dots[[1]]) && is.null(names(answer))) names(answer) <- dots[[1]] @@ -47,4 +55,4 @@ } formals(FUNV) <- formals(FUN) FUNV -} \ No newline at end of file +} -- Lep pozdrav / With regards, Gregor Gorjanc ---------------------------------------------------------------------- University of Ljubljana PhD student Biotechnical Faculty Zootechnical Department URI: http://www.bfro.u...
2016 Jul 11
0
Re: [PATCH v2] OCaml tools: add and use a Getopt module
On Mon, Jul 11, 2016 at 06:03:39PM +0200, Pino Toscano wrote: > diff --git a/mllib/getopt-c.c b/mllib/getopt-c.c > new file mode 100644 > index 0000000..e5e832c > --- /dev/null > +++ b/mllib/getopt-c.c > +static void > +do_call1 (value funv, value paramv) > +{ > + CAMLparam2 (funv, paramv); > + CAMLlocal1 (rv); > + > + rv = caml_callback_exn (funv, paramv); > + > + if (Is_exception_result (rv)) > + fprintf (stderr, > + "libguestfs: uncaught OCaml exception in getopt callback: %s"...
2016 Jul 18
2
[PATCH] mllib: Getopt: fix integer parsing
.....2d3f9b6 100644 --- a/mllib/getopt-c.c +++ b/mllib/getopt-c.c @@ -30,6 +30,8 @@ #include <error.h> #include <assert.h> +#include "xstrtol.h" + #include <caml/alloc.h> #include <caml/fail.h> #include <caml/memory.h> @@ -117,6 +119,26 @@ do_call1 (value funv, value paramv) CAMLreturn0; } +static int +strtoint (const char *arg) +{ + long int num; + + if (xstrtol (arg, NULL, 0, &num, NULL) != LONGINT_OK) { + fprintf (stderr, _("%s: '%s' is not a numeric value.\n"), + guestfs_int_program_name, arg); + show_e...
2011 Dec 12
0
Rsolnp package: warning messages
Dear, I am using the solnp command (package Rsolnp) for a problem with equality and inequality constraints. I am not getting convergence for my problem but apart that I get 1 warning per iteration saying: ?In cbind(temp, funv) : number of rows of result is not a multiple of vector length (arg 1)?. I checked for equality and inequality functions and they seem fine to me. Where this message comes from? Interestingly also is that using different seed values the direction of optimization of my (negative-value) funct...
2012 Feb 23
0
solnp inversed-Hessian problem
...1000 0.21000 0.21000 0.21000 0.21000 0.21000 0.21000 0.21000 0.21000 0.21000 0.21000 solnp--> Solution not reliable....Problem Inverting Hessian. Warning messages: 1: In p0 * vscale[(neq + 2):(nc + np + 1)] : longer object length is not a multiple of shorter object length 2: In cbind(temp, funv) : number of rows of result is not a multiple of vector length (arg 1) ######################################## Anyone knows what may be the reason? Just remembering that the same problem runs OK for smaller datasets. Thanks in advance, Diogo Andr? Portugal
2012 Feb 27
0
solnp inconsistent error messages
...000 0.21000 0.21000 0.21000 0.21000 0.21000 0.21000 0.21000 0.21000 0.21000 0.21000 solnp--> Solution not reliable....Problem Inverting Hessian. Warning messages: 1: In p0 * vscale[(neq + 2):(nc + np + 1)] : longer object length is not a multiple of shorter object length 2: In cbind(temp, funv) : number of rows of result is not a multiple of vector length (arg 1) ######################################## Anyone knows what may be the reason? Just remembering that the same problem runs OK for smaller datasets. Thanks in advance, Diogo Andr? Portugal
2016 Jul 18
0
Re: [PATCH] mllib: Getopt: fix integer parsing
...b/getopt-c.c > @@ -30,6 +30,8 @@ > #include <error.h> > #include <assert.h> > > +#include "xstrtol.h" > + > #include <caml/alloc.h> > #include <caml/fail.h> > #include <caml/memory.h> > @@ -117,6 +119,26 @@ do_call1 (value funv, value paramv) > CAMLreturn0; > } This function needs to return something other than 'int', since on 64 bit OCaml integers (the final destination) are signed 63 bits. I think returning 'long' is a better idea, and the receiving 'num' should also be 'long'...
2016 Jul 11
2
[PATCH v2] OCaml tools: add and use a Getopt module
...+#include <caml/memory.h> +#include <caml/mlvalues.h> +#include <caml/callback.h> +#include <caml/printexc.h> + +#include <guestfs.h> +#include "guestfs-internal-frontend.h" + +extern value guestfs_int_mllib_getopt_parse (value argsv, value specsv, value anon_funv, value usage_msgv); + +#define Val_none Val_int(0) + +#ifdef HAVE_ATTRIBUTE_CLEANUP +#define CLEANUP_FREE_OPTION_LIST __attribute__((cleanup(cleanup_option_list))) + +static void +cleanup_option_list (void *ptr) +{ + struct option *opts = * (struct option **) ptr; + struct option *p = opts; + +...
2016 Jul 18
2
Re: [PATCH] mllib: Getopt: fix integer parsing
...#include <error.h> > > #include <assert.h> > > > > +#include "xstrtol.h" > > + > > #include <caml/alloc.h> > > #include <caml/fail.h> > > #include <caml/memory.h> > > @@ -117,6 +119,26 @@ do_call1 (value funv, value paramv) > > CAMLreturn0; > > } > > This function needs to return something other than 'int', since on 64 > bit OCaml integers (the final destination) are signed 63 bits. I > think returning 'long' is a better idea, and the receiving 'num'...
2016 Jul 18
4
[PATCH 1/3] mllib: Getopt: point to man page as additional help
On error, point also to the man page of the current tool in addition to '$TOOL --help'. --- mllib/getopt-c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mllib/getopt-c.c b/mllib/getopt-c.c index bf40f91..3efd5d3 100644 --- a/mllib/getopt-c.c +++ b/mllib/getopt-c.c @@ -69,8 +69,8 @@ cleanup_option_list (void *ptr) static void __attribute__((noreturn))
2016 Jul 13
3
[PATCH v3 1/2] OCaml tools: add and use a Getopt module
...include <caml/fail.h> +#include <caml/memory.h> +#include <caml/mlvalues.h> +#include <caml/callback.h> +#include <caml/printexc.h> + +#include "guestfs-internal-frontend.h" + +extern value guestfs_int_mllib_getopt_parse (value argsv, value specsv, value anon_funv, value usage_msgv); + +#define Val_none Val_int(0) + +#ifdef HAVE_ATTRIBUTE_CLEANUP +#define CLEANUP_FREE_OPTION_LIST __attribute__((cleanup(cleanup_option_list))) + +static void +cleanup_option_list (void *ptr) +{ + struct option *opts = * (struct option **) ptr; + struct option *p = opts; + +...
2016 Jun 24
2
[PATCH] RFC: OCaml tools: add and use a Getopt module
...+#include <caml/memory.h> +#include <caml/mlvalues.h> +#include <caml/callback.h> +#include <caml/printexc.h> + +#include <guestfs.h> +#include "guestfs-internal-frontend.h" + +extern value guestfs_int_mllib_getopt_parse (value argsv, value specsv, value anon_funv, value usage_msgv); + +#define Val_none Val_int(0) + +static void +xwrite (int fd, const void *v_buf, size_t len) +{ + int r; + const char *buf = v_buf; + + while (len > 0) { + r = write (fd, buf, len); + if (r == -1) + error (EXIT_FAILURE, errno, "write"); + buf += r;...