Hi,
try this.
Regards,
Ralph.
/***********************************/
#include <stdio.h>
#include <gsl/gsl_vector.h>
gsl_vector *one_function();
int main(){
gsl_vector *tmp;
tmp = one_function();
printf("Testing %f\n",gsl_vector_get(tmp,50));
return 0;
}
gsl_vector *one_function (){
gsl_vector *tmp2=gsl_vector_calloc(100);
gsl_vector_set(tmp2,50,-999);
return tmp2;
}
/***********************************/
On 10/9/07, Marios Karaoulis <[EMAIL PROTECTED]> wrote:
>
> With all the respect, and without being a troll ;)
>
> Was my question understood? I really need this answer...
>
> Thanks in advance.
>
> > Let's say we have this program
> >
> >
> >
> > //////////////////////////////////////////////////////////////////
> > double one_function();
> >
> > int main()
> > {
> > gsl_vector *tmp;
> >
> >
> > tmp=one_function();
> >
> >
> > printf("Testing %f\n",gsl_vector_get(tmp,50));
> >
> > }
> >
> >
> >
> > double one_function ()
> > {
> >
> > gsl_vector *tmp2=gsl_calloc_vector(100);
> >
> > gsl_vector_set(tmp2,50,-999);
> >
> > return *tmp2;
> > }
> > ////////////////////////////////////////////
> >
> > Obviously the program won't run.
> > I need this because i have some gsl vectors in one class defined as
> private
> >
> > (
> > eg
> > :private
> >
> > gsl_vector *tmp
> >
> >
> > )
> >
> >
> > And i want to create a function in :public in order to return the
> > vectors to main.
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Help-gsl mailing list
> > [email protected]
> > http://lists.gnu.org/mailman/listinfo/help-gsl
>
>
>
>
>
>
> _______________________________________________
> Help-gsl mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/help-gsl
>
_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl