help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] How to return a pointer of gsl_vector


From: Marios Karaoulis
Subject: [Help-gsl] How to return a pointer of gsl_vector
Date: Sat, 06 Oct 2007 00:17:11 +0300
User-agent: Internet Messaging Program (IMP) H3 (4.1.4-cvs)

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.








reply via email to

[Prev in Thread] Current Thread [Next in Thread]