From a3e983ba467c77d5b40d71f62867236e0eff1ef7 Mon Sep 17 00:00:00 2001 From: Andrea Del Prete <andre.delprete@gmail.com> Date: Tue, 17 Feb 2015 09:11:56 +0100 Subject: [PATCH] Initialize signal array with size 20 even when constructing it from a single signal. --- include/dynamic-graph/signal-array.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/dynamic-graph/signal-array.h b/include/dynamic-graph/signal-array.h index 2a89f70..3af85ff 100644 --- a/include/dynamic-graph/signal-array.h +++ b/include/dynamic-graph/signal-array.h @@ -20,6 +20,7 @@ # include <dynamic-graph/signal-base.h> # include <dynamic-graph/dynamic-graph-api.h> # include <vector> +#include <stdio.h> namespace dynamicgraph { @@ -135,15 +136,15 @@ namespace dynamicgraph SignalArray<Time> (SignalBase<Time>& sig) : SignalArray_const<Time> (0), - array(1) + array(DEFAULT_SIZE) { - size=1; + size=DEFAULT_SIZE; addElmt(&sig); } SignalArray<Time> (const SignalArray<Time>& siga) : SignalArray_const<Time> (siga.getSize()), - array () + array (siga.getSize()) { rank = siga.getSize (); for (unsigned int i = 0; i < rank; ++i) -- GitLab